diff --git a/[refs] b/[refs] index f48ae74ae3bd..b32a4af1199b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ec31b2124158f60c515ed84bd5e40db1a883c7b6 +refs/heads/master: 2f972202315cf71fd60e890ebbed7d5bcf620ba4 diff --git a/trunk/Documentation/ABI/testing/sysfs-class-bdi b/trunk/Documentation/ABI/testing/sysfs-class-bdi deleted file mode 100644 index 5ac1e01bbd48..000000000000 --- a/trunk/Documentation/ABI/testing/sysfs-class-bdi +++ /dev/null @@ -1,46 +0,0 @@ -What: /sys/class/bdi// -Date: January 2008 -Contact: Peter Zijlstra -Description: - -Provide a place in sysfs for the backing_dev_info object. This allows -setting and retrieving various BDI specific variables. - -The identifier can be either of the following: - -MAJOR:MINOR - - Device number for block devices, or value of st_dev on - non-block filesystems which provide their own BDI, such as NFS - and FUSE. - -default - - The default backing dev, used for non-block device backed - filesystems which do not provide their own BDI. - -Files under /sys/class/bdi// ---------------------------------- - -read_ahead_kb (read-write) - - Size of the read-ahead window in kilobytes - -min_ratio (read-write) - - Under normal circumstances each device is given a part of the - total write-back cache that relates to its current average - writeout speed in relation to the other devices. - - The 'min_ratio' parameter allows assigning a minimum - percentage of the write-back cache to a particular device. - For example, this is useful for providing a minimum QoS. - -max_ratio (read-write) - - Allows limiting a particular device to use not more than the - given percentage of the write-back cache. This is useful in - situations where we want to avoid one device taking all or - most of the write-back cache. For example in case of an NFS - mount that is prone to get stuck, or a FUSE mount which cannot - be trusted to play fair. diff --git a/trunk/Documentation/DocBook/Makefile b/trunk/Documentation/DocBook/Makefile index 0eb0d027eb32..83966e94cc32 100644 --- a/trunk/Documentation/DocBook/Makefile +++ b/trunk/Documentation/DocBook/Makefile @@ -12,7 +12,7 @@ DOCBOOKS := wanbook.xml z8530book.xml mcabook.xml videobook.xml \ kernel-api.xml filesystems.xml lsm.xml usb.xml kgdb.xml \ gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \ genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml \ - mac80211.xml debugobjects.xml + mac80211.xml ### # The build process is as follows (targets): diff --git a/trunk/Documentation/DocBook/debugobjects.tmpl b/trunk/Documentation/DocBook/debugobjects.tmpl deleted file mode 100644 index 7f5f218015fe..000000000000 --- a/trunk/Documentation/DocBook/debugobjects.tmpl +++ /dev/null @@ -1,391 +0,0 @@ - - - - - - Debug objects life time - - - - Thomas - Gleixner - -
- tglx@linutronix.de -
-
-
-
- - - 2008 - Thomas Gleixner - - - - - This documentation is free software; you can redistribute - it and/or modify it under the terms of the GNU General Public - License version 2 as published by the Free Software Foundation. - - - - This program is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied - warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - - - You should have received a copy of the GNU General Public - License along with this program; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, - MA 02111-1307 USA - - - - For more details see the file COPYING in the source - distribution of Linux. - - -
- - - - - Introduction - - debugobjects is a generic infrastructure to track the life time - of kernel objects and validate the operations on those. - - - debugobjects is useful to check for the following error patterns: - - Activation of uninitialized objects - Initialization of active objects - Usage of freed/destroyed objects - - - - debugobjects is not changing the data structure of the real - object so it can be compiled in with a minimal runtime impact - and enabled on demand with a kernel command line option. - - - - - Howto use debugobjects - - A kernel subsystem needs to provide a data structure which - describes the object type and add calls into the debug code at - appropriate places. The data structure to describe the object - type needs at minimum the name of the object type. Optional - functions can and should be provided to fixup detected problems - so the kernel can continue to work and the debug information can - be retrieved from a live system instead of hard core debugging - with serial consoles and stack trace transcripts from the - monitor. - - - The debug calls provided by debugobjects are: - - debug_object_init - debug_object_init_on_stack - debug_object_activate - debug_object_deactivate - debug_object_destroy - debug_object_free - - Each of these functions takes the address of the real object and - a pointer to the object type specific debug description - structure. - - - Each detected error is reported in the statistics and a limited - number of errors are printk'ed including a full stack trace. - - - The statistics are available via debugfs/debug_objects/stats. - They provide information about the number of warnings and the - number of successful fixups along with information about the - usage of the internal tracking objects and the state of the - internal tracking objects pool. - - - - Debug functions - - Debug object function reference -!Elib/debugobjects.c - - - debug_object_init - - This function is called whenever the initialization function - of a real object is called. - - - When the real object is already tracked by debugobjects it is - checked, whether the object can be initialized. Initializing - is not allowed for active and destroyed objects. When - debugobjects detects an error, then it calls the fixup_init - function of the object type description structure if provided - by the caller. The fixup function can correct the problem - before the real initialization of the object happens. E.g. it - can deactivate an active object in order to prevent damage to - the subsystem. - - - When the real object is not yet tracked by debugobjects, - debugobjects allocates a tracker object for the real object - and sets the tracker object state to ODEBUG_STATE_INIT. It - verifies that the object is not on the callers stack. If it is - on the callers stack then a limited number of warnings - including a full stack trace is printk'ed. The calling code - must use debug_object_init_on_stack() and remove the object - before leaving the function which allocated it. See next - section. - - - - - debug_object_init_on_stack - - This function is called whenever the initialization function - of a real object which resides on the stack is called. - - - When the real object is already tracked by debugobjects it is - checked, whether the object can be initialized. Initializing - is not allowed for active and destroyed objects. When - debugobjects detects an error, then it calls the fixup_init - function of the object type description structure if provided - by the caller. The fixup function can correct the problem - before the real initialization of the object happens. E.g. it - can deactivate an active object in order to prevent damage to - the subsystem. - - - When the real object is not yet tracked by debugobjects - debugobjects allocates a tracker object for the real object - and sets the tracker object state to ODEBUG_STATE_INIT. It - verifies that the object is on the callers stack. - - - An object which is on the stack must be removed from the - tracker by calling debug_object_free() before the function - which allocates the object returns. Otherwise we keep track of - stale objects. - - - - - debug_object_activate - - This function is called whenever the activation function of a - real object is called. - - - When the real object is already tracked by debugobjects it is - checked, whether the object can be activated. Activating is - not allowed for active and destroyed objects. When - debugobjects detects an error, then it calls the - fixup_activate function of the object type description - structure if provided by the caller. The fixup function can - correct the problem before the real activation of the object - happens. E.g. it can deactivate an active object in order to - prevent damage to the subsystem. - - - When the real object is not yet tracked by debugobjects then - the fixup_activate function is called if available. This is - necessary to allow the legitimate activation of statically - allocated and initialized objects. The fixup function checks - whether the object is valid and calls the debug_objects_init() - function to initialize the tracking of this object. - - - When the activation is legitimate, then the state of the - associated tracker object is set to ODEBUG_STATE_ACTIVE. - - - - - debug_object_deactivate - - This function is called whenever the deactivation function of - a real object is called. - - - When the real object is tracked by debugobjects it is checked, - whether the object can be deactivated. Deactivating is not - allowed for untracked or destroyed objects. - - - When the deactivation is legitimate, then the state of the - associated tracker object is set to ODEBUG_STATE_INACTIVE. - - - - - debug_object_destroy - - This function is called to mark an object destroyed. This is - useful to prevent the usage of invalid objects, which are - still available in memory: either statically allocated objects - or objects which are freed later. - - - When the real object is tracked by debugobjects it is checked, - whether the object can be destroyed. Destruction is not - allowed for active and destroyed objects. When debugobjects - detects an error, then it calls the fixup_destroy function of - the object type description structure if provided by the - caller. The fixup function can correct the problem before the - real destruction of the object happens. E.g. it can deactivate - an active object in order to prevent damage to the subsystem. - - - When the destruction is legitimate, then the state of the - associated tracker object is set to ODEBUG_STATE_DESTROYED. - - - - - debug_object_free - - This function is called before an object is freed. - - - When the real object is tracked by debugobjects it is checked, - whether the object can be freed. Free is not allowed for - active objects. When debugobjects detects an error, then it - calls the fixup_free function of the object type description - structure if provided by the caller. The fixup function can - correct the problem before the real free of the object - happens. E.g. it can deactivate an active object in order to - prevent damage to the subsystem. - - - Note that debug_object_free removes the object from the - tracker. Later usage of the object is detected by the other - debug checks. - - - - - Fixup functions - - Debug object type description structure -!Iinclude/linux/debugobjects.h - - - fixup_init - - This function is called from the debug code whenever a problem - in debug_object_init is detected. The function takes the - address of the object and the state which is currently - recorded in the tracker. - - - Called from debug_object_init when the object state is: - - ODEBUG_STATE_ACTIVE - - - - The function returns 1 when the fixup was successful, - otherwise 0. The return value is used to update the - statistics. - - - Note, that the function needs to call the debug_object_init() - function again, after the damage has been repaired in order to - keep the state consistent. - - - - - fixup_activate - - This function is called from the debug code whenever a problem - in debug_object_activate is detected. - - - Called from debug_object_activate when the object state is: - - ODEBUG_STATE_NOTAVAILABLE - ODEBUG_STATE_ACTIVE - - - - The function returns 1 when the fixup was successful, - otherwise 0. The return value is used to update the - statistics. - - - Note that the function needs to call the debug_object_activate() - function again after the damage has been repaired in order to - keep the state consistent. - - - The activation of statically initialized objects is a special - case. When debug_object_activate() has no tracked object for - this object address then fixup_activate() is called with - object state ODEBUG_STATE_NOTAVAILABLE. The fixup function - needs to check whether this is a legitimate case of a - statically initialized object or not. In case it is it calls - debug_object_init() and debug_object_activate() to make the - object known to the tracker and marked active. In this case - the function should return 0 because this is not a real fixup. - - - - - fixup_destroy - - This function is called from the debug code whenever a problem - in debug_object_destroy is detected. - - - Called from debug_object_destroy when the object state is: - - ODEBUG_STATE_ACTIVE - - - - The function returns 1 when the fixup was successful, - otherwise 0. The return value is used to update the - statistics. - - - - fixup_free - - This function is called from the debug code whenever a problem - in debug_object_free is detected. Further it can be called - from the debug checks in kfree/vfree, when an active object is - detected from the debug_check_no_obj_freed() sanity checks. - - - Called from debug_object_free() or debug_check_no_obj_freed() - when the object state is: - - ODEBUG_STATE_ACTIVE - - - - The function returns 1 when the fixup was successful, - otherwise 0. The return value is used to update the - statistics. - - - - - Known Bugs And Assumptions - - None (knock on wood). - - -
diff --git a/trunk/Documentation/DocBook/rapidio.tmpl b/trunk/Documentation/DocBook/rapidio.tmpl index 54eb26b57372..b9e143e28c64 100644 --- a/trunk/Documentation/DocBook/rapidio.tmpl +++ b/trunk/Documentation/DocBook/rapidio.tmpl @@ -133,6 +133,7 @@ !Idrivers/rapidio/rio-sysfs.c PPC32 support +!Iarch/powerpc/kernel/rio.c !Earch/powerpc/sysdev/fsl_rio.c !Iarch/powerpc/sysdev/fsl_rio.c diff --git a/trunk/Documentation/braille-console.txt b/trunk/Documentation/braille-console.txt deleted file mode 100644 index 000b0fbdc105..000000000000 --- a/trunk/Documentation/braille-console.txt +++ /dev/null @@ -1,34 +0,0 @@ - Linux Braille Console - -To get early boot messages on a braille device (before userspace screen -readers can start), you first need to compile the support for the usual serial -console (see serial-console.txt), and for braille device (in Device Drivers - -Accessibility). - -Then you need to specify a console=brl, option on the kernel command line, the -format is: - - console=brl,serial_options... - -where serial_options... are the same as described in serial-console.txt - -So for instance you can use console=brl,ttyS0 if the braille device is connected -to the first serial port, and console=brl,ttyS0,115200 to override the baud rate -to 115200, etc. - -By default, the braille device will just show the last kernel message (console -mode). To review previous messages, press the Insert key to switch to the VT -review mode. In review mode, the arrow keys permit to browse in the VT content, -page up/down keys go at the top/bottom of the screen, and the home key goes back -to the cursor, hence providing very basic screen reviewing facility. - -Sound feedback can be obtained by adding the braille_console.sound=1 kernel -parameter. - -For simplicity, only one braille console can be enabled, other uses of -console=brl,... will be discarded. Also note that it does not interfere with -the console selection mecanism described in serial-console.txt - -For now, only the VisioBraille device is supported. - -Samuel Thibault diff --git a/trunk/Documentation/feature-removal-schedule.txt b/trunk/Documentation/feature-removal-schedule.txt index 3c35d452b1a9..599fe55bf297 100644 --- a/trunk/Documentation/feature-removal-schedule.txt +++ b/trunk/Documentation/feature-removal-schedule.txt @@ -138,24 +138,6 @@ Who: Kay Sievers --------------------------- -What: find_task_by_pid -When: 2.6.26 -Why: With pid namespaces, calling this funciton will return the - wrong task when called from inside a namespace. - - The best way to save a task pid and find a task by this - pid later, is to find this task's struct pid pointer (or get - it directly from the task) and call pid_task() later. - - If someone really needs to get a task by its pid_t, then - he most likely needs the find_task_by_vpid() to get the - task from the same namespace as the current task is in, but - this may be not so in general. - -Who: Pavel Emelyanov - ---------------------------- - What: ACPI procfs interface When: July 2008 Why: ACPI sysfs conversion should be finished by January 2008. diff --git a/trunk/Documentation/filesystems/proc.txt b/trunk/Documentation/filesystems/proc.txt index dbc3c6a3650f..2a99116edc47 100644 --- a/trunk/Documentation/filesystems/proc.txt +++ b/trunk/Documentation/filesystems/proc.txt @@ -463,17 +463,11 @@ SwapTotal: 0 kB SwapFree: 0 kB Dirty: 968 kB Writeback: 0 kB -AnonPages: 861800 kB Mapped: 280372 kB -Slab: 284364 kB -SReclaimable: 159856 kB -SUnreclaim: 124508 kB -PageTables: 24448 kB -NFS_Unstable: 0 kB -Bounce: 0 kB -WritebackTmp: 0 kB +Slab: 684068 kB CommitLimit: 7669796 kB Committed_AS: 100056 kB +PageTables: 24448 kB VmallocTotal: 112216 kB VmallocUsed: 428 kB VmallocChunk: 111088 kB @@ -509,17 +503,8 @@ VmallocChunk: 111088 kB on the disk Dirty: Memory which is waiting to get written back to the disk Writeback: Memory which is actively being written back to the disk - AnonPages: Non-file backed pages mapped into userspace page tables Mapped: files which have been mmaped, such as libraries Slab: in-kernel data structures cache -SReclaimable: Part of Slab, that might be reclaimed, such as caches - SUnreclaim: Part of Slab, that cannot be reclaimed on memory pressure - PageTables: amount of memory dedicated to the lowest level of page - tables. -NFS_Unstable: NFS pages sent to the server, but not yet committed to stable - storage - Bounce: Memory used for block device "bounce buffers" -WritebackTmp: Memory used by FUSE for temporary writeback buffers CommitLimit: Based on the overcommit ratio ('vm.overcommit_ratio'), this is the total amount of memory currently available to be allocated on the system. This limit is only adhered to @@ -546,6 +531,8 @@ Committed_AS: The amount of memory presently allocated on the system. above) will not be permitted. This is useful if one needs to guarantee that processes will not fail due to lack of memory once that memory has been successfully allocated. + PageTables: amount of memory dedicated to the lowest level of page + tables. VmallocTotal: total size of vmalloc memory area VmallocUsed: amount of vmalloc area which is used VmallocChunk: largest contigious block of vmalloc area which is free diff --git a/trunk/Documentation/kernel-parameters.txt b/trunk/Documentation/kernel-parameters.txt index a3c35446e755..3ce193f86565 100644 --- a/trunk/Documentation/kernel-parameters.txt +++ b/trunk/Documentation/kernel-parameters.txt @@ -496,11 +496,6 @@ and is between 256 and 4096 characters. It is defined in the file switching to the matching ttyS device later. The options are the same as for ttyS, above. - If the device connected to the port is not a TTY but a braille - device, prepend "brl," before the device type, for instance - console=brl,ttyS0 - For now, only VisioBraille is supported. - earlycon= [KNL] Output early console device and options. uart[8250],io,[,options] uart[8250],mmio,[,options] @@ -561,8 +556,6 @@ and is between 256 and 4096 characters. It is defined in the file 1 will print _a lot_ more information - normally only useful to kernel developers. - debug_objects [KNL] Enable object debugging - decnet.addr= [HW,NET] Format: [,] See also Documentation/networking/decnet.txt. diff --git a/trunk/Documentation/powerpc/mpc52xx-device-tree-bindings.txt b/trunk/Documentation/powerpc/mpc52xx-device-tree-bindings.txt index cda7a7dffa6d..5e03610e186f 100644 --- a/trunk/Documentation/powerpc/mpc52xx-device-tree-bindings.txt +++ b/trunk/Documentation/powerpc/mpc52xx-device-tree-bindings.txt @@ -186,12 +186,6 @@ Recommended soc5200 child nodes; populate as needed for your board name device_type compatible Description ---- ----------- ---------- ----------- gpt@ gpt fsl,mpc5200-gpt General purpose timers -gpt@ gpt fsl,mpc5200-gpt-gpio General purpose - timers in GPIO mode -gpio@ fsl,mpc5200-gpio MPC5200 simple gpio - controller -gpio@ fsl,mpc5200-gpio-wkup MPC5200 wakeup gpio - controller rtc@ rtc mpc5200-rtc Real time clock mscan@ mscan mpc5200-mscan CAN bus controller pci@ pci mpc5200-pci PCI bridge @@ -231,12 +225,6 @@ PSC in i2s mode: The mpc5200 and mpc5200b PSCs are not compatible when in i2s mode. An 'mpc5200b-psc-i2s' node cannot include 'mpc5200-psc-i2s' in the compatible field. -7) GPIO controller nodes -Each GPIO controller node should have the empty property gpio-controller and -#gpio-cells set to 2. First cell is the GPIO number which is interpreted -according to the bit numbers in the GPIO control registers. The second cell -is for flags which is currently unsused. - IV - Extra Notes ================ diff --git a/trunk/MAINTAINERS b/trunk/MAINTAINERS index f822c04f1aea..bca09ed77029 100644 --- a/trunk/MAINTAINERS +++ b/trunk/MAINTAINERS @@ -2759,7 +2759,7 @@ M: rubini@ipvvis.unipv.it L: linux-kernel@vger.kernel.org S: Maintained -MOXA SMARTIO/INDUSTIO/INTELLIO SERIAL CARD +MOXA SMARTIO/INDUSTIO SERIAL CARD (MXSER 2.0) P: Jiri Slaby M: jirislaby@gmail.com L: linux-kernel@vger.kernel.org @@ -3743,6 +3743,42 @@ M: chrisw@sous-sol.org L: stable@kernel.org S: Maintained +TPM DEVICE DRIVER +P: Kylene Hall +M: tpmdd-devel@lists.sourceforge.net +W: http://tpmdd.sourceforge.net +P: Marcel Selhorst +M: tpm@selhorst.net +W: http://www.prosec.rub.de/tpm/ +L: tpmdd-devel@lists.sourceforge.net +S: Maintained + +Telecom Clock Driver for MCPL0010 +P: Mark Gross +M: mark.gross@intel.com +S: Supported + +TENSILICA XTENSA PORT (xtensa): +P: Chris Zankel +M: chris@zankel.net +S: Maintained + +THINKPAD ACPI EXTRAS DRIVER +P: Henrique de Moraes Holschuh +M: ibm-acpi@hmh.eng.br +L: ibm-acpi-devel@lists.sourceforge.net +W: http://ibm-acpi.sourceforge.net +W: http://thinkwiki.org/wiki/Ibm-acpi +T: git repo.or.cz/linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git +S: Maintained + +UltraSPARC (sparc64): +P: David S. Miller +M: davem@davemloft.net +L: sparclinux@vger.kernel.org +T: git kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6.git +S: Maintained + SHARP LH SUPPORT (LH7952X & LH7A40X) P: Marc Singer M: elf@buici.com @@ -3839,12 +3875,6 @@ P: Christoph Hellwig M: hch@infradead.org S: Maintained -TASKSTATS STATISTICS INTERFACE -P: Shailabh Nagar -M: nagar@watson.ibm.com -L: linux-kernel@vger.kernel.org -S: Maintained - TC CLASSIFIER P: Jamal Hadi Salim M: hadi@cyberus.ca @@ -3867,25 +3897,6 @@ M: andy@greyhouse.net L: netdev@vger.kernel.org S: Supported -Telecom Clock Driver for MCPL0010 -P: Mark Gross -M: mark.gross@intel.com -S: Supported - -TENSILICA XTENSA PORT (xtensa): -P: Chris Zankel -M: chris@zankel.net -S: Maintained - -THINKPAD ACPI EXTRAS DRIVER -P: Henrique de Moraes Holschuh -M: ibm-acpi@hmh.eng.br -L: ibm-acpi-devel@lists.sourceforge.net -W: http://ibm-acpi.sourceforge.net -W: http://thinkwiki.org/wiki/Ibm-acpi -T: git repo.or.cz/linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git -S: Maintained - TI FLASH MEDIA INTERFACE DRIVER P: Alex Dubov M: oakad@yahoo.com @@ -3903,6 +3914,12 @@ P: Deepak Saxena M: dsaxena@plexity.net S: Maintained +TASKSTATS STATISTICS INTERFACE +P: Shailabh Nagar +M: nagar@watson.ibm.com +L: linux-kernel@vger.kernel.org +S: Maintained + TIPC NETWORK LAYER P: Per Liden M: per.liden@ericsson.com @@ -3936,16 +3953,6 @@ L: tlinux-users@tce.toshiba-dme.co.jp W: http://www.buzzard.org.uk/toshiba/ S: Maintained -TPM DEVICE DRIVER -P: Kylene Hall -M: tpmdd-devel@lists.sourceforge.net -W: http://tpmdd.sourceforge.net -P: Marcel Selhorst -M: tpm@selhorst.net -W: http://www.prosec.rub.de/tpm/ -L: tpmdd-devel@lists.sourceforge.net -S: Maintained - TRIDENT 4DWAVE/SIS 7018 PCI AUDIO CORE P: Muli Ben-Yehuda M: mulix@mulix.org @@ -3958,12 +3965,6 @@ M: trivial@kernel.org L: linux-kernel@vger.kernel.org S: Maintained -TTY LAYER -P: Alan Cox -M: alan@lxorguk.ukuu.org.uk -L: linux-kernel@vger.kernel.org -S: Maintained - TULIP NETWORK DRIVERS P: Grant Grundler M: grundler@parisc-linux.org @@ -4132,20 +4133,6 @@ L: linux-usb@vger.kernel.org W: http://www.chello.nl/~j.vreeken/se401/ S: Maintained -USB SERIAL BELKIN F5U103 DRIVER -P: William Greathouse -M: wgreathouse@smva.com -L: linux-usb@vger.kernel.org -S: Maintained - -USB SERIAL CYPRESS M8 DRIVER -P: Lonnie Mendez -M: dignome@gmail.com -L: linux-usb@vger.kernel.org -S: Maintained -W: http://geocities.com/i0xox0i -W: http://firstlight.net/cvs - USB SERIAL CYBERJACK DRIVER P: Matthias Bruestle and Harald Welte M: support@reiner-sct.com @@ -4165,6 +4152,20 @@ M: gregkh@suse.de L: linux-usb@vger.kernel.org S: Supported +USB SERIAL BELKIN F5U103 DRIVER +P: William Greathouse +M: wgreathouse@smva.com +L: linux-usb@vger.kernel.org +S: Maintained + +USB SERIAL CYPRESS M8 DRIVER +P: Lonnie Mendez +M: dignome@gmail.com +L: linux-usb@vger.kernel.org +S: Maintained +W: http://geocities.com/i0xox0i +W: http://firstlight.net/cvs + USB SERIAL EMPEG EMPEG-CAR MARK I/II DRIVER P: Gary Brubaker M: xavyer@ix.netcom.com @@ -4267,7 +4268,7 @@ M: gregkh@suse.de L: linux-kernel@vger.kernel.org S: Maintained -VFAT/FAT/MSDOS FILESYSTEM: +FAT/VFAT/MSDOS FILESYSTEM: P: OGAWA Hirofumi M: hirofumi@mail.parknet.co.jp L: linux-kernel@vger.kernel.org @@ -4312,13 +4313,6 @@ M: dushistov@mail.ru L: linux-kernel@vger.kernel.org S: Maintained -UltraSPARC (sparc64): -P: David S. Miller -M: davem@davemloft.net -L: sparclinux@vger.kernel.org -T: git kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6.git -S: Maintained - USB DIAMOND RIO500 DRIVER P: Cesar Miquel M: miquel@df.uba.ar diff --git a/trunk/arch/arm/mach-pxa/generic.c b/trunk/arch/arm/mach-pxa/generic.c index 44617938f3f1..331f29b2d0cd 100644 --- a/trunk/arch/arm/mach-pxa/generic.c +++ b/trunk/arch/arm/mach-pxa/generic.c @@ -90,6 +90,11 @@ static struct map_desc standard_io_desc[] __initdata = { .pfn = __phys_to_pfn(0x40000000), .length = 0x02000000, .type = MT_DEVICE + }, { /* LCD */ + .virtual = 0xf4000000, + .pfn = __phys_to_pfn(0x44000000), + .length = 0x00100000, + .type = MT_DEVICE }, { /* Mem Ctl */ .virtual = 0xf6000000, .pfn = __phys_to_pfn(0x48000000), diff --git a/trunk/arch/arm/mach-pxa/littleton.c b/trunk/arch/arm/mach-pxa/littleton.c index 530654474bb2..03396063b561 100644 --- a/trunk/arch/arm/mach-pxa/littleton.c +++ b/trunk/arch/arm/mach-pxa/littleton.c @@ -301,7 +301,8 @@ static struct pxafb_mode_info tpo_tdo24mtea1_modes[] = { static struct pxafb_mach_info littleton_lcd_info = { .modes = tpo_tdo24mtea1_modes, .num_modes = 2, - .lcd_conn = LCD_COLOR_TFT_16BPP, + .lccr0 = LCCR0_Act, + .lccr3 = LCCR3_HSP | LCCR3_VSP, .pxafb_lcd_power = littleton_lcd_power, }; diff --git a/trunk/arch/arm/mach-pxa/lubbock.c b/trunk/arch/arm/mach-pxa/lubbock.c index 0993f4d1a0bc..ca209c443f34 100644 --- a/trunk/arch/arm/mach-pxa/lubbock.c +++ b/trunk/arch/arm/mach-pxa/lubbock.c @@ -395,8 +395,8 @@ static struct pxafb_mach_info sharp_lm8v31 = { .num_modes = 1, .cmap_inverse = 0, .cmap_static = 0, - .lcd_conn = LCD_COLOR_DSTN_16BPP | LCD_PCLK_EDGE_FALL | - LCD_AC_BIAS_FREQ(255); + .lccr0 = LCCR0_SDS, + .lccr3 = LCCR3_PCP | LCCR3_Acb(255), }; #define MMC_POLL_RATE msecs_to_jiffies(1000) diff --git a/trunk/arch/arm/mach-pxa/mainstone.c b/trunk/arch/arm/mach-pxa/mainstone.c index 7399fb34da4e..18d47cfa2a18 100644 --- a/trunk/arch/arm/mach-pxa/mainstone.c +++ b/trunk/arch/arm/mach-pxa/mainstone.c @@ -434,7 +434,8 @@ static struct pxafb_mode_info toshiba_ltm035a776c_mode = { static struct pxafb_mach_info mainstone_pxafb_info = { .num_modes = 1, - .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL, + .lccr0 = LCCR0_Act, + .lccr3 = LCCR3_PCP, }; static int mainstone_mci_init(struct device *dev, irq_handler_t mstone_detect_int, void *data) diff --git a/trunk/arch/arm/mach-pxa/zylonite.c b/trunk/arch/arm/mach-pxa/zylonite.c index 4a0028087ea6..dbb546216be1 100644 --- a/trunk/arch/arm/mach-pxa/zylonite.c +++ b/trunk/arch/arm/mach-pxa/zylonite.c @@ -97,7 +97,8 @@ static struct pxafb_mode_info toshiba_ltm04c380k_mode = { static struct pxafb_mach_info zylonite_toshiba_lcd_info = { .num_modes = 1, - .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL, + .lccr0 = LCCR0_Act, + .lccr3 = LCCR3_PCP, .pxafb_backlight_power = zylonite_backlight_power, }; @@ -133,7 +134,8 @@ static struct pxafb_mode_info sharp_ls037_modes[] = { static struct pxafb_mach_info zylonite_sharp_lcd_info = { .modes = sharp_ls037_modes, .num_modes = 2, - .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL, + .lccr0 = LCCR0_Act, + .lccr3 = LCCR3_PCP | LCCR3_HSP | LCCR3_VSP, .pxafb_backlight_power = zylonite_backlight_power, }; diff --git a/trunk/arch/ia64/hp/sim/simserial.c b/trunk/arch/ia64/hp/sim/simserial.c index 23cafc80d2a4..eb0c32a85fd7 100644 --- a/trunk/arch/ia64/hp/sim/simserial.c +++ b/trunk/arch/ia64/hp/sim/simserial.c @@ -210,23 +210,21 @@ static void do_softint(struct work_struct *private_) printk(KERN_ERR "simserial: do_softint called\n"); } -static int rs_put_char(struct tty_struct *tty, unsigned char ch) +static void rs_put_char(struct tty_struct *tty, unsigned char ch) { struct async_struct *info = (struct async_struct *)tty->driver_data; unsigned long flags; - if (!tty || !info->xmit.buf) - return 0; + if (!tty || !info->xmit.buf) return; local_irq_save(flags); if (CIRC_SPACE(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE) == 0) { local_irq_restore(flags); - return 0; + return; } info->xmit.buf[info->xmit.head] = ch; info->xmit.head = (info->xmit.head + 1) & (SERIAL_XMIT_SIZE-1); local_irq_restore(flags); - return 1; } static void transmit_chars(struct async_struct *info, int *intr_done) @@ -623,8 +621,7 @@ static void rs_close(struct tty_struct *tty, struct file * filp) * the line discipline to only process XON/XOFF characters. */ shutdown(info); - if (tty->ops->flush_buffer) - tty->ops->flush_buffer(tty); + if (tty->driver->flush_buffer) tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); info->event = 0; info->tty = NULL; diff --git a/trunk/arch/ia64/kernel/process.c b/trunk/arch/ia64/kernel/process.c index 58dcfac5ea88..a5ea817cbcbf 100644 --- a/trunk/arch/ia64/kernel/process.c +++ b/trunk/arch/ia64/kernel/process.c @@ -183,7 +183,7 @@ do_notify_resume_user (sigset_t *unused, struct sigscratch *scr, long in_syscall #endif /* deal with pending signal delivery */ - if (test_thread_flag(TIF_SIGPENDING)) + if (test_thread_flag(TIF_SIGPENDING)||test_thread_flag(TIF_RESTORE_SIGMASK)) ia64_do_signal(scr, in_syscall); /* copy user rbs to kernel rbs */ diff --git a/trunk/arch/powerpc/boot/dts/cm5200.dts b/trunk/arch/powerpc/boot/dts/cm5200.dts index 2f74cc4e093e..c6ca6319e4f7 100644 --- a/trunk/arch/powerpc/boot/dts/cm5200.dts +++ b/trunk/arch/powerpc/boot/dts/cm5200.dts @@ -10,7 +10,11 @@ * option) any later version. */ -/dts-v1/; +/* + * WARNING: Do not depend on this tree layout remaining static just yet. + * The MPC5200 device tree conventions are still in flux + * Keep an eye on the linuxppc-dev mailing list for more details + */ / { model = "schindler,cm5200"; @@ -25,10 +29,10 @@ PowerPC,5200@0 { device_type = "cpu"; reg = <0>; - d-cache-line-size = <32>; - i-cache-line-size = <32>; - d-cache-size = <0x4000>; // L1, 16K - i-cache-size = <0x4000>; // L1, 16K + d-cache-line-size = <20>; + i-cache-line-size = <20>; + d-cache-size = <4000>; // L1, 16K + i-cache-size = <4000>; // L1, 16K timebase-frequency = <0>; // from bootloader bus-frequency = <0>; // from bootloader clock-frequency = <0>; // from bootloader @@ -37,34 +41,34 @@ memory { device_type = "memory"; - reg = <0x00000000 0x04000000>; // 64MB + reg = <00000000 04000000>; // 64MB }; soc5200@f0000000 { #address-cells = <1>; #size-cells = <1>; compatible = "fsl,mpc5200b-immr"; - ranges = <0 0xf0000000 0x0000c000>; - reg = <0xf0000000 0x00000100>; + ranges = <0 f0000000 0000c000>; + reg = ; bus-frequency = <0>; // from bootloader system-frequency = <0>; // from bootloader cdm@200 { compatible = "fsl,mpc5200b-cdm","fsl,mpc5200-cdm"; - reg = <0x200 0x38>; + reg = <200 38>; }; - mpc5200_pic: interrupt-controller@500 { + mpc5200_pic: pic@500 { // 5200 interrupts are encoded into two levels; interrupt-controller; #interrupt-cells = <3>; compatible = "fsl,mpc5200b-pic","fsl,mpc5200-pic"; - reg = <0x500 0x80>; + reg = <500 80>; }; timer@600 { // General Purpose Timer compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; - reg = <0x600 0x10>; + reg = <600 10>; interrupts = <1 9 0>; interrupt-parent = <&mpc5200_pic>; fsl,has-wdt; @@ -72,108 +76,108 @@ timer@610 { // General Purpose Timer compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; - reg = <0x610 0x10>; - interrupts = <1 10 0>; + reg = <610 10>; + interrupts = <1 a 0>; interrupt-parent = <&mpc5200_pic>; }; timer@620 { // General Purpose Timer compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; - reg = <0x620 0x10>; - interrupts = <1 11 0>; + reg = <620 10>; + interrupts = <1 b 0>; interrupt-parent = <&mpc5200_pic>; }; timer@630 { // General Purpose Timer compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; - reg = <0x630 0x10>; - interrupts = <1 12 0>; + reg = <630 10>; + interrupts = <1 c 0>; interrupt-parent = <&mpc5200_pic>; }; timer@640 { // General Purpose Timer compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; - reg = <0x640 0x10>; - interrupts = <1 13 0>; + reg = <640 10>; + interrupts = <1 d 0>; interrupt-parent = <&mpc5200_pic>; }; timer@650 { // General Purpose Timer compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; - reg = <0x650 0x10>; - interrupts = <1 14 0>; + reg = <650 10>; + interrupts = <1 e 0>; interrupt-parent = <&mpc5200_pic>; }; timer@660 { // General Purpose Timer compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; - reg = <0x660 0x10>; - interrupts = <1 15 0>; + reg = <660 10>; + interrupts = <1 f 0>; interrupt-parent = <&mpc5200_pic>; }; timer@670 { // General Purpose Timer compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; - reg = <0x670 0x10>; - interrupts = <1 16 0>; + reg = <670 10>; + interrupts = <1 10 0>; interrupt-parent = <&mpc5200_pic>; }; rtc@800 { // Real time clock compatible = "fsl,mpc5200b-rtc","fsl,mpc5200-rtc"; - reg = <0x800 0x100>; + reg = <800 100>; interrupts = <1 5 0 1 6 0>; interrupt-parent = <&mpc5200_pic>; }; gpio@b00 { compatible = "fsl,mpc5200b-gpio","fsl,mpc5200-gpio"; - reg = <0xb00 0x40>; + reg = ; interrupts = <1 7 0>; interrupt-parent = <&mpc5200_pic>; }; gpio@c00 { compatible = "fsl,mpc5200b-gpio-wkup","fsl,mpc5200-gpio-wkup"; - reg = <0xc00 0x40>; + reg = ; interrupts = <1 8 0 0 3 0>; interrupt-parent = <&mpc5200_pic>; }; spi@f00 { compatible = "fsl,mpc5200b-spi","fsl,mpc5200-spi"; - reg = <0xf00 0x20>; - interrupts = <2 13 0 2 14 0>; + reg = ; + interrupts = <2 d 0 2 e 0>; interrupt-parent = <&mpc5200_pic>; }; usb@1000 { compatible = "fsl,mpc5200b-ohci","fsl,mpc5200-ohci","ohci-be"; - reg = <0x1000 0xff>; + reg = <1000 ff>; interrupts = <2 6 0>; interrupt-parent = <&mpc5200_pic>; }; dma-controller@1200 { compatible = "fsl,mpc5200b-bestcomm","fsl,mpc5200-bestcomm"; - reg = <0x1200 0x80>; + reg = <1200 80>; interrupts = <3 0 0 3 1 0 3 2 0 3 3 0 3 4 0 3 5 0 3 6 0 3 7 0 - 3 8 0 3 9 0 3 10 0 3 11 0 - 3 12 0 3 13 0 3 14 0 3 15 0>; + 3 8 0 3 9 0 3 a 0 3 b 0 + 3 c 0 3 d 0 3 e 0 3 f 0>; interrupt-parent = <&mpc5200_pic>; }; xlb@1f00 { compatible = "fsl,mpc5200b-xlb","fsl,mpc5200-xlb"; - reg = <0x1f00 0x100>; + reg = <1f00 100>; }; serial@2000 { // PSC1 device_type = "serial"; compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart"; port-number = <0>; // Logical port assignment - reg = <0x2000 0x100>; + reg = <2000 100>; interrupts = <2 1 0>; interrupt-parent = <&mpc5200_pic>; }; @@ -182,7 +186,7 @@ device_type = "serial"; compatible = "fsl,mpc5200-psc-uart"; port-number = <1>; // Logical port assignment - reg = <0x2200 0x100>; + reg = <2200 100>; interrupts = <2 2 0>; interrupt-parent = <&mpc5200_pic>; }; @@ -191,7 +195,7 @@ device_type = "serial"; compatible = "fsl,mpc5200-psc-uart"; port-number = <2>; // Logical port assignment - reg = <0x2400 0x100>; + reg = <2400 100>; interrupts = <2 3 0>; interrupt-parent = <&mpc5200_pic>; }; @@ -200,7 +204,7 @@ device_type = "serial"; compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart"; port-number = <5>; // Logical port assignment - reg = <0x2c00 0x100>; + reg = <2c00 100>; interrupts = <2 4 0>; interrupt-parent = <&mpc5200_pic>; }; @@ -208,7 +212,7 @@ ethernet@3000 { device_type = "network"; compatible = "fsl,mpc5200b-fec","fsl,mpc5200-fec"; - reg = <0x3000 0x400>; + reg = <3000 400>; local-mac-address = [ 00 00 00 00 00 00 ]; interrupts = <2 5 0>; interrupt-parent = <&mpc5200_pic>; @@ -219,7 +223,7 @@ #address-cells = <1>; #size-cells = <0>; compatible = "fsl,mpc5200b-mdio","fsl,mpc5200-mdio"; - reg = <0x3000 0x400>; // fec range, since we need to setup fec interrupts + reg = <3000 400>; // fec range, since we need to setup fec interrupts interrupts = <2 5 0>; // these are for "mii command finished", not link changes & co. interrupt-parent = <&mpc5200_pic>; @@ -233,15 +237,15 @@ #address-cells = <1>; #size-cells = <0>; compatible = "fsl,mpc5200b-i2c","fsl,mpc5200-i2c","fsl-i2c"; - reg = <0x3d40 0x40>; - interrupts = <2 16 0>; + reg = <3d40 40>; + interrupts = <2 10 0>; interrupt-parent = <&mpc5200_pic>; fsl5200-clocking; }; sram@8000 { compatible = "fsl,mpc5200b-sram","fsl,mpc5200-sram"; - reg = <0x8000 0x4000>; + reg = <8000 4000>; }; }; @@ -250,12 +254,12 @@ compatible = "fsl,lpb"; #address-cells = <2>; #size-cells = <1>; - ranges = <0 0 0xfc000000 0x2000000>; + ranges = <0 0 fc000000 2000000>; // 16-bit flash device at LocalPlus Bus CS0 flash@0,0 { compatible = "cfi-flash"; - reg = <0 0 0x2000000>; + reg = <0 0 2000000>; bank-width = <2>; device-width = <2>; #size-cells = <1>; diff --git a/trunk/arch/powerpc/boot/dts/lite5200.dts b/trunk/arch/powerpc/boot/dts/lite5200.dts index 2cf9a8768f44..09b4e16154d6 100644 --- a/trunk/arch/powerpc/boot/dts/lite5200.dts +++ b/trunk/arch/powerpc/boot/dts/lite5200.dts @@ -10,8 +10,6 @@ * option) any later version. */ -/dts-v1/; - / { model = "fsl,lite5200"; compatible = "fsl,lite5200"; @@ -25,10 +23,10 @@ PowerPC,5200@0 { device_type = "cpu"; reg = <0>; - d-cache-line-size = <32>; - i-cache-line-size = <32>; - d-cache-size = <0x4000>; // L1, 16K - i-cache-size = <0x4000>; // L1, 16K + d-cache-line-size = <20>; + i-cache-line-size = <20>; + d-cache-size = <4000>; // L1, 16K + i-cache-size = <4000>; // L1, 16K timebase-frequency = <0>; // from bootloader bus-frequency = <0>; // from bootloader clock-frequency = <0>; // from bootloader @@ -37,21 +35,21 @@ memory { device_type = "memory"; - reg = <0x00000000 0x04000000>; // 64MB + reg = <00000000 04000000>; // 64MB }; soc5200@f0000000 { #address-cells = <1>; #size-cells = <1>; compatible = "fsl,mpc5200-immr"; - ranges = <0 0xf0000000 0x0000c000>; - reg = <0xf0000000 0x00000100>; + ranges = <0 f0000000 0000c000>; + reg = ; bus-frequency = <0>; // from bootloader system-frequency = <0>; // from bootloader cdm@200 { compatible = "fsl,mpc5200-cdm"; - reg = <0x200 0x38>; + reg = <200 38>; }; mpc5200_pic: interrupt-controller@500 { @@ -60,13 +58,13 @@ #interrupt-cells = <3>; device_type = "interrupt-controller"; compatible = "fsl,mpc5200-pic"; - reg = <0x500 0x80>; + reg = <500 80>; }; timer@600 { // General Purpose Timer compatible = "fsl,mpc5200-gpt"; cell-index = <0>; - reg = <0x600 0x10>; + reg = <600 10>; interrupts = <1 9 0>; interrupt-parent = <&mpc5200_pic>; fsl,has-wdt; @@ -75,63 +73,63 @@ timer@610 { // General Purpose Timer compatible = "fsl,mpc5200-gpt"; cell-index = <1>; - reg = <0x610 0x10>; - interrupts = <1 10 0>; + reg = <610 10>; + interrupts = <1 a 0>; interrupt-parent = <&mpc5200_pic>; }; timer@620 { // General Purpose Timer compatible = "fsl,mpc5200-gpt"; cell-index = <2>; - reg = <0x620 0x10>; - interrupts = <1 11 0>; + reg = <620 10>; + interrupts = <1 b 0>; interrupt-parent = <&mpc5200_pic>; }; timer@630 { // General Purpose Timer compatible = "fsl,mpc5200-gpt"; cell-index = <3>; - reg = <0x630 0x10>; - interrupts = <1 12 0>; + reg = <630 10>; + interrupts = <1 c 0>; interrupt-parent = <&mpc5200_pic>; }; timer@640 { // General Purpose Timer compatible = "fsl,mpc5200-gpt"; cell-index = <4>; - reg = <0x640 0x10>; - interrupts = <1 13 0>; + reg = <640 10>; + interrupts = <1 d 0>; interrupt-parent = <&mpc5200_pic>; }; timer@650 { // General Purpose Timer compatible = "fsl,mpc5200-gpt"; cell-index = <5>; - reg = <0x650 0x10>; - interrupts = <1 14 0>; + reg = <650 10>; + interrupts = <1 e 0>; interrupt-parent = <&mpc5200_pic>; }; timer@660 { // General Purpose Timer compatible = "fsl,mpc5200-gpt"; cell-index = <6>; - reg = <0x660 0x10>; - interrupts = <1 15 0>; + reg = <660 10>; + interrupts = <1 f 0>; interrupt-parent = <&mpc5200_pic>; }; timer@670 { // General Purpose Timer compatible = "fsl,mpc5200-gpt"; cell-index = <7>; - reg = <0x670 0x10>; - interrupts = <1 16 0>; + reg = <670 10>; + interrupts = <1 10 0>; interrupt-parent = <&mpc5200_pic>; }; rtc@800 { // Real time clock compatible = "fsl,mpc5200-rtc"; device_type = "rtc"; - reg = <0x800 0x100>; + reg = <800 100>; interrupts = <1 5 0 1 6 0>; interrupt-parent = <&mpc5200_pic>; }; @@ -139,43 +137,43 @@ can@900 { compatible = "fsl,mpc5200-mscan"; cell-index = <0>; - interrupts = <2 17 0>; + interrupts = <2 11 0>; interrupt-parent = <&mpc5200_pic>; - reg = <0x900 0x80>; + reg = <900 80>; }; can@980 { compatible = "fsl,mpc5200-mscan"; cell-index = <1>; - interrupts = <2 18 0>; + interrupts = <2 12 0>; interrupt-parent = <&mpc5200_pic>; - reg = <0x980 0x80>; + reg = <980 80>; }; gpio@b00 { compatible = "fsl,mpc5200-gpio"; - reg = <0xb00 0x40>; + reg = ; interrupts = <1 7 0>; interrupt-parent = <&mpc5200_pic>; }; gpio@c00 { compatible = "fsl,mpc5200-gpio-wkup"; - reg = <0xc00 0x40>; + reg = ; interrupts = <1 8 0 0 3 0>; interrupt-parent = <&mpc5200_pic>; }; spi@f00 { compatible = "fsl,mpc5200-spi"; - reg = <0xf00 0x20>; - interrupts = <2 13 0 2 14 0>; + reg = ; + interrupts = <2 d 0 2 e 0>; interrupt-parent = <&mpc5200_pic>; }; usb@1000 { compatible = "fsl,mpc5200-ohci","ohci-be"; - reg = <0x1000 0xff>; + reg = <1000 ff>; interrupts = <2 6 0>; interrupt-parent = <&mpc5200_pic>; }; @@ -183,17 +181,17 @@ dma-controller@1200 { device_type = "dma-controller"; compatible = "fsl,mpc5200-bestcomm"; - reg = <0x1200 0x80>; + reg = <1200 80>; interrupts = <3 0 0 3 1 0 3 2 0 3 3 0 3 4 0 3 5 0 3 6 0 3 7 0 - 3 8 0 3 9 0 3 10 0 3 11 0 - 3 12 0 3 13 0 3 14 0 3 15 0>; + 3 8 0 3 9 0 3 a 0 3 b 0 + 3 c 0 3 d 0 3 e 0 3 f 0>; interrupt-parent = <&mpc5200_pic>; }; xlb@1f00 { compatible = "fsl,mpc5200-xlb"; - reg = <0x1f00 0x100>; + reg = <1f00 100>; }; serial@2000 { // PSC1 @@ -201,7 +199,7 @@ compatible = "fsl,mpc5200-psc-uart"; port-number = <0>; // Logical port assignment cell-index = <0>; - reg = <0x2000 0x100>; + reg = <2000 100>; interrupts = <2 1 0>; interrupt-parent = <&mpc5200_pic>; }; @@ -210,7 +208,7 @@ //ac97@2200 { // PSC2 // compatible = "fsl,mpc5200-psc-ac97"; // cell-index = <1>; - // reg = <0x2200 0x100>; + // reg = <2200 100>; // interrupts = <2 2 0>; // interrupt-parent = <&mpc5200_pic>; //}; @@ -219,7 +217,7 @@ //i2s@2400 { // PSC3 // compatible = "fsl,mpc5200-psc-i2s"; // cell-index = <2>; - // reg = <0x2400 0x100>; + // reg = <2400 100>; // interrupts = <2 3 0>; // interrupt-parent = <&mpc5200_pic>; //}; @@ -229,8 +227,8 @@ // device_type = "serial"; // compatible = "fsl,mpc5200-psc-uart"; // cell-index = <3>; - // reg = <0x2600 0x100>; - // interrupts = <2 11 0>; + // reg = <2600 100>; + // interrupts = <2 b 0>; // interrupt-parent = <&mpc5200_pic>; //}; @@ -239,8 +237,8 @@ // device_type = "serial"; // compatible = "fsl,mpc5200-psc-uart"; // cell-index = <4>; - // reg = <0x2800 0x100>; - // interrupts = <2 12 0>; + // reg = <2800 100>; + // interrupts = <2 c 0>; // interrupt-parent = <&mpc5200_pic>; //}; @@ -248,7 +246,7 @@ //spi@2c00 { // PSC6 // compatible = "fsl,mpc5200-psc-spi"; // cell-index = <5>; - // reg = <0x2c00 0x100>; + // reg = <2c00 100>; // interrupts = <2 4 0>; // interrupt-parent = <&mpc5200_pic>; //}; @@ -256,7 +254,7 @@ ethernet@3000 { device_type = "network"; compatible = "fsl,mpc5200-fec"; - reg = <0x3000 0x400>; + reg = <3000 800>; local-mac-address = [ 00 00 00 00 00 00 ]; interrupts = <2 5 0>; interrupt-parent = <&mpc5200_pic>; @@ -267,11 +265,11 @@ #address-cells = <1>; #size-cells = <0>; compatible = "fsl,mpc5200-mdio"; - reg = <0x3000 0x400>; // fec range, since we need to setup fec interrupts + reg = <3000 400>; // fec range, since we need to setup fec interrupts interrupts = <2 5 0>; // these are for "mii command finished", not link changes & co. interrupt-parent = <&mpc5200_pic>; - phy0: ethernet-phy@1 { + phy0:ethernet-phy@1 { device_type = "ethernet-phy"; reg = <1>; }; @@ -280,7 +278,7 @@ ata@3a00 { device_type = "ata"; compatible = "fsl,mpc5200-ata"; - reg = <0x3a00 0x100>; + reg = <3a00 100>; interrupts = <2 7 0>; interrupt-parent = <&mpc5200_pic>; }; @@ -290,8 +288,8 @@ #size-cells = <0>; compatible = "fsl,mpc5200-i2c","fsl-i2c"; cell-index = <0>; - reg = <0x3d00 0x40>; - interrupts = <2 15 0>; + reg = <3d00 40>; + interrupts = <2 f 0>; interrupt-parent = <&mpc5200_pic>; fsl5200-clocking; }; @@ -301,14 +299,14 @@ #size-cells = <0>; compatible = "fsl,mpc5200-i2c","fsl-i2c"; cell-index = <1>; - reg = <0x3d40 0x40>; - interrupts = <2 16 0>; + reg = <3d40 40>; + interrupts = <2 10 0>; interrupt-parent = <&mpc5200_pic>; fsl5200-clocking; }; sram@8000 { compatible = "fsl,mpc5200-sram","sram"; - reg = <0x8000 0x4000>; + reg = <8000 4000>; }; }; @@ -318,18 +316,18 @@ #address-cells = <3>; device_type = "pci"; compatible = "fsl,mpc5200-pci"; - reg = <0xf0000d00 0x100>; - interrupt-map-mask = <0xf800 0 0 7>; - interrupt-map = <0xc000 0 0 1 &mpc5200_pic 0 0 3 - 0xc000 0 0 2 &mpc5200_pic 0 0 3 - 0xc000 0 0 3 &mpc5200_pic 0 0 3 - 0xc000 0 0 4 &mpc5200_pic 0 0 3>; + reg = ; + interrupt-map-mask = ; + interrupt-map = ; clock-frequency = <0>; // From boot loader - interrupts = <2 8 0 2 9 0 2 10 0>; + interrupts = <2 8 0 2 9 0 2 a 0>; interrupt-parent = <&mpc5200_pic>; bus-range = <0 0>; - ranges = <0x42000000 0 0x80000000 0x80000000 0 0x20000000 - 0x02000000 0 0xa0000000 0xa0000000 0 0x10000000 - 0x01000000 0 0x00000000 0xb0000000 0 0x01000000>; + ranges = <42000000 0 80000000 80000000 0 20000000 + 02000000 0 a0000000 a0000000 0 10000000 + 01000000 0 00000000 b0000000 0 01000000>; }; }; diff --git a/trunk/arch/powerpc/boot/dts/lite5200b.dts b/trunk/arch/powerpc/boot/dts/lite5200b.dts index 7bd5b9c399b8..2e9bc397ae9a 100644 --- a/trunk/arch/powerpc/boot/dts/lite5200b.dts +++ b/trunk/arch/powerpc/boot/dts/lite5200b.dts @@ -10,7 +10,11 @@ * option) any later version. */ -/dts-v1/; +/* + * WARNING: Do not depend on this tree layout remaining static just yet. + * The MPC5200 device tree conventions are still in flux + * Keep an eye on the linuxppc-dev mailing list for more details + */ / { model = "fsl,lite5200b"; @@ -25,10 +29,10 @@ PowerPC,5200@0 { device_type = "cpu"; reg = <0>; - d-cache-line-size = <32>; - i-cache-line-size = <32>; - d-cache-size = <0x4000>; // L1, 16K - i-cache-size = <0x4000>; // L1, 16K + d-cache-line-size = <20>; + i-cache-line-size = <20>; + d-cache-size = <4000>; // L1, 16K + i-cache-size = <4000>; // L1, 16K timebase-frequency = <0>; // from bootloader bus-frequency = <0>; // from bootloader clock-frequency = <0>; // from bootloader @@ -37,21 +41,21 @@ memory { device_type = "memory"; - reg = <0x00000000 0x10000000>; // 256MB + reg = <00000000 10000000>; // 256MB }; soc5200@f0000000 { #address-cells = <1>; #size-cells = <1>; compatible = "fsl,mpc5200b-immr"; - ranges = <0 0xf0000000 0x0000c000>; - reg = <0xf0000000 0x00000100>; + ranges = <0 f0000000 0000c000>; + reg = ; bus-frequency = <0>; // from bootloader system-frequency = <0>; // from bootloader cdm@200 { compatible = "fsl,mpc5200b-cdm","fsl,mpc5200-cdm"; - reg = <0x200 0x38>; + reg = <200 38>; }; mpc5200_pic: interrupt-controller@500 { @@ -60,13 +64,13 @@ #interrupt-cells = <3>; device_type = "interrupt-controller"; compatible = "fsl,mpc5200b-pic","fsl,mpc5200-pic"; - reg = <0x500 0x80>; + reg = <500 80>; }; timer@600 { // General Purpose Timer compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; cell-index = <0>; - reg = <0x600 0x10>; + reg = <600 10>; interrupts = <1 9 0>; interrupt-parent = <&mpc5200_pic>; fsl,has-wdt; @@ -75,63 +79,63 @@ timer@610 { // General Purpose Timer compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; cell-index = <1>; - reg = <0x610 0x10>; - interrupts = <1 10 0>; + reg = <610 10>; + interrupts = <1 a 0>; interrupt-parent = <&mpc5200_pic>; }; timer@620 { // General Purpose Timer compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; cell-index = <2>; - reg = <0x620 0x10>; - interrupts = <1 11 0>; + reg = <620 10>; + interrupts = <1 b 0>; interrupt-parent = <&mpc5200_pic>; }; timer@630 { // General Purpose Timer compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; cell-index = <3>; - reg = <0x630 0x10>; - interrupts = <1 12 0>; + reg = <630 10>; + interrupts = <1 c 0>; interrupt-parent = <&mpc5200_pic>; }; timer@640 { // General Purpose Timer compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; cell-index = <4>; - reg = <0x640 0x10>; - interrupts = <1 13 0>; + reg = <640 10>; + interrupts = <1 d 0>; interrupt-parent = <&mpc5200_pic>; }; timer@650 { // General Purpose Timer compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; cell-index = <5>; - reg = <0x650 0x10>; - interrupts = <1 14 0>; + reg = <650 10>; + interrupts = <1 e 0>; interrupt-parent = <&mpc5200_pic>; }; timer@660 { // General Purpose Timer compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; cell-index = <6>; - reg = <0x660 0x10>; - interrupts = <1 15 0>; + reg = <660 10>; + interrupts = <1 f 0>; interrupt-parent = <&mpc5200_pic>; }; timer@670 { // General Purpose Timer compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; cell-index = <7>; - reg = <0x670 0x10>; - interrupts = <1 16 0>; + reg = <670 10>; + interrupts = <1 10 0>; interrupt-parent = <&mpc5200_pic>; }; rtc@800 { // Real time clock compatible = "fsl,mpc5200b-rtc","fsl,mpc5200-rtc"; device_type = "rtc"; - reg = <0x800 0x100>; + reg = <800 100>; interrupts = <1 5 0 1 6 0>; interrupt-parent = <&mpc5200_pic>; }; @@ -139,43 +143,43 @@ can@900 { compatible = "fsl,mpc5200b-mscan","fsl,mpc5200-mscan"; cell-index = <0>; - interrupts = <2 17 0>; + interrupts = <2 11 0>; interrupt-parent = <&mpc5200_pic>; - reg = <0x900 0x80>; + reg = <900 80>; }; can@980 { compatible = "fsl,mpc5200b-mscan","fsl,mpc5200-mscan"; cell-index = <1>; - interrupts = <2 18 0>; + interrupts = <2 12 0>; interrupt-parent = <&mpc5200_pic>; - reg = <0x980 0x80>; + reg = <980 80>; }; gpio@b00 { compatible = "fsl,mpc5200b-gpio","fsl,mpc5200-gpio"; - reg = <0xb00 0x40>; + reg = ; interrupts = <1 7 0>; interrupt-parent = <&mpc5200_pic>; }; gpio@c00 { compatible = "fsl,mpc5200b-gpio-wkup","fsl,mpc5200-gpio-wkup"; - reg = <0xc00 0x40>; + reg = ; interrupts = <1 8 0 0 3 0>; interrupt-parent = <&mpc5200_pic>; }; spi@f00 { compatible = "fsl,mpc5200b-spi","fsl,mpc5200-spi"; - reg = <0xf00 0x20>; - interrupts = <2 13 0 2 14 0>; + reg = ; + interrupts = <2 d 0 2 e 0>; interrupt-parent = <&mpc5200_pic>; }; usb@1000 { compatible = "fsl,mpc5200b-ohci","fsl,mpc5200-ohci","ohci-be"; - reg = <0x1000 0xff>; + reg = <1000 ff>; interrupts = <2 6 0>; interrupt-parent = <&mpc5200_pic>; }; @@ -183,17 +187,17 @@ dma-controller@1200 { device_type = "dma-controller"; compatible = "fsl,mpc5200b-bestcomm","fsl,mpc5200-bestcomm"; - reg = <0x1200 0x80>; + reg = <1200 80>; interrupts = <3 0 0 3 1 0 3 2 0 3 3 0 3 4 0 3 5 0 3 6 0 3 7 0 - 3 8 0 3 9 0 3 10 0 3 11 0 - 3 12 0 3 13 0 3 14 0 3 15 0>; + 3 8 0 3 9 0 3 a 0 3 b 0 + 3 c 0 3 d 0 3 e 0 3 f 0>; interrupt-parent = <&mpc5200_pic>; }; xlb@1f00 { compatible = "fsl,mpc5200b-xlb","fsl,mpc5200-xlb"; - reg = <0x1f00 0x100>; + reg = <1f00 100>; }; serial@2000 { // PSC1 @@ -201,7 +205,7 @@ compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart"; port-number = <0>; // Logical port assignment cell-index = <0>; - reg = <0x2000 0x100>; + reg = <2000 100>; interrupts = <2 1 0>; interrupt-parent = <&mpc5200_pic>; }; @@ -210,7 +214,7 @@ //ac97@2200 { // PSC2 // compatible = "fsl,mpc5200b-psc-ac97","fsl,mpc5200-psc-ac97"; // cell-index = <1>; - // reg = <0x2200 0x100>; + // reg = <2200 100>; // interrupts = <2 2 0>; // interrupt-parent = <&mpc5200_pic>; //}; @@ -219,7 +223,7 @@ //i2s@2400 { // PSC3 // compatible = "fsl,mpc5200b-psc-i2s"; //not 5200 compatible // cell-index = <2>; - // reg = <0x2400 0x100>; + // reg = <2400 100>; // interrupts = <2 3 0>; // interrupt-parent = <&mpc5200_pic>; //}; @@ -229,8 +233,8 @@ // device_type = "serial"; // compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart"; // cell-index = <3>; - // reg = <0x2600 0x100>; - // interrupts = <2 11 0>; + // reg = <2600 100>; + // interrupts = <2 b 0>; // interrupt-parent = <&mpc5200_pic>; //}; @@ -239,8 +243,8 @@ // device_type = "serial"; // compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart"; // cell-index = <4>; - // reg = <0x2800 0x100>; - // interrupts = <2 12 0>; + // reg = <2800 100>; + // interrupts = <2 c 0>; // interrupt-parent = <&mpc5200_pic>; //}; @@ -248,7 +252,7 @@ //spi@2c00 { // PSC6 // compatible = "fsl,mpc5200b-psc-spi","fsl,mpc5200-psc-spi"; // cell-index = <5>; - // reg = <0x2c00 0x100>; + // reg = <2c00 100>; // interrupts = <2 4 0>; // interrupt-parent = <&mpc5200_pic>; //}; @@ -256,7 +260,7 @@ ethernet@3000 { device_type = "network"; compatible = "fsl,mpc5200b-fec","fsl,mpc5200-fec"; - reg = <0x3000 0x400>; + reg = <3000 400>; local-mac-address = [ 00 00 00 00 00 00 ]; interrupts = <2 5 0>; interrupt-parent = <&mpc5200_pic>; @@ -267,11 +271,11 @@ #address-cells = <1>; #size-cells = <0>; compatible = "fsl,mpc5200b-mdio", "fsl,mpc5200-mdio"; - reg = <0x3000 0x400>; // fec range, since we need to setup fec interrupts + reg = <3000 400>; // fec range, since we need to setup fec interrupts interrupts = <2 5 0>; // these are for "mii command finished", not link changes & co. interrupt-parent = <&mpc5200_pic>; - phy0: ethernet-phy@0 { + phy0:ethernet-phy@0 { device_type = "ethernet-phy"; reg = <0>; }; @@ -280,7 +284,7 @@ ata@3a00 { device_type = "ata"; compatible = "fsl,mpc5200b-ata","fsl,mpc5200-ata"; - reg = <0x3a00 0x100>; + reg = <3a00 100>; interrupts = <2 7 0>; interrupt-parent = <&mpc5200_pic>; }; @@ -290,8 +294,8 @@ #size-cells = <0>; compatible = "fsl,mpc5200b-i2c","fsl,mpc5200-i2c","fsl-i2c"; cell-index = <0>; - reg = <0x3d00 0x40>; - interrupts = <2 15 0>; + reg = <3d00 40>; + interrupts = <2 f 0>; interrupt-parent = <&mpc5200_pic>; fsl5200-clocking; }; @@ -301,14 +305,14 @@ #size-cells = <0>; compatible = "fsl,mpc5200b-i2c","fsl,mpc5200-i2c","fsl-i2c"; cell-index = <1>; - reg = <0x3d40 0x40>; - interrupts = <2 16 0>; + reg = <3d40 40>; + interrupts = <2 10 0>; interrupt-parent = <&mpc5200_pic>; fsl5200-clocking; }; sram@8000 { compatible = "fsl,mpc5200b-sram","fsl,mpc5200-sram","sram"; - reg = <0x8000 0x4000>; + reg = <8000 4000>; }; }; @@ -318,23 +322,23 @@ #address-cells = <3>; device_type = "pci"; compatible = "fsl,mpc5200b-pci","fsl,mpc5200-pci"; - reg = <0xf0000d00 0x100>; - interrupt-map-mask = <0xf800 0 0 7>; - interrupt-map = <0xc000 0 0 1 &mpc5200_pic 0 0 3 // 1st slot - 0xc000 0 0 2 &mpc5200_pic 1 1 3 - 0xc000 0 0 3 &mpc5200_pic 1 2 3 - 0xc000 0 0 4 &mpc5200_pic 1 3 3 - - 0xc800 0 0 1 &mpc5200_pic 1 1 3 // 2nd slot - 0xc800 0 0 2 &mpc5200_pic 1 2 3 - 0xc800 0 0 3 &mpc5200_pic 1 3 3 - 0xc800 0 0 4 &mpc5200_pic 0 0 3>; + reg = ; + interrupt-map-mask = ; + interrupt-map = ; clock-frequency = <0>; // From boot loader - interrupts = <2 8 0 2 9 0 2 10 0>; + interrupts = <2 8 0 2 9 0 2 a 0>; interrupt-parent = <&mpc5200_pic>; bus-range = <0 0>; - ranges = <0x42000000 0 0x80000000 0x80000000 0 0x20000000 - 0x02000000 0 0xa0000000 0xa0000000 0 0x10000000 - 0x01000000 0 0x00000000 0xb0000000 0 0x01000000>; + ranges = <42000000 0 80000000 80000000 0 20000000 + 02000000 0 a0000000 a0000000 0 10000000 + 01000000 0 00000000 b0000000 0 01000000>; }; }; diff --git a/trunk/arch/powerpc/boot/dts/motionpro.dts b/trunk/arch/powerpc/boot/dts/motionpro.dts index 9e3c921be164..2b0dde058f8e 100644 --- a/trunk/arch/powerpc/boot/dts/motionpro.dts +++ b/trunk/arch/powerpc/boot/dts/motionpro.dts @@ -10,8 +10,6 @@ * option) any later version. */ -/dts-v1/; - / { model = "promess,motionpro"; compatible = "promess,motionpro"; @@ -25,10 +23,10 @@ PowerPC,5200@0 { device_type = "cpu"; reg = <0>; - d-cache-line-size = <32>; - i-cache-line-size = <32>; - d-cache-size = <0x4000>; // L1, 16K - i-cache-size = <0x4000>; // L1, 16K + d-cache-line-size = <20>; + i-cache-line-size = <20>; + d-cache-size = <4000>; // L1, 16K + i-cache-size = <4000>; // L1, 16K timebase-frequency = <0>; // from bootloader bus-frequency = <0>; // from bootloader clock-frequency = <0>; // from bootloader @@ -37,21 +35,21 @@ memory { device_type = "memory"; - reg = <0x00000000 0x04000000>; // 64MB + reg = <00000000 04000000>; // 64MB }; soc5200@f0000000 { #address-cells = <1>; #size-cells = <1>; compatible = "fsl,mpc5200b-immr"; - ranges = <0 0xf0000000 0x0000c000>; - reg = <0xf0000000 0x00000100>; + ranges = <0 f0000000 0000c000>; + reg = ; bus-frequency = <0>; // from bootloader system-frequency = <0>; // from bootloader cdm@200 { compatible = "fsl,mpc5200b-cdm","fsl,mpc5200-cdm"; - reg = <0x200 0x38>; + reg = <200 38>; }; mpc5200_pic: interrupt-controller@500 { @@ -59,12 +57,12 @@ interrupt-controller; #interrupt-cells = <3>; compatible = "fsl,mpc5200b-pic","fsl,mpc5200-pic"; - reg = <0x500 0x80>; + reg = <500 80>; }; timer@600 { // General Purpose Timer compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; - reg = <0x600 0x10>; + reg = <600 10>; interrupts = <1 9 0>; interrupt-parent = <&mpc5200_pic>; fsl,has-wdt; @@ -72,118 +70,118 @@ timer@610 { // General Purpose Timer compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; - reg = <0x610 0x10>; - interrupts = <1 10 0>; + reg = <610 10>; + interrupts = <1 a 0>; interrupt-parent = <&mpc5200_pic>; }; timer@620 { // General Purpose Timer compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; - reg = <0x620 0x10>; - interrupts = <1 11 0>; + reg = <620 10>; + interrupts = <1 b 0>; interrupt-parent = <&mpc5200_pic>; }; timer@630 { // General Purpose Timer compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; - reg = <0x630 0x10>; - interrupts = <1 12 0>; + reg = <630 10>; + interrupts = <1 c 0>; interrupt-parent = <&mpc5200_pic>; }; timer@640 { // General Purpose Timer compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; - reg = <0x640 0x10>; - interrupts = <1 13 0>; + reg = <640 10>; + interrupts = <1 d 0>; interrupt-parent = <&mpc5200_pic>; }; timer@650 { // General Purpose Timer compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; - reg = <0x650 0x10>; - interrupts = <1 14 0>; + reg = <650 10>; + interrupts = <1 e 0>; interrupt-parent = <&mpc5200_pic>; }; motionpro-led@660 { // Motion-PRO status LED compatible = "promess,motionpro-led"; label = "motionpro-statusled"; - reg = <0x660 0x10>; - interrupts = <1 15 0>; + reg = <660 10>; + interrupts = <1 f 0>; interrupt-parent = <&mpc5200_pic>; - blink-delay = <100>; // 100 msec + blink-delay = <64>; // 100 msec }; motionpro-led@670 { // Motion-PRO ready LED compatible = "promess,motionpro-led"; label = "motionpro-readyled"; - reg = <0x670 0x10>; - interrupts = <1 16 0>; + reg = <670 10>; + interrupts = <1 10 0>; interrupt-parent = <&mpc5200_pic>; }; rtc@800 { // Real time clock compatible = "fsl,mpc5200b-rtc","fsl,mpc5200-rtc"; - reg = <0x800 0x100>; + reg = <800 100>; interrupts = <1 5 0 1 6 0>; interrupt-parent = <&mpc5200_pic>; }; - can@980 { + mscan@980 { compatible = "fsl,mpc5200b-mscan","fsl,mpc5200-mscan"; - interrupts = <2 18 0>; + interrupts = <2 12 0>; interrupt-parent = <&mpc5200_pic>; - reg = <0x980 0x80>; + reg = <980 80>; }; gpio@b00 { compatible = "fsl,mpc5200b-gpio","fsl,mpc5200-gpio"; - reg = <0xb00 0x40>; + reg = ; interrupts = <1 7 0>; interrupt-parent = <&mpc5200_pic>; }; gpio@c00 { compatible = "fsl,mpc5200b-gpio-wkup","fsl,mpc5200-gpio-wkup"; - reg = <0xc00 0x40>; + reg = ; interrupts = <1 8 0 0 3 0>; interrupt-parent = <&mpc5200_pic>; }; spi@f00 { compatible = "fsl,mpc5200b-spi","fsl,mpc5200-spi"; - reg = <0xf00 0x20>; - interrupts = <2 13 0 2 14 0>; + reg = ; + interrupts = <2 d 0 2 e 0>; interrupt-parent = <&mpc5200_pic>; }; usb@1000 { compatible = "fsl,mpc5200b-ohci","fsl,mpc5200-ohci","ohci-be"; - reg = <0x1000 0xff>; + reg = <1000 ff>; interrupts = <2 6 0>; interrupt-parent = <&mpc5200_pic>; }; dma-controller@1200 { compatible = "fsl,mpc5200b-bestcomm","fsl,mpc5200-bestcomm"; - reg = <0x1200 0x80>; + reg = <1200 80>; interrupts = <3 0 0 3 1 0 3 2 0 3 3 0 3 4 0 3 5 0 3 6 0 3 7 0 - 3 8 0 3 9 0 3 10 0 3 11 0 - 3 12 0 3 13 0 3 14 0 3 15 0>; + 3 8 0 3 9 0 3 a 0 3 b 0 + 3 c 0 3 d 0 3 e 0 3 f 0>; interrupt-parent = <&mpc5200_pic>; }; xlb@1f00 { compatible = "fsl,mpc5200b-xlb","fsl,mpc5200-xlb"; - reg = <0x1f00 0x100>; + reg = <1f00 100>; }; serial@2000 { // PSC1 device_type = "serial"; compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart"; port-number = <0>; // Logical port assignment - reg = <0x2000 0x100>; + reg = <2000 100>; interrupts = <2 1 0>; interrupt-parent = <&mpc5200_pic>; }; @@ -192,7 +190,7 @@ spi@2200 { // PSC2 compatible = "fsl,mpc5200b-psc-spi","fsl,mpc5200-psc-spi"; cell-index = <1>; - reg = <0x2200 0x100>; + reg = <2200 100>; interrupts = <2 2 0>; interrupt-parent = <&mpc5200_pic>; }; @@ -202,15 +200,15 @@ device_type = "serial"; compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart"; port-number = <4>; // Logical port assignment - reg = <0x2800 0x100>; - interrupts = <2 12 0>; + reg = <2800 100>; + interrupts = <2 c 0>; interrupt-parent = <&mpc5200_pic>; }; ethernet@3000 { device_type = "network"; compatible = "fsl,mpc5200b-fec","fsl,mpc5200-fec"; - reg = <0x3000 0x400>; + reg = <3000 400>; local-mac-address = [ 00 00 00 00 00 00 ]; interrupts = <2 5 0>; interrupt-parent = <&mpc5200_pic>; @@ -221,7 +219,7 @@ #address-cells = <1>; #size-cells = <0>; compatible = "fsl,mpc5200b-mdio","fsl,mpc5200-mdio"; - reg = <0x3000 0x400>; // fec range, since we need to setup fec interrupts + reg = <3000 400>; // fec range, since we need to setup fec interrupts interrupts = <2 5 0>; // these are for "mii command finished", not link changes & co. interrupt-parent = <&mpc5200_pic>; @@ -233,7 +231,7 @@ ata@3a00 { compatible = "fsl,mpc5200b-ata","fsl,mpc5200-ata"; - reg = <0x3a00 0x100>; + reg = <3a00 100>; interrupts = <2 7 0>; interrupt-parent = <&mpc5200_pic>; }; @@ -242,21 +240,21 @@ #address-cells = <1>; #size-cells = <0>; compatible = "fsl,mpc5200b-i2c","fsl,mpc5200-i2c","fsl-i2c"; - reg = <0x3d40 0x40>; - interrupts = <2 16 0>; + reg = <3d40 40>; + interrupts = <2 10 0>; interrupt-parent = <&mpc5200_pic>; fsl5200-clocking; rtc@68 { device_type = "rtc"; compatible = "dallas,ds1339"; - reg = <0x68>; + reg = <68>; }; }; sram@8000 { compatible = "fsl,mpc5200b-sram","fsl,mpc5200-sram"; - reg = <0x8000 0x4000>; + reg = <8000 4000>; }; }; @@ -264,15 +262,15 @@ compatible = "fsl,lpb"; #address-cells = <2>; #size-cells = <1>; - ranges = <0 0 0xff000000 0x01000000 - 1 0 0x50000000 0x00010000 - 2 0 0x50010000 0x00010000 - 3 0 0x50020000 0x00010000>; + ranges = <0 0 ff000000 01000000 + 1 0 50000000 00010000 + 2 0 50010000 00010000 + 3 0 50020000 00010000>; // 8-bit DualPort SRAM on LocalPlus Bus CS1 kollmorgen@1,0 { compatible = "promess,motionpro-kollmorgen"; - reg = <1 0 0x10000>; + reg = <1 0 10000>; interrupts = <1 1 0>; interrupt-parent = <&mpc5200_pic>; }; @@ -280,13 +278,13 @@ // 8-bit board CPLD on LocalPlus Bus CS2 cpld@2,0 { compatible = "promess,motionpro-cpld"; - reg = <2 0 0x10000>; + reg = <2 0 10000>; }; // 8-bit custom Anybus Module on LocalPlus Bus CS3 anybus@3,0 { compatible = "promess,motionpro-anybus"; - reg = <3 0 0x10000>; + reg = <3 0 10000>; }; pro_module_general@3,0 { compatible = "promess,pro_module_general"; @@ -294,13 +292,13 @@ }; pro_module_dio@3,800 { compatible = "promess,pro_module_dio"; - reg = <3 0x800 2>; + reg = <3 800 2>; }; // 16-bit flash device at LocalPlus Bus CS0 flash@0,0 { compatible = "cfi-flash"; - reg = <0 0 0x01000000>; + reg = <0 0 01000000>; bank-width = <2>; device-width = <2>; #size-cells = <1>; diff --git a/trunk/arch/powerpc/boot/dts/pcm030.dts b/trunk/arch/powerpc/boot/dts/pcm030.dts deleted file mode 100644 index 7c1bb952360c..000000000000 --- a/trunk/arch/powerpc/boot/dts/pcm030.dts +++ /dev/null @@ -1,363 +0,0 @@ -/* - * phyCORE-MPC5200B-tiny (pcm030) board Device Tree Source - * - * Copyright 2006 Pengutronix - * Sascha Hauer - * Copyright 2007 Pengutronix - * Juergen Beisert - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - */ - -/dts-v1/; - -/ { - model = "phytec,pcm030"; - compatible = "phytec,pcm030"; - #address-cells = <1>; - #size-cells = <1>; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - PowerPC,5200@0 { - device_type = "cpu"; - reg = <0>; - d-cache-line-size = <32>; - i-cache-line-size = <32>; - d-cache-size = <0x4000>; /* L1, 16K */ - i-cache-size = <0x4000>; /* L1, 16K */ - timebase-frequency = <0>; /* From Bootloader */ - bus-frequency = <0>; /* From Bootloader */ - clock-frequency = <0>; /* From Bootloader */ - }; - }; - - memory { - device_type = "memory"; - reg = <0x00000000 0x04000000>; /* 64MB */ - }; - - soc5200@f0000000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "fsl,mpc5200b-immr"; - ranges = <0x0 0xf0000000 0x0000c000>; - bus-frequency = <0>; /* From bootloader */ - system-frequency = <0>; /* From bootloader */ - - cdm@200 { - compatible = "fsl,mpc5200b-cdm","fsl,mpc5200-cdm"; - reg = <0x200 0x38>; - }; - - mpc5200_pic: interrupt-controller@500 { - /* 5200 interrupts are encoded into two levels; */ - interrupt-controller; - #interrupt-cells = <3>; - device_type = "interrupt-controller"; - compatible = "fsl,mpc5200b-pic","fsl,mpc5200-pic"; - reg = <0x500 0x80>; - }; - - timer@600 { /* General Purpose Timer */ - compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; - cell-index = <0>; - reg = <0x600 0x10>; - interrupts = <0x1 0x9 0x0>; - interrupt-parent = <&mpc5200_pic>; - fsl,has-wdt; - }; - - timer@610 { /* General Purpose Timer */ - compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; - cell-index = <1>; - reg = <0x610 0x10>; - interrupts = <0x1 0xa 0x0>; - interrupt-parent = <&mpc5200_pic>; - }; - - gpt2: timer@620 { /* General Purpose Timer in GPIO mode */ - compatible = "fsl,mpc5200b-gpt-gpio","fsl,mpc5200-gpt-gpio"; - cell-index = <2>; - reg = <0x620 0x10>; - interrupts = <0x1 0xb 0x0>; - interrupt-parent = <&mpc5200_pic>; - gpio-controller; - #gpio-cells = <2>; - }; - - gpt3: timer@630 { /* General Purpose Timer in GPIO mode */ - compatible = "fsl,mpc5200b-gpt-gpio","fsl,mpc5200-gpt-gpio"; - cell-index = <3>; - reg = <0x630 0x10>; - interrupts = <0x1 0xc 0x0>; - interrupt-parent = <&mpc5200_pic>; - gpio-controller; - #gpio-cells = <2>; - }; - - gpt4: timer@640 { /* General Purpose Timer in GPIO mode */ - compatible = "fsl,mpc5200b-gpt-gpio","fsl,mpc5200-gpt-gpio"; - cell-index = <4>; - reg = <0x640 0x10>; - interrupts = <0x1 0xd 0x0>; - interrupt-parent = <&mpc5200_pic>; - gpio-controller; - #gpio-cells = <2>; - }; - - gpt5: timer@650 { /* General Purpose Timer in GPIO mode */ - compatible = "fsl,mpc5200b-gpt-gpio","fsl,mpc5200-gpt-gpio"; - cell-index = <5>; - reg = <0x650 0x10>; - interrupts = <0x1 0xe 0x0>; - interrupt-parent = <&mpc5200_pic>; - gpio-controller; - #gpio-cells = <2>; - }; - - gpt6: timer@660 { /* General Purpose Timer in GPIO mode */ - compatible = "fsl,mpc5200b-gpt-gpio","fsl,mpc5200-gpt-gpio"; - cell-index = <6>; - reg = <0x660 0x10>; - interrupts = <0x1 0xf 0x0>; - interrupt-parent = <&mpc5200_pic>; - gpio-controller; - #gpio-cells = <2>; - }; - - gpt7: timer@670 { /* General Purpose Timer in GPIO mode */ - compatible = "fsl,mpc5200b-gpt-gpio","fsl,mpc5200-gpt-gpio"; - cell-index = <7>; - reg = <0x670 0x10>; - interrupts = <0x1 0x10 0x0>; - interrupt-parent = <&mpc5200_pic>; - gpio-controller; - #gpio-cells = <2>; - }; - - rtc@800 { // Real time clock - compatible = "fsl,mpc5200b-rtc","fsl,mpc5200-rtc"; - device_type = "rtc"; - reg = <0x800 0x100>; - interrupts = <0x1 0x5 0x0 0x1 0x6 0x0>; - interrupt-parent = <&mpc5200_pic>; - }; - - can@900 { - compatible = "fsl,mpc5200b-mscan","fsl,mpc5200-mscan"; - cell-index = <0>; - interrupts = <0x2 0x11 0x0>; - interrupt-parent = <&mpc5200_pic>; - reg = <0x900 0x80>; - }; - - can@980 { - compatible = "fsl,mpc5200b-mscan","fsl,mpc5200-mscan"; - cell-index = <1>; - interrupts = <0x2 0x12 0x0>; - interrupt-parent = <&mpc5200_pic>; - reg = <0x980 0x80>; - }; - - gpio_simple: gpio@b00 { - compatible = "fsl,mpc5200b-gpio","fsl,mpc5200-gpio"; - reg = <0xb00 0x40>; - interrupts = <0x1 0x7 0x0>; - interrupt-parent = <&mpc5200_pic>; - gpio-controller; - #gpio-cells = <2>; - }; - - gpio_wkup: gpio-wkup@c00 { - compatible = "fsl,mpc5200b-gpio-wkup","fsl,mpc5200-gpio-wkup"; - reg = <0xc00 0x40>; - interrupts = <0x1 0x8 0x0 0x0 0x3 0x0>; - interrupt-parent = <&mpc5200_pic>; - gpio-controller; - #gpio-cells = <2>; - }; - - spi@f00 { - compatible = "fsl,mpc5200b-spi","fsl,mpc5200-spi"; - reg = <0xf00 0x20>; - interrupts = <0x2 0xd 0x0 0x2 0xe 0x0>; - interrupt-parent = <&mpc5200_pic>; - }; - - usb@1000 { - compatible = "fsl,mpc5200b-ohci","fsl,mpc5200-ohci","ohci-be"; - reg = <0x1000 0xff>; - interrupts = <0x2 0x6 0x0>; - interrupt-parent = <&mpc5200_pic>; - }; - - dma-controller@1200 { - device_type = "dma-controller"; - compatible = "fsl,mpc5200b-bestcomm","fsl,mpc5200-bestcomm"; - reg = <0x1200 0x80>; - interrupts = <0x3 0x0 0x0 0x3 0x1 0x0 0x3 0x2 0x0 0x3 0x3 0x0 - 0x3 0x4 0x0 0x3 0x5 0x0 0x3 0x6 0x0 0x3 0x7 0x0 - 0x3 0x8 0x0 0x3 0x9 0x0 0x3 0xa 0x0 0x3 0xb 0x0 - 0x3 0xc 0x0 0x3 0xd 0x0 0x3 0xe 0x0 0x3 0xf 0x0>; - interrupt-parent = <&mpc5200_pic>; - }; - - xlb@1f00 { - compatible = "fsl,mpc5200b-xlb","fsl,mpc5200-xlb"; - reg = <0x1f00 0x100>; - }; - - ac97@2000 { /* PSC1 in ac97 mode */ - device_type = "sound"; - compatible = "mpc5200b-psc-ac97","fsl,mpc5200b-psc-ac97"; - cell-index = <0>; - reg = <0x2000 0x100>; - interrupts = <0x2 0x2 0x0>; - interrupt-parent = <&mpc5200_pic>; - }; - - /* PSC2 port is used by CAN1/2 */ - - serial@2400 { /* PSC3 in UART mode */ - device_type = "serial"; - compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart"; - port-number = <0>; - cell-index = <2>; - reg = <0x2400 0x100>; - interrupts = <0x2 0x3 0x0>; - interrupt-parent = <&mpc5200_pic>; - }; - - /* PSC4 is ??? */ - - /* PSC5 is ??? */ - - serial@2c00 { /* PSC6 in UART mode */ - device_type = "serial"; - compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart"; - port-number = <1>; - cell-index = <5>; - reg = <0x2c00 0x100>; - interrupts = <0x2 0x4 0x0>; - interrupt-parent = <&mpc5200_pic>; - }; - - ethernet@3000 { - device_type = "network"; - compatible = "fsl,mpc5200b-fec","fsl,mpc5200-fec"; - reg = <0x3000 0x400>; - local-mac-address = [00 00 00 00 00 00]; - interrupts = <0x2 0x5 0x0>; - interrupt-parent = <&mpc5200_pic>; - phy-handle = <&phy0>; - }; - - mdio@3000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,mpc5200b-mdio", "fsl,mpc5200-mdio"; - reg = <0x3000 0x400>; /* fec range, since we need to setup fec interrupts */ - interrupts = <0x2 0x5 0x0>; /* these are for "mii command finished", not link changes & co. */ - interrupt-parent = <&mpc5200_pic>; - - phy0:ethernet-phy@0 { - device_type = "ethernet-phy"; - reg = <0x0>; - }; - }; - - ata@3a00 { - device_type = "ata"; - compatible = "fsl,mpc5200b-ata","fsl,mpc5200-ata"; - reg = <0x3a00 0x100>; - interrupts = <0x2 0x7 0x0>; - interrupt-parent = <&mpc5200_pic>; - }; - - i2c@3d00 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,mpc5200b-i2c","fsl,mpc5200-i2c","fsl-i2c"; - cell-index = <0>; - reg = <0x3d00 0x40>; - interrupts = <0x2 0xf 0x0>; - interrupt-parent = <&mpc5200_pic>; - fsl5200-clocking; - }; - - i2c@3d40 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "fsl,mpc5200b-i2c","fsl,mpc5200-i2c","fsl-i2c"; - cell-index = <1>; - reg = <0x3d40 0x40>; - interrupts = <0x2 0x10 0x0>; - interrupt-parent = <&mpc5200_pic>; - fsl5200-clocking; - rtc@51 { - device_type = "rtc"; - compatible = "nxp,pcf8563"; - reg = <0x51>; - }; - /* FIXME: EEPROM */ - }; - - sram@8000 { - compatible = "fsl,mpc5200b-sram","fsl,mpc5200-sram","sram"; - reg = <0x8000 0x4000>; - }; - - /* This is only an example device to show the usage of gpios. It maps all available - * gpios to the "gpio-provider" device. - */ - gpio { - compatible = "gpio-provider"; - - /* mpc52xx exp.con patchfield */ - gpios = <&gpio_wkup 0 0 /* GPIO_WKUP_7 11d jp13-3 */ - &gpio_wkup 1 0 /* GPIO_WKUP_6 14c */ - &gpio_wkup 6 0 /* PSC2_4 43c x5-11 */ - &gpio_simple 2 0 /* IRDA_1 24c x7-6 set GPS_PORT_CONFIG[IRDA] = 0 */ - &gpio_simple 3 0 /* IRDA_0 x8-5 set GPS_PORT_CONFIG[IRDA] = 0 */ - &gpt2 0 0 /* timer2 12d x4-4 */ - &gpt3 0 0 /* timer3 13d x6-4 */ - &gpt4 0 0 /* timer4 61c x2-16 */ - &gpt5 0 0 /* timer5 44c x7-11 */ - &gpt6 0 0 /* timer6 60c x8-15 */ - &gpt7 0 0 /* timer7 36a x17-9 */ - >; - }; - }; - - pci@f0000d00 { - #interrupt-cells = <1>; - #size-cells = <2>; - #address-cells = <3>; - device_type = "pci"; - compatible = "fsl,mpc5200b-pci","fsl,mpc5200-pci"; - reg = <0xf0000d00 0x100>; - interrupt-map-mask = <0xf800 0x0 0x0 0x7>; - interrupt-map = <0xc000 0x0 0x0 0x1 &mpc5200_pic 0x0 0x0 0x3 /* 1st slot */ - 0xc000 0x0 0x0 0x2 &mpc5200_pic 0x1 0x1 0x3 - 0xc000 0x0 0x0 0x3 &mpc5200_pic 0x1 0x2 0x3 - 0xc000 0x0 0x0 0x4 &mpc5200_pic 0x1 0x3 0x3 - - 0xc800 0x0 0x0 0x1 &mpc5200_pic 0x1 0x1 0x3 /* 2nd slot */ - 0xc800 0x0 0x0 0x2 &mpc5200_pic 0x1 0x2 0x3 - 0xc800 0x0 0x0 0x3 &mpc5200_pic 0x1 0x3 0x3 - 0xc800 0x0 0x0 0x4 &mpc5200_pic 0x0 0x0 0x3>; - clock-frequency = <0>; // From boot loader - interrupts = <0x2 0x8 0x0 0x2 0x9 0x0 0x2 0xa 0x0>; - interrupt-parent = <&mpc5200_pic>; - bus-range = <0 0>; - ranges = <0x42000000 0x0 0x80000000 0x80000000 0x0 0x20000000 - 0x02000000 0x0 0xa0000000 0xa0000000 0x0 0x10000000 - 0x01000000 0x0 0x00000000 0xb0000000 0x0 0x01000000>; - }; -}; diff --git a/trunk/arch/powerpc/boot/dts/tqm5200.dts b/trunk/arch/powerpc/boot/dts/tqm5200.dts index 773a68e00058..65bcea6a0173 100644 --- a/trunk/arch/powerpc/boot/dts/tqm5200.dts +++ b/trunk/arch/powerpc/boot/dts/tqm5200.dts @@ -10,8 +10,6 @@ * option) any later version. */ -/dts-v1/; - / { model = "tqc,tqm5200"; compatible = "tqc,tqm5200"; @@ -25,10 +23,10 @@ PowerPC,5200@0 { device_type = "cpu"; reg = <0>; - d-cache-line-size = <32>; - i-cache-line-size = <32>; - d-cache-size = <0x4000>; // L1, 16K - i-cache-size = <0x4000>; // L1, 16K + d-cache-line-size = <20>; + i-cache-line-size = <20>; + d-cache-size = <4000>; // L1, 16K + i-cache-size = <4000>; // L1, 16K timebase-frequency = <0>; // from bootloader bus-frequency = <0>; // from bootloader clock-frequency = <0>; // from bootloader @@ -37,21 +35,21 @@ memory { device_type = "memory"; - reg = <0x00000000 0x04000000>; // 64MB + reg = <00000000 04000000>; // 64MB }; soc5200@f0000000 { #address-cells = <1>; #size-cells = <1>; compatible = "fsl,mpc5200-immr"; - ranges = <0 0xf0000000 0x0000c000>; - reg = <0xf0000000 0x00000100>; + ranges = <0 f0000000 0000c000>; + reg = ; bus-frequency = <0>; // from bootloader system-frequency = <0>; // from bootloader cdm@200 { compatible = "fsl,mpc5200-cdm"; - reg = <0x200 0x38>; + reg = <200 38>; }; mpc5200_pic: interrupt-controller@500 { @@ -59,12 +57,12 @@ interrupt-controller; #interrupt-cells = <3>; compatible = "fsl,mpc5200-pic"; - reg = <0x500 0x80>; + reg = <500 80>; }; timer@600 { // General Purpose Timer compatible = "fsl,mpc5200-gpt"; - reg = <0x600 0x10>; + reg = <600 10>; interrupts = <1 9 0>; interrupt-parent = <&mpc5200_pic>; fsl,has-wdt; @@ -72,38 +70,38 @@ gpio@b00 { compatible = "fsl,mpc5200-gpio"; - reg = <0xb00 0x40>; + reg = ; interrupts = <1 7 0>; interrupt-parent = <&mpc5200_pic>; }; usb@1000 { compatible = "fsl,mpc5200-ohci","ohci-be"; - reg = <0x1000 0xff>; + reg = <1000 ff>; interrupts = <2 6 0>; interrupt-parent = <&mpc5200_pic>; }; dma-controller@1200 { compatible = "fsl,mpc5200-bestcomm"; - reg = <0x1200 0x80>; + reg = <1200 80>; interrupts = <3 0 0 3 1 0 3 2 0 3 3 0 3 4 0 3 5 0 3 6 0 3 7 0 - 3 8 0 3 9 0 3 10 0 3 11 0 - 3 12 0 3 13 0 3 14 0 3 15 0>; + 3 8 0 3 9 0 3 a 0 3 b 0 + 3 c 0 3 d 0 3 e 0 3 f 0>; interrupt-parent = <&mpc5200_pic>; }; xlb@1f00 { compatible = "fsl,mpc5200-xlb"; - reg = <0x1f00 0x100>; + reg = <1f00 100>; }; serial@2000 { // PSC1 device_type = "serial"; compatible = "fsl,mpc5200-psc-uart"; port-number = <0>; // Logical port assignment - reg = <0x2000 0x100>; + reg = <2000 100>; interrupts = <2 1 0>; interrupt-parent = <&mpc5200_pic>; }; @@ -112,7 +110,7 @@ device_type = "serial"; compatible = "fsl,mpc5200-psc-uart"; port-number = <1>; // Logical port assignment - reg = <0x2200 0x100>; + reg = <2200 100>; interrupts = <2 2 0>; interrupt-parent = <&mpc5200_pic>; }; @@ -121,7 +119,7 @@ device_type = "serial"; compatible = "fsl,mpc5200-psc-uart"; port-number = <2>; // Logical port assignment - reg = <0x2400 0x100>; + reg = <2400 100>; interrupts = <2 3 0>; interrupt-parent = <&mpc5200_pic>; }; @@ -129,7 +127,7 @@ ethernet@3000 { device_type = "network"; compatible = "fsl,mpc5200-fec"; - reg = <0x3000 0x400>; + reg = <3000 400>; local-mac-address = [ 00 00 00 00 00 00 ]; interrupts = <2 5 0>; interrupt-parent = <&mpc5200_pic>; @@ -139,8 +137,8 @@ mdio@3000 { #address-cells = <1>; #size-cells = <0>; - compatible = "fsl,mpc5200-mdio"; - reg = <0x3000 0x400>; // fec range, since we need to setup fec interrupts + compatible = "fsl,mpc5200b-mdio","fsl,mpc5200-mdio"; + reg = <3000 400>; // fec range, since we need to setup fec interrupts interrupts = <2 5 0>; // these are for "mii command finished", not link changes & co. interrupt-parent = <&mpc5200_pic>; @@ -152,7 +150,7 @@ ata@3a00 { compatible = "fsl,mpc5200-ata"; - reg = <0x3a00 0x100>; + reg = <3a00 100>; interrupts = <2 7 0>; interrupt-parent = <&mpc5200_pic>; }; @@ -161,21 +159,21 @@ #address-cells = <1>; #size-cells = <0>; compatible = "fsl,mpc5200-i2c","fsl-i2c"; - reg = <0x3d40 0x40>; - interrupts = <2 16 0>; + reg = <3d40 40>; + interrupts = <2 10 0>; interrupt-parent = <&mpc5200_pic>; fsl5200-clocking; rtc@68 { device_type = "rtc"; compatible = "dallas,ds1307"; - reg = <0x68>; + reg = <68>; }; }; sram@8000 { compatible = "fsl,mpc5200-sram"; - reg = <0x8000 0x4000>; + reg = <8000 4000>; }; }; @@ -184,11 +182,11 @@ compatible = "fsl,lpb"; #address-cells = <2>; #size-cells = <1>; - ranges = <0 0 0xfc000000 0x02000000>; + ranges = <0 0 fc000000 02000000>; flash@0,0 { compatible = "cfi-flash"; - reg = <0 0 0x02000000>; + reg = <0 0 02000000>; bank-width = <4>; device-width = <2>; #size-cells = <1>; @@ -202,18 +200,18 @@ #address-cells = <3>; device_type = "pci"; compatible = "fsl,mpc5200-pci"; - reg = <0xf0000d00 0x100>; - interrupt-map-mask = <0xf800 0 0 7>; - interrupt-map = <0xc000 0 0 1 &mpc5200_pic 0 0 3 - 0xc000 0 0 2 &mpc5200_pic 0 0 3 - 0xc000 0 0 3 &mpc5200_pic 0 0 3 - 0xc000 0 0 4 &mpc5200_pic 0 0 3>; + reg = ; + interrupt-map-mask = ; + interrupt-map = ; clock-frequency = <0>; // From boot loader - interrupts = <2 8 0 2 9 0 2 10 0>; + interrupts = <2 8 0 2 9 0 2 a 0>; interrupt-parent = <&mpc5200_pic>; bus-range = <0 0>; - ranges = <0x42000000 0 0x80000000 0x80000000 0 0x10000000 - 0x02000000 0 0x90000000 0x90000000 0 0x10000000 - 0x01000000 0 0x00000000 0xa0000000 0 0x01000000>; + ranges = <42000000 0 80000000 80000000 0 10000000 + 02000000 0 90000000 90000000 0 10000000 + 01000000 0 00000000 a0000000 0 01000000>; }; }; diff --git a/trunk/arch/powerpc/configs/52xx/cm5200_defconfig b/trunk/arch/powerpc/configs/52xx/cm5200_defconfig deleted file mode 100644 index c10f7395aa1b..000000000000 --- a/trunk/arch/powerpc/configs/52xx/cm5200_defconfig +++ /dev/null @@ -1,1099 +0,0 @@ -# -# Automatically generated make config: don't edit -# Linux kernel version: 2.6.25 -# Tue Apr 29 07:11:37 2008 -# -# CONFIG_PPC64 is not set - -# -# Processor support -# -CONFIG_6xx=y -# CONFIG_PPC_85xx is not set -# CONFIG_PPC_8xx is not set -# CONFIG_40x is not set -# CONFIG_44x is not set -# CONFIG_E200 is not set -CONFIG_PPC_FPU=y -# CONFIG_ALTIVEC is not set -CONFIG_PPC_STD_MMU=y -CONFIG_PPC_STD_MMU_32=y -# CONFIG_PPC_MM_SLICES is not set -# CONFIG_SMP is not set -CONFIG_PPC32=y -CONFIG_WORD_SIZE=32 -CONFIG_PPC_MERGE=y -CONFIG_MMU=y -CONFIG_GENERIC_CMOS_UPDATE=y -CONFIG_GENERIC_TIME=y -CONFIG_GENERIC_TIME_VSYSCALL=y -CONFIG_GENERIC_CLOCKEVENTS=y -CONFIG_GENERIC_HARDIRQS=y -# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set -CONFIG_IRQ_PER_CPU=y -CONFIG_STACKTRACE_SUPPORT=y -CONFIG_LOCKDEP_SUPPORT=y -CONFIG_RWSEM_XCHGADD_ALGORITHM=y -CONFIG_ARCH_HAS_ILOG2_U32=y -CONFIG_GENERIC_HWEIGHT=y -CONFIG_GENERIC_CALIBRATE_DELAY=y -CONFIG_GENERIC_FIND_NEXT_BIT=y -# CONFIG_ARCH_NO_VIRT_TO_BUS is not set -CONFIG_PPC=y -CONFIG_EARLY_PRINTK=y -CONFIG_GENERIC_NVRAM=y -CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y -CONFIG_ARCH_MAY_HAVE_PC_FDC=y -CONFIG_PPC_OF=y -CONFIG_OF=y -# CONFIG_PPC_UDBG_16550 is not set -# CONFIG_GENERIC_TBSYNC is not set -CONFIG_AUDIT_ARCH=y -CONFIG_GENERIC_BUG=y -CONFIG_DEFAULT_UIMAGE=y -# CONFIG_PPC_DCR_NATIVE is not set -# CONFIG_PPC_DCR_MMIO is not set -CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" - -# -# General setup -# -CONFIG_EXPERIMENTAL=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -CONFIG_SYSVIPC_SYSCTL=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -# CONFIG_TASKSTATS is not set -# CONFIG_AUDIT is not set -# CONFIG_IKCONFIG is not set -CONFIG_LOG_BUF_SHIFT=14 -# CONFIG_CGROUPS is not set -CONFIG_GROUP_SCHED=y -CONFIG_FAIR_GROUP_SCHED=y -# CONFIG_RT_GROUP_SCHED is not set -CONFIG_USER_SCHED=y -# CONFIG_CGROUP_SCHED is not set -CONFIG_SYSFS_DEPRECATED=y -CONFIG_SYSFS_DEPRECATED_V2=y -# CONFIG_RELAY is not set -# CONFIG_NAMESPACES is not set -CONFIG_BLK_DEV_INITRD=y -CONFIG_INITRAMFS_SOURCE="" -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SYSCTL=y -CONFIG_EMBEDDED=y -# CONFIG_SYSCTL_SYSCALL is not set -# CONFIG_KALLSYMS is not set -CONFIG_HOTPLUG=y -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_ELF_CORE=y -CONFIG_COMPAT_BRK=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_ANON_INODES=y -# CONFIG_EPOLL is not set -CONFIG_SIGNALFD=y -CONFIG_TIMERFD=y -CONFIG_EVENTFD=y -CONFIG_SHMEM=y -CONFIG_VM_EVENT_COUNTERS=y -CONFIG_SLUB_DEBUG=y -# CONFIG_SLAB is not set -CONFIG_SLUB=y -# CONFIG_SLOB is not set -# CONFIG_PROFILING is not set -# CONFIG_MARKERS is not set -CONFIG_HAVE_OPROFILE=y -CONFIG_HAVE_KPROBES=y -CONFIG_HAVE_KRETPROBES=y -CONFIG_PROC_PAGE_MONITOR=y -CONFIG_SLABINFO=y -CONFIG_RT_MUTEXES=y -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 -# CONFIG_MODULES is not set -CONFIG_BLOCK=y -# CONFIG_LBD is not set -# CONFIG_BLK_DEV_IO_TRACE is not set -# CONFIG_LSF is not set -# CONFIG_BLK_DEV_BSG is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" -CONFIG_CLASSIC_RCU=y - -# -# Platform support -# -CONFIG_PPC_MULTIPLATFORM=y -# CONFIG_PPC_82xx is not set -# CONFIG_PPC_83xx is not set -# CONFIG_PPC_86xx is not set -CONFIG_CLASSIC32=y -# CONFIG_PPC_CHRP is not set -# CONFIG_PPC_MPC512x is not set -# CONFIG_PPC_MPC5121 is not set -# CONFIG_MPC5121_ADS is not set -CONFIG_PPC_MPC52xx=y -CONFIG_PPC_MPC5200_SIMPLE=y -# CONFIG_PPC_EFIKA is not set -# CONFIG_PPC_LITE5200 is not set -# CONFIG_PPC_MPC5200_BUGFIX is not set -# CONFIG_PPC_MPC5200_GPIO is not set -# CONFIG_PPC_PMAC is not set -# CONFIG_PPC_CELL is not set -# CONFIG_PPC_CELL_NATIVE is not set -# CONFIG_PQ2ADS is not set -# CONFIG_EMBEDDED6xx is not set -# CONFIG_IPIC is not set -# CONFIG_MPIC is not set -# CONFIG_MPIC_WEIRD is not set -# CONFIG_PPC_I8259 is not set -# CONFIG_PPC_RTAS is not set -# CONFIG_MMIO_NVRAM is not set -# CONFIG_PPC_MPC106 is not set -# CONFIG_PPC_970_NAP is not set -# CONFIG_PPC_INDIRECT_IO is not set -# CONFIG_GENERIC_IOMAP is not set -# CONFIG_CPU_FREQ is not set -# CONFIG_TAU is not set -# CONFIG_FSL_ULI1575 is not set -CONFIG_PPC_BESTCOMM=y -# CONFIG_PPC_BESTCOMM_ATA is not set -CONFIG_PPC_BESTCOMM_FEC=y -# CONFIG_PPC_BESTCOMM_GEN_BD is not set - -# -# Kernel options -# -# CONFIG_HIGHMEM is not set -# CONFIG_TICK_ONESHOT is not set -# CONFIG_NO_HZ is not set -# CONFIG_HIGH_RES_TIMERS is not set -CONFIG_GENERIC_CLOCKEVENTS_BUILD=y -# CONFIG_HZ_100 is not set -CONFIG_HZ_250=y -# CONFIG_HZ_300 is not set -# CONFIG_HZ_1000 is not set -CONFIG_HZ=250 -# CONFIG_SCHED_HRTICK is not set -CONFIG_PREEMPT_NONE=y -# CONFIG_PREEMPT_VOLUNTARY is not set -# CONFIG_PREEMPT is not set -CONFIG_BINFMT_ELF=y -# CONFIG_BINFMT_MISC is not set -# CONFIG_IOMMU_HELPER is not set -CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y -CONFIG_ARCH_HAS_WALK_MEMORY=y -CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y -# CONFIG_KEXEC is not set -CONFIG_ARCH_FLATMEM_ENABLE=y -CONFIG_ARCH_POPULATES_NODE_MAP=y -CONFIG_SELECT_MEMORY_MODEL=y -CONFIG_FLATMEM_MANUAL=y -# CONFIG_DISCONTIGMEM_MANUAL is not set -# CONFIG_SPARSEMEM_MANUAL is not set -CONFIG_FLATMEM=y -CONFIG_FLAT_NODE_MEM_MAP=y -# CONFIG_SPARSEMEM_STATIC is not set -# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set -CONFIG_PAGEFLAGS_EXTENDED=y -CONFIG_SPLIT_PTLOCK_CPUS=4 -# CONFIG_RESOURCES_64BIT is not set -CONFIG_ZONE_DMA_FLAG=1 -CONFIG_BOUNCE=y -CONFIG_VIRT_TO_BUS=y -CONFIG_FORCE_MAX_ZONEORDER=11 -CONFIG_PROC_DEVICETREE=y -# CONFIG_CMDLINE_BOOL is not set -CONFIG_PM=y -# CONFIG_PM_LEGACY is not set -# CONFIG_PM_DEBUG is not set -CONFIG_SECCOMP=y -CONFIG_ISA_DMA_API=y - -# -# Bus options -# -CONFIG_ZONE_DMA=y -CONFIG_GENERIC_ISA_DMA=y -CONFIG_FSL_SOC=y -# CONFIG_PCI is not set -# CONFIG_PCI_DOMAINS is not set -# CONFIG_PCI_SYSCALL is not set -# CONFIG_ARCH_SUPPORTS_MSI is not set -# CONFIG_PCCARD is not set -# CONFIG_HAS_RAPIDIO is not set - -# -# Advanced setup -# -# CONFIG_ADVANCED_OPTIONS is not set - -# -# Default settings for advanced configuration options are used -# -CONFIG_LOWMEM_SIZE=0x30000000 -CONFIG_PAGE_OFFSET=0xc0000000 -CONFIG_KERNEL_START=0xc0000000 -CONFIG_PHYSICAL_START=0x00000000 -CONFIG_TASK_SIZE=0xc0000000 - -# -# Networking -# -CONFIG_NET=y - -# -# Networking options -# -CONFIG_PACKET=y -# CONFIG_PACKET_MMAP is not set -CONFIG_UNIX=y -CONFIG_XFRM=y -CONFIG_XFRM_USER=y -# CONFIG_XFRM_SUB_POLICY is not set -# CONFIG_XFRM_MIGRATE is not set -# CONFIG_XFRM_STATISTICS is not set -# CONFIG_NET_KEY is not set -CONFIG_INET=y -CONFIG_IP_MULTICAST=y -# CONFIG_IP_ADVANCED_ROUTER is not set -CONFIG_IP_FIB_HASH=y -CONFIG_IP_PNP=y -CONFIG_IP_PNP_DHCP=y -CONFIG_IP_PNP_BOOTP=y -# CONFIG_IP_PNP_RARP is not set -# CONFIG_NET_IPIP is not set -# CONFIG_NET_IPGRE is not set -# CONFIG_IP_MROUTE is not set -# CONFIG_ARPD is not set -CONFIG_SYN_COOKIES=y -# CONFIG_INET_AH is not set -# CONFIG_INET_ESP is not set -# CONFIG_INET_IPCOMP is not set -# CONFIG_INET_XFRM_TUNNEL is not set -# CONFIG_INET_TUNNEL is not set -CONFIG_INET_XFRM_MODE_TRANSPORT=y -CONFIG_INET_XFRM_MODE_TUNNEL=y -CONFIG_INET_XFRM_MODE_BEET=y -# CONFIG_INET_LRO is not set -CONFIG_INET_DIAG=y -CONFIG_INET_TCP_DIAG=y -# CONFIG_TCP_CONG_ADVANCED is not set -CONFIG_TCP_CONG_CUBIC=y -CONFIG_DEFAULT_TCP_CONG="cubic" -# CONFIG_TCP_MD5SIG is not set -# CONFIG_IPV6 is not set -# CONFIG_NETWORK_SECMARK is not set -# CONFIG_NETFILTER is not set -# CONFIG_IP_DCCP is not set -# CONFIG_IP_SCTP is not set -# CONFIG_TIPC is not set -# CONFIG_ATM is not set -# CONFIG_BRIDGE is not set -# CONFIG_VLAN_8021Q is not set -# CONFIG_DECNET is not set -# CONFIG_LLC2 is not set -# CONFIG_IPX is not set -# CONFIG_ATALK is not set -# CONFIG_X25 is not set -# CONFIG_LAPB is not set -# CONFIG_ECONET is not set -# CONFIG_WAN_ROUTER is not set -# CONFIG_NET_SCHED is not set - -# -# Network testing -# -# CONFIG_NET_PKTGEN is not set -# CONFIG_HAMRADIO is not set -# CONFIG_CAN is not set -# CONFIG_IRDA is not set -# CONFIG_BT is not set -# CONFIG_AF_RXRPC is not set - -# -# Wireless -# -# CONFIG_CFG80211 is not set -# CONFIG_WIRELESS_EXT is not set -# CONFIG_MAC80211 is not set -# CONFIG_IEEE80211 is not set -# CONFIG_RFKILL is not set -# CONFIG_NET_9P is not set - -# -# Device Drivers -# - -# -# Generic Driver Options -# -CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" -CONFIG_STANDALONE=y -CONFIG_PREVENT_FIRMWARE_BUILD=y -# CONFIG_FW_LOADER is not set -# CONFIG_DEBUG_DRIVER is not set -# CONFIG_DEBUG_DEVRES is not set -# CONFIG_SYS_HYPERVISOR is not set -# CONFIG_CONNECTOR is not set -CONFIG_MTD=y -# CONFIG_MTD_DEBUG is not set -# CONFIG_MTD_CONCAT is not set -CONFIG_MTD_PARTITIONS=y -# CONFIG_MTD_REDBOOT_PARTS is not set -CONFIG_MTD_CMDLINE_PARTS=y -# CONFIG_MTD_OF_PARTS is not set -# CONFIG_MTD_AR7_PARTS is not set - -# -# User Modules And Translation Layers -# -CONFIG_MTD_CHAR=y -CONFIG_MTD_BLKDEVS=y -CONFIG_MTD_BLOCK=y -# CONFIG_FTL is not set -# CONFIG_NFTL is not set -# CONFIG_INFTL is not set -# CONFIG_RFD_FTL is not set -# CONFIG_SSFDC is not set -# CONFIG_MTD_OOPS is not set - -# -# RAM/ROM/Flash chip drivers -# -CONFIG_MTD_CFI=y -# CONFIG_MTD_JEDECPROBE is not set -CONFIG_MTD_GEN_PROBE=y -# CONFIG_MTD_CFI_ADV_OPTIONS is not set -CONFIG_MTD_MAP_BANK_WIDTH_1=y -CONFIG_MTD_MAP_BANK_WIDTH_2=y -CONFIG_MTD_MAP_BANK_WIDTH_4=y -# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set -# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set -# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set -CONFIG_MTD_CFI_I1=y -CONFIG_MTD_CFI_I2=y -# CONFIG_MTD_CFI_I4 is not set -# CONFIG_MTD_CFI_I8 is not set -# CONFIG_MTD_CFI_INTELEXT is not set -CONFIG_MTD_CFI_AMDSTD=y -# CONFIG_MTD_CFI_STAA is not set -CONFIG_MTD_CFI_UTIL=y -# CONFIG_MTD_RAM is not set -# CONFIG_MTD_ROM is not set -# CONFIG_MTD_ABSENT is not set - -# -# Mapping drivers for chip access -# -# CONFIG_MTD_COMPLEX_MAPPINGS is not set -# CONFIG_MTD_PHYSMAP is not set -CONFIG_MTD_PHYSMAP_OF=y -# CONFIG_MTD_PLATRAM is not set - -# -# Self-contained MTD device drivers -# -# CONFIG_MTD_SLRAM is not set -# CONFIG_MTD_PHRAM is not set -# CONFIG_MTD_MTDRAM is not set -# CONFIG_MTD_BLOCK2MTD is not set - -# -# Disk-On-Chip Device Drivers -# -# CONFIG_MTD_DOC2000 is not set -# CONFIG_MTD_DOC2001 is not set -# CONFIG_MTD_DOC2001PLUS is not set -# CONFIG_MTD_NAND is not set -# CONFIG_MTD_ONENAND is not set - -# -# UBI - Unsorted block images -# -# CONFIG_MTD_UBI is not set -CONFIG_OF_DEVICE=y -CONFIG_OF_I2C=y -# CONFIG_PARPORT is not set -CONFIG_BLK_DEV=y -# CONFIG_BLK_DEV_FD is not set -# CONFIG_BLK_DEV_COW_COMMON is not set -CONFIG_BLK_DEV_LOOP=y -# CONFIG_BLK_DEV_CRYPTOLOOP is not set -# CONFIG_BLK_DEV_NBD is not set -# CONFIG_BLK_DEV_UB is not set -CONFIG_BLK_DEV_RAM=y -CONFIG_BLK_DEV_RAM_COUNT=16 -CONFIG_BLK_DEV_RAM_SIZE=32768 -# CONFIG_BLK_DEV_XIP is not set -# CONFIG_CDROM_PKTCDVD is not set -# CONFIG_ATA_OVER_ETH is not set -# CONFIG_MISC_DEVICES is not set -CONFIG_HAVE_IDE=y -# CONFIG_IDE is not set - -# -# SCSI device support -# -# CONFIG_RAID_ATTRS is not set -CONFIG_SCSI=y -CONFIG_SCSI_DMA=y -# CONFIG_SCSI_TGT is not set -# CONFIG_SCSI_NETLINK is not set -CONFIG_SCSI_PROC_FS=y - -# -# SCSI support type (disk, tape, CD-ROM) -# -CONFIG_BLK_DEV_SD=y -# CONFIG_CHR_DEV_ST is not set -# CONFIG_CHR_DEV_OSST is not set -# CONFIG_BLK_DEV_SR is not set -CONFIG_CHR_DEV_SG=y -# CONFIG_CHR_DEV_SCH is not set - -# -# Some SCSI devices (e.g. CD jukebox) support multiple LUNs -# -# CONFIG_SCSI_MULTI_LUN is not set -# CONFIG_SCSI_CONSTANTS is not set -# CONFIG_SCSI_LOGGING is not set -# CONFIG_SCSI_SCAN_ASYNC is not set - -# -# SCSI Transports -# -# CONFIG_SCSI_SPI_ATTRS is not set -# CONFIG_SCSI_FC_ATTRS is not set -# CONFIG_SCSI_ISCSI_ATTRS is not set -# CONFIG_SCSI_SAS_LIBSAS is not set -# CONFIG_SCSI_SRP_ATTRS is not set -# CONFIG_SCSI_LOWLEVEL is not set -# CONFIG_ATA is not set -# CONFIG_MD is not set -# CONFIG_MACINTOSH_DRIVERS is not set -CONFIG_NETDEVICES=y -# CONFIG_NETDEVICES_MULTIQUEUE is not set -# CONFIG_DUMMY is not set -# CONFIG_BONDING is not set -# CONFIG_MACVLAN is not set -# CONFIG_EQUALIZER is not set -# CONFIG_TUN is not set -# CONFIG_VETH is not set -CONFIG_PHYLIB=y - -# -# MII PHY device drivers -# -# CONFIG_MARVELL_PHY is not set -# CONFIG_DAVICOM_PHY is not set -# CONFIG_QSEMI_PHY is not set -CONFIG_LXT_PHY=y -# CONFIG_CICADA_PHY is not set -# CONFIG_VITESSE_PHY is not set -# CONFIG_SMSC_PHY is not set -# CONFIG_BROADCOM_PHY is not set -# CONFIG_ICPLUS_PHY is not set -# CONFIG_REALTEK_PHY is not set -# CONFIG_FIXED_PHY is not set -# CONFIG_MDIO_BITBANG is not set -CONFIG_NET_ETHERNET=y -# CONFIG_MII is not set -# CONFIG_IBM_NEW_EMAC_ZMII is not set -# CONFIG_IBM_NEW_EMAC_RGMII is not set -# CONFIG_IBM_NEW_EMAC_TAH is not set -# CONFIG_IBM_NEW_EMAC_EMAC4 is not set -# CONFIG_B44 is not set -CONFIG_FEC_MPC52xx=y -CONFIG_FEC_MPC52xx_MDIO=y -# CONFIG_NETDEV_1000 is not set -# CONFIG_NETDEV_10000 is not set - -# -# Wireless LAN -# -# CONFIG_WLAN_PRE80211 is not set -# CONFIG_WLAN_80211 is not set -# CONFIG_IWLWIFI is not set -# CONFIG_IWLWIFI_LEDS is not set - -# -# USB Network Adapters -# -# CONFIG_USB_CATC is not set -# CONFIG_USB_KAWETH is not set -# CONFIG_USB_PEGASUS is not set -# CONFIG_USB_RTL8150 is not set -# CONFIG_USB_USBNET is not set -# CONFIG_WAN is not set -# CONFIG_PPP is not set -# CONFIG_SLIP is not set -# CONFIG_NETCONSOLE is not set -# CONFIG_NETPOLL is not set -# CONFIG_NET_POLL_CONTROLLER is not set -# CONFIG_ISDN is not set -# CONFIG_PHONE is not set - -# -# Input device support -# -# CONFIG_INPUT is not set - -# -# Hardware I/O ports -# -# CONFIG_SERIO is not set -# CONFIG_GAMEPORT is not set - -# -# Character devices -# -# CONFIG_VT is not set -# CONFIG_SERIAL_NONSTANDARD is not set - -# -# Serial drivers -# -# CONFIG_SERIAL_8250 is not set - -# -# Non-8250 serial port support -# -# CONFIG_SERIAL_UARTLITE is not set -CONFIG_SERIAL_CORE=y -CONFIG_SERIAL_CORE_CONSOLE=y -CONFIG_SERIAL_MPC52xx=y -CONFIG_SERIAL_MPC52xx_CONSOLE=y -CONFIG_SERIAL_MPC52xx_CONSOLE_BAUD=57600 -CONFIG_UNIX98_PTYS=y -CONFIG_LEGACY_PTYS=y -CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_IPMI_HANDLER is not set -# CONFIG_HW_RANDOM is not set -# CONFIG_NVRAM is not set -# CONFIG_GEN_RTC is not set -# CONFIG_R3964 is not set -# CONFIG_RAW_DRIVER is not set -# CONFIG_TCG_TPM is not set -CONFIG_I2C=y -CONFIG_I2C_BOARDINFO=y -CONFIG_I2C_CHARDEV=y - -# -# I2C Hardware Bus support -# -CONFIG_I2C_MPC=y -# CONFIG_I2C_OCORES is not set -# CONFIG_I2C_PARPORT_LIGHT is not set -# CONFIG_I2C_SIMTEC is not set -# CONFIG_I2C_TAOS_EVM is not set -# CONFIG_I2C_TINY_USB is not set -# CONFIG_I2C_PCA_PLATFORM is not set - -# -# Miscellaneous I2C Chip support -# -# CONFIG_DS1682 is not set -# CONFIG_SENSORS_EEPROM is not set -# CONFIG_SENSORS_PCF8574 is not set -# CONFIG_PCF8575 is not set -# CONFIG_SENSORS_PCF8591 is not set -# CONFIG_SENSORS_MAX6875 is not set -# CONFIG_SENSORS_TSL2550 is not set -# CONFIG_I2C_DEBUG_CORE is not set -# CONFIG_I2C_DEBUG_ALGO is not set -# CONFIG_I2C_DEBUG_BUS is not set -# CONFIG_I2C_DEBUG_CHIP is not set -# CONFIG_SPI is not set -# CONFIG_W1 is not set -# CONFIG_POWER_SUPPLY is not set -# CONFIG_HWMON is not set -# CONFIG_THERMAL is not set -CONFIG_WATCHDOG=y -# CONFIG_WATCHDOG_NOWAYOUT is not set - -# -# Watchdog Device Drivers -# -# CONFIG_SOFT_WATCHDOG is not set -# CONFIG_MPC5200_WDT is not set - -# -# USB-based Watchdog Cards -# -# CONFIG_USBPCWATCHDOG is not set - -# -# Sonics Silicon Backplane -# -CONFIG_SSB_POSSIBLE=y -# CONFIG_SSB is not set - -# -# Multifunction device drivers -# -# CONFIG_MFD_SM501 is not set -# CONFIG_HTC_PASIC3 is not set - -# -# Multimedia devices -# -# CONFIG_VIDEO_DEV is not set -# CONFIG_DVB_CORE is not set -# CONFIG_DAB is not set - -# -# Graphics support -# -# CONFIG_VGASTATE is not set -# CONFIG_VIDEO_OUTPUT_CONTROL is not set -# CONFIG_FB is not set -# CONFIG_BACKLIGHT_LCD_SUPPORT is not set - -# -# Display device support -# -# CONFIG_DISPLAY_SUPPORT is not set - -# -# Sound -# -# CONFIG_SOUND is not set -CONFIG_USB_SUPPORT=y -CONFIG_USB_ARCH_HAS_HCD=y -CONFIG_USB_ARCH_HAS_OHCI=y -# CONFIG_USB_ARCH_HAS_EHCI is not set -CONFIG_USB=y -# CONFIG_USB_DEBUG is not set -# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set - -# -# Miscellaneous USB options -# -CONFIG_USB_DEVICEFS=y -# CONFIG_USB_DEVICE_CLASS is not set -# CONFIG_USB_DYNAMIC_MINORS is not set -# CONFIG_USB_SUSPEND is not set -# CONFIG_USB_OTG is not set -# CONFIG_USB_OTG_WHITELIST is not set -# CONFIG_USB_OTG_BLACKLIST_HUB is not set - -# -# USB Host Controller Drivers -# -# CONFIG_USB_ISP116X_HCD is not set -CONFIG_USB_OHCI_HCD=y -CONFIG_USB_OHCI_HCD_PPC_SOC=y -CONFIG_USB_OHCI_HCD_PPC_OF=y -CONFIG_USB_OHCI_HCD_PPC_OF_BE=y -# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set -CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y -CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y -# CONFIG_USB_OHCI_LITTLE_ENDIAN is not set -# CONFIG_USB_SL811_HCD is not set -# CONFIG_USB_R8A66597_HCD is not set - -# -# USB Device Class drivers -# -# CONFIG_USB_ACM is not set -# CONFIG_USB_PRINTER is not set - -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - -# -# may also be needed; see USB_STORAGE Help for more information -# -CONFIG_USB_STORAGE=y -# CONFIG_USB_STORAGE_DEBUG is not set -# CONFIG_USB_STORAGE_DATAFAB is not set -# CONFIG_USB_STORAGE_FREECOM is not set -# CONFIG_USB_STORAGE_ISD200 is not set -# CONFIG_USB_STORAGE_DPCM is not set -# CONFIG_USB_STORAGE_USBAT is not set -# CONFIG_USB_STORAGE_SDDR09 is not set -# CONFIG_USB_STORAGE_SDDR55 is not set -# CONFIG_USB_STORAGE_JUMPSHOT is not set -# CONFIG_USB_STORAGE_ALAUDA is not set -# CONFIG_USB_STORAGE_KARMA is not set -# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set -# CONFIG_USB_LIBUSUAL is not set - -# -# USB Imaging devices -# -# CONFIG_USB_MDC800 is not set -# CONFIG_USB_MICROTEK is not set -# CONFIG_USB_MON is not set - -# -# USB port drivers -# -# CONFIG_USB_SERIAL is not set - -# -# USB Miscellaneous drivers -# -# CONFIG_USB_EMI62 is not set -# CONFIG_USB_EMI26 is not set -# CONFIG_USB_ADUTUX is not set -# CONFIG_USB_AUERSWALD is not set -# CONFIG_USB_RIO500 is not set -# CONFIG_USB_LEGOTOWER is not set -# CONFIG_USB_LCD is not set -# CONFIG_USB_BERRY_CHARGE is not set -# CONFIG_USB_LED is not set -# CONFIG_USB_CYPRESS_CY7C63 is not set -# CONFIG_USB_CYTHERM is not set -# CONFIG_USB_PHIDGET is not set -# CONFIG_USB_IDMOUSE is not set -# CONFIG_USB_FTDI_ELAN is not set -# CONFIG_USB_APPLEDISPLAY is not set -# CONFIG_USB_LD is not set -# CONFIG_USB_TRANCEVIBRATOR is not set -# CONFIG_USB_IOWARRIOR is not set -# CONFIG_USB_TEST is not set -# CONFIG_USB_GADGET is not set -# CONFIG_MMC is not set -# CONFIG_MEMSTICK is not set -# CONFIG_NEW_LEDS is not set -# CONFIG_EDAC is not set -# CONFIG_RTC_CLASS is not set -# CONFIG_DMADEVICES is not set -# CONFIG_UIO is not set - -# -# File systems -# -CONFIG_EXT2_FS=y -# CONFIG_EXT2_FS_XATTR is not set -# CONFIG_EXT2_FS_XIP is not set -CONFIG_EXT3_FS=y -CONFIG_EXT3_FS_XATTR=y -# CONFIG_EXT3_FS_POSIX_ACL is not set -# CONFIG_EXT3_FS_SECURITY is not set -# CONFIG_EXT4DEV_FS is not set -CONFIG_JBD=y -CONFIG_FS_MBCACHE=y -# CONFIG_REISERFS_FS is not set -# CONFIG_JFS_FS is not set -# CONFIG_FS_POSIX_ACL is not set -# CONFIG_XFS_FS is not set -# CONFIG_OCFS2_FS is not set -CONFIG_DNOTIFY=y -CONFIG_INOTIFY=y -CONFIG_INOTIFY_USER=y -# CONFIG_QUOTA is not set -# CONFIG_AUTOFS_FS is not set -# CONFIG_AUTOFS4_FS is not set -# CONFIG_FUSE_FS is not set - -# -# CD-ROM/DVD Filesystems -# -# CONFIG_ISO9660_FS is not set -# CONFIG_UDF_FS is not set - -# -# DOS/FAT/NT Filesystems -# -CONFIG_FAT_FS=y -CONFIG_MSDOS_FS=y -CONFIG_VFAT_FS=y -CONFIG_FAT_DEFAULT_CODEPAGE=437 -CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" -# CONFIG_NTFS_FS is not set - -# -# Pseudo filesystems -# -CONFIG_PROC_FS=y -CONFIG_PROC_KCORE=y -CONFIG_PROC_SYSCTL=y -CONFIG_SYSFS=y -CONFIG_TMPFS=y -# CONFIG_TMPFS_POSIX_ACL is not set -# CONFIG_HUGETLB_PAGE is not set -# CONFIG_CONFIGFS_FS is not set - -# -# Miscellaneous filesystems -# -# CONFIG_ADFS_FS is not set -# CONFIG_AFFS_FS is not set -# CONFIG_HFS_FS is not set -# CONFIG_HFSPLUS_FS is not set -# CONFIG_BEFS_FS is not set -# CONFIG_BFS_FS is not set -# CONFIG_EFS_FS is not set -CONFIG_JFFS2_FS=y -CONFIG_JFFS2_FS_DEBUG=0 -CONFIG_JFFS2_FS_WRITEBUFFER=y -# CONFIG_JFFS2_FS_WBUF_VERIFY is not set -# CONFIG_JFFS2_SUMMARY is not set -# CONFIG_JFFS2_FS_XATTR is not set -# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set -CONFIG_JFFS2_ZLIB=y -# CONFIG_JFFS2_LZO is not set -CONFIG_JFFS2_RTIME=y -# CONFIG_JFFS2_RUBIN is not set -CONFIG_CRAMFS=y -# CONFIG_VXFS_FS is not set -# CONFIG_MINIX_FS is not set -# CONFIG_HPFS_FS is not set -# CONFIG_QNX4FS_FS is not set -# CONFIG_ROMFS_FS is not set -# CONFIG_SYSV_FS is not set -# CONFIG_UFS_FS is not set -CONFIG_NETWORK_FILESYSTEMS=y -CONFIG_NFS_FS=y -CONFIG_NFS_V3=y -# CONFIG_NFS_V3_ACL is not set -CONFIG_NFS_V4=y -# CONFIG_NFSD is not set -CONFIG_ROOT_NFS=y -CONFIG_LOCKD=y -CONFIG_LOCKD_V4=y -CONFIG_NFS_COMMON=y -CONFIG_SUNRPC=y -CONFIG_SUNRPC_GSS=y -# CONFIG_SUNRPC_BIND34 is not set -CONFIG_RPCSEC_GSS_KRB5=y -# CONFIG_RPCSEC_GSS_SPKM3 is not set -# CONFIG_SMB_FS is not set -# CONFIG_CIFS is not set -# CONFIG_NCP_FS is not set -# CONFIG_CODA_FS is not set -# CONFIG_AFS_FS is not set - -# -# Partition Types -# -CONFIG_PARTITION_ADVANCED=y -# CONFIG_ACORN_PARTITION is not set -# CONFIG_OSF_PARTITION is not set -# CONFIG_AMIGA_PARTITION is not set -# CONFIG_ATARI_PARTITION is not set -# CONFIG_MAC_PARTITION is not set -CONFIG_MSDOS_PARTITION=y -# CONFIG_BSD_DISKLABEL is not set -# CONFIG_MINIX_SUBPARTITION is not set -# CONFIG_SOLARIS_X86_PARTITION is not set -# CONFIG_UNIXWARE_DISKLABEL is not set -# CONFIG_LDM_PARTITION is not set -# CONFIG_SGI_PARTITION is not set -# CONFIG_ULTRIX_PARTITION is not set -# CONFIG_SUN_PARTITION is not set -# CONFIG_KARMA_PARTITION is not set -# CONFIG_EFI_PARTITION is not set -# CONFIG_SYSV68_PARTITION is not set -CONFIG_NLS=y -CONFIG_NLS_DEFAULT="iso8859-1" -CONFIG_NLS_CODEPAGE_437=y -# CONFIG_NLS_CODEPAGE_737 is not set -# CONFIG_NLS_CODEPAGE_775 is not set -# CONFIG_NLS_CODEPAGE_850 is not set -# CONFIG_NLS_CODEPAGE_852 is not set -# CONFIG_NLS_CODEPAGE_855 is not set -# CONFIG_NLS_CODEPAGE_857 is not set -# CONFIG_NLS_CODEPAGE_860 is not set -# CONFIG_NLS_CODEPAGE_861 is not set -# CONFIG_NLS_CODEPAGE_862 is not set -# CONFIG_NLS_CODEPAGE_863 is not set -# CONFIG_NLS_CODEPAGE_864 is not set -# CONFIG_NLS_CODEPAGE_865 is not set -# CONFIG_NLS_CODEPAGE_866 is not set -# CONFIG_NLS_CODEPAGE_869 is not set -# CONFIG_NLS_CODEPAGE_936 is not set -# CONFIG_NLS_CODEPAGE_950 is not set -# CONFIG_NLS_CODEPAGE_932 is not set -# CONFIG_NLS_CODEPAGE_949 is not set -# CONFIG_NLS_CODEPAGE_874 is not set -# CONFIG_NLS_ISO8859_8 is not set -# CONFIG_NLS_CODEPAGE_1250 is not set -# CONFIG_NLS_CODEPAGE_1251 is not set -# CONFIG_NLS_ASCII is not set -CONFIG_NLS_ISO8859_1=y -# CONFIG_NLS_ISO8859_2 is not set -# CONFIG_NLS_ISO8859_3 is not set -# CONFIG_NLS_ISO8859_4 is not set -# CONFIG_NLS_ISO8859_5 is not set -# CONFIG_NLS_ISO8859_6 is not set -# CONFIG_NLS_ISO8859_7 is not set -# CONFIG_NLS_ISO8859_9 is not set -# CONFIG_NLS_ISO8859_13 is not set -# CONFIG_NLS_ISO8859_14 is not set -# CONFIG_NLS_ISO8859_15 is not set -# CONFIG_NLS_KOI8_R is not set -# CONFIG_NLS_KOI8_U is not set -# CONFIG_NLS_UTF8 is not set -# CONFIG_DLM is not set - -# -# Library routines -# -CONFIG_BITREVERSE=y -# CONFIG_GENERIC_FIND_FIRST_BIT is not set -# CONFIG_CRC_CCITT is not set -# CONFIG_CRC16 is not set -# CONFIG_CRC_ITU_T is not set -CONFIG_CRC32=y -# CONFIG_CRC7 is not set -# CONFIG_LIBCRC32C is not set -CONFIG_ZLIB_INFLATE=y -CONFIG_ZLIB_DEFLATE=y -CONFIG_PLIST=y -CONFIG_HAS_IOMEM=y -CONFIG_HAS_IOPORT=y -CONFIG_HAS_DMA=y -CONFIG_HAVE_LMB=y - -# -# Kernel hacking -# -CONFIG_PRINTK_TIME=y -CONFIG_ENABLE_WARN_DEPRECATED=y -CONFIG_ENABLE_MUST_CHECK=y -CONFIG_FRAME_WARN=1024 -# CONFIG_MAGIC_SYSRQ is not set -# CONFIG_UNUSED_SYMBOLS is not set -# CONFIG_DEBUG_FS is not set -# CONFIG_HEADERS_CHECK is not set -CONFIG_DEBUG_KERNEL=y -# CONFIG_DEBUG_SHIRQ is not set -CONFIG_DETECT_SOFTLOCKUP=y -CONFIG_SCHED_DEBUG=y -# CONFIG_SCHEDSTATS is not set -# CONFIG_TIMER_STATS is not set -# CONFIG_SLUB_DEBUG_ON is not set -# CONFIG_SLUB_STATS is not set -# CONFIG_DEBUG_RT_MUTEXES is not set -# CONFIG_RT_MUTEX_TESTER is not set -# CONFIG_DEBUG_SPINLOCK is not set -# CONFIG_DEBUG_MUTEXES is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set -# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set -# CONFIG_DEBUG_KOBJECT is not set -# CONFIG_DEBUG_BUGVERBOSE is not set -# CONFIG_DEBUG_INFO is not set -# CONFIG_DEBUG_VM is not set -# CONFIG_DEBUG_WRITECOUNT is not set -# CONFIG_DEBUG_LIST is not set -# CONFIG_DEBUG_SG is not set -# CONFIG_BOOT_PRINTK_DELAY is not set -# CONFIG_BACKTRACE_SELF_TEST is not set -# CONFIG_FAULT_INJECTION is not set -# CONFIG_SAMPLES is not set -# CONFIG_DEBUG_STACKOVERFLOW is not set -# CONFIG_DEBUG_STACK_USAGE is not set -# CONFIG_DEBUG_PAGEALLOC is not set -# CONFIG_DEBUGGER is not set -# CONFIG_IRQSTACKS is not set -# CONFIG_BDI_SWITCH is not set -# CONFIG_BOOTX_TEXT is not set -# CONFIG_PPC_EARLY_DEBUG is not set - -# -# Security options -# -# CONFIG_KEYS is not set -# CONFIG_SECURITY is not set -# CONFIG_SECURITY_FILE_CAPABILITIES is not set -CONFIG_CRYPTO=y - -# -# Crypto core or helper -# -CONFIG_CRYPTO_ALGAPI=y -CONFIG_CRYPTO_BLKCIPHER=y -CONFIG_CRYPTO_MANAGER=y -# CONFIG_CRYPTO_GF128MUL is not set -# CONFIG_CRYPTO_NULL is not set -# CONFIG_CRYPTO_CRYPTD is not set -# CONFIG_CRYPTO_AUTHENC is not set - -# -# Authenticated Encryption with Associated Data -# -# CONFIG_CRYPTO_CCM is not set -# CONFIG_CRYPTO_GCM is not set -# CONFIG_CRYPTO_SEQIV is not set - -# -# Block modes -# -CONFIG_CRYPTO_CBC=y -# CONFIG_CRYPTO_CTR is not set -# CONFIG_CRYPTO_CTS is not set -CONFIG_CRYPTO_ECB=y -# CONFIG_CRYPTO_LRW is not set -CONFIG_CRYPTO_PCBC=y -# CONFIG_CRYPTO_XTS is not set - -# -# Hash modes -# -# CONFIG_CRYPTO_HMAC is not set -# CONFIG_CRYPTO_XCBC is not set - -# -# Digest -# -# CONFIG_CRYPTO_CRC32C is not set -# CONFIG_CRYPTO_MD4 is not set -CONFIG_CRYPTO_MD5=y -# CONFIG_CRYPTO_MICHAEL_MIC is not set -# CONFIG_CRYPTO_SHA1 is not set -# CONFIG_CRYPTO_SHA256 is not set -# CONFIG_CRYPTO_SHA512 is not set -# CONFIG_CRYPTO_TGR192 is not set -# CONFIG_CRYPTO_WP512 is not set - -# -# Ciphers -# -# CONFIG_CRYPTO_AES is not set -# CONFIG_CRYPTO_ANUBIS is not set -# CONFIG_CRYPTO_ARC4 is not set -# CONFIG_CRYPTO_BLOWFISH is not set -# CONFIG_CRYPTO_CAMELLIA is not set -# CONFIG_CRYPTO_CAST5 is not set -# CONFIG_CRYPTO_CAST6 is not set -CONFIG_CRYPTO_DES=y -# CONFIG_CRYPTO_FCRYPT is not set -# CONFIG_CRYPTO_KHAZAD is not set -# CONFIG_CRYPTO_SALSA20 is not set -# CONFIG_CRYPTO_SEED is not set -# CONFIG_CRYPTO_SERPENT is not set -# CONFIG_CRYPTO_TEA is not set -# CONFIG_CRYPTO_TWOFISH is not set - -# -# Compression -# -# CONFIG_CRYPTO_DEFLATE is not set -# CONFIG_CRYPTO_LZO is not set -CONFIG_CRYPTO_HW=y -CONFIG_PPC_CLOCK=y -CONFIG_PPC_LIB_RHEAP=y -# CONFIG_VIRTUALIZATION is not set diff --git a/trunk/arch/powerpc/configs/52xx/lite5200b_defconfig b/trunk/arch/powerpc/configs/52xx/lite5200b_defconfig deleted file mode 100644 index 1a8a250fa11b..000000000000 --- a/trunk/arch/powerpc/configs/52xx/lite5200b_defconfig +++ /dev/null @@ -1,1049 +0,0 @@ -# -# Automatically generated make config: don't edit -# Linux kernel version: 2.6.25 -# Tue Apr 29 07:12:56 2008 -# -# CONFIG_PPC64 is not set - -# -# Processor support -# -CONFIG_6xx=y -# CONFIG_PPC_85xx is not set -# CONFIG_PPC_8xx is not set -# CONFIG_40x is not set -# CONFIG_44x is not set -# CONFIG_E200 is not set -CONFIG_PPC_FPU=y -# CONFIG_ALTIVEC is not set -CONFIG_PPC_STD_MMU=y -CONFIG_PPC_STD_MMU_32=y -# CONFIG_PPC_MM_SLICES is not set -# CONFIG_SMP is not set -CONFIG_PPC32=y -CONFIG_WORD_SIZE=32 -CONFIG_PPC_MERGE=y -CONFIG_MMU=y -CONFIG_GENERIC_CMOS_UPDATE=y -CONFIG_GENERIC_TIME=y -CONFIG_GENERIC_TIME_VSYSCALL=y -CONFIG_GENERIC_CLOCKEVENTS=y -CONFIG_GENERIC_HARDIRQS=y -# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set -CONFIG_IRQ_PER_CPU=y -CONFIG_STACKTRACE_SUPPORT=y -CONFIG_LOCKDEP_SUPPORT=y -CONFIG_RWSEM_XCHGADD_ALGORITHM=y -CONFIG_ARCH_HAS_ILOG2_U32=y -CONFIG_GENERIC_HWEIGHT=y -CONFIG_GENERIC_CALIBRATE_DELAY=y -CONFIG_GENERIC_FIND_NEXT_BIT=y -# CONFIG_ARCH_NO_VIRT_TO_BUS is not set -CONFIG_PPC=y -CONFIG_EARLY_PRINTK=y -CONFIG_GENERIC_NVRAM=y -CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y -CONFIG_ARCH_MAY_HAVE_PC_FDC=y -CONFIG_PPC_OF=y -CONFIG_OF=y -# CONFIG_PPC_UDBG_16550 is not set -# CONFIG_GENERIC_TBSYNC is not set -CONFIG_AUDIT_ARCH=y -CONFIG_GENERIC_BUG=y -CONFIG_DEFAULT_UIMAGE=y -CONFIG_ARCH_SUSPEND_POSSIBLE=y -# CONFIG_PPC_DCR_NATIVE is not set -# CONFIG_PPC_DCR_MMIO is not set -CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" - -# -# General setup -# -CONFIG_EXPERIMENTAL=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -CONFIG_SYSVIPC_SYSCTL=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -# CONFIG_TASKSTATS is not set -# CONFIG_AUDIT is not set -# CONFIG_IKCONFIG is not set -CONFIG_LOG_BUF_SHIFT=14 -# CONFIG_CGROUPS is not set -CONFIG_GROUP_SCHED=y -# CONFIG_FAIR_GROUP_SCHED is not set -# CONFIG_RT_GROUP_SCHED is not set -CONFIG_USER_SCHED=y -# CONFIG_CGROUP_SCHED is not set -CONFIG_SYSFS_DEPRECATED=y -CONFIG_SYSFS_DEPRECATED_V2=y -# CONFIG_RELAY is not set -# CONFIG_NAMESPACES is not set -CONFIG_BLK_DEV_INITRD=y -CONFIG_INITRAMFS_SOURCE="" -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SYSCTL=y -CONFIG_EMBEDDED=y -# CONFIG_SYSCTL_SYSCALL is not set -# CONFIG_KALLSYMS is not set -CONFIG_HOTPLUG=y -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_ELF_CORE=y -CONFIG_COMPAT_BRK=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_ANON_INODES=y -# CONFIG_EPOLL is not set -CONFIG_SIGNALFD=y -CONFIG_TIMERFD=y -CONFIG_EVENTFD=y -CONFIG_SHMEM=y -CONFIG_VM_EVENT_COUNTERS=y -CONFIG_SLUB_DEBUG=y -# CONFIG_SLAB is not set -CONFIG_SLUB=y -# CONFIG_SLOB is not set -# CONFIG_PROFILING is not set -# CONFIG_MARKERS is not set -CONFIG_HAVE_OPROFILE=y -CONFIG_HAVE_KPROBES=y -CONFIG_HAVE_KRETPROBES=y -CONFIG_PROC_PAGE_MONITOR=y -CONFIG_SLABINFO=y -CONFIG_RT_MUTEXES=y -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -# CONFIG_MODVERSIONS is not set -# CONFIG_MODULE_SRCVERSION_ALL is not set -# CONFIG_KMOD is not set -CONFIG_BLOCK=y -# CONFIG_LBD is not set -# CONFIG_BLK_DEV_IO_TRACE is not set -# CONFIG_LSF is not set -# CONFIG_BLK_DEV_BSG is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" -CONFIG_CLASSIC_RCU=y - -# -# Platform support -# -CONFIG_PPC_MULTIPLATFORM=y -# CONFIG_PPC_82xx is not set -# CONFIG_PPC_83xx is not set -# CONFIG_PPC_86xx is not set -CONFIG_CLASSIC32=y -# CONFIG_PPC_CHRP is not set -# CONFIG_PPC_MPC512x is not set -# CONFIG_PPC_MPC5121 is not set -# CONFIG_MPC5121_ADS is not set -CONFIG_PPC_MPC52xx=y -CONFIG_PPC_MPC5200_SIMPLE=y -# CONFIG_PPC_EFIKA is not set -CONFIG_PPC_LITE5200=y -# CONFIG_PPC_MPC5200_BUGFIX is not set -# CONFIG_PPC_MPC5200_GPIO is not set -# CONFIG_PPC_PMAC is not set -# CONFIG_PPC_CELL is not set -# CONFIG_PPC_CELL_NATIVE is not set -# CONFIG_PQ2ADS is not set -# CONFIG_EMBEDDED6xx is not set -# CONFIG_IPIC is not set -# CONFIG_MPIC is not set -# CONFIG_MPIC_WEIRD is not set -# CONFIG_PPC_I8259 is not set -# CONFIG_PPC_RTAS is not set -# CONFIG_MMIO_NVRAM is not set -# CONFIG_PPC_MPC106 is not set -# CONFIG_PPC_970_NAP is not set -# CONFIG_PPC_INDIRECT_IO is not set -# CONFIG_GENERIC_IOMAP is not set -# CONFIG_CPU_FREQ is not set -# CONFIG_TAU is not set -# CONFIG_FSL_ULI1575 is not set -CONFIG_PPC_BESTCOMM=y -CONFIG_PPC_BESTCOMM_ATA=y -CONFIG_PPC_BESTCOMM_FEC=y -CONFIG_PPC_BESTCOMM_GEN_BD=y - -# -# Kernel options -# -# CONFIG_HIGHMEM is not set -CONFIG_TICK_ONESHOT=y -CONFIG_NO_HZ=y -CONFIG_HIGH_RES_TIMERS=y -CONFIG_GENERIC_CLOCKEVENTS_BUILD=y -# CONFIG_HZ_100 is not set -CONFIG_HZ_250=y -# CONFIG_HZ_300 is not set -# CONFIG_HZ_1000 is not set -CONFIG_HZ=250 -# CONFIG_SCHED_HRTICK is not set -CONFIG_PREEMPT_NONE=y -# CONFIG_PREEMPT_VOLUNTARY is not set -# CONFIG_PREEMPT is not set -CONFIG_BINFMT_ELF=y -# CONFIG_BINFMT_MISC is not set -# CONFIG_IOMMU_HELPER is not set -CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y -CONFIG_ARCH_HAS_WALK_MEMORY=y -CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y -# CONFIG_KEXEC is not set -CONFIG_ARCH_FLATMEM_ENABLE=y -CONFIG_ARCH_POPULATES_NODE_MAP=y -CONFIG_SELECT_MEMORY_MODEL=y -CONFIG_FLATMEM_MANUAL=y -# CONFIG_DISCONTIGMEM_MANUAL is not set -# CONFIG_SPARSEMEM_MANUAL is not set -CONFIG_FLATMEM=y -CONFIG_FLAT_NODE_MEM_MAP=y -# CONFIG_SPARSEMEM_STATIC is not set -# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set -CONFIG_PAGEFLAGS_EXTENDED=y -CONFIG_SPLIT_PTLOCK_CPUS=4 -# CONFIG_RESOURCES_64BIT is not set -CONFIG_ZONE_DMA_FLAG=1 -CONFIG_BOUNCE=y -CONFIG_VIRT_TO_BUS=y -CONFIG_FORCE_MAX_ZONEORDER=11 -CONFIG_PROC_DEVICETREE=y -# CONFIG_CMDLINE_BOOL is not set -CONFIG_PM=y -# CONFIG_PM_LEGACY is not set -# CONFIG_PM_DEBUG is not set -CONFIG_PM_SLEEP=y -CONFIG_SUSPEND=y -CONFIG_SUSPEND_FREEZER=y -CONFIG_SECCOMP=y -CONFIG_ISA_DMA_API=y - -# -# Bus options -# -CONFIG_ZONE_DMA=y -CONFIG_GENERIC_ISA_DMA=y -# CONFIG_PPC_INDIRECT_PCI is not set -CONFIG_FSL_SOC=y -CONFIG_PCI=y -CONFIG_PCI_DOMAINS=y -CONFIG_PCI_SYSCALL=y -# CONFIG_PCIEPORTBUS is not set -CONFIG_ARCH_SUPPORTS_MSI=y -# CONFIG_PCI_MSI is not set -CONFIG_PCI_LEGACY=y -# CONFIG_PCI_DEBUG is not set -# CONFIG_PCCARD is not set -# CONFIG_HOTPLUG_PCI is not set -# CONFIG_HAS_RAPIDIO is not set - -# -# Advanced setup -# -# CONFIG_ADVANCED_OPTIONS is not set - -# -# Default settings for advanced configuration options are used -# -CONFIG_LOWMEM_SIZE=0x30000000 -CONFIG_PAGE_OFFSET=0xc0000000 -CONFIG_KERNEL_START=0xc0000000 -CONFIG_PHYSICAL_START=0x00000000 -CONFIG_TASK_SIZE=0xc0000000 - -# -# Networking -# -CONFIG_NET=y - -# -# Networking options -# -CONFIG_PACKET=y -# CONFIG_PACKET_MMAP is not set -CONFIG_UNIX=y -CONFIG_XFRM=y -CONFIG_XFRM_USER=m -# CONFIG_XFRM_SUB_POLICY is not set -# CONFIG_XFRM_MIGRATE is not set -# CONFIG_XFRM_STATISTICS is not set -# CONFIG_NET_KEY is not set -CONFIG_INET=y -CONFIG_IP_MULTICAST=y -# CONFIG_IP_ADVANCED_ROUTER is not set -CONFIG_IP_FIB_HASH=y -CONFIG_IP_PNP=y -CONFIG_IP_PNP_DHCP=y -CONFIG_IP_PNP_BOOTP=y -# CONFIG_IP_PNP_RARP is not set -# CONFIG_NET_IPIP is not set -# CONFIG_NET_IPGRE is not set -# CONFIG_IP_MROUTE is not set -# CONFIG_ARPD is not set -CONFIG_SYN_COOKIES=y -# CONFIG_INET_AH is not set -# CONFIG_INET_ESP is not set -# CONFIG_INET_IPCOMP is not set -# CONFIG_INET_XFRM_TUNNEL is not set -# CONFIG_INET_TUNNEL is not set -CONFIG_INET_XFRM_MODE_TRANSPORT=y -CONFIG_INET_XFRM_MODE_TUNNEL=y -CONFIG_INET_XFRM_MODE_BEET=y -# CONFIG_INET_LRO is not set -CONFIG_INET_DIAG=y -CONFIG_INET_TCP_DIAG=y -# CONFIG_TCP_CONG_ADVANCED is not set -CONFIG_TCP_CONG_CUBIC=y -CONFIG_DEFAULT_TCP_CONG="cubic" -# CONFIG_TCP_MD5SIG is not set -# CONFIG_IPV6 is not set -# CONFIG_NETWORK_SECMARK is not set -# CONFIG_NETFILTER is not set -# CONFIG_IP_DCCP is not set -# CONFIG_IP_SCTP is not set -# CONFIG_TIPC is not set -# CONFIG_ATM is not set -# CONFIG_BRIDGE is not set -# CONFIG_VLAN_8021Q is not set -# CONFIG_DECNET is not set -# CONFIG_LLC2 is not set -# CONFIG_IPX is not set -# CONFIG_ATALK is not set -# CONFIG_X25 is not set -# CONFIG_LAPB is not set -# CONFIG_ECONET is not set -# CONFIG_WAN_ROUTER is not set -# CONFIG_NET_SCHED is not set - -# -# Network testing -# -# CONFIG_NET_PKTGEN is not set -# CONFIG_HAMRADIO is not set -# CONFIG_CAN is not set -# CONFIG_IRDA is not set -# CONFIG_BT is not set -# CONFIG_AF_RXRPC is not set - -# -# Wireless -# -# CONFIG_CFG80211 is not set -# CONFIG_WIRELESS_EXT is not set -# CONFIG_MAC80211 is not set -# CONFIG_IEEE80211 is not set -# CONFIG_RFKILL is not set -# CONFIG_NET_9P is not set - -# -# Device Drivers -# - -# -# Generic Driver Options -# -CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" -CONFIG_STANDALONE=y -CONFIG_PREVENT_FIRMWARE_BUILD=y -# CONFIG_FW_LOADER is not set -# CONFIG_DEBUG_DRIVER is not set -# CONFIG_DEBUG_DEVRES is not set -# CONFIG_SYS_HYPERVISOR is not set -# CONFIG_CONNECTOR is not set -# CONFIG_MTD is not set -CONFIG_OF_DEVICE=y -CONFIG_OF_I2C=y -# CONFIG_PARPORT is not set -CONFIG_BLK_DEV=y -# CONFIG_BLK_DEV_FD is not set -# CONFIG_BLK_CPQ_DA is not set -# CONFIG_BLK_CPQ_CISS_DA is not set -# CONFIG_BLK_DEV_DAC960 is not set -# CONFIG_BLK_DEV_UMEM is not set -# CONFIG_BLK_DEV_COW_COMMON is not set -CONFIG_BLK_DEV_LOOP=y -# CONFIG_BLK_DEV_CRYPTOLOOP is not set -# CONFIG_BLK_DEV_NBD is not set -# CONFIG_BLK_DEV_SX8 is not set -CONFIG_BLK_DEV_RAM=y -CONFIG_BLK_DEV_RAM_COUNT=16 -CONFIG_BLK_DEV_RAM_SIZE=32768 -# CONFIG_BLK_DEV_XIP is not set -# CONFIG_CDROM_PKTCDVD is not set -# CONFIG_ATA_OVER_ETH is not set -CONFIG_MISC_DEVICES=y -# CONFIG_PHANTOM is not set -# CONFIG_EEPROM_93CX6 is not set -# CONFIG_SGI_IOC4 is not set -# CONFIG_TIFM_CORE is not set -# CONFIG_ENCLOSURE_SERVICES is not set -CONFIG_HAVE_IDE=y -# CONFIG_IDE is not set - -# -# SCSI device support -# -# CONFIG_RAID_ATTRS is not set -CONFIG_SCSI=y -CONFIG_SCSI_DMA=y -# CONFIG_SCSI_TGT is not set -# CONFIG_SCSI_NETLINK is not set -# CONFIG_SCSI_PROC_FS is not set - -# -# SCSI support type (disk, tape, CD-ROM) -# -# CONFIG_BLK_DEV_SD is not set -# CONFIG_CHR_DEV_ST is not set -# CONFIG_CHR_DEV_OSST is not set -# CONFIG_BLK_DEV_SR is not set -# CONFIG_CHR_DEV_SG is not set -# CONFIG_CHR_DEV_SCH is not set - -# -# Some SCSI devices (e.g. CD jukebox) support multiple LUNs -# -# CONFIG_SCSI_MULTI_LUN is not set -# CONFIG_SCSI_CONSTANTS is not set -# CONFIG_SCSI_LOGGING is not set -# CONFIG_SCSI_SCAN_ASYNC is not set -CONFIG_SCSI_WAIT_SCAN=m - -# -# SCSI Transports -# -# CONFIG_SCSI_SPI_ATTRS is not set -# CONFIG_SCSI_FC_ATTRS is not set -# CONFIG_SCSI_ISCSI_ATTRS is not set -# CONFIG_SCSI_SAS_LIBSAS is not set -# CONFIG_SCSI_SRP_ATTRS is not set -CONFIG_SCSI_LOWLEVEL=y -# CONFIG_ISCSI_TCP is not set -# CONFIG_BLK_DEV_3W_XXXX_RAID is not set -# CONFIG_SCSI_3W_9XXX is not set -# CONFIG_SCSI_ACARD is not set -# CONFIG_SCSI_AACRAID is not set -# CONFIG_SCSI_AIC7XXX is not set -# CONFIG_SCSI_AIC7XXX_OLD is not set -# CONFIG_SCSI_AIC79XX is not set -# CONFIG_SCSI_AIC94XX is not set -# CONFIG_SCSI_DPT_I2O is not set -# CONFIG_SCSI_ADVANSYS is not set -# CONFIG_SCSI_ARCMSR is not set -# CONFIG_MEGARAID_NEWGEN is not set -# CONFIG_MEGARAID_LEGACY is not set -# CONFIG_MEGARAID_SAS is not set -# CONFIG_SCSI_HPTIOP is not set -# CONFIG_SCSI_BUSLOGIC is not set -# CONFIG_SCSI_DMX3191D is not set -# CONFIG_SCSI_EATA is not set -# CONFIG_SCSI_FUTURE_DOMAIN is not set -# CONFIG_SCSI_GDTH is not set -# CONFIG_SCSI_IPS is not set -# CONFIG_SCSI_INITIO is not set -# CONFIG_SCSI_INIA100 is not set -# CONFIG_SCSI_MVSAS is not set -# CONFIG_SCSI_STEX is not set -# CONFIG_SCSI_SYM53C8XX_2 is not set -# CONFIG_SCSI_IPR is not set -# CONFIG_SCSI_QLOGIC_1280 is not set -# CONFIG_SCSI_QLA_FC is not set -# CONFIG_SCSI_QLA_ISCSI is not set -# CONFIG_SCSI_LPFC is not set -# CONFIG_SCSI_DC395x is not set -# CONFIG_SCSI_DC390T is not set -# CONFIG_SCSI_NSP32 is not set -# CONFIG_SCSI_DEBUG is not set -# CONFIG_SCSI_SRP is not set -CONFIG_ATA=y -# CONFIG_ATA_NONSTANDARD is not set -CONFIG_SATA_PMP=y -# CONFIG_SATA_AHCI is not set -# CONFIG_SATA_SIL24 is not set -# CONFIG_SATA_FSL is not set -CONFIG_ATA_SFF=y -# CONFIG_SATA_SVW is not set -# CONFIG_ATA_PIIX is not set -# CONFIG_SATA_MV is not set -# CONFIG_SATA_NV is not set -# CONFIG_PDC_ADMA is not set -# CONFIG_SATA_QSTOR is not set -# CONFIG_SATA_PROMISE is not set -# CONFIG_SATA_SX4 is not set -# CONFIG_SATA_SIL is not set -# CONFIG_SATA_SIS is not set -# CONFIG_SATA_ULI is not set -# CONFIG_SATA_VIA is not set -# CONFIG_SATA_VITESSE is not set -# CONFIG_SATA_INIC162X is not set -# CONFIG_PATA_ALI is not set -# CONFIG_PATA_AMD is not set -# CONFIG_PATA_ARTOP is not set -# CONFIG_PATA_ATIIXP is not set -# CONFIG_PATA_CMD640_PCI is not set -# CONFIG_PATA_CMD64X is not set -# CONFIG_PATA_CS5520 is not set -# CONFIG_PATA_CS5530 is not set -# CONFIG_PATA_CYPRESS is not set -# CONFIG_PATA_EFAR is not set -# CONFIG_ATA_GENERIC is not set -# CONFIG_PATA_HPT366 is not set -# CONFIG_PATA_HPT37X is not set -# CONFIG_PATA_HPT3X2N is not set -# CONFIG_PATA_HPT3X3 is not set -# CONFIG_PATA_IT821X is not set -# CONFIG_PATA_IT8213 is not set -# CONFIG_PATA_JMICRON is not set -# CONFIG_PATA_TRIFLEX is not set -# CONFIG_PATA_MARVELL is not set -CONFIG_PATA_MPC52xx=y -# CONFIG_PATA_MPIIX is not set -# CONFIG_PATA_OLDPIIX is not set -# CONFIG_PATA_NETCELL is not set -# CONFIG_PATA_NINJA32 is not set -# CONFIG_PATA_NS87410 is not set -# CONFIG_PATA_NS87415 is not set -# CONFIG_PATA_OPTI is not set -# CONFIG_PATA_OPTIDMA is not set -# CONFIG_PATA_PDC_OLD is not set -# CONFIG_PATA_RADISYS is not set -# CONFIG_PATA_RZ1000 is not set -# CONFIG_PATA_SC1200 is not set -# CONFIG_PATA_SERVERWORKS is not set -# CONFIG_PATA_PDC2027X is not set -# CONFIG_PATA_SIL680 is not set -# CONFIG_PATA_SIS is not set -# CONFIG_PATA_VIA is not set -# CONFIG_PATA_WINBOND is not set -# CONFIG_PATA_PLATFORM is not set -# CONFIG_MD is not set -# CONFIG_FUSION is not set - -# -# IEEE 1394 (FireWire) support -# -# CONFIG_FIREWIRE is not set -# CONFIG_IEEE1394 is not set -# CONFIG_I2O is not set -# CONFIG_MACINTOSH_DRIVERS is not set -CONFIG_NETDEVICES=y -# CONFIG_NETDEVICES_MULTIQUEUE is not set -# CONFIG_DUMMY is not set -# CONFIG_BONDING is not set -# CONFIG_MACVLAN is not set -# CONFIG_EQUALIZER is not set -# CONFIG_TUN is not set -# CONFIG_VETH is not set -# CONFIG_ARCNET is not set -CONFIG_PHYLIB=y - -# -# MII PHY device drivers -# -# CONFIG_MARVELL_PHY is not set -# CONFIG_DAVICOM_PHY is not set -# CONFIG_QSEMI_PHY is not set -CONFIG_LXT_PHY=y -# CONFIG_CICADA_PHY is not set -# CONFIG_VITESSE_PHY is not set -# CONFIG_SMSC_PHY is not set -# CONFIG_BROADCOM_PHY is not set -# CONFIG_ICPLUS_PHY is not set -# CONFIG_REALTEK_PHY is not set -# CONFIG_FIXED_PHY is not set -# CONFIG_MDIO_BITBANG is not set -CONFIG_NET_ETHERNET=y -# CONFIG_MII is not set -# CONFIG_HAPPYMEAL is not set -# CONFIG_SUNGEM is not set -# CONFIG_CASSINI is not set -# CONFIG_NET_VENDOR_3COM is not set -# CONFIG_NET_TULIP is not set -# CONFIG_HP100 is not set -# CONFIG_IBM_NEW_EMAC_ZMII is not set -# CONFIG_IBM_NEW_EMAC_RGMII is not set -# CONFIG_IBM_NEW_EMAC_TAH is not set -# CONFIG_IBM_NEW_EMAC_EMAC4 is not set -# CONFIG_NET_PCI is not set -# CONFIG_B44 is not set -CONFIG_FEC_MPC52xx=y -CONFIG_FEC_MPC52xx_MDIO=y -CONFIG_NETDEV_1000=y -# CONFIG_ACENIC is not set -# CONFIG_DL2K is not set -# CONFIG_E1000 is not set -# CONFIG_E1000E is not set -# CONFIG_E1000E_ENABLED is not set -# CONFIG_IP1000 is not set -# CONFIG_IGB is not set -# CONFIG_NS83820 is not set -# CONFIG_HAMACHI is not set -# CONFIG_YELLOWFIN is not set -# CONFIG_R8169 is not set -# CONFIG_SIS190 is not set -# CONFIG_SKGE is not set -# CONFIG_SKY2 is not set -# CONFIG_VIA_VELOCITY is not set -# CONFIG_TIGON3 is not set -# CONFIG_BNX2 is not set -# CONFIG_GIANFAR is not set -# CONFIG_MV643XX_ETH is not set -# CONFIG_QLA3XXX is not set -# CONFIG_ATL1 is not set -CONFIG_NETDEV_10000=y -# CONFIG_CHELSIO_T1 is not set -# CONFIG_CHELSIO_T3 is not set -# CONFIG_IXGBE is not set -# CONFIG_IXGB is not set -# CONFIG_S2IO is not set -# CONFIG_MYRI10GE is not set -# CONFIG_NETXEN_NIC is not set -# CONFIG_NIU is not set -# CONFIG_MLX4_CORE is not set -# CONFIG_TEHUTI is not set -# CONFIG_BNX2X is not set -# CONFIG_TR is not set - -# -# Wireless LAN -# -# CONFIG_WLAN_PRE80211 is not set -# CONFIG_WLAN_80211 is not set -# CONFIG_IWLWIFI is not set -# CONFIG_IWLWIFI_LEDS is not set -# CONFIG_WAN is not set -# CONFIG_FDDI is not set -# CONFIG_HIPPI is not set -# CONFIG_PPP is not set -# CONFIG_SLIP is not set -# CONFIG_NET_FC is not set -# CONFIG_NETCONSOLE is not set -# CONFIG_NETPOLL is not set -# CONFIG_NET_POLL_CONTROLLER is not set -# CONFIG_ISDN is not set -# CONFIG_PHONE is not set - -# -# Input device support -# -# CONFIG_INPUT is not set - -# -# Hardware I/O ports -# -# CONFIG_SERIO is not set -# CONFIG_GAMEPORT is not set - -# -# Character devices -# -# CONFIG_VT is not set -# CONFIG_SERIAL_NONSTANDARD is not set -# CONFIG_NOZOMI is not set - -# -# Serial drivers -# -# CONFIG_SERIAL_8250 is not set - -# -# Non-8250 serial port support -# -# CONFIG_SERIAL_UARTLITE is not set -CONFIG_SERIAL_CORE=y -CONFIG_SERIAL_CORE_CONSOLE=y -CONFIG_SERIAL_MPC52xx=y -CONFIG_SERIAL_MPC52xx_CONSOLE=y -CONFIG_SERIAL_MPC52xx_CONSOLE_BAUD=115200 -# CONFIG_SERIAL_JSM is not set -CONFIG_UNIX98_PTYS=y -CONFIG_LEGACY_PTYS=y -CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_IPMI_HANDLER is not set -# CONFIG_HW_RANDOM is not set -# CONFIG_NVRAM is not set -CONFIG_GEN_RTC=y -# CONFIG_GEN_RTC_X is not set -# CONFIG_R3964 is not set -# CONFIG_APPLICOM is not set -# CONFIG_RAW_DRIVER is not set -# CONFIG_TCG_TPM is not set -CONFIG_DEVPORT=y -CONFIG_I2C=y -CONFIG_I2C_BOARDINFO=y -CONFIG_I2C_CHARDEV=y - -# -# I2C Hardware Bus support -# -# CONFIG_I2C_ALI1535 is not set -# CONFIG_I2C_ALI1563 is not set -# CONFIG_I2C_ALI15X3 is not set -# CONFIG_I2C_AMD756 is not set -# CONFIG_I2C_AMD8111 is not set -# CONFIG_I2C_I801 is not set -# CONFIG_I2C_I810 is not set -# CONFIG_I2C_PIIX4 is not set -CONFIG_I2C_MPC=y -# CONFIG_I2C_NFORCE2 is not set -# CONFIG_I2C_OCORES is not set -# CONFIG_I2C_PARPORT_LIGHT is not set -# CONFIG_I2C_PROSAVAGE is not set -# CONFIG_I2C_SAVAGE4 is not set -# CONFIG_I2C_SIMTEC is not set -# CONFIG_I2C_SIS5595 is not set -# CONFIG_I2C_SIS630 is not set -# CONFIG_I2C_SIS96X is not set -# CONFIG_I2C_TAOS_EVM is not set -# CONFIG_I2C_STUB is not set -# CONFIG_I2C_VIA is not set -# CONFIG_I2C_VIAPRO is not set -# CONFIG_I2C_VOODOO3 is not set -# CONFIG_I2C_PCA_PLATFORM is not set - -# -# Miscellaneous I2C Chip support -# -# CONFIG_DS1682 is not set -# CONFIG_SENSORS_EEPROM is not set -# CONFIG_SENSORS_PCF8574 is not set -# CONFIG_PCF8575 is not set -# CONFIG_SENSORS_PCF8591 is not set -# CONFIG_SENSORS_MAX6875 is not set -# CONFIG_SENSORS_TSL2550 is not set -# CONFIG_I2C_DEBUG_CORE is not set -# CONFIG_I2C_DEBUG_ALGO is not set -# CONFIG_I2C_DEBUG_BUS is not set -# CONFIG_I2C_DEBUG_CHIP is not set -# CONFIG_SPI is not set -# CONFIG_W1 is not set -# CONFIG_POWER_SUPPLY is not set -# CONFIG_HWMON is not set -# CONFIG_THERMAL is not set -# CONFIG_WATCHDOG is not set - -# -# Sonics Silicon Backplane -# -CONFIG_SSB_POSSIBLE=y -# CONFIG_SSB is not set - -# -# Multifunction device drivers -# -# CONFIG_MFD_SM501 is not set -# CONFIG_HTC_PASIC3 is not set - -# -# Multimedia devices -# -# CONFIG_VIDEO_DEV is not set -# CONFIG_DVB_CORE is not set -# CONFIG_DAB is not set - -# -# Graphics support -# -# CONFIG_AGP is not set -# CONFIG_DRM is not set -# CONFIG_VGASTATE is not set -CONFIG_VIDEO_OUTPUT_CONTROL=m -# CONFIG_FB is not set -# CONFIG_BACKLIGHT_LCD_SUPPORT is not set - -# -# Display device support -# -# CONFIG_DISPLAY_SUPPORT is not set - -# -# Sound -# -# CONFIG_SOUND is not set -CONFIG_USB_SUPPORT=y -CONFIG_USB_ARCH_HAS_HCD=y -CONFIG_USB_ARCH_HAS_OHCI=y -CONFIG_USB_ARCH_HAS_EHCI=y -# CONFIG_USB is not set -# CONFIG_USB_OTG_WHITELIST is not set -# CONFIG_USB_OTG_BLACKLIST_HUB is not set - -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# -# CONFIG_USB_GADGET is not set -# CONFIG_MMC is not set -# CONFIG_MEMSTICK is not set -# CONFIG_NEW_LEDS is not set -# CONFIG_INFINIBAND is not set -# CONFIG_EDAC is not set -# CONFIG_RTC_CLASS is not set -# CONFIG_DMADEVICES is not set -# CONFIG_UIO is not set - -# -# File systems -# -CONFIG_EXT2_FS=y -# CONFIG_EXT2_FS_XATTR is not set -# CONFIG_EXT2_FS_XIP is not set -CONFIG_EXT3_FS=y -CONFIG_EXT3_FS_XATTR=y -# CONFIG_EXT3_FS_POSIX_ACL is not set -# CONFIG_EXT3_FS_SECURITY is not set -# CONFIG_EXT4DEV_FS is not set -CONFIG_JBD=y -CONFIG_FS_MBCACHE=y -# CONFIG_REISERFS_FS is not set -# CONFIG_JFS_FS is not set -# CONFIG_FS_POSIX_ACL is not set -# CONFIG_XFS_FS is not set -# CONFIG_OCFS2_FS is not set -CONFIG_DNOTIFY=y -CONFIG_INOTIFY=y -CONFIG_INOTIFY_USER=y -# CONFIG_QUOTA is not set -# CONFIG_AUTOFS_FS is not set -# CONFIG_AUTOFS4_FS is not set -# CONFIG_FUSE_FS is not set - -# -# CD-ROM/DVD Filesystems -# -# CONFIG_ISO9660_FS is not set -# CONFIG_UDF_FS is not set - -# -# DOS/FAT/NT Filesystems -# -# CONFIG_MSDOS_FS is not set -# CONFIG_VFAT_FS is not set -# CONFIG_NTFS_FS is not set - -# -# Pseudo filesystems -# -CONFIG_PROC_FS=y -CONFIG_PROC_KCORE=y -CONFIG_PROC_SYSCTL=y -CONFIG_SYSFS=y -CONFIG_TMPFS=y -# CONFIG_TMPFS_POSIX_ACL is not set -# CONFIG_HUGETLB_PAGE is not set -# CONFIG_CONFIGFS_FS is not set - -# -# Miscellaneous filesystems -# -# CONFIG_ADFS_FS is not set -# CONFIG_AFFS_FS is not set -# CONFIG_HFS_FS is not set -# CONFIG_HFSPLUS_FS is not set -# CONFIG_BEFS_FS is not set -# CONFIG_BFS_FS is not set -# CONFIG_EFS_FS is not set -# CONFIG_CRAMFS is not set -# CONFIG_VXFS_FS is not set -# CONFIG_MINIX_FS is not set -# CONFIG_HPFS_FS is not set -# CONFIG_QNX4FS_FS is not set -# CONFIG_ROMFS_FS is not set -# CONFIG_SYSV_FS is not set -# CONFIG_UFS_FS is not set -CONFIG_NETWORK_FILESYSTEMS=y -CONFIG_NFS_FS=y -CONFIG_NFS_V3=y -# CONFIG_NFS_V3_ACL is not set -CONFIG_NFS_V4=y -# CONFIG_NFSD is not set -CONFIG_ROOT_NFS=y -CONFIG_LOCKD=y -CONFIG_LOCKD_V4=y -CONFIG_NFS_COMMON=y -CONFIG_SUNRPC=y -CONFIG_SUNRPC_GSS=y -# CONFIG_SUNRPC_BIND34 is not set -CONFIG_RPCSEC_GSS_KRB5=y -# CONFIG_RPCSEC_GSS_SPKM3 is not set -# CONFIG_SMB_FS is not set -# CONFIG_CIFS is not set -# CONFIG_NCP_FS is not set -# CONFIG_CODA_FS is not set -# CONFIG_AFS_FS is not set - -# -# Partition Types -# -# CONFIG_PARTITION_ADVANCED is not set -CONFIG_MSDOS_PARTITION=y -# CONFIG_NLS is not set -# CONFIG_DLM is not set - -# -# Library routines -# -CONFIG_BITREVERSE=y -# CONFIG_GENERIC_FIND_FIRST_BIT is not set -# CONFIG_CRC_CCITT is not set -# CONFIG_CRC16 is not set -# CONFIG_CRC_ITU_T is not set -CONFIG_CRC32=y -# CONFIG_CRC7 is not set -# CONFIG_LIBCRC32C is not set -CONFIG_PLIST=y -CONFIG_HAS_IOMEM=y -CONFIG_HAS_IOPORT=y -CONFIG_HAS_DMA=y -CONFIG_HAVE_LMB=y - -# -# Kernel hacking -# -CONFIG_PRINTK_TIME=y -CONFIG_ENABLE_WARN_DEPRECATED=y -CONFIG_ENABLE_MUST_CHECK=y -CONFIG_FRAME_WARN=1024 -# CONFIG_MAGIC_SYSRQ is not set -# CONFIG_UNUSED_SYMBOLS is not set -# CONFIG_DEBUG_FS is not set -# CONFIG_HEADERS_CHECK is not set -CONFIG_DEBUG_KERNEL=y -# CONFIG_DEBUG_SHIRQ is not set -CONFIG_DETECT_SOFTLOCKUP=y -CONFIG_SCHED_DEBUG=y -# CONFIG_SCHEDSTATS is not set -# CONFIG_TIMER_STATS is not set -# CONFIG_SLUB_DEBUG_ON is not set -# CONFIG_SLUB_STATS is not set -# CONFIG_DEBUG_RT_MUTEXES is not set -# CONFIG_RT_MUTEX_TESTER is not set -# CONFIG_DEBUG_SPINLOCK is not set -# CONFIG_DEBUG_MUTEXES is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set -# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set -# CONFIG_DEBUG_KOBJECT is not set -# CONFIG_DEBUG_BUGVERBOSE is not set -CONFIG_DEBUG_INFO=y -# CONFIG_DEBUG_VM is not set -# CONFIG_DEBUG_WRITECOUNT is not set -# CONFIG_DEBUG_LIST is not set -# CONFIG_DEBUG_SG is not set -# CONFIG_BOOT_PRINTK_DELAY is not set -# CONFIG_RCU_TORTURE_TEST is not set -# CONFIG_BACKTRACE_SELF_TEST is not set -# CONFIG_FAULT_INJECTION is not set -# CONFIG_SAMPLES is not set -# CONFIG_DEBUG_STACKOVERFLOW is not set -# CONFIG_DEBUG_STACK_USAGE is not set -# CONFIG_DEBUG_PAGEALLOC is not set -# CONFIG_DEBUGGER is not set -# CONFIG_IRQSTACKS is not set -# CONFIG_BDI_SWITCH is not set -# CONFIG_BOOTX_TEXT is not set -# CONFIG_PPC_EARLY_DEBUG is not set - -# -# Security options -# -# CONFIG_KEYS is not set -# CONFIG_SECURITY is not set -# CONFIG_SECURITY_FILE_CAPABILITIES is not set -CONFIG_CRYPTO=y - -# -# Crypto core or helper -# -CONFIG_CRYPTO_ALGAPI=y -CONFIG_CRYPTO_BLKCIPHER=y -CONFIG_CRYPTO_MANAGER=y -# CONFIG_CRYPTO_GF128MUL is not set -# CONFIG_CRYPTO_NULL is not set -# CONFIG_CRYPTO_CRYPTD is not set -# CONFIG_CRYPTO_AUTHENC is not set -# CONFIG_CRYPTO_TEST is not set - -# -# Authenticated Encryption with Associated Data -# -# CONFIG_CRYPTO_CCM is not set -# CONFIG_CRYPTO_GCM is not set -# CONFIG_CRYPTO_SEQIV is not set - -# -# Block modes -# -CONFIG_CRYPTO_CBC=y -# CONFIG_CRYPTO_CTR is not set -# CONFIG_CRYPTO_CTS is not set -# CONFIG_CRYPTO_ECB is not set -# CONFIG_CRYPTO_LRW is not set -# CONFIG_CRYPTO_PCBC is not set -# CONFIG_CRYPTO_XTS is not set - -# -# Hash modes -# -# CONFIG_CRYPTO_HMAC is not set -# CONFIG_CRYPTO_XCBC is not set - -# -# Digest -# -# CONFIG_CRYPTO_CRC32C is not set -# CONFIG_CRYPTO_MD4 is not set -CONFIG_CRYPTO_MD5=y -# CONFIG_CRYPTO_MICHAEL_MIC is not set -# CONFIG_CRYPTO_SHA1 is not set -# CONFIG_CRYPTO_SHA256 is not set -# CONFIG_CRYPTO_SHA512 is not set -# CONFIG_CRYPTO_TGR192 is not set -# CONFIG_CRYPTO_WP512 is not set - -# -# Ciphers -# -# CONFIG_CRYPTO_AES is not set -# CONFIG_CRYPTO_ANUBIS is not set -# CONFIG_CRYPTO_ARC4 is not set -# CONFIG_CRYPTO_BLOWFISH is not set -# CONFIG_CRYPTO_CAMELLIA is not set -# CONFIG_CRYPTO_CAST5 is not set -# CONFIG_CRYPTO_CAST6 is not set -CONFIG_CRYPTO_DES=y -# CONFIG_CRYPTO_FCRYPT is not set -# CONFIG_CRYPTO_KHAZAD is not set -# CONFIG_CRYPTO_SALSA20 is not set -# CONFIG_CRYPTO_SEED is not set -# CONFIG_CRYPTO_SERPENT is not set -# CONFIG_CRYPTO_TEA is not set -# CONFIG_CRYPTO_TWOFISH is not set - -# -# Compression -# -# CONFIG_CRYPTO_DEFLATE is not set -# CONFIG_CRYPTO_LZO is not set -CONFIG_CRYPTO_HW=y -# CONFIG_CRYPTO_DEV_HIFN_795X is not set -CONFIG_PPC_CLOCK=y -CONFIG_PPC_LIB_RHEAP=y -# CONFIG_VIRTUALIZATION is not set diff --git a/trunk/arch/powerpc/configs/52xx/motionpro_defconfig b/trunk/arch/powerpc/configs/52xx/motionpro_defconfig deleted file mode 100644 index 8c7ba7c6ba49..000000000000 --- a/trunk/arch/powerpc/configs/52xx/motionpro_defconfig +++ /dev/null @@ -1,1107 +0,0 @@ -# -# Automatically generated make config: don't edit -# Linux kernel version: 2.6.25 -# Tue Apr 29 07:12:22 2008 -# -# CONFIG_PPC64 is not set - -# -# Processor support -# -CONFIG_6xx=y -# CONFIG_PPC_85xx is not set -# CONFIG_PPC_8xx is not set -# CONFIG_40x is not set -# CONFIG_44x is not set -# CONFIG_E200 is not set -CONFIG_PPC_FPU=y -# CONFIG_ALTIVEC is not set -CONFIG_PPC_STD_MMU=y -CONFIG_PPC_STD_MMU_32=y -# CONFIG_PPC_MM_SLICES is not set -# CONFIG_SMP is not set -CONFIG_PPC32=y -CONFIG_WORD_SIZE=32 -CONFIG_PPC_MERGE=y -CONFIG_MMU=y -CONFIG_GENERIC_CMOS_UPDATE=y -CONFIG_GENERIC_TIME=y -CONFIG_GENERIC_TIME_VSYSCALL=y -CONFIG_GENERIC_CLOCKEVENTS=y -CONFIG_GENERIC_HARDIRQS=y -# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set -CONFIG_IRQ_PER_CPU=y -CONFIG_STACKTRACE_SUPPORT=y -CONFIG_LOCKDEP_SUPPORT=y -CONFIG_RWSEM_XCHGADD_ALGORITHM=y -CONFIG_ARCH_HAS_ILOG2_U32=y -CONFIG_GENERIC_HWEIGHT=y -CONFIG_GENERIC_CALIBRATE_DELAY=y -CONFIG_GENERIC_FIND_NEXT_BIT=y -# CONFIG_ARCH_NO_VIRT_TO_BUS is not set -CONFIG_PPC=y -CONFIG_EARLY_PRINTK=y -CONFIG_GENERIC_NVRAM=y -CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y -CONFIG_ARCH_MAY_HAVE_PC_FDC=y -CONFIG_PPC_OF=y -CONFIG_OF=y -# CONFIG_PPC_UDBG_16550 is not set -# CONFIG_GENERIC_TBSYNC is not set -CONFIG_AUDIT_ARCH=y -CONFIG_GENERIC_BUG=y -CONFIG_DEFAULT_UIMAGE=y -# CONFIG_PPC_DCR_NATIVE is not set -# CONFIG_PPC_DCR_MMIO is not set -CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" - -# -# General setup -# -CONFIG_EXPERIMENTAL=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -CONFIG_SYSVIPC_SYSCTL=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -# CONFIG_TASKSTATS is not set -# CONFIG_AUDIT is not set -# CONFIG_IKCONFIG is not set -CONFIG_LOG_BUF_SHIFT=14 -# CONFIG_CGROUPS is not set -CONFIG_GROUP_SCHED=y -CONFIG_FAIR_GROUP_SCHED=y -# CONFIG_RT_GROUP_SCHED is not set -CONFIG_USER_SCHED=y -# CONFIG_CGROUP_SCHED is not set -CONFIG_SYSFS_DEPRECATED=y -CONFIG_SYSFS_DEPRECATED_V2=y -# CONFIG_RELAY is not set -# CONFIG_NAMESPACES is not set -CONFIG_BLK_DEV_INITRD=y -CONFIG_INITRAMFS_SOURCE="" -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SYSCTL=y -CONFIG_EMBEDDED=y -# CONFIG_SYSCTL_SYSCALL is not set -# CONFIG_KALLSYMS is not set -CONFIG_HOTPLUG=y -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_ELF_CORE=y -CONFIG_COMPAT_BRK=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_ANON_INODES=y -# CONFIG_EPOLL is not set -CONFIG_SIGNALFD=y -CONFIG_TIMERFD=y -CONFIG_EVENTFD=y -CONFIG_SHMEM=y -CONFIG_VM_EVENT_COUNTERS=y -CONFIG_SLUB_DEBUG=y -# CONFIG_SLAB is not set -CONFIG_SLUB=y -# CONFIG_SLOB is not set -# CONFIG_PROFILING is not set -# CONFIG_MARKERS is not set -CONFIG_HAVE_OPROFILE=y -CONFIG_HAVE_KPROBES=y -CONFIG_HAVE_KRETPROBES=y -CONFIG_PROC_PAGE_MONITOR=y -CONFIG_SLABINFO=y -CONFIG_RT_MUTEXES=y -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 -# CONFIG_MODULES is not set -CONFIG_BLOCK=y -# CONFIG_LBD is not set -# CONFIG_BLK_DEV_IO_TRACE is not set -# CONFIG_LSF is not set -# CONFIG_BLK_DEV_BSG is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" -CONFIG_CLASSIC_RCU=y - -# -# Platform support -# -CONFIG_PPC_MULTIPLATFORM=y -# CONFIG_PPC_82xx is not set -# CONFIG_PPC_83xx is not set -# CONFIG_PPC_86xx is not set -CONFIG_CLASSIC32=y -# CONFIG_PPC_CHRP is not set -# CONFIG_PPC_MPC512x is not set -# CONFIG_PPC_MPC5121 is not set -# CONFIG_MPC5121_ADS is not set -CONFIG_PPC_MPC52xx=y -CONFIG_PPC_MPC5200_SIMPLE=y -# CONFIG_PPC_EFIKA is not set -# CONFIG_PPC_LITE5200 is not set -# CONFIG_PPC_MPC5200_BUGFIX is not set -# CONFIG_PPC_MPC5200_GPIO is not set -# CONFIG_PPC_PMAC is not set -# CONFIG_PPC_CELL is not set -# CONFIG_PPC_CELL_NATIVE is not set -# CONFIG_PQ2ADS is not set -# CONFIG_EMBEDDED6xx is not set -# CONFIG_IPIC is not set -# CONFIG_MPIC is not set -# CONFIG_MPIC_WEIRD is not set -# CONFIG_PPC_I8259 is not set -# CONFIG_PPC_RTAS is not set -# CONFIG_MMIO_NVRAM is not set -# CONFIG_PPC_MPC106 is not set -# CONFIG_PPC_970_NAP is not set -# CONFIG_PPC_INDIRECT_IO is not set -# CONFIG_GENERIC_IOMAP is not set -# CONFIG_CPU_FREQ is not set -# CONFIG_TAU is not set -# CONFIG_FSL_ULI1575 is not set -CONFIG_PPC_BESTCOMM=y -# CONFIG_PPC_BESTCOMM_ATA is not set -CONFIG_PPC_BESTCOMM_FEC=y -# CONFIG_PPC_BESTCOMM_GEN_BD is not set - -# -# Kernel options -# -# CONFIG_HIGHMEM is not set -# CONFIG_TICK_ONESHOT is not set -# CONFIG_NO_HZ is not set -# CONFIG_HIGH_RES_TIMERS is not set -CONFIG_GENERIC_CLOCKEVENTS_BUILD=y -# CONFIG_HZ_100 is not set -CONFIG_HZ_250=y -# CONFIG_HZ_300 is not set -# CONFIG_HZ_1000 is not set -CONFIG_HZ=250 -# CONFIG_SCHED_HRTICK is not set -CONFIG_PREEMPT_NONE=y -# CONFIG_PREEMPT_VOLUNTARY is not set -# CONFIG_PREEMPT is not set -CONFIG_BINFMT_ELF=y -# CONFIG_BINFMT_MISC is not set -# CONFIG_IOMMU_HELPER is not set -CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y -CONFIG_ARCH_HAS_WALK_MEMORY=y -CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y -# CONFIG_KEXEC is not set -CONFIG_ARCH_FLATMEM_ENABLE=y -CONFIG_ARCH_POPULATES_NODE_MAP=y -CONFIG_SELECT_MEMORY_MODEL=y -CONFIG_FLATMEM_MANUAL=y -# CONFIG_DISCONTIGMEM_MANUAL is not set -# CONFIG_SPARSEMEM_MANUAL is not set -CONFIG_FLATMEM=y -CONFIG_FLAT_NODE_MEM_MAP=y -# CONFIG_SPARSEMEM_STATIC is not set -# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set -CONFIG_PAGEFLAGS_EXTENDED=y -CONFIG_SPLIT_PTLOCK_CPUS=4 -# CONFIG_RESOURCES_64BIT is not set -CONFIG_ZONE_DMA_FLAG=1 -CONFIG_BOUNCE=y -CONFIG_VIRT_TO_BUS=y -CONFIG_FORCE_MAX_ZONEORDER=11 -CONFIG_PROC_DEVICETREE=y -# CONFIG_CMDLINE_BOOL is not set -CONFIG_PM=y -# CONFIG_PM_LEGACY is not set -# CONFIG_PM_DEBUG is not set -CONFIG_SECCOMP=y -CONFIG_ISA_DMA_API=y - -# -# Bus options -# -CONFIG_ZONE_DMA=y -CONFIG_GENERIC_ISA_DMA=y -CONFIG_FSL_SOC=y -# CONFIG_PCI is not set -# CONFIG_PCI_DOMAINS is not set -# CONFIG_PCI_SYSCALL is not set -# CONFIG_ARCH_SUPPORTS_MSI is not set -# CONFIG_PCCARD is not set -# CONFIG_HAS_RAPIDIO is not set - -# -# Advanced setup -# -# CONFIG_ADVANCED_OPTIONS is not set - -# -# Default settings for advanced configuration options are used -# -CONFIG_LOWMEM_SIZE=0x30000000 -CONFIG_PAGE_OFFSET=0xc0000000 -CONFIG_KERNEL_START=0xc0000000 -CONFIG_PHYSICAL_START=0x00000000 -CONFIG_TASK_SIZE=0xc0000000 - -# -# Networking -# -CONFIG_NET=y - -# -# Networking options -# -CONFIG_PACKET=y -# CONFIG_PACKET_MMAP is not set -CONFIG_UNIX=y -CONFIG_XFRM=y -CONFIG_XFRM_USER=y -# CONFIG_XFRM_SUB_POLICY is not set -# CONFIG_XFRM_MIGRATE is not set -# CONFIG_XFRM_STATISTICS is not set -# CONFIG_NET_KEY is not set -CONFIG_INET=y -CONFIG_IP_MULTICAST=y -# CONFIG_IP_ADVANCED_ROUTER is not set -CONFIG_IP_FIB_HASH=y -CONFIG_IP_PNP=y -CONFIG_IP_PNP_DHCP=y -CONFIG_IP_PNP_BOOTP=y -# CONFIG_IP_PNP_RARP is not set -# CONFIG_NET_IPIP is not set -# CONFIG_NET_IPGRE is not set -# CONFIG_IP_MROUTE is not set -# CONFIG_ARPD is not set -CONFIG_SYN_COOKIES=y -# CONFIG_INET_AH is not set -# CONFIG_INET_ESP is not set -# CONFIG_INET_IPCOMP is not set -# CONFIG_INET_XFRM_TUNNEL is not set -# CONFIG_INET_TUNNEL is not set -CONFIG_INET_XFRM_MODE_TRANSPORT=y -CONFIG_INET_XFRM_MODE_TUNNEL=y -CONFIG_INET_XFRM_MODE_BEET=y -# CONFIG_INET_LRO is not set -CONFIG_INET_DIAG=y -CONFIG_INET_TCP_DIAG=y -# CONFIG_TCP_CONG_ADVANCED is not set -CONFIG_TCP_CONG_CUBIC=y -CONFIG_DEFAULT_TCP_CONG="cubic" -# CONFIG_TCP_MD5SIG is not set -# CONFIG_IPV6 is not set -# CONFIG_NETWORK_SECMARK is not set -# CONFIG_NETFILTER is not set -# CONFIG_IP_DCCP is not set -# CONFIG_IP_SCTP is not set -# CONFIG_TIPC is not set -# CONFIG_ATM is not set -# CONFIG_BRIDGE is not set -# CONFIG_VLAN_8021Q is not set -# CONFIG_DECNET is not set -# CONFIG_LLC2 is not set -# CONFIG_IPX is not set -# CONFIG_ATALK is not set -# CONFIG_X25 is not set -# CONFIG_LAPB is not set -# CONFIG_ECONET is not set -# CONFIG_WAN_ROUTER is not set -# CONFIG_NET_SCHED is not set - -# -# Network testing -# -# CONFIG_NET_PKTGEN is not set -# CONFIG_HAMRADIO is not set -# CONFIG_CAN is not set -# CONFIG_IRDA is not set -# CONFIG_BT is not set -# CONFIG_AF_RXRPC is not set - -# -# Wireless -# -# CONFIG_CFG80211 is not set -# CONFIG_WIRELESS_EXT is not set -# CONFIG_MAC80211 is not set -# CONFIG_IEEE80211 is not set -# CONFIG_RFKILL is not set -# CONFIG_NET_9P is not set - -# -# Device Drivers -# - -# -# Generic Driver Options -# -CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" -CONFIG_STANDALONE=y -CONFIG_PREVENT_FIRMWARE_BUILD=y -# CONFIG_FW_LOADER is not set -# CONFIG_DEBUG_DRIVER is not set -# CONFIG_DEBUG_DEVRES is not set -# CONFIG_SYS_HYPERVISOR is not set -# CONFIG_CONNECTOR is not set -CONFIG_MTD=y -# CONFIG_MTD_DEBUG is not set -CONFIG_MTD_CONCAT=y -CONFIG_MTD_PARTITIONS=y -# CONFIG_MTD_REDBOOT_PARTS is not set -CONFIG_MTD_CMDLINE_PARTS=y -# CONFIG_MTD_OF_PARTS is not set -# CONFIG_MTD_AR7_PARTS is not set - -# -# User Modules And Translation Layers -# -CONFIG_MTD_CHAR=y -CONFIG_MTD_BLKDEVS=y -CONFIG_MTD_BLOCK=y -# CONFIG_FTL is not set -# CONFIG_NFTL is not set -# CONFIG_INFTL is not set -# CONFIG_RFD_FTL is not set -# CONFIG_SSFDC is not set -# CONFIG_MTD_OOPS is not set - -# -# RAM/ROM/Flash chip drivers -# -CONFIG_MTD_CFI=y -# CONFIG_MTD_JEDECPROBE is not set -CONFIG_MTD_GEN_PROBE=y -# CONFIG_MTD_CFI_ADV_OPTIONS is not set -CONFIG_MTD_MAP_BANK_WIDTH_1=y -CONFIG_MTD_MAP_BANK_WIDTH_2=y -CONFIG_MTD_MAP_BANK_WIDTH_4=y -# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set -# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set -# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set -CONFIG_MTD_CFI_I1=y -CONFIG_MTD_CFI_I2=y -# CONFIG_MTD_CFI_I4 is not set -# CONFIG_MTD_CFI_I8 is not set -# CONFIG_MTD_CFI_INTELEXT is not set -CONFIG_MTD_CFI_AMDSTD=y -# CONFIG_MTD_CFI_STAA is not set -CONFIG_MTD_CFI_UTIL=y -# CONFIG_MTD_RAM is not set -CONFIG_MTD_ROM=y -# CONFIG_MTD_ABSENT is not set - -# -# Mapping drivers for chip access -# -# CONFIG_MTD_COMPLEX_MAPPINGS is not set -# CONFIG_MTD_PHYSMAP is not set -# CONFIG_MTD_PHYSMAP_OF is not set -# CONFIG_MTD_PLATRAM is not set - -# -# Self-contained MTD device drivers -# -# CONFIG_MTD_SLRAM is not set -# CONFIG_MTD_PHRAM is not set -# CONFIG_MTD_MTDRAM is not set -# CONFIG_MTD_BLOCK2MTD is not set - -# -# Disk-On-Chip Device Drivers -# -# CONFIG_MTD_DOC2000 is not set -# CONFIG_MTD_DOC2001 is not set -# CONFIG_MTD_DOC2001PLUS is not set -# CONFIG_MTD_NAND is not set -# CONFIG_MTD_ONENAND is not set - -# -# UBI - Unsorted block images -# -# CONFIG_MTD_UBI is not set -CONFIG_OF_DEVICE=y -CONFIG_OF_I2C=y -# CONFIG_PARPORT is not set -CONFIG_BLK_DEV=y -# CONFIG_BLK_DEV_FD is not set -# CONFIG_BLK_DEV_COW_COMMON is not set -CONFIG_BLK_DEV_LOOP=y -# CONFIG_BLK_DEV_CRYPTOLOOP is not set -# CONFIG_BLK_DEV_NBD is not set -CONFIG_BLK_DEV_RAM=y -CONFIG_BLK_DEV_RAM_COUNT=16 -CONFIG_BLK_DEV_RAM_SIZE=32768 -# CONFIG_BLK_DEV_XIP is not set -# CONFIG_CDROM_PKTCDVD is not set -# CONFIG_ATA_OVER_ETH is not set -CONFIG_MISC_DEVICES=y -# CONFIG_EEPROM_93CX6 is not set -# CONFIG_ENCLOSURE_SERVICES is not set -CONFIG_HAVE_IDE=y -# CONFIG_IDE is not set - -# -# SCSI device support -# -# CONFIG_RAID_ATTRS is not set -CONFIG_SCSI=y -CONFIG_SCSI_DMA=y -CONFIG_SCSI_TGT=y -# CONFIG_SCSI_NETLINK is not set -CONFIG_SCSI_PROC_FS=y - -# -# SCSI support type (disk, tape, CD-ROM) -# -CONFIG_BLK_DEV_SD=y -# CONFIG_CHR_DEV_ST is not set -# CONFIG_CHR_DEV_OSST is not set -# CONFIG_BLK_DEV_SR is not set -CONFIG_CHR_DEV_SG=y -# CONFIG_CHR_DEV_SCH is not set - -# -# Some SCSI devices (e.g. CD jukebox) support multiple LUNs -# -# CONFIG_SCSI_MULTI_LUN is not set -# CONFIG_SCSI_CONSTANTS is not set -# CONFIG_SCSI_LOGGING is not set -# CONFIG_SCSI_SCAN_ASYNC is not set - -# -# SCSI Transports -# -# CONFIG_SCSI_SPI_ATTRS is not set -# CONFIG_SCSI_FC_ATTRS is not set -# CONFIG_SCSI_ISCSI_ATTRS is not set -# CONFIG_SCSI_SAS_LIBSAS is not set -# CONFIG_SCSI_SRP_ATTRS is not set -CONFIG_SCSI_LOWLEVEL=y -# CONFIG_ISCSI_TCP is not set -# CONFIG_SCSI_DEBUG is not set -CONFIG_ATA=y -# CONFIG_ATA_NONSTANDARD is not set -CONFIG_SATA_PMP=y -# CONFIG_SATA_FSL is not set -CONFIG_ATA_SFF=y -# CONFIG_SATA_MV is not set -CONFIG_PATA_MPC52xx=y -# CONFIG_PATA_PLATFORM is not set -# CONFIG_MD is not set -# CONFIG_MACINTOSH_DRIVERS is not set -CONFIG_NETDEVICES=y -# CONFIG_NETDEVICES_MULTIQUEUE is not set -# CONFIG_DUMMY is not set -# CONFIG_BONDING is not set -# CONFIG_MACVLAN is not set -# CONFIG_EQUALIZER is not set -# CONFIG_TUN is not set -# CONFIG_VETH is not set -CONFIG_PHYLIB=y - -# -# MII PHY device drivers -# -CONFIG_MARVELL_PHY=y -CONFIG_DAVICOM_PHY=y -CONFIG_QSEMI_PHY=y -CONFIG_LXT_PHY=y -CONFIG_CICADA_PHY=y -CONFIG_VITESSE_PHY=y -CONFIG_SMSC_PHY=y -CONFIG_BROADCOM_PHY=y -CONFIG_ICPLUS_PHY=y -# CONFIG_REALTEK_PHY is not set -# CONFIG_FIXED_PHY is not set -CONFIG_MDIO_BITBANG=y -CONFIG_NET_ETHERNET=y -CONFIG_MII=y -# CONFIG_IBM_NEW_EMAC_ZMII is not set -# CONFIG_IBM_NEW_EMAC_RGMII is not set -# CONFIG_IBM_NEW_EMAC_TAH is not set -# CONFIG_IBM_NEW_EMAC_EMAC4 is not set -# CONFIG_B44 is not set -CONFIG_FEC_MPC52xx=y -CONFIG_FEC_MPC52xx_MDIO=y -# CONFIG_NETDEV_1000 is not set -# CONFIG_NETDEV_10000 is not set - -# -# Wireless LAN -# -# CONFIG_WLAN_PRE80211 is not set -# CONFIG_WLAN_80211 is not set -# CONFIG_IWLWIFI is not set -# CONFIG_IWLWIFI_LEDS is not set -# CONFIG_WAN is not set -# CONFIG_PPP is not set -# CONFIG_SLIP is not set -# CONFIG_NETCONSOLE is not set -# CONFIG_NETPOLL is not set -# CONFIG_NET_POLL_CONTROLLER is not set -# CONFIG_ISDN is not set -# CONFIG_PHONE is not set - -# -# Input device support -# -# CONFIG_INPUT is not set - -# -# Hardware I/O ports -# -# CONFIG_SERIO is not set -# CONFIG_GAMEPORT is not set - -# -# Character devices -# -# CONFIG_VT is not set -# CONFIG_SERIAL_NONSTANDARD is not set - -# -# Serial drivers -# -# CONFIG_SERIAL_8250 is not set - -# -# Non-8250 serial port support -# -# CONFIG_SERIAL_UARTLITE is not set -CONFIG_SERIAL_CORE=y -CONFIG_SERIAL_CORE_CONSOLE=y -CONFIG_SERIAL_MPC52xx=y -CONFIG_SERIAL_MPC52xx_CONSOLE=y -CONFIG_SERIAL_MPC52xx_CONSOLE_BAUD=115200 -CONFIG_UNIX98_PTYS=y -CONFIG_LEGACY_PTYS=y -CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_IPMI_HANDLER is not set -# CONFIG_HW_RANDOM is not set -# CONFIG_NVRAM is not set -# CONFIG_R3964 is not set -# CONFIG_RAW_DRIVER is not set -# CONFIG_TCG_TPM is not set -CONFIG_I2C=y -CONFIG_I2C_BOARDINFO=y -CONFIG_I2C_CHARDEV=y - -# -# I2C Hardware Bus support -# -CONFIG_I2C_MPC=y -# CONFIG_I2C_OCORES is not set -# CONFIG_I2C_PARPORT_LIGHT is not set -# CONFIG_I2C_SIMTEC is not set -# CONFIG_I2C_TAOS_EVM is not set -# CONFIG_I2C_PCA_PLATFORM is not set - -# -# Miscellaneous I2C Chip support -# -# CONFIG_DS1682 is not set -CONFIG_SENSORS_EEPROM=y -# CONFIG_SENSORS_PCF8574 is not set -# CONFIG_PCF8575 is not set -# CONFIG_SENSORS_PCF8591 is not set -# CONFIG_SENSORS_MAX6875 is not set -# CONFIG_SENSORS_TSL2550 is not set -# CONFIG_I2C_DEBUG_CORE is not set -# CONFIG_I2C_DEBUG_ALGO is not set -# CONFIG_I2C_DEBUG_BUS is not set -# CONFIG_I2C_DEBUG_CHIP is not set -# CONFIG_SPI is not set -# CONFIG_W1 is not set -# CONFIG_POWER_SUPPLY is not set -CONFIG_HWMON=y -# CONFIG_HWMON_VID is not set -# CONFIG_SENSORS_AD7418 is not set -# CONFIG_SENSORS_ADM1021 is not set -# CONFIG_SENSORS_ADM1025 is not set -# CONFIG_SENSORS_ADM1026 is not set -# CONFIG_SENSORS_ADM1029 is not set -# CONFIG_SENSORS_ADM1031 is not set -# CONFIG_SENSORS_ADM9240 is not set -# CONFIG_SENSORS_ADT7470 is not set -# CONFIG_SENSORS_ADT7473 is not set -# CONFIG_SENSORS_ATXP1 is not set -# CONFIG_SENSORS_DS1621 is not set -# CONFIG_SENSORS_F71805F is not set -# CONFIG_SENSORS_F71882FG is not set -# CONFIG_SENSORS_F75375S is not set -# CONFIG_SENSORS_GL518SM is not set -# CONFIG_SENSORS_GL520SM is not set -# CONFIG_SENSORS_IT87 is not set -# CONFIG_SENSORS_LM63 is not set -# CONFIG_SENSORS_LM75 is not set -# CONFIG_SENSORS_LM77 is not set -# CONFIG_SENSORS_LM78 is not set -# CONFIG_SENSORS_LM80 is not set -# CONFIG_SENSORS_LM83 is not set -# CONFIG_SENSORS_LM85 is not set -# CONFIG_SENSORS_LM87 is not set -# CONFIG_SENSORS_LM90 is not set -# CONFIG_SENSORS_LM92 is not set -# CONFIG_SENSORS_LM93 is not set -# CONFIG_SENSORS_MAX1619 is not set -# CONFIG_SENSORS_MAX6650 is not set -# CONFIG_SENSORS_PC87360 is not set -# CONFIG_SENSORS_PC87427 is not set -# CONFIG_SENSORS_DME1737 is not set -# CONFIG_SENSORS_SMSC47M1 is not set -# CONFIG_SENSORS_SMSC47M192 is not set -# CONFIG_SENSORS_SMSC47B397 is not set -# CONFIG_SENSORS_ADS7828 is not set -# CONFIG_SENSORS_THMC50 is not set -# CONFIG_SENSORS_VT1211 is not set -# CONFIG_SENSORS_W83781D is not set -# CONFIG_SENSORS_W83791D is not set -# CONFIG_SENSORS_W83792D is not set -# CONFIG_SENSORS_W83793 is not set -# CONFIG_SENSORS_W83L785TS is not set -# CONFIG_SENSORS_W83L786NG is not set -# CONFIG_SENSORS_W83627HF is not set -# CONFIG_SENSORS_W83627EHF is not set -# CONFIG_HWMON_DEBUG_CHIP is not set -# CONFIG_THERMAL is not set -CONFIG_WATCHDOG=y -# CONFIG_WATCHDOG_NOWAYOUT is not set - -# -# Watchdog Device Drivers -# -# CONFIG_SOFT_WATCHDOG is not set -# CONFIG_MPC5200_WDT is not set - -# -# Sonics Silicon Backplane -# -CONFIG_SSB_POSSIBLE=y -# CONFIG_SSB is not set - -# -# Multifunction device drivers -# -# CONFIG_MFD_SM501 is not set -# CONFIG_HTC_PASIC3 is not set - -# -# Multimedia devices -# -# CONFIG_VIDEO_DEV is not set -# CONFIG_DVB_CORE is not set -CONFIG_DAB=y - -# -# Graphics support -# -# CONFIG_VGASTATE is not set -# CONFIG_VIDEO_OUTPUT_CONTROL is not set -# CONFIG_FB is not set -# CONFIG_BACKLIGHT_LCD_SUPPORT is not set - -# -# Display device support -# -# CONFIG_DISPLAY_SUPPORT is not set - -# -# Sound -# -# CONFIG_SOUND is not set -# CONFIG_USB_SUPPORT is not set -# CONFIG_MMC is not set -# CONFIG_MEMSTICK is not set -CONFIG_NEW_LEDS=y -CONFIG_LEDS_CLASS=y - -# -# LED drivers -# - -# -# LED Triggers -# -CONFIG_LEDS_TRIGGERS=y -CONFIG_LEDS_TRIGGER_TIMER=y -# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set -# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set -# CONFIG_EDAC is not set -CONFIG_RTC_LIB=y -CONFIG_RTC_CLASS=y -CONFIG_RTC_HCTOSYS=y -CONFIG_RTC_HCTOSYS_DEVICE="rtc0" -# CONFIG_RTC_DEBUG is not set - -# -# RTC interfaces -# -CONFIG_RTC_INTF_SYSFS=y -CONFIG_RTC_INTF_PROC=y -CONFIG_RTC_INTF_DEV=y -# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set -# CONFIG_RTC_DRV_TEST is not set - -# -# I2C RTC drivers -# -CONFIG_RTC_DRV_DS1307=y -# CONFIG_RTC_DRV_DS1374 is not set -# CONFIG_RTC_DRV_DS1672 is not set -# CONFIG_RTC_DRV_MAX6900 is not set -# CONFIG_RTC_DRV_RS5C372 is not set -# CONFIG_RTC_DRV_ISL1208 is not set -# CONFIG_RTC_DRV_X1205 is not set -# CONFIG_RTC_DRV_PCF8563 is not set -# CONFIG_RTC_DRV_PCF8583 is not set -# CONFIG_RTC_DRV_M41T80 is not set -# CONFIG_RTC_DRV_S35390A is not set - -# -# SPI RTC drivers -# - -# -# Platform RTC drivers -# -# CONFIG_RTC_DRV_CMOS is not set -# CONFIG_RTC_DRV_DS1511 is not set -# CONFIG_RTC_DRV_DS1553 is not set -# CONFIG_RTC_DRV_DS1742 is not set -# CONFIG_RTC_DRV_STK17TA8 is not set -# CONFIG_RTC_DRV_M48T86 is not set -# CONFIG_RTC_DRV_M48T59 is not set -# CONFIG_RTC_DRV_V3020 is not set - -# -# on-CPU RTC drivers -# -# CONFIG_DMADEVICES is not set -# CONFIG_UIO is not set - -# -# File systems -# -CONFIG_EXT2_FS=y -# CONFIG_EXT2_FS_XATTR is not set -# CONFIG_EXT2_FS_XIP is not set -CONFIG_EXT3_FS=y -CONFIG_EXT3_FS_XATTR=y -# CONFIG_EXT3_FS_POSIX_ACL is not set -# CONFIG_EXT3_FS_SECURITY is not set -# CONFIG_EXT4DEV_FS is not set -CONFIG_JBD=y -CONFIG_FS_MBCACHE=y -# CONFIG_REISERFS_FS is not set -# CONFIG_JFS_FS is not set -# CONFIG_FS_POSIX_ACL is not set -# CONFIG_XFS_FS is not set -# CONFIG_OCFS2_FS is not set -CONFIG_DNOTIFY=y -CONFIG_INOTIFY=y -CONFIG_INOTIFY_USER=y -# CONFIG_QUOTA is not set -# CONFIG_AUTOFS_FS is not set -# CONFIG_AUTOFS4_FS is not set -# CONFIG_FUSE_FS is not set - -# -# CD-ROM/DVD Filesystems -# -# CONFIG_ISO9660_FS is not set -# CONFIG_UDF_FS is not set - -# -# DOS/FAT/NT Filesystems -# -CONFIG_FAT_FS=y -CONFIG_MSDOS_FS=y -CONFIG_VFAT_FS=y -CONFIG_FAT_DEFAULT_CODEPAGE=437 -CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" -# CONFIG_NTFS_FS is not set - -# -# Pseudo filesystems -# -CONFIG_PROC_FS=y -CONFIG_PROC_KCORE=y -CONFIG_PROC_SYSCTL=y -CONFIG_SYSFS=y -CONFIG_TMPFS=y -# CONFIG_TMPFS_POSIX_ACL is not set -# CONFIG_HUGETLB_PAGE is not set -# CONFIG_CONFIGFS_FS is not set - -# -# Miscellaneous filesystems -# -# CONFIG_ADFS_FS is not set -# CONFIG_AFFS_FS is not set -# CONFIG_HFS_FS is not set -# CONFIG_HFSPLUS_FS is not set -# CONFIG_BEFS_FS is not set -# CONFIG_BFS_FS is not set -# CONFIG_EFS_FS is not set -CONFIG_JFFS2_FS=y -CONFIG_JFFS2_FS_DEBUG=0 -CONFIG_JFFS2_FS_WRITEBUFFER=y -# CONFIG_JFFS2_FS_WBUF_VERIFY is not set -# CONFIG_JFFS2_SUMMARY is not set -# CONFIG_JFFS2_FS_XATTR is not set -# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set -CONFIG_JFFS2_ZLIB=y -# CONFIG_JFFS2_LZO is not set -CONFIG_JFFS2_RTIME=y -# CONFIG_JFFS2_RUBIN is not set -CONFIG_CRAMFS=y -# CONFIG_VXFS_FS is not set -# CONFIG_MINIX_FS is not set -# CONFIG_HPFS_FS is not set -# CONFIG_QNX4FS_FS is not set -# CONFIG_ROMFS_FS is not set -# CONFIG_SYSV_FS is not set -# CONFIG_UFS_FS is not set -CONFIG_NETWORK_FILESYSTEMS=y -CONFIG_NFS_FS=y -CONFIG_NFS_V3=y -# CONFIG_NFS_V3_ACL is not set -CONFIG_NFS_V4=y -# CONFIG_NFSD is not set -CONFIG_ROOT_NFS=y -CONFIG_LOCKD=y -CONFIG_LOCKD_V4=y -CONFIG_NFS_COMMON=y -CONFIG_SUNRPC=y -CONFIG_SUNRPC_GSS=y -# CONFIG_SUNRPC_BIND34 is not set -CONFIG_RPCSEC_GSS_KRB5=y -# CONFIG_RPCSEC_GSS_SPKM3 is not set -# CONFIG_SMB_FS is not set -# CONFIG_CIFS is not set -# CONFIG_NCP_FS is not set -# CONFIG_CODA_FS is not set -# CONFIG_AFS_FS is not set - -# -# Partition Types -# -CONFIG_PARTITION_ADVANCED=y -# CONFIG_ACORN_PARTITION is not set -# CONFIG_OSF_PARTITION is not set -# CONFIG_AMIGA_PARTITION is not set -# CONFIG_ATARI_PARTITION is not set -# CONFIG_MAC_PARTITION is not set -CONFIG_MSDOS_PARTITION=y -# CONFIG_BSD_DISKLABEL is not set -# CONFIG_MINIX_SUBPARTITION is not set -# CONFIG_SOLARIS_X86_PARTITION is not set -# CONFIG_UNIXWARE_DISKLABEL is not set -# CONFIG_LDM_PARTITION is not set -# CONFIG_SGI_PARTITION is not set -# CONFIG_ULTRIX_PARTITION is not set -# CONFIG_SUN_PARTITION is not set -# CONFIG_KARMA_PARTITION is not set -# CONFIG_EFI_PARTITION is not set -# CONFIG_SYSV68_PARTITION is not set -CONFIG_NLS=y -CONFIG_NLS_DEFAULT="iso8859-1" -CONFIG_NLS_CODEPAGE_437=y -# CONFIG_NLS_CODEPAGE_737 is not set -# CONFIG_NLS_CODEPAGE_775 is not set -# CONFIG_NLS_CODEPAGE_850 is not set -# CONFIG_NLS_CODEPAGE_852 is not set -# CONFIG_NLS_CODEPAGE_855 is not set -# CONFIG_NLS_CODEPAGE_857 is not set -# CONFIG_NLS_CODEPAGE_860 is not set -# CONFIG_NLS_CODEPAGE_861 is not set -# CONFIG_NLS_CODEPAGE_862 is not set -# CONFIG_NLS_CODEPAGE_863 is not set -# CONFIG_NLS_CODEPAGE_864 is not set -# CONFIG_NLS_CODEPAGE_865 is not set -# CONFIG_NLS_CODEPAGE_866 is not set -# CONFIG_NLS_CODEPAGE_869 is not set -# CONFIG_NLS_CODEPAGE_936 is not set -# CONFIG_NLS_CODEPAGE_950 is not set -# CONFIG_NLS_CODEPAGE_932 is not set -# CONFIG_NLS_CODEPAGE_949 is not set -# CONFIG_NLS_CODEPAGE_874 is not set -# CONFIG_NLS_ISO8859_8 is not set -# CONFIG_NLS_CODEPAGE_1250 is not set -# CONFIG_NLS_CODEPAGE_1251 is not set -# CONFIG_NLS_ASCII is not set -CONFIG_NLS_ISO8859_1=y -# CONFIG_NLS_ISO8859_2 is not set -# CONFIG_NLS_ISO8859_3 is not set -# CONFIG_NLS_ISO8859_4 is not set -# CONFIG_NLS_ISO8859_5 is not set -# CONFIG_NLS_ISO8859_6 is not set -# CONFIG_NLS_ISO8859_7 is not set -# CONFIG_NLS_ISO8859_9 is not set -# CONFIG_NLS_ISO8859_13 is not set -# CONFIG_NLS_ISO8859_14 is not set -# CONFIG_NLS_ISO8859_15 is not set -# CONFIG_NLS_KOI8_R is not set -# CONFIG_NLS_KOI8_U is not set -# CONFIG_NLS_UTF8 is not set -# CONFIG_DLM is not set - -# -# Library routines -# -CONFIG_BITREVERSE=y -# CONFIG_GENERIC_FIND_FIRST_BIT is not set -# CONFIG_CRC_CCITT is not set -# CONFIG_CRC16 is not set -# CONFIG_CRC_ITU_T is not set -CONFIG_CRC32=y -# CONFIG_CRC7 is not set -# CONFIG_LIBCRC32C is not set -CONFIG_ZLIB_INFLATE=y -CONFIG_ZLIB_DEFLATE=y -CONFIG_PLIST=y -CONFIG_HAS_IOMEM=y -CONFIG_HAS_IOPORT=y -CONFIG_HAS_DMA=y -CONFIG_HAVE_LMB=y - -# -# Kernel hacking -# -CONFIG_PRINTK_TIME=y -CONFIG_ENABLE_WARN_DEPRECATED=y -CONFIG_ENABLE_MUST_CHECK=y -CONFIG_FRAME_WARN=1024 -# CONFIG_MAGIC_SYSRQ is not set -# CONFIG_UNUSED_SYMBOLS is not set -# CONFIG_DEBUG_FS is not set -# CONFIG_HEADERS_CHECK is not set -CONFIG_DEBUG_KERNEL=y -# CONFIG_DEBUG_SHIRQ is not set -CONFIG_DETECT_SOFTLOCKUP=y -CONFIG_SCHED_DEBUG=y -# CONFIG_SCHEDSTATS is not set -# CONFIG_TIMER_STATS is not set -# CONFIG_SLUB_DEBUG_ON is not set -# CONFIG_SLUB_STATS is not set -# CONFIG_DEBUG_RT_MUTEXES is not set -# CONFIG_RT_MUTEX_TESTER is not set -# CONFIG_DEBUG_SPINLOCK is not set -# CONFIG_DEBUG_MUTEXES is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set -# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set -# CONFIG_DEBUG_KOBJECT is not set -# CONFIG_DEBUG_BUGVERBOSE is not set -CONFIG_DEBUG_INFO=y -# CONFIG_DEBUG_VM is not set -# CONFIG_DEBUG_WRITECOUNT is not set -# CONFIG_DEBUG_LIST is not set -# CONFIG_DEBUG_SG is not set -# CONFIG_BOOT_PRINTK_DELAY is not set -# CONFIG_BACKTRACE_SELF_TEST is not set -# CONFIG_FAULT_INJECTION is not set -# CONFIG_SAMPLES is not set -# CONFIG_DEBUG_STACKOVERFLOW is not set -# CONFIG_DEBUG_STACK_USAGE is not set -# CONFIG_DEBUG_PAGEALLOC is not set -# CONFIG_DEBUGGER is not set -# CONFIG_IRQSTACKS is not set -# CONFIG_BDI_SWITCH is not set -# CONFIG_BOOTX_TEXT is not set -# CONFIG_PPC_EARLY_DEBUG is not set - -# -# Security options -# -# CONFIG_KEYS is not set -# CONFIG_SECURITY is not set -# CONFIG_SECURITY_FILE_CAPABILITIES is not set -CONFIG_CRYPTO=y - -# -# Crypto core or helper -# -CONFIG_CRYPTO_ALGAPI=y -CONFIG_CRYPTO_BLKCIPHER=y -CONFIG_CRYPTO_MANAGER=y -# CONFIG_CRYPTO_GF128MUL is not set -# CONFIG_CRYPTO_NULL is not set -# CONFIG_CRYPTO_CRYPTD is not set -# CONFIG_CRYPTO_AUTHENC is not set - -# -# Authenticated Encryption with Associated Data -# -# CONFIG_CRYPTO_CCM is not set -# CONFIG_CRYPTO_GCM is not set -# CONFIG_CRYPTO_SEQIV is not set - -# -# Block modes -# -CONFIG_CRYPTO_CBC=y -# CONFIG_CRYPTO_CTR is not set -# CONFIG_CRYPTO_CTS is not set -CONFIG_CRYPTO_ECB=y -# CONFIG_CRYPTO_LRW is not set -CONFIG_CRYPTO_PCBC=y -# CONFIG_CRYPTO_XTS is not set - -# -# Hash modes -# -# CONFIG_CRYPTO_HMAC is not set -# CONFIG_CRYPTO_XCBC is not set - -# -# Digest -# -# CONFIG_CRYPTO_CRC32C is not set -# CONFIG_CRYPTO_MD4 is not set -CONFIG_CRYPTO_MD5=y -# CONFIG_CRYPTO_MICHAEL_MIC is not set -# CONFIG_CRYPTO_SHA1 is not set -# CONFIG_CRYPTO_SHA256 is not set -# CONFIG_CRYPTO_SHA512 is not set -# CONFIG_CRYPTO_TGR192 is not set -# CONFIG_CRYPTO_WP512 is not set - -# -# Ciphers -# -# CONFIG_CRYPTO_AES is not set -# CONFIG_CRYPTO_ANUBIS is not set -# CONFIG_CRYPTO_ARC4 is not set -# CONFIG_CRYPTO_BLOWFISH is not set -# CONFIG_CRYPTO_CAMELLIA is not set -# CONFIG_CRYPTO_CAST5 is not set -# CONFIG_CRYPTO_CAST6 is not set -CONFIG_CRYPTO_DES=y -# CONFIG_CRYPTO_FCRYPT is not set -# CONFIG_CRYPTO_KHAZAD is not set -# CONFIG_CRYPTO_SALSA20 is not set -# CONFIG_CRYPTO_SEED is not set -# CONFIG_CRYPTO_SERPENT is not set -# CONFIG_CRYPTO_TEA is not set -# CONFIG_CRYPTO_TWOFISH is not set - -# -# Compression -# -# CONFIG_CRYPTO_DEFLATE is not set -# CONFIG_CRYPTO_LZO is not set -CONFIG_CRYPTO_HW=y -CONFIG_PPC_CLOCK=y -CONFIG_PPC_LIB_RHEAP=y -# CONFIG_VIRTUALIZATION is not set diff --git a/trunk/arch/powerpc/configs/52xx/pcm030_defconfig b/trunk/arch/powerpc/configs/52xx/pcm030_defconfig deleted file mode 100644 index 9c0caa488b2e..000000000000 --- a/trunk/arch/powerpc/configs/52xx/pcm030_defconfig +++ /dev/null @@ -1,1115 +0,0 @@ -# -# Automatically generated make config: don't edit -# Linux kernel version: 2.6.25 -# Tue Apr 29 07:13:19 2008 -# -# CONFIG_PPC64 is not set - -# -# Processor support -# -CONFIG_6xx=y -# CONFIG_PPC_85xx is not set -# CONFIG_PPC_8xx is not set -# CONFIG_40x is not set -# CONFIG_44x is not set -# CONFIG_E200 is not set -CONFIG_PPC_FPU=y -# CONFIG_ALTIVEC is not set -CONFIG_PPC_STD_MMU=y -CONFIG_PPC_STD_MMU_32=y -# CONFIG_PPC_MM_SLICES is not set -# CONFIG_SMP is not set -CONFIG_PPC32=y -CONFIG_WORD_SIZE=32 -CONFIG_PPC_MERGE=y -CONFIG_MMU=y -CONFIG_GENERIC_CMOS_UPDATE=y -CONFIG_GENERIC_TIME=y -CONFIG_GENERIC_TIME_VSYSCALL=y -CONFIG_GENERIC_CLOCKEVENTS=y -CONFIG_GENERIC_HARDIRQS=y -# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set -CONFIG_IRQ_PER_CPU=y -CONFIG_STACKTRACE_SUPPORT=y -CONFIG_LOCKDEP_SUPPORT=y -CONFIG_RWSEM_XCHGADD_ALGORITHM=y -CONFIG_ARCH_HAS_ILOG2_U32=y -CONFIG_GENERIC_HWEIGHT=y -CONFIG_GENERIC_CALIBRATE_DELAY=y -CONFIG_GENERIC_FIND_NEXT_BIT=y -# CONFIG_ARCH_NO_VIRT_TO_BUS is not set -CONFIG_PPC=y -CONFIG_EARLY_PRINTK=y -CONFIG_GENERIC_NVRAM=y -CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y -CONFIG_ARCH_MAY_HAVE_PC_FDC=y -CONFIG_PPC_OF=y -CONFIG_OF=y -# CONFIG_PPC_UDBG_16550 is not set -# CONFIG_GENERIC_TBSYNC is not set -CONFIG_AUDIT_ARCH=y -CONFIG_GENERIC_BUG=y -CONFIG_DEFAULT_UIMAGE=y -# CONFIG_PPC_DCR_NATIVE is not set -# CONFIG_PPC_DCR_MMIO is not set -CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" - -# -# General setup -# -CONFIG_EXPERIMENTAL=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_LOCK_KERNEL=y -CONFIG_INIT_ENV_ARG_LIMIT=32 -CONFIG_LOCALVERSION="trunk" -# CONFIG_LOCALVERSION_AUTO is not set -# CONFIG_SWAP is not set -CONFIG_SYSVIPC=y -CONFIG_SYSVIPC_SYSCTL=y -CONFIG_POSIX_MQUEUE=y -# CONFIG_BSD_PROCESS_ACCT is not set -# CONFIG_TASKSTATS is not set -# CONFIG_AUDIT is not set -CONFIG_IKCONFIG=y -CONFIG_IKCONFIG_PROC=y -CONFIG_LOG_BUF_SHIFT=14 -# CONFIG_CGROUPS is not set -CONFIG_GROUP_SCHED=y -CONFIG_FAIR_GROUP_SCHED=y -# CONFIG_RT_GROUP_SCHED is not set -CONFIG_USER_SCHED=y -# CONFIG_CGROUP_SCHED is not set -CONFIG_SYSFS_DEPRECATED=y -CONFIG_SYSFS_DEPRECATED_V2=y -# CONFIG_RELAY is not set -# CONFIG_NAMESPACES is not set -# CONFIG_BLK_DEV_INITRD is not set -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SYSCTL=y -CONFIG_EMBEDDED=y -# CONFIG_SYSCTL_SYSCALL is not set -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_HOTPLUG=y -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_ELF_CORE=y -CONFIG_COMPAT_BRK=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_ANON_INODES=y -CONFIG_EPOLL=y -CONFIG_SIGNALFD=y -CONFIG_TIMERFD=y -CONFIG_EVENTFD=y -CONFIG_SHMEM=y -# CONFIG_VM_EVENT_COUNTERS is not set -CONFIG_SLAB=y -# CONFIG_SLUB is not set -# CONFIG_SLOB is not set -# CONFIG_PROFILING is not set -# CONFIG_MARKERS is not set -CONFIG_HAVE_OPROFILE=y -# CONFIG_KPROBES is not set -CONFIG_HAVE_KPROBES=y -CONFIG_HAVE_KRETPROBES=y -CONFIG_PROC_PAGE_MONITOR=y -CONFIG_SLABINFO=y -CONFIG_RT_MUTEXES=y -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -# CONFIG_MODVERSIONS is not set -# CONFIG_MODULE_SRCVERSION_ALL is not set -# CONFIG_KMOD is not set -CONFIG_BLOCK=y -# CONFIG_LBD is not set -# CONFIG_BLK_DEV_IO_TRACE is not set -# CONFIG_LSF is not set -# CONFIG_BLK_DEV_BSG is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -# CONFIG_IOSCHED_AS is not set -# CONFIG_IOSCHED_DEADLINE is not set -# CONFIG_IOSCHED_CFQ is not set -# CONFIG_DEFAULT_AS is not set -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -CONFIG_DEFAULT_NOOP=y -CONFIG_DEFAULT_IOSCHED="noop" -CONFIG_CLASSIC_RCU=y - -# -# Platform support -# -CONFIG_PPC_MULTIPLATFORM=y -# CONFIG_PPC_82xx is not set -# CONFIG_PPC_83xx is not set -# CONFIG_PPC_86xx is not set -CONFIG_CLASSIC32=y -# CONFIG_PPC_CHRP is not set -# CONFIG_PPC_MPC512x is not set -# CONFIG_PPC_MPC5121 is not set -# CONFIG_MPC5121_ADS is not set -CONFIG_PPC_MPC52xx=y -CONFIG_PPC_MPC5200_SIMPLE=y -# CONFIG_PPC_EFIKA is not set -# CONFIG_PPC_LITE5200 is not set -# CONFIG_PPC_MPC5200_BUGFIX is not set -# CONFIG_PPC_MPC5200_GPIO is not set -# CONFIG_PPC_PMAC is not set -# CONFIG_PPC_CELL is not set -# CONFIG_PPC_CELL_NATIVE is not set -# CONFIG_PQ2ADS is not set -# CONFIG_EMBEDDED6xx is not set -# CONFIG_IPIC is not set -# CONFIG_MPIC is not set -# CONFIG_MPIC_WEIRD is not set -# CONFIG_PPC_I8259 is not set -# CONFIG_PPC_RTAS is not set -# CONFIG_MMIO_NVRAM is not set -# CONFIG_PPC_MPC106 is not set -# CONFIG_PPC_970_NAP is not set -# CONFIG_PPC_INDIRECT_IO is not set -# CONFIG_GENERIC_IOMAP is not set -# CONFIG_CPU_FREQ is not set -# CONFIG_TAU is not set -# CONFIG_FSL_ULI1575 is not set -CONFIG_PPC_BESTCOMM=y -CONFIG_PPC_BESTCOMM_ATA=y -CONFIG_PPC_BESTCOMM_FEC=y -CONFIG_PPC_BESTCOMM_GEN_BD=y - -# -# Kernel options -# -# CONFIG_HIGHMEM is not set -CONFIG_TICK_ONESHOT=y -CONFIG_NO_HZ=y -CONFIG_HIGH_RES_TIMERS=y -CONFIG_GENERIC_CLOCKEVENTS_BUILD=y -CONFIG_HZ_100=y -# CONFIG_HZ_250 is not set -# CONFIG_HZ_300 is not set -# CONFIG_HZ_1000 is not set -CONFIG_HZ=100 -# CONFIG_SCHED_HRTICK is not set -# CONFIG_PREEMPT_NONE is not set -# CONFIG_PREEMPT_VOLUNTARY is not set -CONFIG_PREEMPT=y -# CONFIG_PREEMPT_RCU is not set -CONFIG_BINFMT_ELF=y -# CONFIG_BINFMT_MISC is not set -# CONFIG_IOMMU_HELPER is not set -CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y -CONFIG_ARCH_HAS_WALK_MEMORY=y -CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y -# CONFIG_KEXEC is not set -CONFIG_ARCH_FLATMEM_ENABLE=y -CONFIG_ARCH_POPULATES_NODE_MAP=y -CONFIG_SELECT_MEMORY_MODEL=y -CONFIG_FLATMEM_MANUAL=y -# CONFIG_DISCONTIGMEM_MANUAL is not set -# CONFIG_SPARSEMEM_MANUAL is not set -CONFIG_FLATMEM=y -CONFIG_FLAT_NODE_MEM_MAP=y -# CONFIG_SPARSEMEM_STATIC is not set -# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set -CONFIG_PAGEFLAGS_EXTENDED=y -CONFIG_SPLIT_PTLOCK_CPUS=4 -# CONFIG_RESOURCES_64BIT is not set -CONFIG_ZONE_DMA_FLAG=1 -CONFIG_BOUNCE=y -CONFIG_VIRT_TO_BUS=y -CONFIG_FORCE_MAX_ZONEORDER=11 -CONFIG_PROC_DEVICETREE=y -# CONFIG_CMDLINE_BOOL is not set -# CONFIG_PM is not set -# CONFIG_SECCOMP is not set -CONFIG_ISA_DMA_API=y - -# -# Bus options -# -CONFIG_ZONE_DMA=y -CONFIG_GENERIC_ISA_DMA=y -# CONFIG_PPC_INDIRECT_PCI is not set -CONFIG_FSL_SOC=y -CONFIG_PCI=y -CONFIG_PCI_DOMAINS=y -CONFIG_PCI_SYSCALL=y -# CONFIG_PCIEPORTBUS is not set -CONFIG_ARCH_SUPPORTS_MSI=y -# CONFIG_PCI_MSI is not set -CONFIG_PCI_LEGACY=y -# CONFIG_PCCARD is not set -# CONFIG_HOTPLUG_PCI is not set -# CONFIG_HAS_RAPIDIO is not set - -# -# Advanced setup -# -# CONFIG_ADVANCED_OPTIONS is not set - -# -# Default settings for advanced configuration options are used -# -CONFIG_LOWMEM_SIZE=0x30000000 -CONFIG_PAGE_OFFSET=0xc0000000 -CONFIG_KERNEL_START=0xc0000000 -CONFIG_PHYSICAL_START=0x00000000 -CONFIG_TASK_SIZE=0xc0000000 - -# -# Networking -# -CONFIG_NET=y - -# -# Networking options -# -CONFIG_PACKET=y -# CONFIG_PACKET_MMAP is not set -CONFIG_UNIX=y -# CONFIG_NET_KEY is not set -CONFIG_INET=y -CONFIG_IP_MULTICAST=y -# CONFIG_IP_ADVANCED_ROUTER is not set -CONFIG_IP_FIB_HASH=y -CONFIG_IP_PNP=y -CONFIG_IP_PNP_DHCP=y -CONFIG_IP_PNP_BOOTP=y -# CONFIG_IP_PNP_RARP is not set -# CONFIG_NET_IPIP is not set -# CONFIG_NET_IPGRE is not set -# CONFIG_IP_MROUTE is not set -# CONFIG_ARPD is not set -# CONFIG_SYN_COOKIES is not set -# CONFIG_INET_AH is not set -# CONFIG_INET_ESP is not set -# CONFIG_INET_IPCOMP is not set -# CONFIG_INET_XFRM_TUNNEL is not set -# CONFIG_INET_TUNNEL is not set -# CONFIG_INET_XFRM_MODE_TRANSPORT is not set -# CONFIG_INET_XFRM_MODE_TUNNEL is not set -# CONFIG_INET_XFRM_MODE_BEET is not set -# CONFIG_INET_LRO is not set -# CONFIG_INET_DIAG is not set -# CONFIG_TCP_CONG_ADVANCED is not set -CONFIG_TCP_CONG_CUBIC=y -CONFIG_DEFAULT_TCP_CONG="cubic" -# CONFIG_TCP_MD5SIG is not set -# CONFIG_IPV6 is not set -# CONFIG_NETWORK_SECMARK is not set -# CONFIG_NETFILTER is not set -# CONFIG_IP_DCCP is not set -# CONFIG_IP_SCTP is not set -# CONFIG_TIPC is not set -# CONFIG_ATM is not set -# CONFIG_BRIDGE is not set -# CONFIG_VLAN_8021Q is not set -# CONFIG_DECNET is not set -# CONFIG_LLC2 is not set -# CONFIG_IPX is not set -# CONFIG_ATALK is not set -# CONFIG_X25 is not set -# CONFIG_LAPB is not set -# CONFIG_ECONET is not set -# CONFIG_WAN_ROUTER is not set -# CONFIG_NET_SCHED is not set - -# -# Network testing -# -# CONFIG_NET_PKTGEN is not set -# CONFIG_HAMRADIO is not set -# CONFIG_CAN is not set -# CONFIG_IRDA is not set -# CONFIG_BT is not set -# CONFIG_AF_RXRPC is not set - -# -# Wireless -# -# CONFIG_CFG80211 is not set -# CONFIG_WIRELESS_EXT is not set -# CONFIG_MAC80211 is not set -# CONFIG_IEEE80211 is not set -# CONFIG_RFKILL is not set -# CONFIG_NET_9P is not set - -# -# Device Drivers -# - -# -# Generic Driver Options -# -CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" -CONFIG_STANDALONE=y -CONFIG_PREVENT_FIRMWARE_BUILD=y -# CONFIG_FW_LOADER is not set -# CONFIG_SYS_HYPERVISOR is not set -# CONFIG_CONNECTOR is not set -CONFIG_MTD=y -# CONFIG_MTD_DEBUG is not set -# CONFIG_MTD_CONCAT is not set -CONFIG_MTD_PARTITIONS=y -# CONFIG_MTD_REDBOOT_PARTS is not set -CONFIG_MTD_CMDLINE_PARTS=y -# CONFIG_MTD_OF_PARTS is not set -# CONFIG_MTD_AR7_PARTS is not set - -# -# User Modules And Translation Layers -# -CONFIG_MTD_CHAR=y -CONFIG_MTD_BLKDEVS=y -CONFIG_MTD_BLOCK=y -# CONFIG_FTL is not set -# CONFIG_NFTL is not set -# CONFIG_INFTL is not set -# CONFIG_RFD_FTL is not set -# CONFIG_SSFDC is not set -# CONFIG_MTD_OOPS is not set - -# -# RAM/ROM/Flash chip drivers -# -CONFIG_MTD_CFI=y -# CONFIG_MTD_JEDECPROBE is not set -CONFIG_MTD_GEN_PROBE=y -# CONFIG_MTD_CFI_ADV_OPTIONS is not set -CONFIG_MTD_MAP_BANK_WIDTH_1=y -CONFIG_MTD_MAP_BANK_WIDTH_2=y -CONFIG_MTD_MAP_BANK_WIDTH_4=y -# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set -# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set -# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set -CONFIG_MTD_CFI_I1=y -CONFIG_MTD_CFI_I2=y -# CONFIG_MTD_CFI_I4 is not set -# CONFIG_MTD_CFI_I8 is not set -CONFIG_MTD_CFI_INTELEXT=y -# CONFIG_MTD_CFI_AMDSTD is not set -# CONFIG_MTD_CFI_STAA is not set -CONFIG_MTD_CFI_UTIL=y -# CONFIG_MTD_RAM is not set -# CONFIG_MTD_ROM is not set -# CONFIG_MTD_ABSENT is not set - -# -# Mapping drivers for chip access -# -# CONFIG_MTD_COMPLEX_MAPPINGS is not set -CONFIG_MTD_PHYSMAP=y -CONFIG_MTD_PHYSMAP_START=0x0 -CONFIG_MTD_PHYSMAP_LEN=0x0 -CONFIG_MTD_PHYSMAP_BANKWIDTH=1 -# CONFIG_MTD_PHYSMAP_OF is not set -# CONFIG_MTD_INTEL_VR_NOR is not set -# CONFIG_MTD_PLATRAM is not set - -# -# Self-contained MTD device drivers -# -# CONFIG_MTD_PMC551 is not set -# CONFIG_MTD_SLRAM is not set -# CONFIG_MTD_PHRAM is not set -# CONFIG_MTD_MTDRAM is not set -# CONFIG_MTD_BLOCK2MTD is not set - -# -# Disk-On-Chip Device Drivers -# -# CONFIG_MTD_DOC2000 is not set -# CONFIG_MTD_DOC2001 is not set -# CONFIG_MTD_DOC2001PLUS is not set -# CONFIG_MTD_NAND is not set -# CONFIG_MTD_ONENAND is not set - -# -# UBI - Unsorted block images -# -# CONFIG_MTD_UBI is not set -CONFIG_OF_DEVICE=y -CONFIG_OF_I2C=y -# CONFIG_PARPORT is not set -# CONFIG_BLK_DEV is not set -# CONFIG_MISC_DEVICES is not set -CONFIG_HAVE_IDE=y -# CONFIG_IDE is not set - -# -# SCSI device support -# -# CONFIG_RAID_ATTRS is not set -CONFIG_SCSI=m -CONFIG_SCSI_DMA=y -# CONFIG_SCSI_TGT is not set -# CONFIG_SCSI_NETLINK is not set -# CONFIG_SCSI_PROC_FS is not set - -# -# SCSI support type (disk, tape, CD-ROM) -# -CONFIG_BLK_DEV_SD=m -# CONFIG_CHR_DEV_ST is not set -# CONFIG_CHR_DEV_OSST is not set -# CONFIG_BLK_DEV_SR is not set -# CONFIG_CHR_DEV_SG is not set -# CONFIG_CHR_DEV_SCH is not set - -# -# Some SCSI devices (e.g. CD jukebox) support multiple LUNs -# -# CONFIG_SCSI_MULTI_LUN is not set -# CONFIG_SCSI_CONSTANTS is not set -# CONFIG_SCSI_LOGGING is not set -# CONFIG_SCSI_SCAN_ASYNC is not set -CONFIG_SCSI_WAIT_SCAN=m - -# -# SCSI Transports -# -# CONFIG_SCSI_SPI_ATTRS is not set -# CONFIG_SCSI_FC_ATTRS is not set -# CONFIG_SCSI_ISCSI_ATTRS is not set -# CONFIG_SCSI_SAS_LIBSAS is not set -# CONFIG_SCSI_SRP_ATTRS is not set -# CONFIG_SCSI_LOWLEVEL is not set -CONFIG_ATA=m -# CONFIG_ATA_NONSTANDARD is not set -CONFIG_SATA_PMP=y -# CONFIG_SATA_AHCI is not set -# CONFIG_SATA_SIL24 is not set -# CONFIG_SATA_FSL is not set -CONFIG_ATA_SFF=y -# CONFIG_SATA_SVW is not set -# CONFIG_ATA_PIIX is not set -# CONFIG_SATA_MV is not set -# CONFIG_SATA_NV is not set -# CONFIG_PDC_ADMA is not set -# CONFIG_SATA_QSTOR is not set -# CONFIG_SATA_PROMISE is not set -# CONFIG_SATA_SX4 is not set -# CONFIG_SATA_SIL is not set -# CONFIG_SATA_SIS is not set -# CONFIG_SATA_ULI is not set -# CONFIG_SATA_VIA is not set -# CONFIG_SATA_VITESSE is not set -# CONFIG_SATA_INIC162X is not set -# CONFIG_PATA_ALI is not set -# CONFIG_PATA_AMD is not set -# CONFIG_PATA_ARTOP is not set -# CONFIG_PATA_ATIIXP is not set -# CONFIG_PATA_CMD640_PCI is not set -# CONFIG_PATA_CMD64X is not set -# CONFIG_PATA_CS5520 is not set -# CONFIG_PATA_CS5530 is not set -# CONFIG_PATA_CYPRESS is not set -# CONFIG_PATA_EFAR is not set -# CONFIG_ATA_GENERIC is not set -# CONFIG_PATA_HPT366 is not set -# CONFIG_PATA_HPT37X is not set -# CONFIG_PATA_HPT3X2N is not set -# CONFIG_PATA_HPT3X3 is not set -# CONFIG_PATA_IT821X is not set -# CONFIG_PATA_IT8213 is not set -# CONFIG_PATA_JMICRON is not set -# CONFIG_PATA_TRIFLEX is not set -# CONFIG_PATA_MARVELL is not set -CONFIG_PATA_MPC52xx=m -# CONFIG_PATA_MPIIX is not set -# CONFIG_PATA_OLDPIIX is not set -# CONFIG_PATA_NETCELL is not set -# CONFIG_PATA_NINJA32 is not set -# CONFIG_PATA_NS87410 is not set -# CONFIG_PATA_NS87415 is not set -# CONFIG_PATA_OPTI is not set -# CONFIG_PATA_OPTIDMA is not set -# CONFIG_PATA_PDC_OLD is not set -# CONFIG_PATA_RADISYS is not set -# CONFIG_PATA_RZ1000 is not set -# CONFIG_PATA_SC1200 is not set -# CONFIG_PATA_SERVERWORKS is not set -# CONFIG_PATA_PDC2027X is not set -# CONFIG_PATA_SIL680 is not set -# CONFIG_PATA_SIS is not set -# CONFIG_PATA_VIA is not set -# CONFIG_PATA_WINBOND is not set -# CONFIG_PATA_PLATFORM is not set -# CONFIG_MD is not set -# CONFIG_FUSION is not set - -# -# IEEE 1394 (FireWire) support -# -# CONFIG_FIREWIRE is not set -# CONFIG_IEEE1394 is not set -# CONFIG_I2O is not set -# CONFIG_MACINTOSH_DRIVERS is not set -CONFIG_NETDEVICES=y -# CONFIG_NETDEVICES_MULTIQUEUE is not set -# CONFIG_DUMMY is not set -# CONFIG_BONDING is not set -# CONFIG_MACVLAN is not set -# CONFIG_EQUALIZER is not set -# CONFIG_TUN is not set -# CONFIG_VETH is not set -# CONFIG_ARCNET is not set -CONFIG_PHYLIB=y - -# -# MII PHY device drivers -# -# CONFIG_MARVELL_PHY is not set -# CONFIG_DAVICOM_PHY is not set -# CONFIG_QSEMI_PHY is not set -# CONFIG_LXT_PHY is not set -# CONFIG_CICADA_PHY is not set -# CONFIG_VITESSE_PHY is not set -# CONFIG_SMSC_PHY is not set -# CONFIG_BROADCOM_PHY is not set -# CONFIG_ICPLUS_PHY is not set -# CONFIG_REALTEK_PHY is not set -# CONFIG_FIXED_PHY is not set -# CONFIG_MDIO_BITBANG is not set -CONFIG_NET_ETHERNET=y -CONFIG_MII=y -# CONFIG_HAPPYMEAL is not set -# CONFIG_SUNGEM is not set -# CONFIG_CASSINI is not set -# CONFIG_NET_VENDOR_3COM is not set -# CONFIG_NET_TULIP is not set -# CONFIG_HP100 is not set -# CONFIG_IBM_NEW_EMAC_ZMII is not set -# CONFIG_IBM_NEW_EMAC_RGMII is not set -# CONFIG_IBM_NEW_EMAC_TAH is not set -# CONFIG_IBM_NEW_EMAC_EMAC4 is not set -# CONFIG_NET_PCI is not set -# CONFIG_B44 is not set -CONFIG_FEC_MPC52xx=y -CONFIG_FEC_MPC52xx_MDIO=y -# CONFIG_NETDEV_1000 is not set -# CONFIG_NETDEV_10000 is not set -# CONFIG_TR is not set - -# -# Wireless LAN -# -# CONFIG_WLAN_PRE80211 is not set -# CONFIG_WLAN_80211 is not set -# CONFIG_IWLWIFI is not set -# CONFIG_IWLWIFI_LEDS is not set - -# -# USB Network Adapters -# -# CONFIG_USB_CATC is not set -# CONFIG_USB_KAWETH is not set -# CONFIG_USB_PEGASUS is not set -# CONFIG_USB_RTL8150 is not set -# CONFIG_USB_USBNET is not set -# CONFIG_WAN is not set -# CONFIG_FDDI is not set -# CONFIG_HIPPI is not set -# CONFIG_PPP is not set -# CONFIG_SLIP is not set -# CONFIG_NET_FC is not set -# CONFIG_NETCONSOLE is not set -# CONFIG_NETPOLL is not set -# CONFIG_NET_POLL_CONTROLLER is not set -# CONFIG_ISDN is not set -# CONFIG_PHONE is not set - -# -# Input device support -# -# CONFIG_INPUT is not set - -# -# Hardware I/O ports -# -# CONFIG_SERIO is not set -# CONFIG_GAMEPORT is not set - -# -# Character devices -# -# CONFIG_VT is not set -# CONFIG_SERIAL_NONSTANDARD is not set -# CONFIG_NOZOMI is not set - -# -# Serial drivers -# -# CONFIG_SERIAL_8250 is not set - -# -# Non-8250 serial port support -# -# CONFIG_SERIAL_UARTLITE is not set -CONFIG_SERIAL_CORE=y -CONFIG_SERIAL_CORE_CONSOLE=y -CONFIG_SERIAL_MPC52xx=y -CONFIG_SERIAL_MPC52xx_CONSOLE=y -CONFIG_SERIAL_MPC52xx_CONSOLE_BAUD=9600 -# CONFIG_SERIAL_JSM is not set -CONFIG_UNIX98_PTYS=y -# CONFIG_LEGACY_PTYS is not set -# CONFIG_IPMI_HANDLER is not set -CONFIG_HW_RANDOM=y -# CONFIG_NVRAM is not set -# CONFIG_R3964 is not set -# CONFIG_APPLICOM is not set -# CONFIG_RAW_DRIVER is not set -# CONFIG_TCG_TPM is not set -CONFIG_DEVPORT=y -CONFIG_I2C=y -CONFIG_I2C_BOARDINFO=y -CONFIG_I2C_CHARDEV=y - -# -# I2C Hardware Bus support -# -# CONFIG_I2C_ALI1535 is not set -# CONFIG_I2C_ALI1563 is not set -# CONFIG_I2C_ALI15X3 is not set -# CONFIG_I2C_AMD756 is not set -# CONFIG_I2C_AMD8111 is not set -# CONFIG_I2C_I801 is not set -# CONFIG_I2C_I810 is not set -# CONFIG_I2C_PIIX4 is not set -CONFIG_I2C_MPC=y -# CONFIG_I2C_NFORCE2 is not set -# CONFIG_I2C_OCORES is not set -# CONFIG_I2C_PARPORT_LIGHT is not set -# CONFIG_I2C_PROSAVAGE is not set -# CONFIG_I2C_SAVAGE4 is not set -# CONFIG_I2C_SIMTEC is not set -# CONFIG_I2C_SIS5595 is not set -# CONFIG_I2C_SIS630 is not set -# CONFIG_I2C_SIS96X is not set -# CONFIG_I2C_TAOS_EVM is not set -# CONFIG_I2C_STUB is not set -# CONFIG_I2C_TINY_USB is not set -# CONFIG_I2C_VIA is not set -# CONFIG_I2C_VIAPRO is not set -# CONFIG_I2C_VOODOO3 is not set -# CONFIG_I2C_PCA_PLATFORM is not set - -# -# Miscellaneous I2C Chip support -# -# CONFIG_DS1682 is not set -CONFIG_SENSORS_EEPROM=m -# CONFIG_SENSORS_PCF8574 is not set -# CONFIG_PCF8575 is not set -# CONFIG_SENSORS_PCF8591 is not set -# CONFIG_SENSORS_MAX6875 is not set -# CONFIG_SENSORS_TSL2550 is not set -# CONFIG_I2C_DEBUG_CORE is not set -# CONFIG_I2C_DEBUG_ALGO is not set -# CONFIG_I2C_DEBUG_BUS is not set -# CONFIG_I2C_DEBUG_CHIP is not set -# CONFIG_SPI is not set -# CONFIG_W1 is not set -# CONFIG_POWER_SUPPLY is not set -# CONFIG_HWMON is not set -# CONFIG_THERMAL is not set -# CONFIG_WATCHDOG is not set - -# -# Sonics Silicon Backplane -# -CONFIG_SSB_POSSIBLE=y -# CONFIG_SSB is not set - -# -# Multifunction device drivers -# -# CONFIG_MFD_SM501 is not set -# CONFIG_HTC_PASIC3 is not set - -# -# Multimedia devices -# -# CONFIG_VIDEO_DEV is not set -# CONFIG_DVB_CORE is not set -# CONFIG_DAB is not set - -# -# Graphics support -# -# CONFIG_AGP is not set -# CONFIG_DRM is not set -# CONFIG_VGASTATE is not set -# CONFIG_VIDEO_OUTPUT_CONTROL is not set -# CONFIG_FB is not set -# CONFIG_BACKLIGHT_LCD_SUPPORT is not set - -# -# Display device support -# -# CONFIG_DISPLAY_SUPPORT is not set - -# -# Sound -# -# CONFIG_SOUND is not set -CONFIG_USB_SUPPORT=y -CONFIG_USB_ARCH_HAS_HCD=y -CONFIG_USB_ARCH_HAS_OHCI=y -CONFIG_USB_ARCH_HAS_EHCI=y -CONFIG_USB=y -# CONFIG_USB_DEBUG is not set -# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set - -# -# Miscellaneous USB options -# -CONFIG_USB_DEVICEFS=y -# CONFIG_USB_DEVICE_CLASS is not set -# CONFIG_USB_DYNAMIC_MINORS is not set -# CONFIG_USB_OTG is not set -# CONFIG_USB_OTG_WHITELIST is not set -# CONFIG_USB_OTG_BLACKLIST_HUB is not set - -# -# USB Host Controller Drivers -# -# CONFIG_USB_EHCI_HCD is not set -# CONFIG_USB_ISP116X_HCD is not set -CONFIG_USB_OHCI_HCD=m -# CONFIG_USB_OHCI_HCD_PPC_SOC is not set -CONFIG_USB_OHCI_HCD_PPC_OF=y -CONFIG_USB_OHCI_HCD_PPC_OF_BE=y -# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set -# CONFIG_USB_OHCI_HCD_PCI is not set -CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y -CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y -# CONFIG_USB_OHCI_LITTLE_ENDIAN is not set -# CONFIG_USB_UHCI_HCD is not set -# CONFIG_USB_SL811_HCD is not set -# CONFIG_USB_R8A66597_HCD is not set - -# -# USB Device Class drivers -# -# CONFIG_USB_ACM is not set -# CONFIG_USB_PRINTER is not set - -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - -# -# may also be needed; see USB_STORAGE Help for more information -# -CONFIG_USB_STORAGE=m -# CONFIG_USB_STORAGE_DEBUG is not set -# CONFIG_USB_STORAGE_DATAFAB is not set -# CONFIG_USB_STORAGE_FREECOM is not set -# CONFIG_USB_STORAGE_ISD200 is not set -# CONFIG_USB_STORAGE_DPCM is not set -# CONFIG_USB_STORAGE_USBAT is not set -# CONFIG_USB_STORAGE_SDDR09 is not set -# CONFIG_USB_STORAGE_SDDR55 is not set -# CONFIG_USB_STORAGE_JUMPSHOT is not set -# CONFIG_USB_STORAGE_ALAUDA is not set -# CONFIG_USB_STORAGE_KARMA is not set -# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set -# CONFIG_USB_LIBUSUAL is not set - -# -# USB Imaging devices -# -# CONFIG_USB_MDC800 is not set -# CONFIG_USB_MICROTEK is not set -# CONFIG_USB_MON is not set - -# -# USB port drivers -# -# CONFIG_USB_SERIAL is not set - -# -# USB Miscellaneous drivers -# -# CONFIG_USB_EMI62 is not set -# CONFIG_USB_EMI26 is not set -# CONFIG_USB_ADUTUX is not set -# CONFIG_USB_AUERSWALD is not set -# CONFIG_USB_RIO500 is not set -# CONFIG_USB_LEGOTOWER is not set -# CONFIG_USB_LCD is not set -# CONFIG_USB_BERRY_CHARGE is not set -# CONFIG_USB_LED is not set -# CONFIG_USB_CYPRESS_CY7C63 is not set -# CONFIG_USB_CYTHERM is not set -# CONFIG_USB_PHIDGET is not set -# CONFIG_USB_IDMOUSE is not set -# CONFIG_USB_FTDI_ELAN is not set -# CONFIG_USB_APPLEDISPLAY is not set -# CONFIG_USB_LD is not set -# CONFIG_USB_TRANCEVIBRATOR is not set -# CONFIG_USB_IOWARRIOR is not set -# CONFIG_USB_TEST is not set -# CONFIG_USB_GADGET is not set -# CONFIG_MMC is not set -# CONFIG_MEMSTICK is not set -# CONFIG_NEW_LEDS is not set -# CONFIG_INFINIBAND is not set -# CONFIG_EDAC is not set -CONFIG_RTC_LIB=m -CONFIG_RTC_CLASS=m - -# -# RTC interfaces -# -CONFIG_RTC_INTF_SYSFS=y -CONFIG_RTC_INTF_PROC=y -CONFIG_RTC_INTF_DEV=y -# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set -# CONFIG_RTC_DRV_TEST is not set - -# -# I2C RTC drivers -# -# CONFIG_RTC_DRV_DS1307 is not set -# CONFIG_RTC_DRV_DS1374 is not set -# CONFIG_RTC_DRV_DS1672 is not set -# CONFIG_RTC_DRV_MAX6900 is not set -# CONFIG_RTC_DRV_RS5C372 is not set -# CONFIG_RTC_DRV_ISL1208 is not set -# CONFIG_RTC_DRV_X1205 is not set -CONFIG_RTC_DRV_PCF8563=m -# CONFIG_RTC_DRV_PCF8583 is not set -# CONFIG_RTC_DRV_M41T80 is not set -# CONFIG_RTC_DRV_S35390A is not set - -# -# SPI RTC drivers -# - -# -# Platform RTC drivers -# -# CONFIG_RTC_DRV_CMOS is not set -# CONFIG_RTC_DRV_DS1511 is not set -# CONFIG_RTC_DRV_DS1553 is not set -# CONFIG_RTC_DRV_DS1742 is not set -# CONFIG_RTC_DRV_STK17TA8 is not set -# CONFIG_RTC_DRV_M48T86 is not set -# CONFIG_RTC_DRV_M48T59 is not set -# CONFIG_RTC_DRV_V3020 is not set - -# -# on-CPU RTC drivers -# -# CONFIG_DMADEVICES is not set -# CONFIG_UIO is not set - -# -# File systems -# -CONFIG_EXT2_FS=m -# CONFIG_EXT2_FS_XATTR is not set -# CONFIG_EXT2_FS_XIP is not set -CONFIG_EXT3_FS=m -CONFIG_EXT3_FS_XATTR=y -# CONFIG_EXT3_FS_POSIX_ACL is not set -# CONFIG_EXT3_FS_SECURITY is not set -# CONFIG_EXT4DEV_FS is not set -CONFIG_JBD=m -CONFIG_FS_MBCACHE=m -# CONFIG_REISERFS_FS is not set -# CONFIG_JFS_FS is not set -# CONFIG_FS_POSIX_ACL is not set -# CONFIG_XFS_FS is not set -# CONFIG_OCFS2_FS is not set -# CONFIG_DNOTIFY is not set -# CONFIG_INOTIFY is not set -# CONFIG_QUOTA is not set -# CONFIG_AUTOFS_FS is not set -# CONFIG_AUTOFS4_FS is not set -# CONFIG_FUSE_FS is not set - -# -# CD-ROM/DVD Filesystems -# -# CONFIG_ISO9660_FS is not set -# CONFIG_UDF_FS is not set - -# -# DOS/FAT/NT Filesystems -# -CONFIG_FAT_FS=m -# CONFIG_MSDOS_FS is not set -CONFIG_VFAT_FS=m -CONFIG_FAT_DEFAULT_CODEPAGE=850 -CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" -# CONFIG_NTFS_FS is not set - -# -# Pseudo filesystems -# -CONFIG_PROC_FS=y -# CONFIG_PROC_KCORE is not set -CONFIG_PROC_SYSCTL=y -CONFIG_SYSFS=y -CONFIG_TMPFS=y -# CONFIG_TMPFS_POSIX_ACL is not set -# CONFIG_HUGETLB_PAGE is not set -# CONFIG_CONFIGFS_FS is not set - -# -# Miscellaneous filesystems -# -# CONFIG_ADFS_FS is not set -# CONFIG_AFFS_FS is not set -# CONFIG_HFS_FS is not set -# CONFIG_HFSPLUS_FS is not set -# CONFIG_BEFS_FS is not set -# CONFIG_BFS_FS is not set -# CONFIG_EFS_FS is not set -CONFIG_JFFS2_FS=y -CONFIG_JFFS2_FS_DEBUG=0 -CONFIG_JFFS2_FS_WRITEBUFFER=y -# CONFIG_JFFS2_FS_WBUF_VERIFY is not set -# CONFIG_JFFS2_SUMMARY is not set -# CONFIG_JFFS2_FS_XATTR is not set -# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set -CONFIG_JFFS2_ZLIB=y -# CONFIG_JFFS2_LZO is not set -CONFIG_JFFS2_RTIME=y -# CONFIG_JFFS2_RUBIN is not set -# CONFIG_CRAMFS is not set -# CONFIG_VXFS_FS is not set -# CONFIG_MINIX_FS is not set -# CONFIG_HPFS_FS is not set -# CONFIG_QNX4FS_FS is not set -# CONFIG_ROMFS_FS is not set -# CONFIG_SYSV_FS is not set -# CONFIG_UFS_FS is not set -CONFIG_NETWORK_FILESYSTEMS=y -CONFIG_NFS_FS=y -CONFIG_NFS_V3=y -# CONFIG_NFS_V3_ACL is not set -# CONFIG_NFS_V4 is not set -# CONFIG_NFSD is not set -CONFIG_ROOT_NFS=y -CONFIG_LOCKD=y -CONFIG_LOCKD_V4=y -CONFIG_NFS_COMMON=y -CONFIG_SUNRPC=y -# CONFIG_SUNRPC_BIND34 is not set -# CONFIG_RPCSEC_GSS_KRB5 is not set -# CONFIG_RPCSEC_GSS_SPKM3 is not set -# CONFIG_SMB_FS is not set -# CONFIG_CIFS is not set -# CONFIG_NCP_FS is not set -# CONFIG_CODA_FS is not set -# CONFIG_AFS_FS is not set - -# -# Partition Types -# -# CONFIG_PARTITION_ADVANCED is not set -CONFIG_MSDOS_PARTITION=y -CONFIG_NLS=y -CONFIG_NLS_DEFAULT="iso8859-1" -# CONFIG_NLS_CODEPAGE_437 is not set -# CONFIG_NLS_CODEPAGE_737 is not set -# CONFIG_NLS_CODEPAGE_775 is not set -CONFIG_NLS_CODEPAGE_850=y -# CONFIG_NLS_CODEPAGE_852 is not set -# CONFIG_NLS_CODEPAGE_855 is not set -# CONFIG_NLS_CODEPAGE_857 is not set -# CONFIG_NLS_CODEPAGE_860 is not set -# CONFIG_NLS_CODEPAGE_861 is not set -# CONFIG_NLS_CODEPAGE_862 is not set -# CONFIG_NLS_CODEPAGE_863 is not set -# CONFIG_NLS_CODEPAGE_864 is not set -# CONFIG_NLS_CODEPAGE_865 is not set -# CONFIG_NLS_CODEPAGE_866 is not set -# CONFIG_NLS_CODEPAGE_869 is not set -# CONFIG_NLS_CODEPAGE_936 is not set -# CONFIG_NLS_CODEPAGE_950 is not set -# CONFIG_NLS_CODEPAGE_932 is not set -# CONFIG_NLS_CODEPAGE_949 is not set -# CONFIG_NLS_CODEPAGE_874 is not set -# CONFIG_NLS_ISO8859_8 is not set -# CONFIG_NLS_CODEPAGE_1250 is not set -# CONFIG_NLS_CODEPAGE_1251 is not set -# CONFIG_NLS_ASCII is not set -CONFIG_NLS_ISO8859_1=y -# CONFIG_NLS_ISO8859_2 is not set -# CONFIG_NLS_ISO8859_3 is not set -# CONFIG_NLS_ISO8859_4 is not set -# CONFIG_NLS_ISO8859_5 is not set -# CONFIG_NLS_ISO8859_6 is not set -# CONFIG_NLS_ISO8859_7 is not set -# CONFIG_NLS_ISO8859_9 is not set -# CONFIG_NLS_ISO8859_13 is not set -# CONFIG_NLS_ISO8859_14 is not set -# CONFIG_NLS_ISO8859_15 is not set -# CONFIG_NLS_KOI8_R is not set -# CONFIG_NLS_KOI8_U is not set -# CONFIG_NLS_UTF8 is not set -# CONFIG_DLM is not set - -# -# Library routines -# -CONFIG_BITREVERSE=y -# CONFIG_GENERIC_FIND_FIRST_BIT is not set -# CONFIG_CRC_CCITT is not set -# CONFIG_CRC16 is not set -# CONFIG_CRC_ITU_T is not set -CONFIG_CRC32=y -# CONFIG_CRC7 is not set -# CONFIG_LIBCRC32C is not set -CONFIG_ZLIB_INFLATE=y -CONFIG_ZLIB_DEFLATE=y -CONFIG_PLIST=y -CONFIG_HAS_IOMEM=y -CONFIG_HAS_IOPORT=y -CONFIG_HAS_DMA=y -CONFIG_HAVE_LMB=y - -# -# Kernel hacking -# -# CONFIG_PRINTK_TIME is not set -CONFIG_ENABLE_WARN_DEPRECATED=y -CONFIG_ENABLE_MUST_CHECK=y -CONFIG_FRAME_WARN=1024 -# CONFIG_MAGIC_SYSRQ is not set -# CONFIG_UNUSED_SYMBOLS is not set -# CONFIG_DEBUG_FS is not set -# CONFIG_HEADERS_CHECK is not set -# CONFIG_DEBUG_KERNEL is not set -# CONFIG_DEBUG_BUGVERBOSE is not set -# CONFIG_SAMPLES is not set -# CONFIG_IRQSTACKS is not set -# CONFIG_BOOTX_TEXT is not set -# CONFIG_PPC_EARLY_DEBUG is not set - -# -# Security options -# -# CONFIG_KEYS is not set -# CONFIG_SECURITY is not set -# CONFIG_SECURITY_FILE_CAPABILITIES is not set -# CONFIG_CRYPTO is not set -CONFIG_PPC_CLOCK=y -CONFIG_PPC_LIB_RHEAP=y -# CONFIG_VIRTUALIZATION is not set diff --git a/trunk/arch/powerpc/configs/52xx/tqm5200_defconfig b/trunk/arch/powerpc/configs/52xx/tqm5200_defconfig deleted file mode 100644 index 7672bfba3566..000000000000 --- a/trunk/arch/powerpc/configs/52xx/tqm5200_defconfig +++ /dev/null @@ -1,1214 +0,0 @@ -# -# Automatically generated make config: don't edit -# Linux kernel version: 2.6.25 -# Tue Apr 29 07:12:39 2008 -# -# CONFIG_PPC64 is not set - -# -# Processor support -# -CONFIG_6xx=y -# CONFIG_PPC_85xx is not set -# CONFIG_PPC_8xx is not set -# CONFIG_40x is not set -# CONFIG_44x is not set -# CONFIG_E200 is not set -CONFIG_PPC_FPU=y -# CONFIG_ALTIVEC is not set -CONFIG_PPC_STD_MMU=y -CONFIG_PPC_STD_MMU_32=y -# CONFIG_PPC_MM_SLICES is not set -# CONFIG_SMP is not set -CONFIG_PPC32=y -CONFIG_WORD_SIZE=32 -CONFIG_PPC_MERGE=y -CONFIG_MMU=y -CONFIG_GENERIC_CMOS_UPDATE=y -CONFIG_GENERIC_TIME=y -CONFIG_GENERIC_TIME_VSYSCALL=y -CONFIG_GENERIC_CLOCKEVENTS=y -CONFIG_GENERIC_HARDIRQS=y -# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set -CONFIG_IRQ_PER_CPU=y -CONFIG_STACKTRACE_SUPPORT=y -CONFIG_LOCKDEP_SUPPORT=y -CONFIG_RWSEM_XCHGADD_ALGORITHM=y -CONFIG_ARCH_HAS_ILOG2_U32=y -CONFIG_GENERIC_HWEIGHT=y -CONFIG_GENERIC_CALIBRATE_DELAY=y -CONFIG_GENERIC_FIND_NEXT_BIT=y -# CONFIG_ARCH_NO_VIRT_TO_BUS is not set -CONFIG_PPC=y -CONFIG_EARLY_PRINTK=y -CONFIG_GENERIC_NVRAM=y -CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y -CONFIG_ARCH_MAY_HAVE_PC_FDC=y -CONFIG_PPC_OF=y -CONFIG_OF=y -# CONFIG_PPC_UDBG_16550 is not set -# CONFIG_GENERIC_TBSYNC is not set -CONFIG_AUDIT_ARCH=y -CONFIG_GENERIC_BUG=y -CONFIG_DEFAULT_UIMAGE=y -# CONFIG_PPC_DCR_NATIVE is not set -# CONFIG_PPC_DCR_MMIO is not set -CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" - -# -# General setup -# -CONFIG_EXPERIMENTAL=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -CONFIG_SYSVIPC_SYSCTL=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -# CONFIG_TASKSTATS is not set -# CONFIG_AUDIT is not set -# CONFIG_IKCONFIG is not set -CONFIG_LOG_BUF_SHIFT=14 -# CONFIG_CGROUPS is not set -CONFIG_GROUP_SCHED=y -CONFIG_FAIR_GROUP_SCHED=y -# CONFIG_RT_GROUP_SCHED is not set -CONFIG_USER_SCHED=y -# CONFIG_CGROUP_SCHED is not set -CONFIG_SYSFS_DEPRECATED=y -CONFIG_SYSFS_DEPRECATED_V2=y -# CONFIG_RELAY is not set -# CONFIG_NAMESPACES is not set -CONFIG_BLK_DEV_INITRD=y -CONFIG_INITRAMFS_SOURCE="" -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SYSCTL=y -CONFIG_EMBEDDED=y -# CONFIG_SYSCTL_SYSCALL is not set -# CONFIG_KALLSYMS is not set -CONFIG_HOTPLUG=y -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_ELF_CORE=y -CONFIG_COMPAT_BRK=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_ANON_INODES=y -# CONFIG_EPOLL is not set -CONFIG_SIGNALFD=y -CONFIG_TIMERFD=y -CONFIG_EVENTFD=y -CONFIG_SHMEM=y -CONFIG_VM_EVENT_COUNTERS=y -CONFIG_SLUB_DEBUG=y -# CONFIG_SLAB is not set -CONFIG_SLUB=y -# CONFIG_SLOB is not set -# CONFIG_PROFILING is not set -# CONFIG_MARKERS is not set -CONFIG_HAVE_OPROFILE=y -CONFIG_HAVE_KPROBES=y -CONFIG_HAVE_KRETPROBES=y -CONFIG_PROC_PAGE_MONITOR=y -CONFIG_SLABINFO=y -CONFIG_RT_MUTEXES=y -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -CONFIG_MODVERSIONS=y -# CONFIG_MODULE_SRCVERSION_ALL is not set -CONFIG_KMOD=y -CONFIG_BLOCK=y -# CONFIG_LBD is not set -# CONFIG_BLK_DEV_IO_TRACE is not set -# CONFIG_LSF is not set -# CONFIG_BLK_DEV_BSG is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" -CONFIG_CLASSIC_RCU=y - -# -# Platform support -# -CONFIG_PPC_MULTIPLATFORM=y -# CONFIG_PPC_82xx is not set -# CONFIG_PPC_83xx is not set -# CONFIG_PPC_86xx is not set -CONFIG_CLASSIC32=y -# CONFIG_PPC_CHRP is not set -# CONFIG_PPC_MPC512x is not set -# CONFIG_PPC_MPC5121 is not set -# CONFIG_MPC5121_ADS is not set -CONFIG_PPC_MPC52xx=y -CONFIG_PPC_MPC5200_SIMPLE=y -# CONFIG_PPC_EFIKA is not set -# CONFIG_PPC_LITE5200 is not set -CONFIG_PPC_MPC5200_BUGFIX=y -# CONFIG_PPC_MPC5200_GPIO is not set -# CONFIG_PPC_PMAC is not set -# CONFIG_PPC_CELL is not set -# CONFIG_PPC_CELL_NATIVE is not set -# CONFIG_PQ2ADS is not set -# CONFIG_EMBEDDED6xx is not set -# CONFIG_IPIC is not set -# CONFIG_MPIC is not set -# CONFIG_MPIC_WEIRD is not set -# CONFIG_PPC_I8259 is not set -# CONFIG_PPC_RTAS is not set -# CONFIG_MMIO_NVRAM is not set -# CONFIG_PPC_MPC106 is not set -# CONFIG_PPC_970_NAP is not set -# CONFIG_PPC_INDIRECT_IO is not set -# CONFIG_GENERIC_IOMAP is not set -# CONFIG_CPU_FREQ is not set -# CONFIG_TAU is not set -# CONFIG_FSL_ULI1575 is not set -CONFIG_PPC_BESTCOMM=y -# CONFIG_PPC_BESTCOMM_ATA is not set -CONFIG_PPC_BESTCOMM_FEC=y -# CONFIG_PPC_BESTCOMM_GEN_BD is not set - -# -# Kernel options -# -# CONFIG_HIGHMEM is not set -# CONFIG_TICK_ONESHOT is not set -# CONFIG_NO_HZ is not set -# CONFIG_HIGH_RES_TIMERS is not set -CONFIG_GENERIC_CLOCKEVENTS_BUILD=y -# CONFIG_HZ_100 is not set -CONFIG_HZ_250=y -# CONFIG_HZ_300 is not set -# CONFIG_HZ_1000 is not set -CONFIG_HZ=250 -# CONFIG_SCHED_HRTICK is not set -CONFIG_PREEMPT_NONE=y -# CONFIG_PREEMPT_VOLUNTARY is not set -# CONFIG_PREEMPT is not set -CONFIG_BINFMT_ELF=y -# CONFIG_BINFMT_MISC is not set -# CONFIG_IOMMU_HELPER is not set -CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y -CONFIG_ARCH_HAS_WALK_MEMORY=y -CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y -# CONFIG_KEXEC is not set -CONFIG_ARCH_FLATMEM_ENABLE=y -CONFIG_ARCH_POPULATES_NODE_MAP=y -CONFIG_SELECT_MEMORY_MODEL=y -CONFIG_FLATMEM_MANUAL=y -# CONFIG_DISCONTIGMEM_MANUAL is not set -# CONFIG_SPARSEMEM_MANUAL is not set -CONFIG_FLATMEM=y -CONFIG_FLAT_NODE_MEM_MAP=y -# CONFIG_SPARSEMEM_STATIC is not set -# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set -CONFIG_PAGEFLAGS_EXTENDED=y -CONFIG_SPLIT_PTLOCK_CPUS=4 -# CONFIG_RESOURCES_64BIT is not set -CONFIG_ZONE_DMA_FLAG=1 -CONFIG_BOUNCE=y -CONFIG_VIRT_TO_BUS=y -CONFIG_FORCE_MAX_ZONEORDER=11 -CONFIG_PROC_DEVICETREE=y -# CONFIG_CMDLINE_BOOL is not set -CONFIG_PM=y -# CONFIG_PM_LEGACY is not set -# CONFIG_PM_DEBUG is not set -CONFIG_SECCOMP=y -CONFIG_ISA_DMA_API=y - -# -# Bus options -# -CONFIG_ZONE_DMA=y -CONFIG_GENERIC_ISA_DMA=y -CONFIG_FSL_SOC=y -# CONFIG_PCI is not set -# CONFIG_PCI_DOMAINS is not set -# CONFIG_PCI_SYSCALL is not set -# CONFIG_ARCH_SUPPORTS_MSI is not set -# CONFIG_PCCARD is not set -# CONFIG_HAS_RAPIDIO is not set - -# -# Advanced setup -# -# CONFIG_ADVANCED_OPTIONS is not set - -# -# Default settings for advanced configuration options are used -# -CONFIG_LOWMEM_SIZE=0x30000000 -CONFIG_PAGE_OFFSET=0xc0000000 -CONFIG_KERNEL_START=0xc0000000 -CONFIG_PHYSICAL_START=0x00000000 -CONFIG_TASK_SIZE=0xc0000000 - -# -# Networking -# -CONFIG_NET=y - -# -# Networking options -# -CONFIG_PACKET=y -# CONFIG_PACKET_MMAP is not set -CONFIG_UNIX=y -CONFIG_XFRM=y -CONFIG_XFRM_USER=y -# CONFIG_XFRM_SUB_POLICY is not set -# CONFIG_XFRM_MIGRATE is not set -# CONFIG_XFRM_STATISTICS is not set -# CONFIG_NET_KEY is not set -CONFIG_INET=y -CONFIG_IP_MULTICAST=y -# CONFIG_IP_ADVANCED_ROUTER is not set -CONFIG_IP_FIB_HASH=y -CONFIG_IP_PNP=y -CONFIG_IP_PNP_DHCP=y -CONFIG_IP_PNP_BOOTP=y -# CONFIG_IP_PNP_RARP is not set -# CONFIG_NET_IPIP is not set -# CONFIG_NET_IPGRE is not set -# CONFIG_IP_MROUTE is not set -# CONFIG_ARPD is not set -CONFIG_SYN_COOKIES=y -# CONFIG_INET_AH is not set -# CONFIG_INET_ESP is not set -# CONFIG_INET_IPCOMP is not set -# CONFIG_INET_XFRM_TUNNEL is not set -# CONFIG_INET_TUNNEL is not set -CONFIG_INET_XFRM_MODE_TRANSPORT=y -CONFIG_INET_XFRM_MODE_TUNNEL=y -CONFIG_INET_XFRM_MODE_BEET=y -# CONFIG_INET_LRO is not set -CONFIG_INET_DIAG=y -CONFIG_INET_TCP_DIAG=y -# CONFIG_TCP_CONG_ADVANCED is not set -CONFIG_TCP_CONG_CUBIC=y -CONFIG_DEFAULT_TCP_CONG="cubic" -# CONFIG_TCP_MD5SIG is not set -# CONFIG_IPV6 is not set -# CONFIG_NETWORK_SECMARK is not set -# CONFIG_NETFILTER is not set -# CONFIG_IP_DCCP is not set -# CONFIG_IP_SCTP is not set -# CONFIG_TIPC is not set -# CONFIG_ATM is not set -# CONFIG_BRIDGE is not set -# CONFIG_VLAN_8021Q is not set -# CONFIG_DECNET is not set -# CONFIG_LLC2 is not set -# CONFIG_IPX is not set -# CONFIG_ATALK is not set -# CONFIG_X25 is not set -# CONFIG_LAPB is not set -# CONFIG_ECONET is not set -# CONFIG_WAN_ROUTER is not set -# CONFIG_NET_SCHED is not set - -# -# Network testing -# -# CONFIG_NET_PKTGEN is not set -# CONFIG_HAMRADIO is not set -# CONFIG_CAN is not set -# CONFIG_IRDA is not set -# CONFIG_BT is not set -# CONFIG_AF_RXRPC is not set - -# -# Wireless -# -# CONFIG_CFG80211 is not set -# CONFIG_WIRELESS_EXT is not set -# CONFIG_MAC80211 is not set -# CONFIG_IEEE80211 is not set -# CONFIG_RFKILL is not set -# CONFIG_NET_9P is not set - -# -# Device Drivers -# - -# -# Generic Driver Options -# -CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" -CONFIG_STANDALONE=y -CONFIG_PREVENT_FIRMWARE_BUILD=y -# CONFIG_FW_LOADER is not set -# CONFIG_DEBUG_DRIVER is not set -# CONFIG_DEBUG_DEVRES is not set -# CONFIG_SYS_HYPERVISOR is not set -# CONFIG_CONNECTOR is not set -CONFIG_MTD=y -# CONFIG_MTD_DEBUG is not set -CONFIG_MTD_CONCAT=y -CONFIG_MTD_PARTITIONS=y -# CONFIG_MTD_REDBOOT_PARTS is not set -CONFIG_MTD_CMDLINE_PARTS=y -# CONFIG_MTD_OF_PARTS is not set -# CONFIG_MTD_AR7_PARTS is not set - -# -# User Modules And Translation Layers -# -CONFIG_MTD_CHAR=y -CONFIG_MTD_BLKDEVS=y -CONFIG_MTD_BLOCK=y -# CONFIG_FTL is not set -# CONFIG_NFTL is not set -# CONFIG_INFTL is not set -# CONFIG_RFD_FTL is not set -# CONFIG_SSFDC is not set -# CONFIG_MTD_OOPS is not set - -# -# RAM/ROM/Flash chip drivers -# -CONFIG_MTD_CFI=y -# CONFIG_MTD_JEDECPROBE is not set -CONFIG_MTD_GEN_PROBE=y -# CONFIG_MTD_CFI_ADV_OPTIONS is not set -CONFIG_MTD_MAP_BANK_WIDTH_1=y -CONFIG_MTD_MAP_BANK_WIDTH_2=y -CONFIG_MTD_MAP_BANK_WIDTH_4=y -# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set -# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set -# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set -CONFIG_MTD_CFI_I1=y -CONFIG_MTD_CFI_I2=y -# CONFIG_MTD_CFI_I4 is not set -# CONFIG_MTD_CFI_I8 is not set -# CONFIG_MTD_CFI_INTELEXT is not set -CONFIG_MTD_CFI_AMDSTD=y -# CONFIG_MTD_CFI_STAA is not set -CONFIG_MTD_CFI_UTIL=y -# CONFIG_MTD_RAM is not set -CONFIG_MTD_ROM=y -# CONFIG_MTD_ABSENT is not set - -# -# Mapping drivers for chip access -# -# CONFIG_MTD_COMPLEX_MAPPINGS is not set -# CONFIG_MTD_PHYSMAP is not set -CONFIG_MTD_PHYSMAP_OF=y -# CONFIG_MTD_PLATRAM is not set - -# -# Self-contained MTD device drivers -# -# CONFIG_MTD_SLRAM is not set -# CONFIG_MTD_PHRAM is not set -# CONFIG_MTD_MTDRAM is not set -# CONFIG_MTD_BLOCK2MTD is not set - -# -# Disk-On-Chip Device Drivers -# -# CONFIG_MTD_DOC2000 is not set -# CONFIG_MTD_DOC2001 is not set -# CONFIG_MTD_DOC2001PLUS is not set -# CONFIG_MTD_NAND is not set -# CONFIG_MTD_ONENAND is not set - -# -# UBI - Unsorted block images -# -# CONFIG_MTD_UBI is not set -CONFIG_OF_DEVICE=y -CONFIG_OF_I2C=y -# CONFIG_PARPORT is not set -CONFIG_BLK_DEV=y -# CONFIG_BLK_DEV_FD is not set -# CONFIG_BLK_DEV_COW_COMMON is not set -CONFIG_BLK_DEV_LOOP=y -# CONFIG_BLK_DEV_CRYPTOLOOP is not set -# CONFIG_BLK_DEV_NBD is not set -# CONFIG_BLK_DEV_UB is not set -CONFIG_BLK_DEV_RAM=y -CONFIG_BLK_DEV_RAM_COUNT=16 -CONFIG_BLK_DEV_RAM_SIZE=32768 -# CONFIG_BLK_DEV_XIP is not set -# CONFIG_CDROM_PKTCDVD is not set -# CONFIG_ATA_OVER_ETH is not set -# CONFIG_MISC_DEVICES is not set -CONFIG_HAVE_IDE=y -# CONFIG_IDE is not set - -# -# SCSI device support -# -# CONFIG_RAID_ATTRS is not set -CONFIG_SCSI=y -CONFIG_SCSI_DMA=y -# CONFIG_SCSI_TGT is not set -# CONFIG_SCSI_NETLINK is not set -CONFIG_SCSI_PROC_FS=y - -# -# SCSI support type (disk, tape, CD-ROM) -# -CONFIG_BLK_DEV_SD=y -# CONFIG_CHR_DEV_ST is not set -# CONFIG_CHR_DEV_OSST is not set -# CONFIG_BLK_DEV_SR is not set -CONFIG_CHR_DEV_SG=y -# CONFIG_CHR_DEV_SCH is not set - -# -# Some SCSI devices (e.g. CD jukebox) support multiple LUNs -# -# CONFIG_SCSI_MULTI_LUN is not set -# CONFIG_SCSI_CONSTANTS is not set -# CONFIG_SCSI_LOGGING is not set -# CONFIG_SCSI_SCAN_ASYNC is not set -CONFIG_SCSI_WAIT_SCAN=m - -# -# SCSI Transports -# -# CONFIG_SCSI_SPI_ATTRS is not set -# CONFIG_SCSI_FC_ATTRS is not set -# CONFIG_SCSI_ISCSI_ATTRS is not set -# CONFIG_SCSI_SAS_LIBSAS is not set -# CONFIG_SCSI_SRP_ATTRS is not set -CONFIG_SCSI_LOWLEVEL=y -# CONFIG_ISCSI_TCP is not set -# CONFIG_SCSI_DEBUG is not set -CONFIG_ATA=y -# CONFIG_ATA_NONSTANDARD is not set -CONFIG_SATA_PMP=y -# CONFIG_SATA_FSL is not set -CONFIG_ATA_SFF=y -# CONFIG_SATA_MV is not set -CONFIG_PATA_MPC52xx=y -CONFIG_PATA_PLATFORM=y -# CONFIG_PATA_OF_PLATFORM is not set -# CONFIG_MD is not set -# CONFIG_MACINTOSH_DRIVERS is not set -CONFIG_NETDEVICES=y -# CONFIG_NETDEVICES_MULTIQUEUE is not set -# CONFIG_DUMMY is not set -# CONFIG_BONDING is not set -# CONFIG_MACVLAN is not set -# CONFIG_EQUALIZER is not set -# CONFIG_TUN is not set -# CONFIG_VETH is not set -CONFIG_PHYLIB=y - -# -# MII PHY device drivers -# -# CONFIG_MARVELL_PHY is not set -# CONFIG_DAVICOM_PHY is not set -# CONFIG_QSEMI_PHY is not set -CONFIG_LXT_PHY=y -# CONFIG_CICADA_PHY is not set -# CONFIG_VITESSE_PHY is not set -# CONFIG_SMSC_PHY is not set -# CONFIG_BROADCOM_PHY is not set -# CONFIG_ICPLUS_PHY is not set -# CONFIG_REALTEK_PHY is not set -# CONFIG_FIXED_PHY is not set -# CONFIG_MDIO_BITBANG is not set -CONFIG_NET_ETHERNET=y -# CONFIG_MII is not set -# CONFIG_IBM_NEW_EMAC_ZMII is not set -# CONFIG_IBM_NEW_EMAC_RGMII is not set -# CONFIG_IBM_NEW_EMAC_TAH is not set -# CONFIG_IBM_NEW_EMAC_EMAC4 is not set -# CONFIG_B44 is not set -CONFIG_FEC_MPC52xx=y -CONFIG_FEC_MPC52xx_MDIO=y -# CONFIG_NETDEV_1000 is not set -# CONFIG_NETDEV_10000 is not set - -# -# Wireless LAN -# -# CONFIG_WLAN_PRE80211 is not set -# CONFIG_WLAN_80211 is not set -# CONFIG_IWLWIFI is not set -# CONFIG_IWLWIFI_LEDS is not set - -# -# USB Network Adapters -# -# CONFIG_USB_CATC is not set -# CONFIG_USB_KAWETH is not set -# CONFIG_USB_PEGASUS is not set -# CONFIG_USB_RTL8150 is not set -# CONFIG_USB_USBNET is not set -# CONFIG_WAN is not set -# CONFIG_PPP is not set -# CONFIG_SLIP is not set -# CONFIG_NETCONSOLE is not set -# CONFIG_NETPOLL is not set -# CONFIG_NET_POLL_CONTROLLER is not set -# CONFIG_ISDN is not set -# CONFIG_PHONE is not set - -# -# Input device support -# -# CONFIG_INPUT is not set - -# -# Hardware I/O ports -# -# CONFIG_SERIO is not set -# CONFIG_GAMEPORT is not set - -# -# Character devices -# -# CONFIG_VT is not set -# CONFIG_SERIAL_NONSTANDARD is not set - -# -# Serial drivers -# -# CONFIG_SERIAL_8250 is not set - -# -# Non-8250 serial port support -# -# CONFIG_SERIAL_UARTLITE is not set -CONFIG_SERIAL_CORE=y -CONFIG_SERIAL_CORE_CONSOLE=y -CONFIG_SERIAL_MPC52xx=y -CONFIG_SERIAL_MPC52xx_CONSOLE=y -CONFIG_SERIAL_MPC52xx_CONSOLE_BAUD=115200 -CONFIG_UNIX98_PTYS=y -CONFIG_LEGACY_PTYS=y -CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_IPMI_HANDLER is not set -# CONFIG_HW_RANDOM is not set -# CONFIG_NVRAM is not set -# CONFIG_R3964 is not set -# CONFIG_RAW_DRIVER is not set -# CONFIG_TCG_TPM is not set -CONFIG_I2C=y -CONFIG_I2C_BOARDINFO=y -CONFIG_I2C_CHARDEV=y - -# -# I2C Hardware Bus support -# -CONFIG_I2C_MPC=y -# CONFIG_I2C_OCORES is not set -# CONFIG_I2C_PARPORT_LIGHT is not set -# CONFIG_I2C_SIMTEC is not set -# CONFIG_I2C_TAOS_EVM is not set -# CONFIG_I2C_STUB is not set -# CONFIG_I2C_TINY_USB is not set -# CONFIG_I2C_PCA_PLATFORM is not set - -# -# Miscellaneous I2C Chip support -# -# CONFIG_DS1682 is not set -# CONFIG_SENSORS_EEPROM is not set -# CONFIG_SENSORS_PCF8574 is not set -# CONFIG_PCF8575 is not set -# CONFIG_SENSORS_PCF8591 is not set -# CONFIG_SENSORS_MAX6875 is not set -# CONFIG_SENSORS_TSL2550 is not set -# CONFIG_I2C_DEBUG_CORE is not set -# CONFIG_I2C_DEBUG_ALGO is not set -# CONFIG_I2C_DEBUG_BUS is not set -# CONFIG_I2C_DEBUG_CHIP is not set -# CONFIG_SPI is not set -# CONFIG_W1 is not set -# CONFIG_POWER_SUPPLY is not set -CONFIG_HWMON=y -# CONFIG_HWMON_VID is not set -# CONFIG_SENSORS_AD7418 is not set -# CONFIG_SENSORS_ADM1021 is not set -# CONFIG_SENSORS_ADM1025 is not set -# CONFIG_SENSORS_ADM1026 is not set -# CONFIG_SENSORS_ADM1029 is not set -# CONFIG_SENSORS_ADM1031 is not set -# CONFIG_SENSORS_ADM9240 is not set -# CONFIG_SENSORS_ADT7470 is not set -# CONFIG_SENSORS_ADT7473 is not set -# CONFIG_SENSORS_ATXP1 is not set -# CONFIG_SENSORS_DS1621 is not set -# CONFIG_SENSORS_F71805F is not set -# CONFIG_SENSORS_F71882FG is not set -# CONFIG_SENSORS_F75375S is not set -# CONFIG_SENSORS_GL518SM is not set -# CONFIG_SENSORS_GL520SM is not set -# CONFIG_SENSORS_IT87 is not set -# CONFIG_SENSORS_LM63 is not set -# CONFIG_SENSORS_LM75 is not set -# CONFIG_SENSORS_LM77 is not set -# CONFIG_SENSORS_LM78 is not set -# CONFIG_SENSORS_LM80 is not set -# CONFIG_SENSORS_LM83 is not set -# CONFIG_SENSORS_LM85 is not set -# CONFIG_SENSORS_LM87 is not set -# CONFIG_SENSORS_LM90 is not set -# CONFIG_SENSORS_LM92 is not set -# CONFIG_SENSORS_LM93 is not set -# CONFIG_SENSORS_MAX1619 is not set -# CONFIG_SENSORS_MAX6650 is not set -# CONFIG_SENSORS_PC87360 is not set -# CONFIG_SENSORS_PC87427 is not set -# CONFIG_SENSORS_DME1737 is not set -# CONFIG_SENSORS_SMSC47M1 is not set -# CONFIG_SENSORS_SMSC47M192 is not set -# CONFIG_SENSORS_SMSC47B397 is not set -# CONFIG_SENSORS_ADS7828 is not set -# CONFIG_SENSORS_THMC50 is not set -# CONFIG_SENSORS_VT1211 is not set -# CONFIG_SENSORS_W83781D is not set -# CONFIG_SENSORS_W83791D is not set -# CONFIG_SENSORS_W83792D is not set -# CONFIG_SENSORS_W83793 is not set -# CONFIG_SENSORS_W83L785TS is not set -# CONFIG_SENSORS_W83L786NG is not set -# CONFIG_SENSORS_W83627HF is not set -# CONFIG_SENSORS_W83627EHF is not set -# CONFIG_HWMON_DEBUG_CHIP is not set -# CONFIG_THERMAL is not set -CONFIG_WATCHDOG=y -# CONFIG_WATCHDOG_NOWAYOUT is not set - -# -# Watchdog Device Drivers -# -# CONFIG_SOFT_WATCHDOG is not set -# CONFIG_MPC5200_WDT is not set - -# -# USB-based Watchdog Cards -# -# CONFIG_USBPCWATCHDOG is not set - -# -# Sonics Silicon Backplane -# -CONFIG_SSB_POSSIBLE=y -# CONFIG_SSB is not set - -# -# Multifunction device drivers -# -# CONFIG_MFD_SM501 is not set -# CONFIG_HTC_PASIC3 is not set - -# -# Multimedia devices -# -# CONFIG_VIDEO_DEV is not set -# CONFIG_DVB_CORE is not set -# CONFIG_DAB is not set - -# -# Graphics support -# -# CONFIG_VGASTATE is not set -# CONFIG_VIDEO_OUTPUT_CONTROL is not set -# CONFIG_FB is not set -# CONFIG_BACKLIGHT_LCD_SUPPORT is not set - -# -# Display device support -# -# CONFIG_DISPLAY_SUPPORT is not set - -# -# Sound -# -# CONFIG_SOUND is not set -CONFIG_USB_SUPPORT=y -CONFIG_USB_ARCH_HAS_HCD=y -CONFIG_USB_ARCH_HAS_OHCI=y -# CONFIG_USB_ARCH_HAS_EHCI is not set -CONFIG_USB=y -# CONFIG_USB_DEBUG is not set -# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set - -# -# Miscellaneous USB options -# -CONFIG_USB_DEVICEFS=y -# CONFIG_USB_DEVICE_CLASS is not set -# CONFIG_USB_DYNAMIC_MINORS is not set -# CONFIG_USB_SUSPEND is not set -# CONFIG_USB_OTG is not set -# CONFIG_USB_OTG_WHITELIST is not set -# CONFIG_USB_OTG_BLACKLIST_HUB is not set - -# -# USB Host Controller Drivers -# -# CONFIG_USB_ISP116X_HCD is not set -CONFIG_USB_OHCI_HCD=y -CONFIG_USB_OHCI_HCD_PPC_SOC=y -CONFIG_USB_OHCI_HCD_PPC_OF=y -CONFIG_USB_OHCI_HCD_PPC_OF_BE=y -# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set -CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y -CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y -# CONFIG_USB_OHCI_LITTLE_ENDIAN is not set -# CONFIG_USB_SL811_HCD is not set -# CONFIG_USB_R8A66597_HCD is not set - -# -# USB Device Class drivers -# -# CONFIG_USB_ACM is not set -# CONFIG_USB_PRINTER is not set - -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - -# -# may also be needed; see USB_STORAGE Help for more information -# -CONFIG_USB_STORAGE=y -# CONFIG_USB_STORAGE_DEBUG is not set -# CONFIG_USB_STORAGE_DATAFAB is not set -# CONFIG_USB_STORAGE_FREECOM is not set -# CONFIG_USB_STORAGE_ISD200 is not set -# CONFIG_USB_STORAGE_DPCM is not set -# CONFIG_USB_STORAGE_USBAT is not set -# CONFIG_USB_STORAGE_SDDR09 is not set -# CONFIG_USB_STORAGE_SDDR55 is not set -# CONFIG_USB_STORAGE_JUMPSHOT is not set -# CONFIG_USB_STORAGE_ALAUDA is not set -# CONFIG_USB_STORAGE_KARMA is not set -# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set -# CONFIG_USB_LIBUSUAL is not set - -# -# USB Imaging devices -# -# CONFIG_USB_MDC800 is not set -# CONFIG_USB_MICROTEK is not set -CONFIG_USB_MON=y - -# -# USB port drivers -# -# CONFIG_USB_SERIAL is not set - -# -# USB Miscellaneous drivers -# -# CONFIG_USB_EMI62 is not set -# CONFIG_USB_EMI26 is not set -# CONFIG_USB_ADUTUX is not set -# CONFIG_USB_AUERSWALD is not set -# CONFIG_USB_RIO500 is not set -# CONFIG_USB_LEGOTOWER is not set -# CONFIG_USB_LCD is not set -# CONFIG_USB_BERRY_CHARGE is not set -# CONFIG_USB_LED is not set -# CONFIG_USB_CYPRESS_CY7C63 is not set -# CONFIG_USB_CYTHERM is not set -# CONFIG_USB_PHIDGET is not set -# CONFIG_USB_IDMOUSE is not set -# CONFIG_USB_FTDI_ELAN is not set -# CONFIG_USB_APPLEDISPLAY is not set -# CONFIG_USB_LD is not set -# CONFIG_USB_TRANCEVIBRATOR is not set -# CONFIG_USB_IOWARRIOR is not set -# CONFIG_USB_TEST is not set -# CONFIG_USB_GADGET is not set -# CONFIG_MMC is not set -# CONFIG_MEMSTICK is not set -# CONFIG_NEW_LEDS is not set -# CONFIG_EDAC is not set -CONFIG_RTC_LIB=y -CONFIG_RTC_CLASS=y -CONFIG_RTC_HCTOSYS=y -CONFIG_RTC_HCTOSYS_DEVICE="rtc0" -# CONFIG_RTC_DEBUG is not set - -# -# RTC interfaces -# -CONFIG_RTC_INTF_SYSFS=y -CONFIG_RTC_INTF_PROC=y -CONFIG_RTC_INTF_DEV=y -# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set -# CONFIG_RTC_DRV_TEST is not set - -# -# I2C RTC drivers -# -CONFIG_RTC_DRV_DS1307=y -# CONFIG_RTC_DRV_DS1374 is not set -# CONFIG_RTC_DRV_DS1672 is not set -# CONFIG_RTC_DRV_MAX6900 is not set -# CONFIG_RTC_DRV_RS5C372 is not set -# CONFIG_RTC_DRV_ISL1208 is not set -# CONFIG_RTC_DRV_X1205 is not set -# CONFIG_RTC_DRV_PCF8563 is not set -# CONFIG_RTC_DRV_PCF8583 is not set -# CONFIG_RTC_DRV_M41T80 is not set -# CONFIG_RTC_DRV_S35390A is not set - -# -# SPI RTC drivers -# - -# -# Platform RTC drivers -# -# CONFIG_RTC_DRV_CMOS is not set -# CONFIG_RTC_DRV_DS1511 is not set -# CONFIG_RTC_DRV_DS1553 is not set -# CONFIG_RTC_DRV_DS1742 is not set -# CONFIG_RTC_DRV_STK17TA8 is not set -# CONFIG_RTC_DRV_M48T86 is not set -# CONFIG_RTC_DRV_M48T59 is not set -# CONFIG_RTC_DRV_V3020 is not set - -# -# on-CPU RTC drivers -# -# CONFIG_DMADEVICES is not set -# CONFIG_UIO is not set - -# -# File systems -# -CONFIG_EXT2_FS=y -# CONFIG_EXT2_FS_XATTR is not set -# CONFIG_EXT2_FS_XIP is not set -CONFIG_EXT3_FS=y -CONFIG_EXT3_FS_XATTR=y -# CONFIG_EXT3_FS_POSIX_ACL is not set -# CONFIG_EXT3_FS_SECURITY is not set -# CONFIG_EXT4DEV_FS is not set -CONFIG_JBD=y -CONFIG_FS_MBCACHE=y -# CONFIG_REISERFS_FS is not set -# CONFIG_JFS_FS is not set -# CONFIG_FS_POSIX_ACL is not set -# CONFIG_XFS_FS is not set -# CONFIG_OCFS2_FS is not set -CONFIG_DNOTIFY=y -CONFIG_INOTIFY=y -CONFIG_INOTIFY_USER=y -# CONFIG_QUOTA is not set -# CONFIG_AUTOFS_FS is not set -# CONFIG_AUTOFS4_FS is not set -# CONFIG_FUSE_FS is not set - -# -# CD-ROM/DVD Filesystems -# -# CONFIG_ISO9660_FS is not set -# CONFIG_UDF_FS is not set - -# -# DOS/FAT/NT Filesystems -# -CONFIG_FAT_FS=y -CONFIG_MSDOS_FS=y -CONFIG_VFAT_FS=y -CONFIG_FAT_DEFAULT_CODEPAGE=437 -CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" -# CONFIG_NTFS_FS is not set - -# -# Pseudo filesystems -# -CONFIG_PROC_FS=y -CONFIG_PROC_KCORE=y -CONFIG_PROC_SYSCTL=y -CONFIG_SYSFS=y -CONFIG_TMPFS=y -# CONFIG_TMPFS_POSIX_ACL is not set -# CONFIG_HUGETLB_PAGE is not set -# CONFIG_CONFIGFS_FS is not set - -# -# Miscellaneous filesystems -# -# CONFIG_ADFS_FS is not set -# CONFIG_AFFS_FS is not set -# CONFIG_HFS_FS is not set -# CONFIG_HFSPLUS_FS is not set -# CONFIG_BEFS_FS is not set -# CONFIG_BFS_FS is not set -# CONFIG_EFS_FS is not set -CONFIG_JFFS2_FS=y -CONFIG_JFFS2_FS_DEBUG=0 -CONFIG_JFFS2_FS_WRITEBUFFER=y -# CONFIG_JFFS2_FS_WBUF_VERIFY is not set -# CONFIG_JFFS2_SUMMARY is not set -# CONFIG_JFFS2_FS_XATTR is not set -# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set -CONFIG_JFFS2_ZLIB=y -# CONFIG_JFFS2_LZO is not set -CONFIG_JFFS2_RTIME=y -# CONFIG_JFFS2_RUBIN is not set -CONFIG_CRAMFS=y -# CONFIG_VXFS_FS is not set -# CONFIG_MINIX_FS is not set -# CONFIG_HPFS_FS is not set -# CONFIG_QNX4FS_FS is not set -# CONFIG_ROMFS_FS is not set -# CONFIG_SYSV_FS is not set -# CONFIG_UFS_FS is not set -CONFIG_NETWORK_FILESYSTEMS=y -CONFIG_NFS_FS=y -CONFIG_NFS_V3=y -# CONFIG_NFS_V3_ACL is not set -CONFIG_NFS_V4=y -# CONFIG_NFSD is not set -CONFIG_ROOT_NFS=y -CONFIG_LOCKD=y -CONFIG_LOCKD_V4=y -CONFIG_NFS_COMMON=y -CONFIG_SUNRPC=y -CONFIG_SUNRPC_GSS=y -# CONFIG_SUNRPC_BIND34 is not set -CONFIG_RPCSEC_GSS_KRB5=y -# CONFIG_RPCSEC_GSS_SPKM3 is not set -# CONFIG_SMB_FS is not set -# CONFIG_CIFS is not set -# CONFIG_NCP_FS is not set -# CONFIG_CODA_FS is not set -# CONFIG_AFS_FS is not set - -# -# Partition Types -# -CONFIG_PARTITION_ADVANCED=y -# CONFIG_ACORN_PARTITION is not set -# CONFIG_OSF_PARTITION is not set -# CONFIG_AMIGA_PARTITION is not set -# CONFIG_ATARI_PARTITION is not set -# CONFIG_MAC_PARTITION is not set -CONFIG_MSDOS_PARTITION=y -# CONFIG_BSD_DISKLABEL is not set -# CONFIG_MINIX_SUBPARTITION is not set -# CONFIG_SOLARIS_X86_PARTITION is not set -# CONFIG_UNIXWARE_DISKLABEL is not set -# CONFIG_LDM_PARTITION is not set -# CONFIG_SGI_PARTITION is not set -# CONFIG_ULTRIX_PARTITION is not set -# CONFIG_SUN_PARTITION is not set -# CONFIG_KARMA_PARTITION is not set -# CONFIG_EFI_PARTITION is not set -# CONFIG_SYSV68_PARTITION is not set -CONFIG_NLS=y -CONFIG_NLS_DEFAULT="iso8859-1" -CONFIG_NLS_CODEPAGE_437=y -# CONFIG_NLS_CODEPAGE_737 is not set -# CONFIG_NLS_CODEPAGE_775 is not set -# CONFIG_NLS_CODEPAGE_850 is not set -# CONFIG_NLS_CODEPAGE_852 is not set -# CONFIG_NLS_CODEPAGE_855 is not set -# CONFIG_NLS_CODEPAGE_857 is not set -# CONFIG_NLS_CODEPAGE_860 is not set -# CONFIG_NLS_CODEPAGE_861 is not set -# CONFIG_NLS_CODEPAGE_862 is not set -# CONFIG_NLS_CODEPAGE_863 is not set -# CONFIG_NLS_CODEPAGE_864 is not set -# CONFIG_NLS_CODEPAGE_865 is not set -# CONFIG_NLS_CODEPAGE_866 is not set -# CONFIG_NLS_CODEPAGE_869 is not set -# CONFIG_NLS_CODEPAGE_936 is not set -# CONFIG_NLS_CODEPAGE_950 is not set -# CONFIG_NLS_CODEPAGE_932 is not set -# CONFIG_NLS_CODEPAGE_949 is not set -# CONFIG_NLS_CODEPAGE_874 is not set -# CONFIG_NLS_ISO8859_8 is not set -# CONFIG_NLS_CODEPAGE_1250 is not set -# CONFIG_NLS_CODEPAGE_1251 is not set -# CONFIG_NLS_ASCII is not set -CONFIG_NLS_ISO8859_1=y -# CONFIG_NLS_ISO8859_2 is not set -# CONFIG_NLS_ISO8859_3 is not set -# CONFIG_NLS_ISO8859_4 is not set -# CONFIG_NLS_ISO8859_5 is not set -# CONFIG_NLS_ISO8859_6 is not set -# CONFIG_NLS_ISO8859_7 is not set -# CONFIG_NLS_ISO8859_9 is not set -# CONFIG_NLS_ISO8859_13 is not set -# CONFIG_NLS_ISO8859_14 is not set -# CONFIG_NLS_ISO8859_15 is not set -# CONFIG_NLS_KOI8_R is not set -# CONFIG_NLS_KOI8_U is not set -# CONFIG_NLS_UTF8 is not set -# CONFIG_DLM is not set - -# -# Library routines -# -CONFIG_BITREVERSE=y -# CONFIG_GENERIC_FIND_FIRST_BIT is not set -# CONFIG_CRC_CCITT is not set -# CONFIG_CRC16 is not set -# CONFIG_CRC_ITU_T is not set -CONFIG_CRC32=y -# CONFIG_CRC7 is not set -# CONFIG_LIBCRC32C is not set -CONFIG_ZLIB_INFLATE=y -CONFIG_ZLIB_DEFLATE=y -CONFIG_PLIST=y -CONFIG_HAS_IOMEM=y -CONFIG_HAS_IOPORT=y -CONFIG_HAS_DMA=y -CONFIG_HAVE_LMB=y - -# -# Kernel hacking -# -CONFIG_PRINTK_TIME=y -CONFIG_ENABLE_WARN_DEPRECATED=y -CONFIG_ENABLE_MUST_CHECK=y -CONFIG_FRAME_WARN=1024 -# CONFIG_MAGIC_SYSRQ is not set -# CONFIG_UNUSED_SYMBOLS is not set -# CONFIG_DEBUG_FS is not set -# CONFIG_HEADERS_CHECK is not set -CONFIG_DEBUG_KERNEL=y -# CONFIG_DEBUG_SHIRQ is not set -CONFIG_DETECT_SOFTLOCKUP=y -CONFIG_SCHED_DEBUG=y -# CONFIG_SCHEDSTATS is not set -# CONFIG_TIMER_STATS is not set -# CONFIG_SLUB_DEBUG_ON is not set -# CONFIG_SLUB_STATS is not set -# CONFIG_DEBUG_RT_MUTEXES is not set -# CONFIG_RT_MUTEX_TESTER is not set -# CONFIG_DEBUG_SPINLOCK is not set -# CONFIG_DEBUG_MUTEXES is not set -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set -# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set -# CONFIG_DEBUG_KOBJECT is not set -# CONFIG_DEBUG_BUGVERBOSE is not set -CONFIG_DEBUG_INFO=y -# CONFIG_DEBUG_VM is not set -# CONFIG_DEBUG_WRITECOUNT is not set -# CONFIG_DEBUG_LIST is not set -# CONFIG_DEBUG_SG is not set -# CONFIG_BOOT_PRINTK_DELAY is not set -# CONFIG_RCU_TORTURE_TEST is not set -# CONFIG_BACKTRACE_SELF_TEST is not set -# CONFIG_FAULT_INJECTION is not set -# CONFIG_SAMPLES is not set -# CONFIG_DEBUG_STACKOVERFLOW is not set -# CONFIG_DEBUG_STACK_USAGE is not set -# CONFIG_DEBUG_PAGEALLOC is not set -# CONFIG_DEBUGGER is not set -# CONFIG_IRQSTACKS is not set -# CONFIG_BDI_SWITCH is not set -# CONFIG_BOOTX_TEXT is not set -# CONFIG_PPC_EARLY_DEBUG is not set - -# -# Security options -# -# CONFIG_KEYS is not set -# CONFIG_SECURITY is not set -# CONFIG_SECURITY_FILE_CAPABILITIES is not set -CONFIG_CRYPTO=y - -# -# Crypto core or helper -# -CONFIG_CRYPTO_ALGAPI=y -CONFIG_CRYPTO_BLKCIPHER=y -CONFIG_CRYPTO_MANAGER=y -# CONFIG_CRYPTO_GF128MUL is not set -# CONFIG_CRYPTO_NULL is not set -# CONFIG_CRYPTO_CRYPTD is not set -# CONFIG_CRYPTO_AUTHENC is not set -# CONFIG_CRYPTO_TEST is not set - -# -# Authenticated Encryption with Associated Data -# -# CONFIG_CRYPTO_CCM is not set -# CONFIG_CRYPTO_GCM is not set -# CONFIG_CRYPTO_SEQIV is not set - -# -# Block modes -# -CONFIG_CRYPTO_CBC=y -# CONFIG_CRYPTO_CTR is not set -# CONFIG_CRYPTO_CTS is not set -CONFIG_CRYPTO_ECB=y -# CONFIG_CRYPTO_LRW is not set -CONFIG_CRYPTO_PCBC=y -# CONFIG_CRYPTO_XTS is not set - -# -# Hash modes -# -# CONFIG_CRYPTO_HMAC is not set -# CONFIG_CRYPTO_XCBC is not set - -# -# Digest -# -# CONFIG_CRYPTO_CRC32C is not set -# CONFIG_CRYPTO_MD4 is not set -CONFIG_CRYPTO_MD5=y -# CONFIG_CRYPTO_MICHAEL_MIC is not set -# CONFIG_CRYPTO_SHA1 is not set -# CONFIG_CRYPTO_SHA256 is not set -# CONFIG_CRYPTO_SHA512 is not set -# CONFIG_CRYPTO_TGR192 is not set -# CONFIG_CRYPTO_WP512 is not set - -# -# Ciphers -# -# CONFIG_CRYPTO_AES is not set -# CONFIG_CRYPTO_ANUBIS is not set -# CONFIG_CRYPTO_ARC4 is not set -# CONFIG_CRYPTO_BLOWFISH is not set -# CONFIG_CRYPTO_CAMELLIA is not set -# CONFIG_CRYPTO_CAST5 is not set -# CONFIG_CRYPTO_CAST6 is not set -CONFIG_CRYPTO_DES=y -# CONFIG_CRYPTO_FCRYPT is not set -# CONFIG_CRYPTO_KHAZAD is not set -# CONFIG_CRYPTO_SALSA20 is not set -# CONFIG_CRYPTO_SEED is not set -# CONFIG_CRYPTO_SERPENT is not set -# CONFIG_CRYPTO_TEA is not set -# CONFIG_CRYPTO_TWOFISH is not set - -# -# Compression -# -# CONFIG_CRYPTO_DEFLATE is not set -# CONFIG_CRYPTO_LZO is not set -CONFIG_CRYPTO_HW=y -CONFIG_PPC_CLOCK=y -CONFIG_PPC_LIB_RHEAP=y -# CONFIG_VIRTUALIZATION is not set diff --git a/trunk/arch/powerpc/kernel/machine_kexec.c b/trunk/arch/powerpc/kernel/machine_kexec.c index 29a0e039d436..2d202f274e73 100644 --- a/trunk/arch/powerpc/kernel/machine_kexec.c +++ b/trunk/arch/powerpc/kernel/machine_kexec.c @@ -74,20 +74,20 @@ void __init reserve_crashkernel(void) ret = parse_crashkernel(boot_command_line, lmb_phys_mem_size(), &crash_size, &crash_base); if (ret == 0 && crash_size > 0) { + if (crash_base == 0) + crash_base = KDUMP_KERNELBASE; crashk_res.start = crash_base; - crashk_res.end = crash_base + crash_size - 1; + } else { + /* handle the device tree */ + crash_size = crashk_res.end - crashk_res.start + 1; } - if (crashk_res.end == crashk_res.start) { - crashk_res.start = crashk_res.end = 0; + if (crash_size == 0) return; - } /* We might have got these values via the command line or the * device tree, either way sanitise them now. */ - crash_size = crashk_res.end - crashk_res.start + 1; - if (crashk_res.start != KDUMP_KERNELBASE) printk("Crash kernel location must be 0x%x\n", KDUMP_KERNELBASE); diff --git a/trunk/arch/powerpc/kernel/ppc_ksyms.c b/trunk/arch/powerpc/kernel/ppc_ksyms.c index cf6b5a7d8b3f..09fcb50c45ae 100644 --- a/trunk/arch/powerpc/kernel/ppc_ksyms.c +++ b/trunk/arch/powerpc/kernel/ppc_ksyms.c @@ -133,6 +133,9 @@ EXPORT_SYMBOL(adb_try_handler_change); EXPORT_SYMBOL(cuda_request); EXPORT_SYMBOL(cuda_poll); #endif /* CONFIG_ADB_CUDA */ +#ifdef CONFIG_VT +EXPORT_SYMBOL(kd_mksound); +#endif EXPORT_SYMBOL(to_tm); #ifdef CONFIG_PPC32 diff --git a/trunk/arch/powerpc/kernel/setup_64.c b/trunk/arch/powerpc/kernel/setup_64.c index 25e3fd8606ab..dff6308d1b5e 100644 --- a/trunk/arch/powerpc/kernel/setup_64.c +++ b/trunk/arch/powerpc/kernel/setup_64.c @@ -487,12 +487,9 @@ static void __init emergency_stack_init(void) */ limit = min(0x10000000UL, lmb.rmo_size); - for_each_possible_cpu(i) { - unsigned long sp; - sp = lmb_alloc_base(THREAD_SIZE, THREAD_SIZE, limit); - sp += THREAD_SIZE; - paca[i].emergency_sp = __va(sp); - } + for_each_possible_cpu(i) + paca[i].emergency_sp = + __va(lmb_alloc_base(HW_PAGE_SIZE, 128, limit)) + HW_PAGE_SIZE; } /* diff --git a/trunk/arch/powerpc/platforms/52xx/Kconfig b/trunk/arch/powerpc/platforms/52xx/Kconfig index acd2fc8cf492..cf945d55c276 100644 --- a/trunk/arch/powerpc/platforms/52xx/Kconfig +++ b/trunk/arch/powerpc/platforms/52xx/Kconfig @@ -44,9 +44,3 @@ config PPC_MPC5200_BUGFIX It is safe to say 'Y' here -config PPC_MPC5200_GPIO - bool "MPC5200 GPIO support" - depends on PPC_MPC52xx - select HAVE_GPIO_LIB - help - Enable gpiolib support for mpc5200 based boards diff --git a/trunk/arch/powerpc/platforms/52xx/Makefile b/trunk/arch/powerpc/platforms/52xx/Makefile index daf0e1568d6d..fe1b81bb5224 100644 --- a/trunk/arch/powerpc/platforms/52xx/Makefile +++ b/trunk/arch/powerpc/platforms/52xx/Makefile @@ -14,5 +14,3 @@ obj-$(CONFIG_PM) += mpc52xx_sleep.o mpc52xx_pm.o ifeq ($(CONFIG_PPC_LITE5200),y) obj-$(CONFIG_PM) += lite5200_sleep.o lite5200_pm.o endif - -obj-$(CONFIG_PPC_MPC5200_GPIO) += mpc52xx_gpio.o \ No newline at end of file diff --git a/trunk/arch/powerpc/platforms/52xx/mpc5200_simple.c b/trunk/arch/powerpc/platforms/52xx/mpc5200_simple.c index a3bda0b9f1ff..c48b82bc2aad 100644 --- a/trunk/arch/powerpc/platforms/52xx/mpc5200_simple.c +++ b/trunk/arch/powerpc/platforms/52xx/mpc5200_simple.c @@ -51,7 +51,6 @@ static void __init mpc5200_simple_setup_arch(void) /* list of the supported boards */ static char *board[] __initdata = { "promess,motionpro", - "phytec,pcm030", "schindler,cm5200", "tqc,tqm5200", NULL diff --git a/trunk/arch/powerpc/platforms/52xx/mpc52xx_gpio.c b/trunk/arch/powerpc/platforms/52xx/mpc52xx_gpio.c deleted file mode 100644 index 48da5dfe4856..000000000000 --- a/trunk/arch/powerpc/platforms/52xx/mpc52xx_gpio.c +++ /dev/null @@ -1,465 +0,0 @@ -/* - * MPC52xx gpio driver - * - * Copyright (c) 2008 Sascha Hauer , Pengutronix - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include -#include -#include -#include -#include - -#include -#include -#include - -static DEFINE_SPINLOCK(gpio_lock); - -struct mpc52xx_gpiochip { - struct of_mm_gpio_chip mmchip; - unsigned int shadow_dvo; - unsigned int shadow_gpioe; - unsigned int shadow_ddr; -}; - -/* - * GPIO LIB API implementation for wakeup GPIOs. - * - * There's a maximum of 8 wakeup GPIOs. Which of these are available - * for use depends on your board setup. - * - * 0 -> GPIO_WKUP_7 - * 1 -> GPIO_WKUP_6 - * 2 -> PSC6_1 - * 3 -> PSC6_0 - * 4 -> ETH_17 - * 5 -> PSC3_9 - * 6 -> PSC2_4 - * 7 -> PSC1_4 - * - */ -static int mpc52xx_wkup_gpio_get(struct gpio_chip *gc, unsigned int gpio) -{ - struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); - struct mpc52xx_gpio_wkup __iomem *regs = mm_gc->regs; - unsigned int ret; - - ret = (in_8(®s->wkup_ival) >> (7 - gpio)) & 1; - - pr_debug("%s: gpio: %d ret: %d\n", __func__, gpio, ret); - - return ret; -} - -static inline void -__mpc52xx_wkup_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val) -{ - struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); - struct mpc52xx_gpiochip *chip = container_of(mm_gc, - struct mpc52xx_gpiochip, mmchip); - struct mpc52xx_gpio_wkup __iomem *regs = mm_gc->regs; - - if (val) - chip->shadow_dvo |= 1 << (7 - gpio); - else - chip->shadow_dvo &= ~(1 << (7 - gpio)); - - out_8(®s->wkup_dvo, chip->shadow_dvo); -} - -static void -mpc52xx_wkup_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val) -{ - unsigned long flags; - - spin_lock_irqsave(&gpio_lock, flags); - - __mpc52xx_wkup_gpio_set(gc, gpio, val); - - spin_unlock_irqrestore(&gpio_lock, flags); - - pr_debug("%s: gpio: %d val: %d\n", __func__, gpio, val); -} - -static int mpc52xx_wkup_gpio_dir_in(struct gpio_chip *gc, unsigned int gpio) -{ - struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); - struct mpc52xx_gpiochip *chip = container_of(mm_gc, - struct mpc52xx_gpiochip, mmchip); - struct mpc52xx_gpio_wkup *regs = mm_gc->regs; - unsigned long flags; - - spin_lock_irqsave(&gpio_lock, flags); - - /* set the direction */ - chip->shadow_ddr &= ~(1 << (7 - gpio)); - out_8(®s->wkup_ddr, chip->shadow_ddr); - - /* and enable the pin */ - chip->shadow_gpioe |= 1 << (7 - gpio); - out_8(®s->wkup_gpioe, chip->shadow_gpioe); - - spin_unlock_irqrestore(&gpio_lock, flags); - - return 0; -} - -static int -mpc52xx_wkup_gpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val) -{ - struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); - struct mpc52xx_gpio_wkup *regs = mm_gc->regs; - struct mpc52xx_gpiochip *chip = container_of(mm_gc, - struct mpc52xx_gpiochip, mmchip); - unsigned long flags; - - spin_lock_irqsave(&gpio_lock, flags); - - __mpc52xx_wkup_gpio_set(gc, gpio, val); - - /* Then set direction */ - chip->shadow_ddr |= 1 << (7 - gpio); - out_8(®s->wkup_ddr, chip->shadow_ddr); - - /* Finally enable the pin */ - chip->shadow_gpioe |= 1 << (7 - gpio); - out_8(®s->wkup_gpioe, chip->shadow_gpioe); - - spin_unlock_irqrestore(&gpio_lock, flags); - - pr_debug("%s: gpio: %d val: %d\n", __func__, gpio, val); - - return 0; -} - -static int __devinit mpc52xx_wkup_gpiochip_probe(struct of_device *ofdev, - const struct of_device_id *match) -{ - struct mpc52xx_gpiochip *chip; - struct mpc52xx_gpio_wkup *regs; - struct of_gpio_chip *ofchip; - int ret; - - chip = kzalloc(sizeof(*chip), GFP_KERNEL); - if (!chip) - return -ENOMEM; - - ofchip = &chip->mmchip.of_gc; - - ofchip->gpio_cells = 2; - ofchip->gc.ngpio = 8; - ofchip->gc.direction_input = mpc52xx_wkup_gpio_dir_in; - ofchip->gc.direction_output = mpc52xx_wkup_gpio_dir_out; - ofchip->gc.get = mpc52xx_wkup_gpio_get; - ofchip->gc.set = mpc52xx_wkup_gpio_set; - - ret = of_mm_gpiochip_add(ofdev->node, &chip->mmchip); - if (ret) - return ret; - - regs = chip->mmchip.regs; - chip->shadow_gpioe = in_8(®s->wkup_gpioe); - chip->shadow_ddr = in_8(®s->wkup_ddr); - chip->shadow_dvo = in_8(®s->wkup_dvo); - - return 0; -} - -static int mpc52xx_gpiochip_remove(struct of_device *ofdev) -{ - return -EBUSY; -} - -static const struct of_device_id mpc52xx_wkup_gpiochip_match[] = { - { - .compatible = "fsl,mpc5200-gpio-wkup", - }, - {} -}; - -static struct of_platform_driver mpc52xx_wkup_gpiochip_driver = { - .name = "gpio_wkup", - .match_table = mpc52xx_wkup_gpiochip_match, - .probe = mpc52xx_wkup_gpiochip_probe, - .remove = mpc52xx_gpiochip_remove, -}; - -/* - * GPIO LIB API implementation for simple GPIOs - * - * There's a maximum of 32 simple GPIOs. Which of these are available - * for use depends on your board setup. - * The numbering reflects the bit numbering in the port registers: - * - * 0..1 > reserved - * 2..3 > IRDA - * 4..7 > ETHR - * 8..11 > reserved - * 12..15 > USB - * 16..17 > reserved - * 18..23 > PSC3 - * 24..27 > PSC2 - * 28..31 > PSC1 - */ -static int mpc52xx_simple_gpio_get(struct gpio_chip *gc, unsigned int gpio) -{ - struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); - struct mpc52xx_gpio __iomem *regs = mm_gc->regs; - unsigned int ret; - - ret = (in_be32(®s->simple_ival) >> (31 - gpio)) & 1; - - return ret; -} - -static inline void -__mpc52xx_simple_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val) -{ - struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); - struct mpc52xx_gpiochip *chip = container_of(mm_gc, - struct mpc52xx_gpiochip, mmchip); - struct mpc52xx_gpio __iomem *regs = mm_gc->regs; - - if (val) - chip->shadow_dvo |= 1 << (31 - gpio); - else - chip->shadow_dvo &= ~(1 << (31 - gpio)); - out_be32(®s->simple_dvo, chip->shadow_dvo); -} - -static void -mpc52xx_simple_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val) -{ - unsigned long flags; - - spin_lock_irqsave(&gpio_lock, flags); - - __mpc52xx_simple_gpio_set(gc, gpio, val); - - spin_unlock_irqrestore(&gpio_lock, flags); - - pr_debug("%s: gpio: %d val: %d\n", __func__, gpio, val); -} - -static int mpc52xx_simple_gpio_dir_in(struct gpio_chip *gc, unsigned int gpio) -{ - struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); - struct mpc52xx_gpiochip *chip = container_of(mm_gc, - struct mpc52xx_gpiochip, mmchip); - struct mpc52xx_gpio *regs = mm_gc->regs; - unsigned long flags; - - spin_lock_irqsave(&gpio_lock, flags); - - /* set the direction */ - chip->shadow_ddr &= ~(1 << (31 - gpio)); - out_be32(®s->simple_ddr, chip->shadow_ddr); - - /* and enable the pin */ - chip->shadow_gpioe |= 1 << (31 - gpio); - out_be32(®s->simple_gpioe, chip->shadow_gpioe); - - spin_unlock_irqrestore(&gpio_lock, flags); - - return 0; -} - -static int -mpc52xx_simple_gpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val) -{ - struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); - struct mpc52xx_gpiochip *chip = container_of(mm_gc, - struct mpc52xx_gpiochip, mmchip); - struct mpc52xx_gpio *regs = mm_gc->regs; - unsigned long flags; - - spin_lock_irqsave(&gpio_lock, flags); - - /* First set initial value */ - __mpc52xx_simple_gpio_set(gc, gpio, val); - - /* Then set direction */ - chip->shadow_ddr |= 1 << (31 - gpio); - out_be32(®s->simple_ddr, chip->shadow_ddr); - - /* Finally enable the pin */ - chip->shadow_gpioe |= 1 << (31 - gpio); - out_be32(®s->simple_gpioe, chip->shadow_gpioe); - - spin_unlock_irqrestore(&gpio_lock, flags); - - pr_debug("%s: gpio: %d val: %d\n", __func__, gpio, val); - - return 0; -} - -static int __devinit mpc52xx_simple_gpiochip_probe(struct of_device *ofdev, - const struct of_device_id *match) -{ - struct mpc52xx_gpiochip *chip; - struct of_gpio_chip *ofchip; - struct mpc52xx_gpio *regs; - int ret; - - chip = kzalloc(sizeof(*chip), GFP_KERNEL); - if (!chip) - return -ENOMEM; - - ofchip = &chip->mmchip.of_gc; - - ofchip->gpio_cells = 2; - ofchip->gc.ngpio = 32; - ofchip->gc.direction_input = mpc52xx_simple_gpio_dir_in; - ofchip->gc.direction_output = mpc52xx_simple_gpio_dir_out; - ofchip->gc.get = mpc52xx_simple_gpio_get; - ofchip->gc.set = mpc52xx_simple_gpio_set; - - ret = of_mm_gpiochip_add(ofdev->node, &chip->mmchip); - if (ret) - return ret; - - regs = chip->mmchip.regs; - chip->shadow_gpioe = in_be32(®s->simple_gpioe); - chip->shadow_ddr = in_be32(®s->simple_ddr); - chip->shadow_dvo = in_be32(®s->simple_dvo); - - return 0; -} - -static const struct of_device_id mpc52xx_simple_gpiochip_match[] = { - { - .compatible = "fsl,mpc5200-gpio", - }, - {} -}; - -static struct of_platform_driver mpc52xx_simple_gpiochip_driver = { - .name = "gpio", - .match_table = mpc52xx_simple_gpiochip_match, - .probe = mpc52xx_simple_gpiochip_probe, - .remove = mpc52xx_gpiochip_remove, -}; - -/* - * GPIO LIB API implementation for gpt GPIOs. - * - * Each gpt only has a single GPIO. - */ -static int mpc52xx_gpt_gpio_get(struct gpio_chip *gc, unsigned int gpio) -{ - struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); - struct mpc52xx_gpt __iomem *regs = mm_gc->regs; - unsigned int ret; - - return (in_be32(®s->status) & (1 << (31 - 23))) ? 1 : 0; - - return ret; -} - -static void -mpc52xx_gpt_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val) -{ - struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); - struct mpc52xx_gpt __iomem *regs = mm_gc->regs; - - if (val) - out_be32(®s->mode, 0x34); - else - out_be32(®s->mode, 0x24); - - pr_debug("%s: gpio: %d val: %d\n", __func__, gpio, val); -} - -static int mpc52xx_gpt_gpio_dir_in(struct gpio_chip *gc, unsigned int gpio) -{ - struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); - struct mpc52xx_gpt *regs = mm_gc->regs; - - out_be32(®s->mode, 0x04); - - return 0; -} - -static int -mpc52xx_gpt_gpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val) -{ - mpc52xx_gpt_gpio_set(gc, gpio, val); - pr_debug("%s: gpio: %d val: %d\n", __func__, gpio, val); - - return 0; -} - -static int __devinit mpc52xx_gpt_gpiochip_probe(struct of_device *ofdev, - const struct of_device_id *match) -{ - struct of_mm_gpio_chip *mmchip; - struct of_gpio_chip *chip; - - mmchip = kzalloc(sizeof(*mmchip), GFP_KERNEL); - if (!mmchip) - return -ENOMEM; - - chip = &mmchip->of_gc; - - chip->gpio_cells = 2; - chip->gc.ngpio = 1; - chip->gc.direction_input = mpc52xx_gpt_gpio_dir_in; - chip->gc.direction_output = mpc52xx_gpt_gpio_dir_out; - chip->gc.get = mpc52xx_gpt_gpio_get; - chip->gc.set = mpc52xx_gpt_gpio_set; - - return of_mm_gpiochip_add(ofdev->node, mmchip); -} - -static const struct of_device_id mpc52xx_gpt_gpiochip_match[] = { - { - .compatible = "fsl,mpc5200-gpt-gpio", - }, - {} -}; - -static struct of_platform_driver mpc52xx_gpt_gpiochip_driver = { - .name = "gpio_gpt", - .match_table = mpc52xx_gpt_gpiochip_match, - .probe = mpc52xx_gpt_gpiochip_probe, - .remove = mpc52xx_gpiochip_remove, -}; - -static int __init mpc52xx_gpio_init(void) -{ - if (of_register_platform_driver(&mpc52xx_wkup_gpiochip_driver)) - printk(KERN_ERR "Unable to register wakeup GPIO driver\n"); - - if (of_register_platform_driver(&mpc52xx_simple_gpiochip_driver)) - printk(KERN_ERR "Unable to register simple GPIO driver\n"); - - if (of_register_platform_driver(&mpc52xx_gpt_gpiochip_driver)) - printk(KERN_ERR "Unable to register gpt GPIO driver\n"); - - return 0; -} - - -/* Make sure we get initialised before anyone else tries to use us */ -subsys_initcall(mpc52xx_gpio_init); - -/* No exit call at the moment as we cannot unregister of gpio chips */ - -MODULE_DESCRIPTION("Freescale MPC52xx gpio driver"); -MODULE_AUTHOR("Sascha Hauer #include #include #include @@ -110,48 +109,11 @@ static void mpc52xx_extirq_ack(unsigned int virq) io_be_setbit(&intr->ctrl, 27-l2irq); } -static int mpc52xx_extirq_set_type(unsigned int virq, unsigned int flow_type) -{ - u32 ctrl_reg, type; - int irq; - int l2irq; - - irq = irq_map[virq].hwirq; - l2irq = (irq & MPC52xx_IRQ_L2_MASK) >> MPC52xx_IRQ_L2_OFFSET; - - pr_debug("%s: irq=%x. l2=%d flow_type=%d\n", __func__, irq, l2irq, flow_type); - - switch (flow_type) { - case IRQF_TRIGGER_HIGH: - type = 0; - break; - case IRQF_TRIGGER_RISING: - type = 1; - break; - case IRQF_TRIGGER_FALLING: - type = 2; - break; - case IRQF_TRIGGER_LOW: - type = 3; - break; - default: - type = 0; - } - - ctrl_reg = in_be32(&intr->ctrl); - ctrl_reg &= ~(0x3 << (22 - (l2irq * 2))); - ctrl_reg |= (type << (22 - (l2irq * 2))); - out_be32(&intr->ctrl, ctrl_reg); - - return 0; -} - static struct irq_chip mpc52xx_extirq_irqchip = { .typename = " MPC52xx IRQ[0-3] ", .mask = mpc52xx_extirq_mask, .unmask = mpc52xx_extirq_unmask, .ack = mpc52xx_extirq_ack, - .set_type = mpc52xx_extirq_set_type, }; /* diff --git a/trunk/arch/powerpc/platforms/cell/spufs/.gitignore b/trunk/arch/powerpc/platforms/cell/spufs/.gitignore deleted file mode 100644 index a09ee8d84d6c..000000000000 --- a/trunk/arch/powerpc/platforms/cell/spufs/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -spu_save_dump.h -spu_restore_dump.h diff --git a/trunk/arch/powerpc/platforms/cell/spufs/context.c b/trunk/arch/powerpc/platforms/cell/spufs/context.c index 177735f79317..0ad83aeb70b1 100644 --- a/trunk/arch/powerpc/platforms/cell/spufs/context.c +++ b/trunk/arch/powerpc/platforms/cell/spufs/context.c @@ -78,7 +78,6 @@ void destroy_spu_context(struct kref *kref) { struct spu_context *ctx; ctx = container_of(kref, struct spu_context, kref); - spu_context_nospu_trace(destroy_spu_context__enter, ctx); mutex_lock(&ctx->state_mutex); spu_deactivate(ctx); mutex_unlock(&ctx->state_mutex); @@ -89,7 +88,6 @@ void destroy_spu_context(struct kref *kref) kref_put(ctx->prof_priv_kref, ctx->prof_priv_release); BUG_ON(!list_empty(&ctx->rq)); atomic_dec(&nr_spu_contexts); - kfree(ctx->switch_log); kfree(ctx); } @@ -152,8 +150,6 @@ int spu_acquire_saved(struct spu_context *ctx) { int ret; - spu_context_nospu_trace(spu_acquire_saved__enter, ctx); - ret = spu_acquire(ctx); if (ret) return ret; diff --git a/trunk/arch/powerpc/platforms/cell/spufs/file.c b/trunk/arch/powerpc/platforms/cell/spufs/file.c index 80911a373400..08f44d1971ac 100644 --- a/trunk/arch/powerpc/platforms/cell/spufs/file.c +++ b/trunk/arch/powerpc/platforms/cell/spufs/file.c @@ -2386,171 +2386,6 @@ static const struct file_operations spufs_stat_fops = { .release = single_release, }; -static inline int spufs_switch_log_used(struct spu_context *ctx) -{ - return (ctx->switch_log->head - ctx->switch_log->tail) % - SWITCH_LOG_BUFSIZE; -} - -static inline int spufs_switch_log_avail(struct spu_context *ctx) -{ - return SWITCH_LOG_BUFSIZE - spufs_switch_log_used(ctx); -} - -static int spufs_switch_log_open(struct inode *inode, struct file *file) -{ - struct spu_context *ctx = SPUFS_I(inode)->i_ctx; - - /* - * We (ab-)use the mapping_lock here because it serves the similar - * purpose for synchronizing open/close elsewhere. Maybe it should - * be renamed eventually. - */ - mutex_lock(&ctx->mapping_lock); - if (ctx->switch_log) { - spin_lock(&ctx->switch_log->lock); - ctx->switch_log->head = 0; - ctx->switch_log->tail = 0; - spin_unlock(&ctx->switch_log->lock); - } else { - /* - * We allocate the switch log data structures on first open. - * They will never be free because we assume a context will - * be traced until it goes away. - */ - ctx->switch_log = kzalloc(sizeof(struct switch_log) + - SWITCH_LOG_BUFSIZE * sizeof(struct switch_log_entry), - GFP_KERNEL); - if (!ctx->switch_log) - goto out; - spin_lock_init(&ctx->switch_log->lock); - init_waitqueue_head(&ctx->switch_log->wait); - } - mutex_unlock(&ctx->mapping_lock); - - return 0; - out: - mutex_unlock(&ctx->mapping_lock); - return -ENOMEM; -} - -static int switch_log_sprint(struct spu_context *ctx, char *tbuf, int n) -{ - struct switch_log_entry *p; - - p = ctx->switch_log->log + ctx->switch_log->tail % SWITCH_LOG_BUFSIZE; - - return snprintf(tbuf, n, "%u.%09u %d %u %u %llu\n", - (unsigned int) p->tstamp.tv_sec, - (unsigned int) p->tstamp.tv_nsec, - p->spu_id, - (unsigned int) p->type, - (unsigned int) p->val, - (unsigned long long) p->timebase); -} - -static ssize_t spufs_switch_log_read(struct file *file, char __user *buf, - size_t len, loff_t *ppos) -{ - struct inode *inode = file->f_path.dentry->d_inode; - struct spu_context *ctx = SPUFS_I(inode)->i_ctx; - int error = 0, cnt = 0; - - if (!buf || len < 0) - return -EINVAL; - - while (cnt < len) { - char tbuf[128]; - int width; - - if (file->f_flags & O_NONBLOCK) { - if (spufs_switch_log_used(ctx) <= 0) - return cnt ? cnt : -EAGAIN; - } else { - /* Wait for data in buffer */ - error = wait_event_interruptible(ctx->switch_log->wait, - spufs_switch_log_used(ctx) > 0); - if (error) - break; - } - - spin_lock(&ctx->switch_log->lock); - if (ctx->switch_log->head == ctx->switch_log->tail) { - /* multiple readers race? */ - spin_unlock(&ctx->switch_log->lock); - continue; - } - - width = switch_log_sprint(ctx, tbuf, sizeof(tbuf)); - if (width < len) { - ctx->switch_log->tail = - (ctx->switch_log->tail + 1) % - SWITCH_LOG_BUFSIZE; - } - - spin_unlock(&ctx->switch_log->lock); - - /* - * If the record is greater than space available return - * partial buffer (so far) - */ - if (width >= len) - break; - - error = copy_to_user(buf + cnt, tbuf, width); - if (error) - break; - cnt += width; - } - - return cnt == 0 ? error : cnt; -} - -static unsigned int spufs_switch_log_poll(struct file *file, poll_table *wait) -{ - struct inode *inode = file->f_path.dentry->d_inode; - struct spu_context *ctx = SPUFS_I(inode)->i_ctx; - unsigned int mask = 0; - - poll_wait(file, &ctx->switch_log->wait, wait); - - if (spufs_switch_log_used(ctx) > 0) - mask |= POLLIN; - - return mask; -} - -static const struct file_operations spufs_switch_log_fops = { - .owner = THIS_MODULE, - .open = spufs_switch_log_open, - .read = spufs_switch_log_read, - .poll = spufs_switch_log_poll, -}; - -void spu_switch_log_notify(struct spu *spu, struct spu_context *ctx, - u32 type, u32 val) -{ - if (!ctx->switch_log) - return; - - spin_lock(&ctx->switch_log->lock); - if (spufs_switch_log_avail(ctx) > 1) { - struct switch_log_entry *p; - - p = ctx->switch_log->log + ctx->switch_log->head; - ktime_get_ts(&p->tstamp); - p->timebase = get_tb(); - p->spu_id = spu ? spu->number : -1; - p->type = type; - p->val = val; - - ctx->switch_log->head = - (ctx->switch_log->head + 1) % SWITCH_LOG_BUFSIZE; - } - spin_unlock(&ctx->switch_log->lock); - - wake_up(&ctx->switch_log->wait); -} struct tree_descr spufs_dir_contents[] = { { "capabilities", &spufs_caps_fops, 0444, }, @@ -2587,7 +2422,6 @@ struct tree_descr spufs_dir_contents[] = { { "proxydma_info", &spufs_proxydma_info_fops, 0444, }, { "tid", &spufs_tid_fops, 0444, }, { "stat", &spufs_stat_fops, 0444, }, - { "switch_log", &spufs_switch_log_fops, 0444 }, {}, }; diff --git a/trunk/arch/powerpc/platforms/cell/spufs/run.c b/trunk/arch/powerpc/platforms/cell/spufs/run.c index a9c35b7b719f..96bf7c2b86fc 100644 --- a/trunk/arch/powerpc/platforms/cell/spufs/run.c +++ b/trunk/arch/powerpc/platforms/cell/spufs/run.c @@ -405,8 +405,6 @@ long spufs_run_spu(struct spu_context *ctx, u32 *npc, u32 *event) ret = spu_run_fini(ctx, npc, &status); spu_yield(ctx); - spu_switch_log_notify(NULL, ctx, SWITCH_LOG_EXIT, status); - if ((status & SPU_STATUS_STOPPED_BY_STOP) && (((status >> SPU_STOP_STATUS_SHIFT) & 0x3f00) == 0x2100)) ctx->stats.libassist++; diff --git a/trunk/arch/powerpc/platforms/cell/spufs/sched.c b/trunk/arch/powerpc/platforms/cell/spufs/sched.c index 7298e7db2c83..45dcd2693502 100644 --- a/trunk/arch/powerpc/platforms/cell/spufs/sched.c +++ b/trunk/arch/powerpc/platforms/cell/spufs/sched.c @@ -240,7 +240,6 @@ static void spu_bind_context(struct spu *spu, struct spu_context *ctx) spu->mfc_callback = spufs_mfc_callback; mb(); spu_unmap_mappings(ctx); - spu_switch_log_notify(spu, ctx, SWITCH_LOG_START, 0); spu_restore(&ctx->csa, spu); spu->timestamp = jiffies; spu_cpu_affinity_set(spu, raw_smp_processor_id()); @@ -420,7 +419,6 @@ static void spu_unbind_context(struct spu *spu, struct spu_context *ctx) spu_switch_notify(spu, NULL); spu_unmap_mappings(ctx); spu_save(&ctx->csa, spu); - spu_switch_log_notify(spu, ctx, SWITCH_LOG_STOP, 0); spu->timestamp = jiffies; ctx->state = SPU_STATE_SAVED; spu->ibox_callback = NULL; @@ -593,7 +591,7 @@ static struct spu *find_victim(struct spu_context *ctx) struct spu *spu; int node, n; - spu_context_nospu_trace(spu_find_victim__enter, ctx); + spu_context_nospu_trace(spu_find_vitim__enter, ctx); /* * Look for a possible preemption candidate on the local node first. diff --git a/trunk/arch/powerpc/platforms/cell/spufs/spufs.h b/trunk/arch/powerpc/platforms/cell/spufs/spufs.h index 7312745b7540..cdc515182f82 100644 --- a/trunk/arch/powerpc/platforms/cell/spufs/spufs.h +++ b/trunk/arch/powerpc/platforms/cell/spufs/spufs.h @@ -47,30 +47,6 @@ enum { SPU_SCHED_SPU_RUN, /* context is within spu_run */ }; -enum { - SWITCH_LOG_BUFSIZE = 4096, -}; - -enum { - SWITCH_LOG_START, - SWITCH_LOG_STOP, - SWITCH_LOG_EXIT, -}; - -struct switch_log { - spinlock_t lock; - wait_queue_head_t wait; - unsigned long head; - unsigned long tail; - struct switch_log_entry { - struct timespec tstamp; - s32 spu_id; - u32 type; - u32 val; - u64 timebase; - } log[]; -}; - struct spu_context { struct spu *spu; /* pointer to a physical SPU */ struct spu_state csa; /* SPU context save area. */ @@ -140,9 +116,6 @@ struct spu_context { unsigned long long libassist; } stats; - /* context switch log */ - struct switch_log *switch_log; - struct list_head aff_list; int aff_head; int aff_offset; @@ -283,8 +256,6 @@ int spu_activate(struct spu_context *ctx, unsigned long flags); void spu_deactivate(struct spu_context *ctx); void spu_yield(struct spu_context *ctx); void spu_switch_notify(struct spu *spu, struct spu_context *ctx); -void spu_switch_log_notify(struct spu *spu, struct spu_context *ctx, - u32 type, u32 val); void spu_set_timeslice(struct spu_context *ctx); void spu_update_sched_info(struct spu_context *ctx); void __spu_update_sched_info(struct spu_context *ctx); @@ -359,8 +330,8 @@ extern void spuctx_switch_state(struct spu_context *ctx, enum spu_utilization_state new_state); #define spu_context_trace(name, ctx, spu) \ - trace_mark(name, "ctx %p spu %p", ctx, spu); + trace_mark(name, "%p %p", ctx, spu); #define spu_context_nospu_trace(name, ctx) \ - trace_mark(name, "ctx %p", ctx); + trace_mark(name, "%p", ctx); #endif diff --git a/trunk/arch/powerpc/platforms/cell/spufs/sputrace.c b/trunk/arch/powerpc/platforms/cell/spufs/sputrace.c index 53202422ba72..aea5286f1245 100644 --- a/trunk/arch/powerpc/platforms/cell/spufs/sputrace.c +++ b/trunk/arch/powerpc/platforms/cell/spufs/sputrace.c @@ -171,24 +171,24 @@ static void spu_context_nospu_event(void *probe_private, void *call_data, } struct spu_probe spu_probes[] = { - { "spu_bind_context__enter", "ctx %p spu %p", spu_context_event }, - { "spu_unbind_context__enter", "ctx %p spu %p", spu_context_event }, - { "spu_get_idle__enter", "ctx %p", spu_context_nospu_event }, - { "spu_get_idle__found", "ctx %p spu %p", spu_context_event }, - { "spu_get_idle__not_found", "ctx %p", spu_context_nospu_event }, - { "spu_find_victim__enter", "ctx %p", spu_context_nospu_event }, - { "spusched_tick__preempt", "ctx %p spu %p", spu_context_event }, - { "spusched_tick__newslice", "ctx %p", spu_context_nospu_event }, - { "spu_yield__enter", "ctx %p", spu_context_nospu_event }, - { "spu_deactivate__enter", "ctx %p", spu_context_nospu_event }, - { "__spu_deactivate__unload", "ctx %p spu %p", spu_context_event }, - { "spufs_ps_nopfn__enter", "ctx %p", spu_context_nospu_event }, - { "spufs_ps_nopfn__sleep", "ctx %p", spu_context_nospu_event }, - { "spufs_ps_nopfn__wake", "ctx %p spu %p", spu_context_event }, - { "spufs_ps_nopfn__insert", "ctx %p spu %p", spu_context_event }, - { "spu_acquire_saved__enter", "ctx %p", spu_context_nospu_event }, - { "destroy_spu_context__enter", "ctx %p", spu_context_nospu_event }, - { "spufs_stop_callback__enter", "ctx %p spu %p", spu_context_event }, + { "spu_bind_context__enter", "%p %p", spu_context_event }, + { "spu_unbind_context__enter", "%p %p", spu_context_event }, + { "spu_get_idle__enter", "%p", spu_context_nospu_event }, + { "spu_get_idle__found", "%p %p", spu_context_event }, + { "spu_get_idle__not_found", "%p", spu_context_nospu_event }, + { "spu_find_victim__enter", "%p", spu_context_nospu_event }, + { "spusched_tick__preempt", "%p %p", spu_context_event }, + { "spusched_tick__newslice", "%p", spu_context_nospu_event }, + { "spu_yield__enter", "%p", spu_context_nospu_event }, + { "spu_deactivate__enter", "%p", spu_context_nospu_event }, + { "__spu_deactivate__unload", "%p %p", spu_context_event }, + { "spufs_ps_nopfn__enter", "%p", spu_context_nospu_event }, + { "spufs_ps_nopfn__sleep", "%p", spu_context_nospu_event }, + { "spufs_ps_nopfn__wake", "%p %p", spu_context_event }, + { "spufs_ps_nopfn__insert", "%p %p", spu_context_event }, + { "spu_acquire_saved__enter", "%p", spu_context_nospu_event }, + { "destroy_spu_context__enter", "%p", spu_context_nospu_event }, + { "spufs_stop_callback__enter", "%p %p", spu_context_event }, }; static int __init sputrace_init(void) diff --git a/trunk/arch/ppc/kernel/ppc_ksyms.c b/trunk/arch/ppc/kernel/ppc_ksyms.c index 16ac11ca7ba0..d9036ef0b658 100644 --- a/trunk/arch/ppc/kernel/ppc_ksyms.c +++ b/trunk/arch/ppc/kernel/ppc_ksyms.c @@ -183,6 +183,9 @@ EXPORT_SYMBOL(cuda_poll); #if defined(CONFIG_BOOTX_TEXT) EXPORT_SYMBOL(btext_update_display); #endif +#ifdef CONFIG_VT +EXPORT_SYMBOL(kd_mksound); +#endif EXPORT_SYMBOL(to_tm); EXPORT_SYMBOL(pm_power_off); diff --git a/trunk/arch/s390/kernel/entry.S b/trunk/arch/s390/kernel/entry.S index bdbb3bcd78a5..6766e37fe8ea 100644 --- a/trunk/arch/s390/kernel/entry.S +++ b/trunk/arch/s390/kernel/entry.S @@ -49,9 +49,9 @@ SP_ILC = STACK_FRAME_OVERHEAD + __PT_ILC SP_TRAP = STACK_FRAME_OVERHEAD + __PT_TRAP SP_SIZE = STACK_FRAME_OVERHEAD + __PT_SIZE -_TIF_WORK_SVC = (_TIF_SIGPENDING | _TIF_NEED_RESCHED | \ +_TIF_WORK_SVC = (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK | _TIF_NEED_RESCHED | \ _TIF_MCCK_PENDING | _TIF_RESTART_SVC | _TIF_SINGLE_STEP ) -_TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_NEED_RESCHED | \ +_TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK | _TIF_NEED_RESCHED | \ _TIF_MCCK_PENDING) STACK_SHIFT = PAGE_SHIFT + THREAD_ORDER @@ -316,7 +316,7 @@ sysc_work: bo BASED(sysc_mcck_pending) tm __TI_flags+3(%r9),_TIF_NEED_RESCHED bo BASED(sysc_reschedule) - tm __TI_flags+3(%r9),_TIF_SIGPENDING + tm __TI_flags+3(%r9),(_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK) bnz BASED(sysc_sigpending) tm __TI_flags+3(%r9),_TIF_RESTART_SVC bo BASED(sysc_restart) @@ -342,7 +342,7 @@ sysc_mcck_pending: br %r1 # TIF bit will be cleared by handler # -# _TIF_SIGPENDING is set, call do_signal +# _TIF_SIGPENDING or _TIF_RESTORE_SIGMASK is set, call do_signal # sysc_sigpending: ni __TI_flags+3(%r9),255-_TIF_SINGLE_STEP # clear TIF_SINGLE_STEP @@ -657,7 +657,7 @@ io_work: lr %r15,%r1 # # One of the work bits is on. Find out which one. -# Checked are: _TIF_SIGPENDING, _TIF_NEED_RESCHED +# Checked are: _TIF_SIGPENDING, _TIF_RESTORE_SIGMASK, _TIF_NEED_RESCHED # and _TIF_MCCK_PENDING # io_work_loop: @@ -665,7 +665,7 @@ io_work_loop: bo BASED(io_mcck_pending) tm __TI_flags+3(%r9),_TIF_NEED_RESCHED bo BASED(io_reschedule) - tm __TI_flags+3(%r9),_TIF_SIGPENDING + tm __TI_flags+3(%r9),(_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK) bnz BASED(io_sigpending) b BASED(io_restore) io_work_done: @@ -693,7 +693,7 @@ io_reschedule: b BASED(io_work_loop) # -# _TIF_SIGPENDING is set, call do_signal +# _TIF_SIGPENDING or _TIF_RESTORE_SIGMASK is set, call do_signal # io_sigpending: TRACE_IRQS_ON diff --git a/trunk/arch/s390/kernel/entry64.S b/trunk/arch/s390/kernel/entry64.S index 5a4a7bcd2bba..cd959c0b2e16 100644 --- a/trunk/arch/s390/kernel/entry64.S +++ b/trunk/arch/s390/kernel/entry64.S @@ -52,9 +52,9 @@ SP_SIZE = STACK_FRAME_OVERHEAD + __PT_SIZE STACK_SHIFT = PAGE_SHIFT + THREAD_ORDER STACK_SIZE = 1 << STACK_SHIFT -_TIF_WORK_SVC = (_TIF_SIGPENDING | _TIF_NEED_RESCHED | \ +_TIF_WORK_SVC = (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK | _TIF_NEED_RESCHED | \ _TIF_MCCK_PENDING | _TIF_RESTART_SVC | _TIF_SINGLE_STEP ) -_TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_NEED_RESCHED | \ +_TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK | _TIF_NEED_RESCHED | \ _TIF_MCCK_PENDING) #define BASED(name) name-system_call(%r13) @@ -308,7 +308,7 @@ sysc_work: jo sysc_mcck_pending tm __TI_flags+7(%r9),_TIF_NEED_RESCHED jo sysc_reschedule - tm __TI_flags+7(%r9),_TIF_SIGPENDING + tm __TI_flags+7(%r9),(_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK) jnz sysc_sigpending tm __TI_flags+7(%r9),_TIF_RESTART_SVC jo sysc_restart @@ -332,7 +332,7 @@ sysc_mcck_pending: jg s390_handle_mcck # TIF bit will be cleared by handler # -# _TIF_SIGPENDING is set, call do_signal +# _TIF_SIGPENDING or _TIF_RESTORE_SIGMASK is set, call do_signal # sysc_sigpending: ni __TI_flags+7(%r9),255-_TIF_SINGLE_STEP # clear TIF_SINGLE_STEP @@ -648,7 +648,7 @@ io_work_loop: jo io_mcck_pending tm __TI_flags+7(%r9),_TIF_NEED_RESCHED jo io_reschedule - tm __TI_flags+7(%r9),_TIF_SIGPENDING + tm __TI_flags+7(%r9),(_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK) jnz io_sigpending j io_restore io_work_done: @@ -674,7 +674,7 @@ io_reschedule: j io_work_loop # -# _TIF_SIGPENDING or is set, call do_signal +# _TIF_SIGPENDING or _TIF_RESTORE_SIGMASK is set, call do_signal # io_sigpending: TRACE_IRQS_ON diff --git a/trunk/arch/x86/ia32/ia32_signal.c b/trunk/arch/x86/ia32/ia32_signal.c index cb3856a18c85..bbed3a26ce55 100644 --- a/trunk/arch/x86/ia32/ia32_signal.c +++ b/trunk/arch/x86/ia32/ia32_signal.c @@ -128,7 +128,7 @@ asmlinkage long sys32_sigsuspend(int history0, int history1, old_sigset_t mask) current->state = TASK_INTERRUPTIBLE; schedule(); - set_restore_sigmask(); + set_thread_flag(TIF_RESTORE_SIGMASK); return -ERESTARTNOHAND; } diff --git a/trunk/arch/x86/kernel/signal_32.c b/trunk/arch/x86/kernel/signal_32.c index d92373630963..8e05e7f7bd40 100644 --- a/trunk/arch/x86/kernel/signal_32.c +++ b/trunk/arch/x86/kernel/signal_32.c @@ -57,7 +57,7 @@ sys_sigsuspend(int history0, int history1, old_sigset_t mask) current->state = TASK_INTERRUPTIBLE; schedule(); - set_restore_sigmask(); + set_thread_flag(TIF_RESTORE_SIGMASK); return -ERESTARTNOHAND; } @@ -593,7 +593,7 @@ static void do_signal(struct pt_regs *regs) if (!user_mode(regs)) return; - if (current_thread_info()->status & TS_RESTORE_SIGMASK) + if (test_thread_flag(TIF_RESTORE_SIGMASK)) oldset = ¤t->saved_sigmask; else oldset = ¤t->blocked; @@ -612,12 +612,13 @@ static void do_signal(struct pt_regs *regs) /* Whee! Actually deliver the signal. */ if (handle_signal(signr, &info, &ka, oldset, regs) == 0) { /* - * A signal was successfully delivered; the saved + * a signal was successfully delivered; the saved * sigmask will have been stored in the signal frame, * and will be restored by sigreturn, so we can simply - * clear the TS_RESTORE_SIGMASK flag. + * clear the TIF_RESTORE_SIGMASK flag */ - current_thread_info()->status &= ~TS_RESTORE_SIGMASK; + if (test_thread_flag(TIF_RESTORE_SIGMASK)) + clear_thread_flag(TIF_RESTORE_SIGMASK); } return; } @@ -644,8 +645,8 @@ static void do_signal(struct pt_regs *regs) * If there's no signal to deliver, we just put the saved sigmask * back. */ - if (current_thread_info()->status & TS_RESTORE_SIGMASK) { - current_thread_info()->status &= ~TS_RESTORE_SIGMASK; + if (test_thread_flag(TIF_RESTORE_SIGMASK)) { + clear_thread_flag(TIF_RESTORE_SIGMASK); sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); } } @@ -664,7 +665,7 @@ do_notify_resume(struct pt_regs *regs, void *unused, __u32 thread_info_flags) } /* deal with pending signal delivery */ - if (thread_info_flags & _TIF_SIGPENDING) + if (thread_info_flags & (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK)) do_signal(regs); if (thread_info_flags & _TIF_HRTICK_RESCHED) diff --git a/trunk/arch/x86/kernel/signal_64.c b/trunk/arch/x86/kernel/signal_64.c index e53b267662e7..ccb2a4560c2d 100644 --- a/trunk/arch/x86/kernel/signal_64.c +++ b/trunk/arch/x86/kernel/signal_64.c @@ -427,7 +427,7 @@ static void do_signal(struct pt_regs *regs) if (!user_mode(regs)) return; - if (current_thread_info()->status & TS_RESTORE_SIGMASK) + if (test_thread_flag(TIF_RESTORE_SIGMASK)) oldset = ¤t->saved_sigmask; else oldset = ¤t->blocked; @@ -444,13 +444,11 @@ static void do_signal(struct pt_regs *regs) /* Whee! Actually deliver the signal. */ if (handle_signal(signr, &info, &ka, oldset, regs) == 0) { - /* - * A signal was successfully delivered; the saved + /* a signal was successfully delivered; the saved * sigmask will have been stored in the signal frame, * and will be restored by sigreturn, so we can simply - * clear the TS_RESTORE_SIGMASK flag. - */ - current_thread_info()->status &= ~TS_RESTORE_SIGMASK; + * clear the TIF_RESTORE_SIGMASK flag */ + clear_thread_flag(TIF_RESTORE_SIGMASK); } return; } @@ -478,8 +476,8 @@ static void do_signal(struct pt_regs *regs) * If there's no signal to deliver, we just put the saved sigmask * back. */ - if (current_thread_info()->status & TS_RESTORE_SIGMASK) { - current_thread_info()->status &= ~TS_RESTORE_SIGMASK; + if (test_thread_flag(TIF_RESTORE_SIGMASK)) { + clear_thread_flag(TIF_RESTORE_SIGMASK); sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); } } @@ -500,7 +498,7 @@ void do_notify_resume(struct pt_regs *regs, void *unused, #endif /* CONFIG_X86_MCE */ /* deal with pending signal delivery */ - if (thread_info_flags & _TIF_SIGPENDING) + if (thread_info_flags & (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK)) do_signal(regs); if (thread_info_flags & _TIF_HRTICK_RESCHED) diff --git a/trunk/block/genhd.c b/trunk/block/genhd.c index fda9c7a63c29..00da5219ee37 100644 --- a/trunk/block/genhd.c +++ b/trunk/block/genhd.c @@ -182,17 +182,11 @@ static int exact_lock(dev_t devt, void *data) */ void add_disk(struct gendisk *disk) { - struct backing_dev_info *bdi; - disk->flags |= GENHD_FL_UP; blk_register_region(MKDEV(disk->major, disk->first_minor), disk->minors, NULL, exact_match, exact_lock, disk); register_disk(disk); blk_register_queue(disk); - - bdi = &disk->queue->backing_dev_info; - bdi_register_dev(bdi, MKDEV(disk->major, disk->first_minor)); - sysfs_create_link(&disk->dev.kobj, &bdi->dev->kobj, "bdi"); } EXPORT_SYMBOL(add_disk); @@ -200,8 +194,6 @@ EXPORT_SYMBOL(del_gendisk); /* in partitions/check.c */ void unlink_gendisk(struct gendisk *disk) { - sysfs_remove_link(&disk->dev.kobj, "bdi"); - bdi_unregister(&disk->queue->backing_dev_info); blk_unregister_queue(disk); blk_unregister_region(MKDEV(disk->major, disk->first_minor), disk->minors); diff --git a/trunk/drivers/Kconfig b/trunk/drivers/Kconfig index 59f33fa6af3e..80f0ec91e2cf 100644 --- a/trunk/drivers/Kconfig +++ b/trunk/drivers/Kconfig @@ -84,8 +84,6 @@ source "drivers/memstick/Kconfig" source "drivers/leds/Kconfig" -source "drivers/accessibility/Kconfig" - source "drivers/infiniband/Kconfig" source "drivers/edac/Kconfig" diff --git a/trunk/drivers/Makefile b/trunk/drivers/Makefile index f65deda72d61..e5e394a7e6c0 100644 --- a/trunk/drivers/Makefile +++ b/trunk/drivers/Makefile @@ -70,7 +70,6 @@ obj-$(CONFIG_WATCHDOG) += watchdog/ obj-$(CONFIG_PHONE) += telephony/ obj-$(CONFIG_MD) += md/ obj-$(CONFIG_BT) += bluetooth/ -obj-$(CONFIG_ACCESSIBILITY) += accessibility/ obj-$(CONFIG_ISDN) += isdn/ obj-$(CONFIG_EDAC) += edac/ obj-$(CONFIG_MCA) += mca/ diff --git a/trunk/drivers/accessibility/Kconfig b/trunk/drivers/accessibility/Kconfig deleted file mode 100644 index 1264c4b98094..000000000000 --- a/trunk/drivers/accessibility/Kconfig +++ /dev/null @@ -1,23 +0,0 @@ -menuconfig ACCESSIBILITY - bool "Accessibility support" - ---help--- - Enable a submenu where accessibility items may be enabled. - - If unsure, say N. - -if ACCESSIBILITY -config A11Y_BRAILLE_CONSOLE - bool "Console on braille device" - depends on VT - depends on SERIAL_CORE_CONSOLE - ---help--- - Enables console output on a braille device connected to a 8250 - serial port. For now only the VisioBraille device is supported. - - To actually enable it, you need to pass option - console=brl,ttyS0 - to the kernel. Options are the same as for serial console. - - If unsure, say N. - -endif # ACCESSIBILITY diff --git a/trunk/drivers/accessibility/Makefile b/trunk/drivers/accessibility/Makefile deleted file mode 100644 index 72b01a46546f..000000000000 --- a/trunk/drivers/accessibility/Makefile +++ /dev/null @@ -1 +0,0 @@ -obj-y += braille/ diff --git a/trunk/drivers/accessibility/braille/Makefile b/trunk/drivers/accessibility/braille/Makefile deleted file mode 100644 index 2e9f16c91347..000000000000 --- a/trunk/drivers/accessibility/braille/Makefile +++ /dev/null @@ -1 +0,0 @@ -obj-$(CONFIG_A11Y_BRAILLE_CONSOLE) += braille_console.o diff --git a/trunk/drivers/accessibility/braille/braille_console.c b/trunk/drivers/accessibility/braille/braille_console.c deleted file mode 100644 index 0a5f6b2114c5..000000000000 --- a/trunk/drivers/accessibility/braille/braille_console.c +++ /dev/null @@ -1,397 +0,0 @@ -/* - * Minimalistic braille device kernel support. - * - * By default, shows console messages on the braille device. - * Pressing Insert switches to VC browsing. - * - * Copyright (C) Samuel Thibault - * - * This program is free software ; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation ; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY ; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with the program ; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include - -MODULE_AUTHOR("samuel.thibault@ens-lyon.org"); -MODULE_DESCRIPTION("braille device"); -MODULE_LICENSE("GPL"); - -/* - * Braille device support part. - */ - -/* Emit various sounds */ -static int sound; -module_param(sound, bool, 0); -MODULE_PARM_DESC(sound, "emit sounds"); - -static void beep(unsigned int freq) -{ - if (sound) - kd_mksound(freq, HZ/10); -} - -/* mini console */ -#define WIDTH 40 -#define BRAILLE_KEY KEY_INSERT -static u16 console_buf[WIDTH]; -static int console_cursor; - -/* mini view of VC */ -static int vc_x, vc_y, lastvc_x, lastvc_y; - -/* show console ? (or show VC) */ -static int console_show = 1; -/* pending newline ? */ -static int console_newline = 1; -static int lastVC = -1; - -static struct console *braille_co; - -/* Very VisioBraille-specific */ -static void braille_write(u16 *buf) -{ - static u16 lastwrite[WIDTH]; - unsigned char data[1 + 1 + 2*WIDTH + 2 + 1], csum = 0, *c; - u16 out; - int i; - - if (!braille_co) - return; - - if (!memcmp(lastwrite, buf, WIDTH * sizeof(*buf))) - return; - memcpy(lastwrite, buf, WIDTH * sizeof(*buf)); - -#define SOH 1 -#define STX 2 -#define ETX 2 -#define EOT 4 -#define ENQ 5 - data[0] = STX; - data[1] = '>'; - csum ^= '>'; - c = &data[2]; - for (i = 0; i < WIDTH; i++) { - out = buf[i]; - if (out >= 0x100) - out = '?'; - else if (out == 0x00) - out = ' '; - csum ^= out; - if (out <= 0x05) { - *c++ = SOH; - out |= 0x40; - } - *c++ = out; - } - - if (csum <= 0x05) { - *c++ = SOH; - csum |= 0x40; - } - *c++ = csum; - *c++ = ETX; - - braille_co->write(braille_co, data, c - data); -} - -/* Follow the VC cursor*/ -static void vc_follow_cursor(struct vc_data *vc) -{ - vc_x = vc->vc_x - (vc->vc_x % WIDTH); - vc_y = vc->vc_y; - lastvc_x = vc->vc_x; - lastvc_y = vc->vc_y; -} - -/* Maybe the VC cursor moved, if so follow it */ -static void vc_maybe_cursor_moved(struct vc_data *vc) -{ - if (vc->vc_x != lastvc_x || vc->vc_y != lastvc_y) - vc_follow_cursor(vc); -} - -/* Show portion of VC at vc_x, vc_y */ -static void vc_refresh(struct vc_data *vc) -{ - u16 buf[WIDTH]; - int i; - - for (i = 0; i < WIDTH; i++) { - u16 glyph = screen_glyph(vc, - 2 * (vc_x + i) + vc_y * vc->vc_size_row); - buf[i] = inverse_translate(vc, glyph, 1); - } - braille_write(buf); -} - -/* - * Link to keyboard - */ - -static int keyboard_notifier_call(struct notifier_block *blk, - unsigned long code, void *_param) -{ - struct keyboard_notifier_param *param = _param; - struct vc_data *vc = param->vc; - int ret = NOTIFY_OK; - - if (!param->down) - return ret; - - switch (code) { - case KBD_KEYCODE: - if (console_show) { - if (param->value == BRAILLE_KEY) { - console_show = 0; - beep(880); - vc_maybe_cursor_moved(vc); - vc_refresh(vc); - ret = NOTIFY_STOP; - } - } else { - ret = NOTIFY_STOP; - switch (param->value) { - case KEY_INSERT: - beep(440); - console_show = 1; - lastVC = -1; - braille_write(console_buf); - break; - case KEY_LEFT: - if (vc_x > 0) { - vc_x -= WIDTH; - if (vc_x < 0) - vc_x = 0; - } else if (vc_y >= 1) { - beep(880); - vc_y--; - vc_x = vc->vc_cols-WIDTH; - } else - beep(220); - break; - case KEY_RIGHT: - if (vc_x + WIDTH < vc->vc_cols) { - vc_x += WIDTH; - } else if (vc_y + 1 < vc->vc_rows) { - beep(880); - vc_y++; - vc_x = 0; - } else - beep(220); - break; - case KEY_DOWN: - if (vc_y + 1 < vc->vc_rows) - vc_y++; - else - beep(220); - break; - case KEY_UP: - if (vc_y >= 1) - vc_y--; - else - beep(220); - break; - case KEY_HOME: - vc_follow_cursor(vc); - break; - case KEY_PAGEUP: - vc_x = 0; - vc_y = 0; - break; - case KEY_PAGEDOWN: - vc_x = 0; - vc_y = vc->vc_rows-1; - break; - default: - ret = NOTIFY_OK; - break; - } - if (ret == NOTIFY_STOP) - vc_refresh(vc); - } - break; - case KBD_POST_KEYSYM: - { - unsigned char type = KTYP(param->value) - 0xf0; - if (type == KT_SPEC) { - unsigned char val = KVAL(param->value); - int on_off = -1; - - switch (val) { - case KVAL(K_CAPS): - on_off = vc_kbd_led(kbd_table + fg_console, - VC_CAPSLOCK); - break; - case KVAL(K_NUM): - on_off = vc_kbd_led(kbd_table + fg_console, - VC_NUMLOCK); - break; - case KVAL(K_HOLD): - on_off = vc_kbd_led(kbd_table + fg_console, - VC_SCROLLOCK); - break; - } - if (on_off == 1) - beep(880); - else if (on_off == 0) - beep(440); - } - } - case KBD_UNBOUND_KEYCODE: - case KBD_UNICODE: - case KBD_KEYSYM: - /* Unused */ - break; - } - return ret; -} - -static struct notifier_block keyboard_notifier_block = { - .notifier_call = keyboard_notifier_call, -}; - -static int vt_notifier_call(struct notifier_block *blk, - unsigned long code, void *_param) -{ - struct vt_notifier_param *param = _param; - struct vc_data *vc = param->vc; - switch (code) { - case VT_ALLOCATE: - break; - case VT_DEALLOCATE: - break; - case VT_WRITE: - { - unsigned char c = param->c; - if (vc->vc_num != fg_console) - break; - switch (c) { - case '\b': - case 127: - if (console_cursor > 0) { - console_cursor--; - console_buf[console_cursor] = ' '; - } - break; - case '\n': - case '\v': - case '\f': - case '\r': - console_newline = 1; - break; - case '\t': - c = ' '; - /* Fallthrough */ - default: - if (c < 32) - /* Ignore other control sequences */ - break; - if (console_newline) { - memset(console_buf, 0, sizeof(console_buf)); - console_cursor = 0; - console_newline = 0; - } - if (console_cursor == WIDTH) - memmove(console_buf, &console_buf[1], - (WIDTH-1) * sizeof(*console_buf)); - else - console_cursor++; - console_buf[console_cursor-1] = c; - break; - } - if (console_show) - braille_write(console_buf); - else { - vc_maybe_cursor_moved(vc); - vc_refresh(vc); - } - break; - } - case VT_UPDATE: - /* Maybe a VT switch, flush */ - if (console_show) { - if (vc->vc_num != lastVC) { - lastVC = vc->vc_num; - memset(console_buf, 0, sizeof(console_buf)); - console_cursor = 0; - braille_write(console_buf); - } - } else { - vc_maybe_cursor_moved(vc); - vc_refresh(vc); - } - break; - } - return NOTIFY_OK; -} - -static struct notifier_block vt_notifier_block = { - .notifier_call = vt_notifier_call, -}; - -/* - * Called from printk.c when console=brl is given - */ - -int braille_register_console(struct console *console, int index, - char *console_options, char *braille_options) -{ - int ret; - if (!console_options) - /* Only support VisioBraille for now */ - console_options = "57600o8"; - if (braille_co) - return -ENODEV; - if (console->setup) { - ret = console->setup(console, console_options); - if (ret != 0) - return ret; - } - console->flags |= CON_ENABLED; - console->index = index; - braille_co = console; - return 0; -} - -int braille_unregister_console(struct console *console) -{ - if (braille_co != console) - return -EINVAL; - braille_co = NULL; - return 0; -} - -static int __init braille_init(void) -{ - register_keyboard_notifier(&keyboard_notifier_block); - register_vt_notifier(&vt_notifier_block); - return 0; -} - -console_initcall(braille_init); diff --git a/trunk/drivers/base/node.c b/trunk/drivers/base/node.c index 39f3d1b3a213..12fde2d03d69 100644 --- a/trunk/drivers/base/node.c +++ b/trunk/drivers/base/node.c @@ -77,7 +77,6 @@ static ssize_t node_read_meminfo(struct sys_device * dev, char * buf) "Node %d PageTables: %8lu kB\n" "Node %d NFS_Unstable: %8lu kB\n" "Node %d Bounce: %8lu kB\n" - "Node %d WritebackTmp: %8lu kB\n" "Node %d Slab: %8lu kB\n" "Node %d SReclaimable: %8lu kB\n" "Node %d SUnreclaim: %8lu kB\n", @@ -100,7 +99,6 @@ static ssize_t node_read_meminfo(struct sys_device * dev, char * buf) nid, K(node_page_state(nid, NR_PAGETABLE)), nid, K(node_page_state(nid, NR_UNSTABLE_NFS)), nid, K(node_page_state(nid, NR_BOUNCE)), - nid, K(node_page_state(nid, NR_WRITEBACK_TEMP)), nid, K(node_page_state(nid, NR_SLAB_RECLAIMABLE) + node_page_state(nid, NR_SLAB_UNRECLAIMABLE)), nid, K(node_page_state(nid, NR_SLAB_RECLAIMABLE)), diff --git a/trunk/drivers/block/brd.c b/trunk/drivers/block/brd.c index a196ef7f147f..e8e38faeafd8 100644 --- a/trunk/drivers/block/brd.c +++ b/trunk/drivers/block/brd.c @@ -387,14 +387,10 @@ static struct block_device_operations brd_fops = { */ static int rd_nr; int rd_size = CONFIG_BLK_DEV_RAM_SIZE; -static int max_part; -static int part_shift; module_param(rd_nr, int, 0); MODULE_PARM_DESC(rd_nr, "Maximum number of brd devices"); module_param(rd_size, int, 0); MODULE_PARM_DESC(rd_size, "Size of each RAM disk in kbytes."); -module_param(max_part, int, 0); -MODULE_PARM_DESC(max_part, "Maximum number of partitions per RAM disk"); MODULE_LICENSE("GPL"); MODULE_ALIAS_BLOCKDEV_MAJOR(RAMDISK_MAJOR); @@ -439,11 +435,11 @@ static struct brd_device *brd_alloc(int i) blk_queue_max_sectors(brd->brd_queue, 1024); blk_queue_bounce_limit(brd->brd_queue, BLK_BOUNCE_ANY); - disk = brd->brd_disk = alloc_disk(1 << part_shift); + disk = brd->brd_disk = alloc_disk(1); if (!disk) goto out_free_queue; disk->major = RAMDISK_MAJOR; - disk->first_minor = i << part_shift; + disk->first_minor = i; disk->fops = &brd_fops; disk->private_data = brd; disk->queue = brd->brd_queue; @@ -527,12 +523,7 @@ static int __init brd_init(void) * themselves and have kernel automatically instantiate actual * device on-demand. */ - - part_shift = 0; - if (max_part > 0) - part_shift = fls(max_part); - - if (rd_nr > 1UL << (MINORBITS - part_shift)) + if (rd_nr > 1UL << MINORBITS) return -EINVAL; if (rd_nr) { @@ -540,7 +531,7 @@ static int __init brd_init(void) range = rd_nr; } else { nr = CONFIG_BLK_DEV_RAM_COUNT; - range = 1UL << (MINORBITS - part_shift); + range = 1UL << MINORBITS; } if (register_blkdev(RAMDISK_MAJOR, "ramdisk")) @@ -579,7 +570,7 @@ static void __exit brd_exit(void) unsigned long range; struct brd_device *brd, *next; - range = rd_nr ? rd_nr : 1UL << (MINORBITS - part_shift); + range = rd_nr ? rd_nr : 1UL << MINORBITS; list_for_each_entry_safe(brd, next, &brd_devices, brd_list) brd_del_one(brd); diff --git a/trunk/drivers/bluetooth/hci_ldisc.c b/trunk/drivers/bluetooth/hci_ldisc.c index e5cd856a2fea..7e31d5f1bc8a 100644 --- a/trunk/drivers/bluetooth/hci_ldisc.c +++ b/trunk/drivers/bluetooth/hci_ldisc.c @@ -143,7 +143,7 @@ int hci_uart_tx_wakeup(struct hci_uart *hu) int len; set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); - len = tty->ops->write(tty, skb->data, skb->len); + len = tty->driver->write(tty, skb->data, skb->len); hdev->stat.byte_tx += len; skb_pull(skb, len); @@ -190,7 +190,8 @@ static int hci_uart_flush(struct hci_dev *hdev) /* Flush any pending characters in the driver and discipline. */ tty_ldisc_flush(tty); - tty_driver_flush_buffer(tty); + if (tty->driver && tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if (test_bit(HCI_UART_PROTO_SET, &hu->flags)) hu->proto->flush(hu); @@ -284,7 +285,9 @@ static int hci_uart_tty_open(struct tty_struct *tty) if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); - tty_driver_flush_buffer(tty); + + if (tty->driver && tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); return 0; } @@ -370,7 +373,9 @@ static void hci_uart_tty_receive(struct tty_struct *tty, const u8 *data, char *f hu->hdev->stat.byte_rx += count; spin_unlock(&hu->rx_lock); - tty_unthrottle(tty); + if (test_and_clear_bit(TTY_THROTTLED, &tty->flags) && + tty->driver->unthrottle) + tty->driver->unthrottle(tty); } static int hci_uart_register_dev(struct hci_uart *hu) diff --git a/trunk/drivers/char/agp/agp.h b/trunk/drivers/char/agp/agp.h index 99e6a406efb4..c69f79598e47 100644 --- a/trunk/drivers/char/agp/agp.h +++ b/trunk/drivers/char/agp/agp.h @@ -35,7 +35,7 @@ //#define AGP_DEBUG 1 #ifdef AGP_DEBUG -#define DBG(x,y...) printk (KERN_DEBUG PFX "%s: " x "\n", __func__ , ## y) +#define DBG(x,y...) printk (KERN_DEBUG PFX "%s: " x "\n", __FUNCTION__ , ## y) #else #define DBG(x,y...) do { } while (0) #endif diff --git a/trunk/drivers/char/amiserial.c b/trunk/drivers/char/amiserial.c index 37457e5a4f2b..3d468f502d2d 100644 --- a/trunk/drivers/char/amiserial.c +++ b/trunk/drivers/char/amiserial.c @@ -832,34 +832,33 @@ static void change_speed(struct async_struct *info, local_irq_restore(flags); } -static int rs_put_char(struct tty_struct *tty, unsigned char ch) +static void rs_put_char(struct tty_struct *tty, unsigned char ch) { struct async_struct *info; unsigned long flags; if (!tty) - return 0; + return; info = tty->driver_data; if (serial_paranoia_check(info, tty->name, "rs_put_char")) - return 0; + return; if (!info->xmit.buf) - return 0; + return; local_irq_save(flags); if (CIRC_SPACE(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE) == 0) { local_irq_restore(flags); - return 0; + return; } info->xmit.buf[info->xmit.head++] = ch; info->xmit.head &= SERIAL_XMIT_SIZE-1; local_irq_restore(flags); - return 1; } static void rs_flush_chars(struct tty_struct *tty) @@ -1075,7 +1074,6 @@ static int get_serial_info(struct async_struct * info, if (!retinfo) return -EFAULT; memset(&tmp, 0, sizeof(tmp)); - lock_kernel(); tmp.type = state->type; tmp.line = state->line; tmp.port = state->port; @@ -1086,7 +1084,6 @@ static int get_serial_info(struct async_struct * info, tmp.close_delay = state->close_delay; tmp.closing_wait = state->closing_wait; tmp.custom_divisor = state->custom_divisor; - unlock_kernel(); if (copy_to_user(retinfo,&tmp,sizeof(*retinfo))) return -EFAULT; return 0; @@ -1102,17 +1099,13 @@ static int set_serial_info(struct async_struct * info, if (copy_from_user(&new_serial,new_info,sizeof(new_serial))) return -EFAULT; - - lock_kernel(); state = info->state; old_state = *state; change_irq = new_serial.irq != state->irq; change_port = (new_serial.port != state->port); - if(change_irq || change_port || (new_serial.xmit_fifo_size != state->xmit_fifo_size)) { - unlock_kernel(); + if(change_irq || change_port || (new_serial.xmit_fifo_size != state->xmit_fifo_size)) return -EINVAL; - } if (!serial_isroot()) { if ((new_serial.baud_base != state->baud_base) || @@ -1129,10 +1122,8 @@ static int set_serial_info(struct async_struct * info, goto check_and_exit; } - if (new_serial.baud_base < 9600) { - unlock_kernel(); + if (new_serial.baud_base < 9600) return -EINVAL; - } /* * OK, past this point, all the error checking has been done. @@ -1166,7 +1157,6 @@ static int set_serial_info(struct async_struct * info, } } else retval = startup(info); - unlock_kernel(); return retval; } @@ -1506,7 +1496,8 @@ static void rs_close(struct tty_struct *tty, struct file * filp) rs_wait_until_sent(tty, info->timeout); } shutdown(info); - rs_flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); tty_ldisc_flush(tty); tty->closing = 0; @@ -1539,8 +1530,6 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout) return; /* Just in case.... */ orig_jiffies = jiffies; - - lock_kernel(); /* * Set the check interval to be 1/5 of the estimated time to * send a single character, and make it at least 1. The check @@ -1581,7 +1570,6 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout) break; } __set_current_state(TASK_RUNNING); - unlock_kernel(); #ifdef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT printk("lsr = %d (jiff=%lu)...done\n", lsr, jiffies); #endif diff --git a/trunk/drivers/char/applicom.c b/trunk/drivers/char/applicom.c index 31d08b641f5b..a7c4990b5b6b 100644 --- a/trunk/drivers/char/applicom.c +++ b/trunk/drivers/char/applicom.c @@ -199,7 +199,7 @@ static int __init applicom_init(void) if (pci_enable_device(dev)) return -EIO; - RamIO = ioremap_nocache(pci_resource_start(dev, 0), LEN_RAM_IO); + RamIO = ioremap(pci_resource_start(dev, 0), LEN_RAM_IO); if (!RamIO) { printk(KERN_INFO "ac.o: Failed to ioremap PCI memory " @@ -254,7 +254,7 @@ static int __init applicom_init(void) /* Now try the specified ISA cards */ for (i = 0; i < MAX_ISA_BOARD; i++) { - RamIO = ioremap_nocache(mem + (LEN_RAM_IO * i), LEN_RAM_IO); + RamIO = ioremap(mem + (LEN_RAM_IO * i), LEN_RAM_IO); if (!RamIO) { printk(KERN_INFO "ac.o: Failed to ioremap the ISA card's memory space (slot #%d)\n", i + 1); diff --git a/trunk/drivers/char/consolemap.c b/trunk/drivers/char/consolemap.c index 4246b8e36cb3..6b104e45a322 100644 --- a/trunk/drivers/char/consolemap.c +++ b/trunk/drivers/char/consolemap.c @@ -277,7 +277,6 @@ u16 inverse_translate(struct vc_data *conp, int glyph, int use_unicode) return p->inverse_translations[m][glyph]; } } -EXPORT_SYMBOL_GPL(inverse_translate); static void update_user_maps(void) { diff --git a/trunk/drivers/char/cyclades.c b/trunk/drivers/char/cyclades.c index ef73e72daedc..e4f579c3e245 100644 --- a/trunk/drivers/char/cyclades.c +++ b/trunk/drivers/char/cyclades.c @@ -21,6 +21,7 @@ * * This version supports shared IRQ's (only for PCI boards). * + * $Log: cyclades.c,v $ * Prevent users from opening non-existing Z ports. * * Revision 2.3.2.8 2000/07/06 18:14:16 ivan @@ -61,7 +62,7 @@ * Driver now makes sure that the constant SERIAL_XMIT_SIZE is defined; * * Revision 2.3.2.2 1999/10/01 11:27:43 ivan - * Fixed bug in cyz_poll that would make all ports but port 0 + * Fixed bug in cyz_poll that would make all ports but port 0 * unable to transmit/receive data (Cyclades-Z only); * Implemented logic to prevent the RX buffer from being stuck with data * due to a driver / firmware race condition in interrupt op mode @@ -82,25 +83,25 @@ * Revision 2.3.1.1 1999/07/15 16:45:53 ivan * Removed CY_PROC conditional compilation; * Implemented SMP-awareness for the driver; - * Implemented a new ISA IRQ autoprobe that uses the irq_probe_[on|off] + * Implemented a new ISA IRQ autoprobe that uses the irq_probe_[on|off] * functions; * The driver now accepts memory addresses (maddr=0xMMMMM) and IRQs * (irq=NN) as parameters (only for ISA boards); - * Fixed bug in set_line_char that would prevent the Cyclades-Z + * Fixed bug in set_line_char that would prevent the Cyclades-Z * ports from being configured at speeds above 115.2Kbps; * Fixed bug in cy_set_termios that would prevent XON/XOFF flow control * switching from working properly; - * The driver now only prints IRQ info for the Cyclades-Z if it's + * The driver now only prints IRQ info for the Cyclades-Z if it's * configured to work in interrupt mode; * * Revision 2.2.2.3 1999/06/28 11:13:29 ivan * Added support for interrupt mode operation for the Z cards; * Removed the driver inactivity control for the Z; - * Added a missing MOD_DEC_USE_COUNT in the cy_open function for when + * Added a missing MOD_DEC_USE_COUNT in the cy_open function for when * the Z firmware is not loaded yet; - * Replaced the "manual" Z Tx flush buffer by a call to a FW command of + * Replaced the "manual" Z Tx flush buffer by a call to a FW command of * same functionality; - * Implemented workaround for IRQ setting loss on the PCI configuration + * Implemented workaround for IRQ setting loss on the PCI configuration * registers after a PCI bridge EEPROM reload (affects PLX9060 only); * * Revision 2.2.2.2 1999/05/14 17:18:15 ivan @@ -111,22 +112,22 @@ * BREAK implementation changed in order to make use of the 'break_ctl' * TTY facility; * Fixed typo in TTY structure field 'driver_name'; - * Included a PCI bridge reset and EEPROM reload in the board + * Included a PCI bridge reset and EEPROM reload in the board * initialization code (for both Y and Z series). * * Revision 2.2.2.1 1999/04/08 16:17:43 ivan - * Fixed a bug in cy_wait_until_sent that was preventing the port to be + * Fixed a bug in cy_wait_until_sent that was preventing the port to be * closed properly after a SIGINT; * Module usage counter scheme revisited; * Added support to the upcoming Y PCI boards (i.e., support to additional * PCI Device ID's). - * + * * Revision 2.2.1.10 1999/01/20 16:14:29 ivan * Removed all unnecessary page-alignement operations in ioremap calls * (ioremap is currently safe for these operations). * * Revision 2.2.1.9 1998/12/30 18:18:30 ivan - * Changed access to PLX PCI bridge registers from I/O to MMIO, in + * Changed access to PLX PCI bridge registers from I/O to MMIO, in * order to make PLX9050-based boards work with certain motherboards. * * Revision 2.2.1.8 1998/11/13 12:46:20 ivan @@ -147,7 +148,7 @@ * Fixed Cyclom-4Yo hardware detection bug. * * Revision 2.2.1.4 1998/08/04 11:02:50 ivan - * /proc/cyclades implementation with great collaboration of + * /proc/cyclades implementation with great collaboration of * Marc Lewis ; * cyy_interrupt was changed to avoid occurrence of kernel oopses * during PPP operation. @@ -156,7 +157,7 @@ * General code review in order to comply with 2.1 kernel standards; * data loss prevention for slow devices revisited (cy_wait_until_sent * was created); - * removed conditional compilation for new/old PCI structure support + * removed conditional compilation for new/old PCI structure support * (now the driver only supports the new PCI structure). * * Revision 2.2.1.1 1998/03/19 16:43:12 ivan @@ -167,7 +168,7 @@ * cleaned up the data loss fix; * fixed XON/XOFF handling once more (Cyclades-Z); * general review of the driver routines; - * introduction of a mechanism to prevent data loss with slow + * introduction of a mechanism to prevent data loss with slow * printers, by forcing a delay before closing the port. * * Revision 2.1.1.2 1998/02/17 16:50:00 ivan @@ -181,12 +182,12 @@ * Code review for the module cleanup routine; * fixed RTS and DTR status report for new CD1400's in get_modem_info; * includes anonymous changes regarding signal_pending. - * + * * Revision 2.1 1997/11/01 17:42:41 ivan * Changes in the driver to support Alpha systems (except 8Zo V_1); * BREAK fix for the Cyclades-Z boards; * driver inactivity control by FW implemented; - * introduction of flag that allows driver to take advantage of + * introduction of flag that allows driver to take advantage of * a special CD1400 feature related to HW flow control; * added support for the CD1400 rev. J (Cyclom-Y boards); * introduction of ioctls to: @@ -195,17 +196,17 @@ * - adjust the polling interval (Cyclades-Z); * * Revision 1.36.4.33 1997/06/27 19:00:00 ivan - * Fixes related to kernel version conditional + * Fixes related to kernel version conditional * compilation. - * + * * Revision 1.36.4.32 1997/06/14 19:30:00 ivan - * Compatibility issues between kernels 2.0.x and + * Compatibility issues between kernels 2.0.x and * 2.1.x (mainly related to clear_bit function). - * + * * Revision 1.36.4.31 1997/06/03 15:30:00 ivan - * Changes to define the memory window according to the + * Changes to define the memory window according to the * board type. - * + * * Revision 1.36.4.30 1997/05/16 15:30:00 daniel * Changes to support new cycladesZ boards. * @@ -623,7 +624,7 @@ #undef CY_PCI_DEBUG /* - * Include section + * Include section */ #include #include @@ -648,9 +649,9 @@ #include #include -#include +#include #include -#include +#include #include #include @@ -667,10 +668,10 @@ static void cy_send_xchar(struct tty_struct *tty, char ch); ((readl(&((struct RUNTIME_9060 __iomem *) \ ((card).ctl_addr))->init_ctrl) & (1<<17)) != 0) -#define ISZLOADED(card) (((ZO_V1 == readl(&((struct RUNTIME_9060 __iomem *) \ +#define ISZLOADED(card) (((ZO_V1==readl(&((struct RUNTIME_9060 __iomem *) \ ((card).ctl_addr))->mail_box_0)) || \ Z_FPGA_CHECK(card)) && \ - (ZFIRM_ID == readl(&((struct FIRM_ID __iomem *) \ + (ZFIRM_ID==readl(&((struct FIRM_ID __iomem *) \ ((card).base_addr+ID_ADDRESS))->signature))) #ifndef SERIAL_XMIT_SIZE @@ -808,12 +809,12 @@ static char baud_cor3[] = { /* receive threshold */ /* * The Cyclades driver implements HW flow control as any serial driver. - * The cyclades_port structure member rflow and the vector rflow_thr - * allows us to take advantage of a special feature in the CD1400 to avoid - * data loss even when the system interrupt latency is too high. These flags - * are to be used only with very special applications. Setting these flags - * requires the use of a special cable (DTR and RTS reversed). In the new - * CD1400-based boards (rev. 6.00 or later), there is no need for special + * The cyclades_port structure member rflow and the vector rflow_thr + * allows us to take advantage of a special feature in the CD1400 to avoid + * data loss even when the system interrupt latency is too high. These flags + * are to be used only with very special applications. Setting these flags + * requires the use of a special cable (DTR and RTS reversed). In the new + * CD1400-based boards (rev. 6.00 or later), there is no need for special * cables. */ @@ -840,22 +841,14 @@ static int cy_chip_offset[] = { 0x0000, #ifdef CONFIG_PCI static struct pci_device_id cy_pci_dev_id[] __devinitdata = { - /* PCI < 1Mb */ - { PCI_DEVICE(PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_CYCLOM_Y_Lo) }, - /* PCI > 1Mb */ - { PCI_DEVICE(PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_CYCLOM_Y_Hi) }, - /* 4Y PCI < 1Mb */ - { PCI_DEVICE(PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_CYCLOM_4Y_Lo) }, - /* 4Y PCI > 1Mb */ - { PCI_DEVICE(PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_CYCLOM_4Y_Hi) }, - /* 8Y PCI < 1Mb */ - { PCI_DEVICE(PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_CYCLOM_8Y_Lo) }, - /* 8Y PCI > 1Mb */ - { PCI_DEVICE(PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_CYCLOM_8Y_Hi) }, - /* Z PCI < 1Mb */ - { PCI_DEVICE(PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_CYCLOM_Z_Lo) }, - /* Z PCI > 1Mb */ - { PCI_DEVICE(PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_CYCLOM_Z_Hi) }, + { PCI_DEVICE(PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_CYCLOM_Y_Lo) }, /* PCI < 1Mb */ + { PCI_DEVICE(PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_CYCLOM_Y_Hi) }, /* PCI > 1Mb */ + { PCI_DEVICE(PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_CYCLOM_4Y_Lo) }, /* 4Y PCI < 1Mb */ + { PCI_DEVICE(PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_CYCLOM_4Y_Hi) }, /* 4Y PCI > 1Mb */ + { PCI_DEVICE(PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_CYCLOM_8Y_Lo) }, /* 8Y PCI < 1Mb */ + { PCI_DEVICE(PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_CYCLOM_8Y_Hi) }, /* 8Y PCI > 1Mb */ + { PCI_DEVICE(PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_CYCLOM_Z_Lo) }, /* Z PCI < 1Mb */ + { PCI_DEVICE(PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_CYCLOM_Z_Hi) }, /* Z PCI > 1Mb */ { } /* end of table */ }; MODULE_DEVICE_TABLE(pci, cy_pci_dev_id); @@ -912,14 +905,15 @@ static inline int serial_paranoia_check(struct cyclades_port *info, This function is only called from inside spinlock-protected code. */ -static int cyy_issue_cmd(void __iomem *base_addr, u_char cmd, int index) +static int cyy_issue_cmd(void __iomem * base_addr, u_char cmd, int index) { unsigned int i; /* Check to see that the previous command has completed */ for (i = 0; i < 100; i++) { - if (readb(base_addr + (CyCCR << index)) == 0) + if (readb(base_addr + (CyCCR << index)) == 0) { break; + } udelay(10L); } /* if the CCR never cleared, the previous command @@ -935,7 +929,7 @@ static int cyy_issue_cmd(void __iomem *base_addr, u_char cmd, int index) #ifdef CONFIG_ISA /* ISA interrupt detection code */ -static unsigned detect_isa_irq(void __iomem *address) +static unsigned detect_isa_irq(void __iomem * address) { int irq; unsigned long irqs, flags; @@ -1044,7 +1038,7 @@ static void cyy_chip_rx(struct cyclades_card *cinfo, int chip, if (info->flags & ASYNC_SAK) do_SAK(tty); } else if (data & CyFRAME) { - tty_insert_flip_char(tty, + tty_insert_flip_char( tty, readb(base_addr + (CyRDSR << index)), TTY_FRAME); info->icount.rx++; @@ -1326,8 +1320,7 @@ static irqreturn_t cyy_interrupt(int irq, void *dev_id) if (unlikely(cinfo == NULL)) { #ifdef CY_DEBUG_INTERRUPTS - printk(KERN_DEBUG "cyy_interrupt: spurious interrupt %d\n", - irq); + printk(KERN_DEBUG "cyy_interrupt: spurious interrupt %d\n",irq); #endif return IRQ_NONE; /* spurious interrupt */ } @@ -1382,12 +1375,12 @@ static irqreturn_t cyy_interrupt(int irq, void *dev_id) /***********************************************************/ /********* End of block of Cyclom-Y specific code **********/ -/******** Start of block of Cyclades-Z specific code *******/ +/******** Start of block of Cyclades-Z specific code *********/ /***********************************************************/ static int cyz_fetch_msg(struct cyclades_card *cinfo, - __u32 *channel, __u8 *cmd, __u32 *param) + __u32 * channel, __u8 * cmd, __u32 * param) { struct FIRM_ID __iomem *firm_id; struct ZFW_CTRL __iomem *zfw_ctrl; @@ -1395,8 +1388,9 @@ cyz_fetch_msg(struct cyclades_card *cinfo, unsigned long loc_doorbell; firm_id = cinfo->base_addr + ID_ADDRESS; - if (!ISZLOADED(*cinfo)) + if (!ISZLOADED(*cinfo)) { return -1; + } zfw_ctrl = cinfo->base_addr + (readl(&firm_id->zfwctrl_addr) & 0xfffff); board_ctrl = &zfw_ctrl->board_ctrl; @@ -1424,9 +1418,9 @@ cyz_issue_cmd(struct cyclades_card *cinfo, unsigned int index; firm_id = cinfo->base_addr + ID_ADDRESS; - if (!ISZLOADED(*cinfo)) + if (!ISZLOADED(*cinfo)) { return -1; - + } zfw_ctrl = cinfo->base_addr + (readl(&firm_id->zfwctrl_addr) & 0xfffff); board_ctrl = &zfw_ctrl->board_ctrl; @@ -1434,8 +1428,9 @@ cyz_issue_cmd(struct cyclades_card *cinfo, pci_doorbell = &((struct RUNTIME_9060 __iomem *)(cinfo->ctl_addr))->pci_doorbell; while ((readl(pci_doorbell) & 0xff) != 0) { - if (index++ == 1000) + if (index++ == 1000) { return (int)(readl(pci_doorbell) & 0xff); + } udelay(50L); } cy_writel(&board_ctrl->hcmd_channel, channel); @@ -1509,8 +1504,7 @@ static void cyz_handle_rx(struct cyclades_port *info, while (len--) { data = readb(cinfo->base_addr + rx_bufaddr + new_rx_get); - new_rx_get = (new_rx_get + 1) & - (rx_bufsize - 1); + new_rx_get = (new_rx_get + 1)& (rx_bufsize - 1); tty_insert_flip_char(tty, data, TTY_NORMAL); info->idle_stats.recv_bytes++; info->icount.rx++; @@ -1642,8 +1636,7 @@ static void cyz_handle_cmd(struct cyclades_card *cinfo) special_count = 0; delta_count = 0; info = &cinfo->ports[channel]; - tty = info->tty; - if (tty == NULL) + if ((tty = info->tty) == NULL) continue; ch_ctrl = &(zfw_ctrl->ch_ctrl[channel]); @@ -1739,8 +1732,7 @@ static irqreturn_t cyz_interrupt(int irq, void *dev_id) if (unlikely(cinfo == NULL)) { #ifdef CY_DEBUG_INTERRUPTS - printk(KERN_DEBUG "cyz_interrupt: spurious interrupt %d\n", - irq); + printk(KERN_DEBUG "cyz_interrupt: spurious interrupt %d\n",irq); #endif return IRQ_NONE; /* spurious interrupt */ } @@ -1859,8 +1851,9 @@ static int startup(struct cyclades_port *info) } if (!info->type) { - if (info->tty) + if (info->tty) { set_bit(TTY_IO_ERROR, &info->tty->flags); + } free_page(page); goto errout; } @@ -1911,8 +1904,9 @@ static int startup(struct cyclades_port *info) readb(base_addr + (CySRER << index)) | CyRxData); info->flags |= ASYNC_INITIALIZED; - if (info->tty) + if (info->tty) { clear_bit(TTY_IO_ERROR, &info->tty->flags); + } info->xmit_cnt = info->xmit_head = info->xmit_tail = 0; info->breakon = info->breakoff = 0; memset((char *)&info->idle_stats, 0, sizeof(info->idle_stats)); @@ -1931,8 +1925,9 @@ static int startup(struct cyclades_port *info) base_addr = card->base_addr; firm_id = base_addr + ID_ADDRESS; - if (!ISZLOADED(*card)) + if (!ISZLOADED(*card)) { return -ENODEV; + } zfw_ctrl = card->base_addr + (readl(&firm_id->zfwctrl_addr) & 0xfffff); @@ -1995,8 +1990,9 @@ static int startup(struct cyclades_port *info) /* enable send, recv, modem !!! */ info->flags |= ASYNC_INITIALIZED; - if (info->tty) + if (info->tty) { clear_bit(TTY_IO_ERROR, &info->tty->flags); + } info->xmit_cnt = info->xmit_head = info->xmit_tail = 0; info->breakon = info->breakoff = 0; memset((char *)&info->idle_stats, 0, sizeof(info->idle_stats)); @@ -2065,8 +2061,9 @@ static void shutdown(struct cyclades_port *info) void __iomem *base_addr; int chip, channel, index; - if (!(info->flags & ASYNC_INITIALIZED)) + if (!(info->flags & ASYNC_INITIALIZED)) { return; + } card = info->card; channel = info->line - card->first_line; @@ -2108,8 +2105,9 @@ static void shutdown(struct cyclades_port *info) /* it may be appropriate to clear _XMIT at some later date (after testing)!!! */ - if (info->tty) + if (info->tty) { set_bit(TTY_IO_ERROR, &info->tty->flags); + } info->flags &= ~ASYNC_INITIALIZED; spin_unlock_irqrestore(&card->card_lock, flags); } else { @@ -2126,8 +2124,9 @@ static void shutdown(struct cyclades_port *info) #endif firm_id = base_addr + ID_ADDRESS; - if (!ISZLOADED(*card)) + if (!ISZLOADED(*card)) { return; + } zfw_ctrl = card->base_addr + (readl(&firm_id->zfwctrl_addr) & 0xfffff); @@ -2158,8 +2157,9 @@ static void shutdown(struct cyclades_port *info) #endif } - if (info->tty) + if (info->tty) { set_bit(TTY_IO_ERROR, &info->tty->flags); + } info->flags &= ~ASYNC_INITIALIZED; spin_unlock_irqrestore(&card->card_lock, flags); @@ -2204,8 +2204,7 @@ block_til_ready(struct tty_struct *tty, struct file *filp, * If non-blocking mode is set, then make the check up front * and then exit. */ - if ((filp->f_flags & O_NONBLOCK) || - (tty->flags & (1 << TTY_IO_ERROR))) { + if ((filp->f_flags & O_NONBLOCK) || (tty->flags & (1 << TTY_IO_ERROR))) { info->flags |= ASYNC_NORMAL_ACTIVE; return 0; } @@ -2302,8 +2301,7 @@ block_til_ready(struct tty_struct *tty, struct file *filp, return -EINVAL; } - zfw_ctrl = base_addr + (readl(&firm_id->zfwctrl_addr) - & 0xfffff); + zfw_ctrl = base_addr + (readl(&firm_id->zfwctrl_addr)& 0xfffff); board_ctrl = &zfw_ctrl->board_ctrl; ch_ctrl = zfw_ctrl->ch_ctrl; @@ -2380,9 +2378,9 @@ static int cy_open(struct tty_struct *tty, struct file *filp) int retval; line = tty->index; - if (tty->index < 0 || NR_PORTS <= line) + if ((tty->index < 0) || (NR_PORTS <= line)) { return -ENODEV; - + } for (i = 0; i < NR_CARDS; i++) if (line < cy_card[i].first_line + cy_card[i].nports && line >= cy_card[i].first_line) @@ -2390,8 +2388,9 @@ static int cy_open(struct tty_struct *tty, struct file *filp) if (i >= NR_CARDS) return -ENODEV; info = &cy_card[i].ports[line - cy_card[i].first_line]; - if (info->line < 0) + if (info->line < 0) { return -ENODEV; + } /* If the card's firmware hasn't been loaded, treat it as absent from the system. This @@ -2457,9 +2456,9 @@ static int cy_open(struct tty_struct *tty, struct file *filp) #endif tty->driver_data = info; info->tty = tty; - if (serial_paranoia_check(info, tty->name, "cy_open")) + if (serial_paranoia_check(info, tty->name, "cy_open")) { return -ENODEV; - + } #ifdef CY_DEBUG_OPEN printk(KERN_DEBUG "cyc:cy_open ttyC%d, count = %d\n", info->line, info->count); @@ -2483,8 +2482,9 @@ static int cy_open(struct tty_struct *tty, struct file *filp) * Start up serial port */ retval = startup(info); - if (retval) + if (retval) { return retval; + } retval = block_til_ready(tty, filp, info); if (retval) { @@ -2522,7 +2522,6 @@ static void cy_wait_until_sent(struct tty_struct *tty, int timeout) return; /* Just in case.... */ orig_jiffies = jiffies; - lock_kernel(); /* * Set the check interval to be 1/5 of the estimated time to * send a single character, and make it at least 1. The check @@ -2574,47 +2573,11 @@ static void cy_wait_until_sent(struct tty_struct *tty, int timeout) } /* Run one more char cycle */ msleep_interruptible(jiffies_to_msecs(char_time * 5)); - unlock_kernel(); #ifdef CY_DEBUG_WAIT_UNTIL_SENT printk(KERN_DEBUG "Clean (jiff=%lu)...done\n", jiffies); #endif } -static void cy_flush_buffer(struct tty_struct *tty) -{ - struct cyclades_port *info = tty->driver_data; - struct cyclades_card *card; - int channel, retval; - unsigned long flags; - -#ifdef CY_DEBUG_IO - printk(KERN_DEBUG "cyc:cy_flush_buffer ttyC%d\n", info->line); -#endif - - if (serial_paranoia_check(info, tty->name, "cy_flush_buffer")) - return; - - card = info->card; - channel = info->line - card->first_line; - - spin_lock_irqsave(&card->card_lock, flags); - info->xmit_cnt = info->xmit_head = info->xmit_tail = 0; - spin_unlock_irqrestore(&card->card_lock, flags); - - if (IS_CYC_Z(*card)) { /* If it is a Z card, flush the on-board - buffers as well */ - spin_lock_irqsave(&card->card_lock, flags); - retval = cyz_issue_cmd(card, channel, C_CM_FLUSH_TX, 0L); - if (retval != 0) { - printk(KERN_ERR "cyc: flush_buffer retval on ttyC%d " - "was %x\n", info->line, retval); - } - spin_unlock_irqrestore(&card->card_lock, flags); - } - tty_wakeup(tty); -} /* cy_flush_buffer */ - - /* * This routine is called when a particular tty device is closed. */ @@ -2628,8 +2591,9 @@ static void cy_close(struct tty_struct *tty, struct file *filp) printk(KERN_DEBUG "cyc:cy_close ttyC%d\n", info->line); #endif - if (!info || serial_paranoia_check(info, tty->name, "cy_close")) + if (!info || serial_paranoia_check(info, tty->name, "cy_close")) { return; + } card = info->card; @@ -2677,9 +2641,9 @@ static void cy_close(struct tty_struct *tty, struct file *filp) */ tty->closing = 1; spin_unlock_irqrestore(&card->card_lock, flags); - if (info->closing_wait != CY_CLOSING_WAIT_NONE) + if (info->closing_wait != CY_CLOSING_WAIT_NONE) { tty_wait_until_sent(tty, info->closing_wait); - + } spin_lock_irqsave(&card->card_lock, flags); if (!IS_CYC_Z(*card)) { @@ -2693,16 +2657,15 @@ static void cy_close(struct tty_struct *tty, struct file *filp) cy_writeb(base_addr + (CySRER << index), readb(base_addr + (CySRER << index)) & ~CyRxData); if (info->flags & ASYNC_INITIALIZED) { - /* Waiting for on-board buffers to be empty before - closing the port */ + /* Waiting for on-board buffers to be empty before closing + the port */ spin_unlock_irqrestore(&card->card_lock, flags); cy_wait_until_sent(tty, info->timeout); spin_lock_irqsave(&card->card_lock, flags); } } else { #ifdef Z_WAKE - /* Waiting for on-board buffers to be empty before closing - the port */ + /* Waiting for on-board buffers to be empty before closing the port */ void __iomem *base_addr = card->base_addr; struct FIRM_ID __iomem *firm_id = base_addr + ID_ADDRESS; struct ZFW_CTRL __iomem *zfw_ctrl = @@ -2726,7 +2689,8 @@ static void cy_close(struct tty_struct *tty, struct file *filp) spin_unlock_irqrestore(&card->card_lock, flags); shutdown(info); - cy_flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); tty_ldisc_flush(tty); spin_lock_irqsave(&card->card_lock, flags); @@ -2774,16 +2738,17 @@ static int cy_write(struct tty_struct *tty, const unsigned char *buf, int count) printk(KERN_DEBUG "cyc:cy_write ttyC%d\n", info->line); #endif - if (serial_paranoia_check(info, tty->name, "cy_write")) + if (serial_paranoia_check(info, tty->name, "cy_write")) { return 0; + } if (!info->xmit_buf) return 0; spin_lock_irqsave(&info->card->card_lock, flags); while (1) { - c = min(count, (int)(SERIAL_XMIT_SIZE - info->xmit_cnt - 1)); - c = min(c, (int)(SERIAL_XMIT_SIZE - info->xmit_head)); + c = min(count, min((int)(SERIAL_XMIT_SIZE - info->xmit_cnt - 1), + (int)(SERIAL_XMIT_SIZE - info->xmit_head))); if (c <= 0) break; @@ -2801,9 +2766,9 @@ static int cy_write(struct tty_struct *tty, const unsigned char *buf, int count) info->idle_stats.xmit_bytes += ret; info->idle_stats.xmit_idle = jiffies; - if (info->xmit_cnt && !tty->stopped && !tty->hw_stopped) + if (info->xmit_cnt && !tty->stopped && !tty->hw_stopped) { start_xmit(info); - + } return ret; } /* cy_write */ @@ -2814,7 +2779,7 @@ static int cy_write(struct tty_struct *tty, const unsigned char *buf, int count) * done stuffing characters into the driver. If there is no room * in the queue, the character is ignored. */ -static int cy_put_char(struct tty_struct *tty, unsigned char ch) +static void cy_put_char(struct tty_struct *tty, unsigned char ch) { struct cyclades_port *info = tty->driver_data; unsigned long flags; @@ -2824,15 +2789,15 @@ static int cy_put_char(struct tty_struct *tty, unsigned char ch) #endif if (serial_paranoia_check(info, tty->name, "cy_put_char")) - return 0; + return; if (!info->xmit_buf) - return 0; + return; spin_lock_irqsave(&info->card->card_lock, flags); if (info->xmit_cnt >= (int)(SERIAL_XMIT_SIZE - 1)) { spin_unlock_irqrestore(&info->card->card_lock, flags); - return 0; + return; } info->xmit_buf[info->xmit_head++] = ch; @@ -2841,12 +2806,11 @@ static int cy_put_char(struct tty_struct *tty, unsigned char ch) info->idle_stats.xmit_bytes++; info->idle_stats.xmit_idle = jiffies; spin_unlock_irqrestore(&info->card->card_lock, flags); - return 1; } /* cy_put_char */ /* * This routine is called by the kernel after it has written a - * series of characters to the tty device using put_char(). + * series of characters to the tty device using put_char(). */ static void cy_flush_chars(struct tty_struct *tty) { @@ -2918,7 +2882,6 @@ static int cy_chars_in_buffer(struct tty_struct *tty) int char_count; __u32 tx_put, tx_get, tx_bufsize; - lock_kernel(); firm_id = card->base_addr + ID_ADDRESS; zfw_ctrl = card->base_addr + (readl(&firm_id->zfwctrl_addr) & 0xfffff); @@ -2936,7 +2899,6 @@ static int cy_chars_in_buffer(struct tty_struct *tty) printk(KERN_DEBUG "cyc:cy_chars_in_buffer ttyC%d %d\n", info->line, info->xmit_cnt + char_count); #endif - unlock_kernel(); return info->xmit_cnt + char_count; } #endif /* Z_EXT_CHARS_IN_BUFFER */ @@ -2988,12 +2950,12 @@ static void set_line_char(struct cyclades_port *info) int baud, baud_rate = 0; int i; - if (!info->tty || !info->tty->termios) + if (!info->tty || !info->tty->termios) { return; - - if (info->line == -1) + } + if (info->line == -1) { return; - + } cflag = info->tty->termios->c_cflag; iflag = info->tty->termios->c_iflag; @@ -3032,11 +2994,13 @@ static void set_line_char(struct cyclades_port *info) } /* find the baud index */ for (i = 0; i < 20; i++) { - if (baud == baud_table[i]) + if (baud == baud_table[i]) { break; + } } - if (i == 20) + if (i == 20) { i = 19; /* CD1400_MAX_SPEED */ + } if (baud == 38400 && (info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST) { @@ -3095,16 +3059,18 @@ static void set_line_char(struct cyclades_port *info) info->cor1 = Cy_8_BITS; break; } - if (cflag & CSTOPB) + if (cflag & CSTOPB) { info->cor1 |= Cy_2_STOP; - + } if (cflag & PARENB) { - if (cflag & PARODD) + if (cflag & PARODD) { info->cor1 |= CyPARITY_O; - else + } else { info->cor1 |= CyPARITY_E; - } else + } + } else { info->cor1 |= CyPARITY_NONE; + } /* CTS flow control flag */ if (cflag & CRTSCTS) { @@ -3157,8 +3123,7 @@ static void set_line_char(struct cyclades_port *info) cyy_issue_cmd(base_addr, CyCOR_CHANGE | CyCOR1ch | CyCOR2ch | CyCOR3ch, index); - /* !!! Is this needed? */ - cy_writeb(base_addr + (CyCAR << index), (u_char) channel); + cy_writeb(base_addr + (CyCAR << index), (u_char) channel); /* !!! Is this needed? */ cy_writeb(base_addr + (CyRTPR << index), (info->default_timeout ? info->default_timeout : 0x02)); /* 10ms rx timeout */ @@ -3226,8 +3191,9 @@ static void set_line_char(struct cyclades_port *info) #endif } - if (info->tty) + if (info->tty) { clear_bit(TTY_IO_ERROR, &info->tty->flags); + } spin_unlock_irqrestore(&card->card_lock, flags); } else { @@ -3240,8 +3206,9 @@ static void set_line_char(struct cyclades_port *info) int retval; firm_id = card->base_addr + ID_ADDRESS; - if (!ISZLOADED(*card)) + if (!ISZLOADED(*card)) { return; + } zfw_ctrl = card->base_addr + (readl(&firm_id->zfwctrl_addr) & 0xfffff); @@ -3301,12 +3268,14 @@ static void set_line_char(struct cyclades_port *info) readl(&ch_ctrl->comm_data_l) | C_DL_1STOP); } if (cflag & PARENB) { - if (cflag & PARODD) + if (cflag & PARODD) { cy_writel(&ch_ctrl->comm_parity, C_PR_ODD); - else + } else { cy_writel(&ch_ctrl->comm_parity, C_PR_EVEN); - } else + } + } else { cy_writel(&ch_ctrl->comm_parity, C_PR_NONE); + } /* CTS flow control flag */ if (cflag & CRTSCTS) { @@ -3336,10 +3305,11 @@ static void set_line_char(struct cyclades_port *info) } /* CD sensitivity */ - if (cflag & CLOCAL) + if (cflag & CLOCAL) { info->flags &= ~ASYNC_CHECK_CD; - else + } else { info->flags |= ASYNC_CHECK_CD; + } if (baud == 0) { /* baud rate is zero, turn off line */ cy_writel(&ch_ctrl->rs_control, @@ -3355,20 +3325,21 @@ static void set_line_char(struct cyclades_port *info) #endif } - retval = cyz_issue_cmd(card, channel, C_CM_IOCTLM, 0L); + retval = cyz_issue_cmd(card, channel, C_CM_IOCTLM,0L); if (retval != 0) { printk(KERN_ERR "cyc:set_line_char(2) retval on ttyC%d " "was %x\n", info->line, retval); } - if (info->tty) + if (info->tty) { clear_bit(TTY_IO_ERROR, &info->tty->flags); + } } } /* set_line_char */ static int get_serial_info(struct cyclades_port *info, - struct serial_struct __user *retinfo) + struct serial_struct __user * retinfo) { struct serial_struct tmp; struct cyclades_card *cinfo = info->card; @@ -3392,7 +3363,7 @@ get_serial_info(struct cyclades_port *info, static int set_serial_info(struct cyclades_port *info, - struct serial_struct __user *new_info) + struct serial_struct __user * new_info) { struct serial_struct new_serial; struct cyclades_port old_info; @@ -3446,7 +3417,7 @@ set_serial_info(struct cyclades_port *info, * transmit holding register is empty. This functionality * allows an RS485 driver to be written in user space. */ -static int get_lsr_info(struct cyclades_port *info, unsigned int __user *value) +static int get_lsr_info(struct cyclades_port *info, unsigned int __user * value) { struct cyclades_card *card; int chip, channel, index; @@ -3490,11 +3461,9 @@ static int cy_tiocmget(struct tty_struct *tty, struct file *file) struct BOARD_CTRL __iomem *board_ctrl; struct CH_CTRL __iomem *ch_ctrl; - if (serial_paranoia_check(info, tty->name, __func__)) + if (serial_paranoia_check(info, tty->name, __FUNCTION__)) return -ENODEV; - lock_kernel(); - card = info->card; channel = info->line - card->first_line; if (!IS_CYC_Z(*card)) { @@ -3537,12 +3506,10 @@ static int cy_tiocmget(struct tty_struct *tty, struct file *file) ((lstatus & C_RS_CTS) ? TIOCM_CTS : 0); } else { result = 0; - unlock_kernel(); return -ENODEV; } } - unlock_kernel(); return result; } /* cy_tiomget */ @@ -3561,7 +3528,7 @@ cy_tiocmset(struct tty_struct *tty, struct file *file, struct CH_CTRL __iomem *ch_ctrl; int retval; - if (serial_paranoia_check(info, tty->name, __func__)) + if (serial_paranoia_check(info, tty->name, __FUNCTION__)) return -ENODEV; card = info->card; @@ -3760,8 +3727,8 @@ static void cy_break(struct tty_struct *tty, int break_state) spin_unlock_irqrestore(&card->card_lock, flags); } /* cy_break */ -static int get_mon_info(struct cyclades_port *info, - struct cyclades_monitor __user *mon) +static int +get_mon_info(struct cyclades_port *info, struct cyclades_monitor __user * mon) { if (copy_to_user(mon, &info->mon, sizeof(struct cyclades_monitor))) @@ -3800,8 +3767,8 @@ static int set_threshold(struct cyclades_port *info, unsigned long value) return 0; } /* set_threshold */ -static int get_threshold(struct cyclades_port *info, - unsigned long __user *value) +static int +get_threshold(struct cyclades_port *info, unsigned long __user * value) { struct cyclades_card *card; void __iomem *base_addr; @@ -3822,15 +3789,15 @@ static int get_threshold(struct cyclades_port *info, return 0; } /* get_threshold */ -static int set_default_threshold(struct cyclades_port *info, - unsigned long value) +static int +set_default_threshold(struct cyclades_port *info, unsigned long value) { info->default_threshold = value & 0x0f; return 0; } /* set_default_threshold */ -static int get_default_threshold(struct cyclades_port *info, - unsigned long __user *value) +static int +get_default_threshold(struct cyclades_port *info, unsigned long __user * value) { return put_user(info->default_threshold, value); } /* get_default_threshold */ @@ -3857,8 +3824,7 @@ static int set_timeout(struct cyclades_port *info, unsigned long value) return 0; } /* set_timeout */ -static int get_timeout(struct cyclades_port *info, - unsigned long __user *value) +static int get_timeout(struct cyclades_port *info, unsigned long __user * value) { struct cyclades_card *card; void __iomem *base_addr; @@ -3885,8 +3851,8 @@ static int set_default_timeout(struct cyclades_port *info, unsigned long value) return 0; } /* set_default_timeout */ -static int get_default_timeout(struct cyclades_port *info, - unsigned long __user *value) +static int +get_default_timeout(struct cyclades_port *info, unsigned long __user * value) { return put_user(info->default_timeout, value); } /* get_default_timeout */ @@ -3914,7 +3880,6 @@ cy_ioctl(struct tty_struct *tty, struct file *file, printk(KERN_DEBUG "cyc:cy_ioctl ttyC%d, cmd = %x arg = %lx\n", info->line, cmd, arg); #endif - lock_kernel(); switch (cmd) { case CYGETMON: @@ -3971,7 +3936,7 @@ cy_ioctl(struct tty_struct *tty, struct file *file, break; #endif /* CONFIG_CYZ_INTR */ case CYSETWAIT: - info->closing_wait = (unsigned short)arg * HZ / 100; + info->closing_wait = (unsigned short)arg *HZ / 100; ret_val = 0; break; case CYGETWAIT: @@ -4023,47 +3988,47 @@ cy_ioctl(struct tty_struct *tty, struct file *file, p_cuser = argp; ret_val = put_user(cnow.cts, &p_cuser->cts); if (ret_val) - break; + return ret_val; ret_val = put_user(cnow.dsr, &p_cuser->dsr); if (ret_val) - break; + return ret_val; ret_val = put_user(cnow.rng, &p_cuser->rng); if (ret_val) - break; + return ret_val; ret_val = put_user(cnow.dcd, &p_cuser->dcd); if (ret_val) - break; + return ret_val; ret_val = put_user(cnow.rx, &p_cuser->rx); if (ret_val) - break; + return ret_val; ret_val = put_user(cnow.tx, &p_cuser->tx); if (ret_val) - break; + return ret_val; ret_val = put_user(cnow.frame, &p_cuser->frame); if (ret_val) - break; + return ret_val; ret_val = put_user(cnow.overrun, &p_cuser->overrun); if (ret_val) - break; + return ret_val; ret_val = put_user(cnow.parity, &p_cuser->parity); if (ret_val) - break; + return ret_val; ret_val = put_user(cnow.brk, &p_cuser->brk); if (ret_val) - break; + return ret_val; ret_val = put_user(cnow.buf_overrun, &p_cuser->buf_overrun); if (ret_val) - break; + return ret_val; ret_val = 0; break; default: ret_val = -ENOIOCTLCMD; } - unlock_kernel(); #ifdef CY_DEBUG_OTHER printk(KERN_DEBUG "cyc:cy_ioctl done\n"); #endif + return ret_val; } /* cy_ioctl */ @@ -4148,8 +4113,9 @@ static void cy_throttle(struct tty_struct *tty) tty->ldisc.chars_in_buffer(tty), info->line); #endif - if (serial_paranoia_check(info, tty->name, "cy_throttle")) + if (serial_paranoia_check(info, tty->name, "cy_throttle")) { return; + } card = info->card; @@ -4203,11 +4169,12 @@ static void cy_unthrottle(struct tty_struct *tty) char buf[64]; printk(KERN_DEBUG "cyc:unthrottle %s: %ld...ttyC%d\n", - tty_name(tty, buf), tty_chars_in_buffer(tty), info->line); + tty_name(tty, buf), tty->ldisc.chars_in_buffer(tty),info->line); #endif - if (serial_paranoia_check(info, tty->name, "cy_unthrottle")) + if (serial_paranoia_check(info, tty->name, "cy_unthrottle")) { return; + } if (I_IXOFF(tty)) { if (info->x_char) @@ -4302,14 +4269,47 @@ static void cy_start(struct tty_struct *tty) base_addr = cinfo->base_addr + (cy_chip_offset[chip] << index); spin_lock_irqsave(&cinfo->card_lock, flags); - cy_writeb(base_addr + (CyCAR << index), - (u_char) (channel & 0x0003)); /* index channel */ + cy_writeb(base_addr + (CyCAR << index), (u_char) (channel & 0x0003)); /* index channel */ cy_writeb(base_addr + (CySRER << index), readb(base_addr + (CySRER << index)) | CyTxRdy); spin_unlock_irqrestore(&cinfo->card_lock, flags); } } /* cy_start */ +static void cy_flush_buffer(struct tty_struct *tty) +{ + struct cyclades_port *info = tty->driver_data; + struct cyclades_card *card; + int channel, retval; + unsigned long flags; + +#ifdef CY_DEBUG_IO + printk(KERN_DEBUG "cyc:cy_flush_buffer ttyC%d\n", info->line); +#endif + + if (serial_paranoia_check(info, tty->name, "cy_flush_buffer")) + return; + + card = info->card; + channel = info->line - card->first_line; + + spin_lock_irqsave(&card->card_lock, flags); + info->xmit_cnt = info->xmit_head = info->xmit_tail = 0; + spin_unlock_irqrestore(&card->card_lock, flags); + + if (IS_CYC_Z(*card)) { /* If it is a Z card, flush the on-board + buffers as well */ + spin_lock_irqsave(&card->card_lock, flags); + retval = cyz_issue_cmd(card, channel, C_CM_FLUSH_TX, 0L); + if (retval != 0) { + printk(KERN_ERR "cyc: flush_buffer retval on ttyC%d " + "was %x\n", info->line, retval); + } + spin_unlock_irqrestore(&card->card_lock, flags); + } + tty_wakeup(tty); +} /* cy_flush_buffer */ + /* * cy_hangup() --- called by tty_hangup() when a hangup is signaled. */ @@ -4406,11 +4406,10 @@ static int __devinit cy_init_card(struct cyclades_card *cinfo) info->cor3 = 0x08; /* _very_ small rcv threshold */ chip_number = (port - cinfo->first_line) / 4; - info->chip_rev = readb(cinfo->base_addr + - (cy_chip_offset[chip_number] << index) + - (CyGFRCR << index)); - - if (info->chip_rev >= CD1400_REV_J) { + if ((info->chip_rev = readb(cinfo->base_addr + + (cy_chip_offset[chip_number] << + index) + (CyGFRCR << index))) >= + CD1400_REV_J) { /* It is a CD1400 rev. J or later */ info->tbpr = baud_bpr_60[13]; /* Tx BPR */ info->tco = baud_co_60[13]; /* Tx CO */ @@ -4455,8 +4454,7 @@ static unsigned short __devinit cyy_init_card(void __iomem *true_base_addr, /* Cy_ClrIntr is 0x1800 */ udelay(500L); - for (chip_number = 0; chip_number < CyMAX_CHIPS_PER_CARD; - chip_number++) { + for (chip_number = 0; chip_number < CyMAX_CHIPS_PER_CARD; chip_number++) { base_addr = true_base_addr + (cy_chip_offset[chip_number] << index); mdelay(1); @@ -4557,11 +4555,12 @@ static int __init cy_detect_isa(void) /* scan the address table probing for Cyclom-Y/ISA boards */ for (i = 0; i < NR_ISA_ADDRS; i++) { unsigned int isa_address = cy_isa_addresses[i]; - if (isa_address == 0x0000) + if (isa_address == 0x0000) { return nboard; + } /* probe for CD1400... */ - cy_isa_address = ioremap_nocache(isa_address, CyISA_Ywin); + cy_isa_address = ioremap(isa_address, CyISA_Ywin); if (cy_isa_address == NULL) { printk(KERN_ERR "Cyclom-Y/ISA: can't remap base " "address\n"); @@ -4848,10 +4847,12 @@ static int __devinit cyz_load_fw(struct pci_dev *pdev, void __iomem *base_addr, if (mailbox != 0) { /* set window to last 512K of RAM */ cy_writel(&ctl_addr->loc_addr_base, WIN_RAM + RAM_SIZE); + //sleep(1); for (tmp = base_addr; tmp < base_addr + RAM_SIZE; tmp++) cy_writeb(tmp, 255); /* set window to beginning of RAM */ cy_writel(&ctl_addr->loc_addr_base, WIN_RAM); + //sleep(1); } retval = __cyz_load_fw(fw, "Cyclom-Z", mailbox, base_addr, NULL); @@ -5381,8 +5382,7 @@ static void __exit cy_cleanup_module(void) del_timer_sync(&cyz_timerlist); #endif /* CONFIG_CYZ_INTR */ - e1 = tty_unregister_driver(cy_serial_driver); - if (e1) + if ((e1 = tty_unregister_driver(cy_serial_driver))) printk(KERN_ERR "failed to unregister Cyclades serial " "driver(%d)\n", e1); diff --git a/trunk/drivers/char/drm/drmP.h b/trunk/drivers/char/drm/drmP.h index 213b3ca3468e..ecee3547a13f 100644 --- a/trunk/drivers/char/drm/drmP.h +++ b/trunk/drivers/char/drm/drmP.h @@ -160,7 +160,7 @@ struct drm_device; * \param arg arguments */ #define DRM_ERROR(fmt, arg...) \ - printk(KERN_ERR "[" DRM_NAME ":%s] *ERROR* " fmt , __func__ , ##arg) + printk(KERN_ERR "[" DRM_NAME ":%s] *ERROR* " fmt , __FUNCTION__ , ##arg) /** * Memory error output. @@ -170,7 +170,7 @@ struct drm_device; * \param arg arguments */ #define DRM_MEM_ERROR(area, fmt, arg...) \ - printk(KERN_ERR "[" DRM_NAME ":%s:%s] *ERROR* " fmt , __func__, \ + printk(KERN_ERR "[" DRM_NAME ":%s:%s] *ERROR* " fmt , __FUNCTION__, \ drm_mem_stats[area].name , ##arg) #define DRM_INFO(fmt, arg...) printk(KERN_INFO "[" DRM_NAME "] " fmt , ##arg) @@ -187,7 +187,7 @@ struct drm_device; if ( drm_debug ) \ printk(KERN_DEBUG \ "[" DRM_NAME ":%s] " fmt , \ - __func__ , ##arg); \ + __FUNCTION__ , ##arg); \ } while (0) #else #define DRM_DEBUG(fmt, arg...) do { } while (0) @@ -238,7 +238,7 @@ do { \ if ( !_DRM_LOCK_IS_HELD( dev->lock.hw_lock->lock ) || \ dev->lock.file_priv != file_priv ) { \ DRM_ERROR( "%s called without lock held, held %d owner %p %p\n",\ - __func__, _DRM_LOCK_IS_HELD( dev->lock.hw_lock->lock ),\ + __FUNCTION__, _DRM_LOCK_IS_HELD( dev->lock.hw_lock->lock ),\ dev->lock.file_priv, file_priv ); \ return -EINVAL; \ } \ diff --git a/trunk/drivers/char/drm/drm_sysfs.c b/trunk/drivers/char/drm/drm_sysfs.c index 9a32169e88fb..7a1d9a782ddb 100644 --- a/trunk/drivers/char/drm/drm_sysfs.c +++ b/trunk/drivers/char/drm/drm_sysfs.c @@ -34,7 +34,7 @@ static int drm_sysfs_suspend(struct device *dev, pm_message_t state) struct drm_minor *drm_minor = to_drm_minor(dev); struct drm_device *drm_dev = drm_minor->dev; - printk(KERN_ERR "%s\n", __func__); + printk(KERN_ERR "%s\n", __FUNCTION__); if (drm_dev->driver->suspend) return drm_dev->driver->suspend(drm_dev, state); diff --git a/trunk/drivers/char/drm/i830_dma.c b/trunk/drivers/char/drm/i830_dma.c index a86ab30b4620..60c9376be486 100644 --- a/trunk/drivers/char/drm/i830_dma.c +++ b/trunk/drivers/char/drm/i830_dma.c @@ -692,7 +692,7 @@ static void i830EmitState(struct drm_device * dev) drm_i830_sarea_t *sarea_priv = dev_priv->sarea_priv; unsigned int dirty = sarea_priv->dirty; - DRM_DEBUG("%s %x\n", __func__, dirty); + DRM_DEBUG("%s %x\n", __FUNCTION__, dirty); if (dirty & I830_UPLOAD_BUFFERS) { i830EmitDestVerified(dev, sarea_priv->BufferState); @@ -1043,7 +1043,7 @@ static void i830_dma_dispatch_flip(struct drm_device * dev) RING_LOCALS; DRM_DEBUG("%s: page=%d pfCurrentPage=%d\n", - __func__, + __FUNCTION__, dev_priv->current_page, dev_priv->sarea_priv->pf_current_page); @@ -1206,7 +1206,7 @@ static void i830_dma_quiescent(struct drm_device * dev) OUT_RING(0); ADVANCE_LP_RING(); - i830_wait_ring(dev, dev_priv->ring.Size - 8, __func__); + i830_wait_ring(dev, dev_priv->ring.Size - 8, __FUNCTION__); } static int i830_flush_queue(struct drm_device * dev) @@ -1223,7 +1223,7 @@ static int i830_flush_queue(struct drm_device * dev) OUT_RING(0); ADVANCE_LP_RING(); - i830_wait_ring(dev, dev_priv->ring.Size - 8, __func__); + i830_wait_ring(dev, dev_priv->ring.Size - 8, __FUNCTION__); for (i = 0; i < dma->buf_count; i++) { struct drm_buf *buf = dma->buflist[i]; @@ -1344,7 +1344,7 @@ static void i830_do_init_pageflip(struct drm_device * dev) { drm_i830_private_t *dev_priv = dev->dev_private; - DRM_DEBUG("%s\n", __func__); + DRM_DEBUG("%s\n", __FUNCTION__); dev_priv->page_flipping = 1; dev_priv->current_page = 0; dev_priv->sarea_priv->pf_current_page = dev_priv->current_page; @@ -1354,7 +1354,7 @@ static int i830_do_cleanup_pageflip(struct drm_device * dev) { drm_i830_private_t *dev_priv = dev->dev_private; - DRM_DEBUG("%s\n", __func__); + DRM_DEBUG("%s\n", __FUNCTION__); if (dev_priv->current_page != 0) i830_dma_dispatch_flip(dev); @@ -1367,7 +1367,7 @@ static int i830_flip_bufs(struct drm_device *dev, void *data, { drm_i830_private_t *dev_priv = dev->dev_private; - DRM_DEBUG("%s\n", __func__); + DRM_DEBUG("%s\n", __FUNCTION__); LOCK_TEST_WITH_RETURN(dev, file_priv); @@ -1437,7 +1437,7 @@ static int i830_getparam(struct drm_device *dev, void *data, int value; if (!dev_priv) { - DRM_ERROR("%s called with no initialization\n", __func__); + DRM_ERROR("%s called with no initialization\n", __FUNCTION__); return -EINVAL; } @@ -1464,7 +1464,7 @@ static int i830_setparam(struct drm_device *dev, void *data, drm_i830_setparam_t *param = data; if (!dev_priv) { - DRM_ERROR("%s called with no initialization\n", __func__); + DRM_ERROR("%s called with no initialization\n", __FUNCTION__); return -EINVAL; } diff --git a/trunk/drivers/char/drm/i830_drv.h b/trunk/drivers/char/drm/i830_drv.h index b5bf8cc0fdaa..4caba8c54455 100644 --- a/trunk/drivers/char/drm/i830_drv.h +++ b/trunk/drivers/char/drm/i830_drv.h @@ -158,7 +158,7 @@ extern int i830_driver_device_is_agp(struct drm_device * dev); if (I830_VERBOSE) \ printk("BEGIN_LP_RING(%d)\n", (n)); \ if (dev_priv->ring.space < n*4) \ - i830_wait_ring(dev, n*4, __func__); \ + i830_wait_ring(dev, n*4, __FUNCTION__); \ outcount = 0; \ outring = dev_priv->ring.tail; \ ringmask = dev_priv->ring.tail_mask; \ diff --git a/trunk/drivers/char/drm/i830_irq.c b/trunk/drivers/char/drm/i830_irq.c index 91ec2bb497e9..a33db5f0967f 100644 --- a/trunk/drivers/char/drm/i830_irq.c +++ b/trunk/drivers/char/drm/i830_irq.c @@ -58,7 +58,7 @@ static int i830_emit_irq(struct drm_device * dev) drm_i830_private_t *dev_priv = dev->dev_private; RING_LOCALS; - DRM_DEBUG("%s\n", __func__); + DRM_DEBUG("%s\n", __FUNCTION__); atomic_inc(&dev_priv->irq_emitted); @@ -77,7 +77,7 @@ static int i830_wait_irq(struct drm_device * dev, int irq_nr) unsigned long end = jiffies + HZ * 3; int ret = 0; - DRM_DEBUG("%s\n", __func__); + DRM_DEBUG("%s\n", __FUNCTION__); if (atomic_read(&dev_priv->irq_received) >= irq_nr) return 0; @@ -124,7 +124,7 @@ int i830_irq_emit(struct drm_device *dev, void *data, LOCK_TEST_WITH_RETURN(dev, file_priv); if (!dev_priv) { - DRM_ERROR("%s called with no initialization\n", __func__); + DRM_ERROR("%s called with no initialization\n", __FUNCTION__); return -EINVAL; } @@ -147,7 +147,7 @@ int i830_irq_wait(struct drm_device *dev, void *data, drm_i830_irq_wait_t *irqwait = data; if (!dev_priv) { - DRM_ERROR("%s called with no initialization\n", __func__); + DRM_ERROR("%s called with no initialization\n", __FUNCTION__); return -EINVAL; } diff --git a/trunk/drivers/char/drm/i915_dma.c b/trunk/drivers/char/drm/i915_dma.c index f47e46e3529f..ef7bf143a80c 100644 --- a/trunk/drivers/char/drm/i915_dma.c +++ b/trunk/drivers/char/drm/i915_dma.c @@ -194,7 +194,7 @@ static int i915_dma_resume(struct drm_device * dev) { drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; - DRM_DEBUG("%s\n", __func__); + DRM_DEBUG("%s\n", __FUNCTION__); if (!dev_priv->sarea) { DRM_ERROR("can not find sarea!\n"); @@ -609,7 +609,7 @@ static int i915_quiescent(struct drm_device * dev) drm_i915_private_t *dev_priv = dev->dev_private; i915_kernel_lost_context(dev); - return i915_wait_ring(dev, dev_priv->ring.Size - 8, __func__); + return i915_wait_ring(dev, dev_priv->ring.Size - 8, __FUNCTION__); } static int i915_flush_ioctl(struct drm_device *dev, void *data, diff --git a/trunk/drivers/char/drm/i915_drv.h b/trunk/drivers/char/drm/i915_drv.h index db7001f22561..c614d78b3dfd 100644 --- a/trunk/drivers/char/drm/i915_drv.h +++ b/trunk/drivers/char/drm/i915_drv.h @@ -272,7 +272,7 @@ extern void i915_mem_release(struct drm_device * dev, if (I915_VERBOSE) \ DRM_DEBUG("BEGIN_LP_RING(%d)\n", (n)); \ if (dev_priv->ring.space < (n)*4) \ - i915_wait_ring(dev, (n)*4, __func__); \ + i915_wait_ring(dev, (n)*4, __FUNCTION__); \ outcount = 0; \ outring = dev_priv->ring.tail; \ ringmask = dev_priv->ring.tail_mask; \ diff --git a/trunk/drivers/char/drm/radeon_cp.c b/trunk/drivers/char/drm/radeon_cp.c index f6f6c92bf771..9072e4a1894e 100644 --- a/trunk/drivers/char/drm/radeon_cp.c +++ b/trunk/drivers/char/drm/radeon_cp.c @@ -894,7 +894,7 @@ static u32 RADEON_READ_IGPGART(drm_radeon_private_t *dev_priv, int addr) #if RADEON_FIFO_DEBUG static void radeon_status(drm_radeon_private_t * dev_priv) { - printk("%s:\n", __func__); + printk("%s:\n", __FUNCTION__); printk("RBBM_STATUS = 0x%08x\n", (unsigned int)RADEON_READ(RADEON_RBBM_STATUS)); printk("CP_RB_RTPR = 0x%08x\n", diff --git a/trunk/drivers/char/ds1286.c b/trunk/drivers/char/ds1286.c index ea35ab2c9909..59146e3365ba 100644 --- a/trunk/drivers/char/ds1286.c +++ b/trunk/drivers/char/ds1286.c @@ -39,7 +39,6 @@ #include #include #include -#include #include #include @@ -452,7 +451,7 @@ static void ds1286_get_time(struct rtc_time *rtc_tm) */ if (ds1286_is_updating() != 0) - while (time_before(jiffies, uip_watchdog + 2*HZ/100)) + while (jiffies - uip_watchdog < 2*HZ/100) barrier(); /* diff --git a/trunk/drivers/char/epca.c b/trunk/drivers/char/epca.c index 60a4df7dac12..ffd747c5dff0 100644 --- a/trunk/drivers/char/epca.c +++ b/trunk/drivers/char/epca.c @@ -38,8 +38,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include "digiPCI.h" @@ -73,8 +73,7 @@ static int invalid_lilo_config; */ static DEFINE_SPINLOCK(epca_lock); -/* MAXBOARDS is typically 12, but ISA and EISA cards are restricted - to 7 below. */ +/* MAXBOARDS is typically 12, but ISA and EISA cards are restricted to 7 below. */ static struct board_info boards[MAXBOARDS]; static struct tty_driver *pc_driver; @@ -158,12 +157,13 @@ static void epca_error(int, char *); static void pc_close(struct tty_struct *, struct file *); static void shutdown(struct channel *); static void pc_hangup(struct tty_struct *); +static void pc_put_char(struct tty_struct *, unsigned char); static int pc_write_room(struct tty_struct *); static int pc_chars_in_buffer(struct tty_struct *); static void pc_flush_buffer(struct tty_struct *); static void pc_flush_chars(struct tty_struct *); static int block_til_ready(struct tty_struct *, struct file *, - struct channel *); + struct channel *); static int pc_open(struct tty_struct *, struct file *); static void post_fep_init(unsigned int crd); static void epcapoll(unsigned long); @@ -175,18 +175,18 @@ static unsigned termios2digi_c(struct channel *ch, unsigned); static void epcaparam(struct tty_struct *, struct channel *); static void receive_data(struct channel *); static int pc_ioctl(struct tty_struct *, struct file *, - unsigned int, unsigned long); + unsigned int, unsigned long); static int info_ioctl(struct tty_struct *, struct file *, - unsigned int, unsigned long); + unsigned int, unsigned long); static void pc_set_termios(struct tty_struct *, struct ktermios *); static void do_softint(struct work_struct *work); static void pc_stop(struct tty_struct *); static void pc_start(struct tty_struct *); -static void pc_throttle(struct tty_struct *tty); +static void pc_throttle(struct tty_struct * tty); static void pc_unthrottle(struct tty_struct *tty); static void digi_send_break(struct channel *ch, int msec); static void setup_empty_event(struct tty_struct *tty, struct channel *ch); -static void epca_setup(char *, int *); +void epca_setup(char *, int *); static int pc_write(struct tty_struct *, const unsigned char *, int); static int pc_init(void); @@ -243,7 +243,7 @@ static void assertmemoff(struct channel *ch) /* PCXEM windowing is the same as that used in the PCXR and CX series cards. */ static void pcxem_memwinon(struct board_info *b, unsigned int win) { - outb_p(FEPWIN | win, b->port + 1); + outb_p(FEPWIN|win, b->port + 1); } static void pcxem_memwinoff(struct board_info *b, unsigned int win) @@ -253,7 +253,7 @@ static void pcxem_memwinoff(struct board_info *b, unsigned int win) static void pcxem_globalwinon(struct channel *ch) { - outb_p(FEPWIN, (int)ch->board->port + 1); + outb_p( FEPWIN, (int)ch->board->port + 1); } static void pcxem_rxwinon(struct channel *ch) @@ -394,7 +394,7 @@ static struct channel *verifyChannel(struct tty_struct *tty) */ if (tty) { struct channel *ch = (struct channel *)tty->driver_data; - if (ch >= &digi_channels[0] && ch < &digi_channels[nbdevs]) { + if ((ch >= &digi_channels[0]) && (ch < &digi_channels[nbdevs])) { if (ch->magic == EPCA_MAGIC) return ch; } @@ -414,7 +414,7 @@ static void pc_sched_event(struct channel *ch, int event) static void epca_error(int line, char *msg) { - printk(KERN_ERR "epca_error (Digi): line = %d %s\n", line, msg); + printk(KERN_ERR "epca_error (Digi): line = %d %s\n",line,msg); } static void pc_close(struct tty_struct *tty, struct file *filp) @@ -425,8 +425,7 @@ static void pc_close(struct tty_struct *tty, struct file *filp) * verifyChannel returns the channel from the tty struct if it is * valid. This serves as a sanity check. */ - ch = verifyChannel(tty); - if (ch != NULL) { + if ((ch = verifyChannel(tty)) != NULL) { spin_lock_irqsave(&epca_lock, flags); if (tty_hung_up_p(filp)) { spin_unlock_irqrestore(&epca_lock, flags); @@ -441,6 +440,7 @@ static void pc_close(struct tty_struct *tty, struct file *filp) spin_unlock_irqrestore(&epca_lock, flags); return; } + /* Port open only once go ahead with shutdown & reset */ BUG_ON(ch->count < 0); @@ -455,13 +455,12 @@ static void pc_close(struct tty_struct *tty, struct file *filp) spin_unlock_irqrestore(&epca_lock, flags); if (ch->asyncflags & ASYNC_INITIALIZED) { - /* Setup an event to indicate when the - transmit buffer empties */ + /* Setup an event to indicate when the transmit buffer empties */ setup_empty_event(tty, ch); - /* 30 seconds timeout */ - tty_wait_until_sent(tty, 3000); + tty_wait_until_sent(tty, 3000); /* 30 seconds timeout */ } - pc_flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); tty_ldisc_flush(tty); shutdown(ch); @@ -478,7 +477,7 @@ static void pc_close(struct tty_struct *tty, struct file *filp) wake_up_interruptible(&ch->open_wait); } ch->asyncflags &= ~(ASYNC_NORMAL_ACTIVE | ASYNC_INITIALIZED | - ASYNC_CLOSING); + ASYNC_CLOSING); wake_up_interruptible(&ch->close_wait); } } @@ -525,15 +524,16 @@ static void shutdown(struct channel *ch) static void pc_hangup(struct tty_struct *tty) { struct channel *ch; + /* * verifyChannel returns the channel from the tty struct if it is * valid. This serves as a sanity check. */ - ch = verifyChannel(tty); - if (ch != NULL) { + if ((ch = verifyChannel(tty)) != NULL) { unsigned long flags; - pc_flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); tty_ldisc_flush(tty); shutdown(ch); @@ -548,7 +548,7 @@ static void pc_hangup(struct tty_struct *tty) } static int pc_write(struct tty_struct *tty, - const unsigned char *buf, int bytesAvailable) + const unsigned char *buf, int bytesAvailable) { unsigned int head, tail; int dataLen; @@ -572,8 +572,7 @@ static int pc_write(struct tty_struct *tty, * verifyChannel returns the channel from the tty struct if it is * valid. This serves as a sanity check. */ - ch = verifyChannel(tty); - if (ch == NULL) + if ((ch = verifyChannel(tty)) == NULL) return 0; /* Make a pointer to the channel data structure found on the board. */ @@ -646,19 +645,26 @@ static int pc_write(struct tty_struct *tty, return amountCopied; } +static void pc_put_char(struct tty_struct *tty, unsigned char c) +{ + pc_write(tty, &c, 1); +} + static int pc_write_room(struct tty_struct *tty) { - int remain = 0; + int remain; struct channel *ch; unsigned long flags; unsigned int head, tail; struct board_chan __iomem *bc; + + remain = 0; + /* * verifyChannel returns the channel from the tty struct if it is * valid. This serves as a sanity check. */ - ch = verifyChannel(tty); - if (ch != NULL) { + if ((ch = verifyChannel(tty)) != NULL) { spin_lock_irqsave(&epca_lock, flags); globalwinon(ch); @@ -670,8 +676,8 @@ static int pc_write_room(struct tty_struct *tty) tail = readw(&bc->tout); /* Wrap tail if necessary */ tail &= (ch->txbufsize - 1); - remain = tail - head - 1; - if (remain < 0) + + if ((remain = tail - head - 1) < 0 ) remain += ch->txbufsize; if (remain && (ch->statusflags & LOWWAIT) == 0) { @@ -693,12 +699,12 @@ static int pc_chars_in_buffer(struct tty_struct *tty) unsigned long flags; struct channel *ch; struct board_chan __iomem *bc; + /* * verifyChannel returns the channel from the tty struct if it is * valid. This serves as a sanity check. */ - ch = verifyChannel(tty); - if (ch == NULL) + if ((ch = verifyChannel(tty)) == NULL) return 0; spin_lock_irqsave(&epca_lock, flags); @@ -709,8 +715,7 @@ static int pc_chars_in_buffer(struct tty_struct *tty) head = readw(&bc->tin); ctail = readw(&ch->mailbox->cout); - if (tail == head && readw(&ch->mailbox->cin) == ctail && - readb(&bc->tbusy) == 0) + if (tail == head && readw(&ch->mailbox->cin) == ctail && readb(&bc->tbusy) == 0) chars = 0; else { /* Begin if some space on the card has been used */ head = readw(&bc->tin) & (ch->txbufsize - 1); @@ -720,8 +725,7 @@ static int pc_chars_in_buffer(struct tty_struct *tty) * pc_write_room here we are finding the amount of bytes in the * buffer filled. Not the amount of bytes empty. */ - remain = tail - head - 1; - if (remain < 0) + if ((remain = tail - head - 1) < 0 ) remain += ch->txbufsize; chars = (int)(ch->txbufsize - remain); /* @@ -732,7 +736,7 @@ static int pc_chars_in_buffer(struct tty_struct *tty) * transmit buffer empties. */ if (!(ch->statusflags & EMPTYWAIT)) - setup_empty_event(tty, ch); + setup_empty_event(tty,ch); } /* End if some space on the card has been used */ memoff(ch); spin_unlock_irqrestore(&epca_lock, flags); @@ -750,8 +754,7 @@ static void pc_flush_buffer(struct tty_struct *tty) * verifyChannel returns the channel from the tty struct if it is * valid. This serves as a sanity check. */ - ch = verifyChannel(tty); - if (ch == NULL) + if ((ch = verifyChannel(tty)) == NULL) return; spin_lock_irqsave(&epca_lock, flags); @@ -772,25 +775,23 @@ static void pc_flush_chars(struct tty_struct *tty) * verifyChannel returns the channel from the tty struct if it is * valid. This serves as a sanity check. */ - ch = verifyChannel(tty); - if (ch != NULL) { + if ((ch = verifyChannel(tty)) != NULL) { unsigned long flags; spin_lock_irqsave(&epca_lock, flags); /* * If not already set and the transmitter is busy setup an * event to indicate when the transmit empties. */ - if ((ch->statusflags & TXBUSY) && - !(ch->statusflags & EMPTYWAIT)) - setup_empty_event(tty, ch); + if ((ch->statusflags & TXBUSY) && !(ch->statusflags & EMPTYWAIT)) + setup_empty_event(tty,ch); spin_unlock_irqrestore(&epca_lock, flags); } } static int block_til_ready(struct tty_struct *tty, - struct file *filp, struct channel *ch) + struct file *filp, struct channel *ch) { - DECLARE_WAITQUEUE(wait, current); + DECLARE_WAITQUEUE(wait,current); int retval, do_clocal = 0; unsigned long flags; @@ -838,7 +839,8 @@ static int block_til_ready(struct tty_struct *tty, while (1) { set_current_state(TASK_INTERRUPTIBLE); if (tty_hung_up_p(filp) || - !(ch->asyncflags & ASYNC_INITIALIZED)) { + !(ch->asyncflags & ASYNC_INITIALIZED)) + { if (ch->asyncflags & ASYNC_HUP_NOTIFY) retval = -EAGAIN; else @@ -878,7 +880,7 @@ static int block_til_ready(struct tty_struct *tty, return 0; } -static int pc_open(struct tty_struct *tty, struct file *filp) +static int pc_open(struct tty_struct *tty, struct file * filp) { struct channel *ch; unsigned long flags; @@ -921,8 +923,7 @@ static int pc_open(struct tty_struct *tty, struct file *filp) return(-ENODEV); } - bc = ch->brdchan; - if (bc == NULL) { + if ((bc = ch->brdchan) == 0) { tty->driver_data = NULL; return -ENODEV; } @@ -963,7 +964,7 @@ static int pc_open(struct tty_struct *tty, struct file *filp) * The below routine generally sets up parity, baud, flow control * issues, etc.... It effect both control flags and input flags. */ - epcaparam(tty, ch); + epcaparam(tty,ch); ch->asyncflags |= ASYNC_INITIALIZED; memoff(ch); spin_unlock_irqrestore(&epca_lock, flags); @@ -1001,8 +1002,8 @@ static void __exit epca_module_exit(void) del_timer_sync(&epca_timer); - if (tty_unregister_driver(pc_driver) || - tty_unregister_driver(pc_info)) { + if (tty_unregister_driver(pc_driver) || tty_unregister_driver(pc_info)) + { printk(KERN_WARNING "epca: cleanup_module failed to un-register tty driver\n"); return; } @@ -1033,6 +1034,7 @@ static const struct tty_operations pc_ops = { .flush_buffer = pc_flush_buffer, .chars_in_buffer = pc_chars_in_buffer, .flush_chars = pc_flush_chars, + .put_char = pc_put_char, .ioctl = pc_ioctl, .set_termios = pc_set_termios, .stop = pc_stop, @@ -1042,7 +1044,7 @@ static const struct tty_operations pc_ops = { .hangup = pc_hangup, }; -static int info_open(struct tty_struct *tty, struct file *filp) +static int info_open(struct tty_struct *tty, struct file * filp) { return 0; } @@ -1097,7 +1099,7 @@ static int __init pc_init(void) * Set up interrupt, we will worry about memory allocation in * post_fep_init. */ - printk(KERN_INFO "DIGI epca driver version %s loaded.\n", VERSION); + printk(KERN_INFO "DIGI epca driver version %s loaded.\n",VERSION); /* * NOTE : This code assumes that the number of ports found in the @@ -1250,7 +1252,7 @@ static int __init pc_init(void) if ((board_id & 0x30) == 0x30) bd->memory_seg = 0x8000; } else - printk(KERN_ERR "epca: Board at 0x%x doesn't appear to be an XI\n", (int)bd->port); + printk(KERN_ERR "epca: Board at 0x%x doesn't appear to be an XI\n",(int)bd->port); break; } } @@ -1324,12 +1326,12 @@ static void post_fep_init(unsigned int crd) */ /* PCI cards are already remapped at this point ISA are not */ bd->numports = readw(bd->re_map_membase + XEMPORTS); - epcaassert(bd->numports <= 64, "PCI returned a invalid number of ports"); + epcaassert(bd->numports <= 64,"PCI returned a invalid number of ports"); nbdevs += (bd->numports); } else { /* Fix up the mappings for ISA/EISA etc */ /* FIXME: 64K - can we be smarter ? */ - bd->re_map_membase = ioremap_nocache(bd->membase, 0x10000); + bd->re_map_membase = ioremap(bd->membase, 0x10000); } if (crd != 0) @@ -1360,8 +1362,7 @@ static void post_fep_init(unsigned int crd) * XEPORTS (address 0xc22) points at the number of channels the card * supports. (For 64XE, XI, XEM, and XR use 0xc02) */ - if ((bd->type == PCXEVE || bd->type == PCXE) && - (readw(memaddr + XEPORTS) < 3)) + if ((bd->type == PCXEVE || bd->type == PCXE) && (readw(memaddr + XEPORTS) < 3)) shrinkmem = 1; if (bd->type < PCIXEM) if (!request_region((int)bd->port, 4, board_desc[bd->type])) @@ -1460,12 +1461,10 @@ static void post_fep_init(unsigned int crd) case PCXEVE: case PCXE: - ch->txptr = memaddr + (((tseg - bd->memory_seg) << 4) - & 0x1fff); + ch->txptr = memaddr + (((tseg - bd->memory_seg) << 4) & 0x1fff); ch->txwin = FEPWIN | ((tseg - bd->memory_seg) >> 9); - ch->rxptr = memaddr + (((rseg - bd->memory_seg) << 4) - & 0x1fff); - ch->rxwin = FEPWIN | ((rseg - bd->memory_seg) >> 9); + ch->rxptr = memaddr + (((rseg - bd->memory_seg) << 4) & 0x1fff); + ch->rxwin = FEPWIN | ((rseg - bd->memory_seg) >>9 ); break; case PCXI: @@ -1519,9 +1518,8 @@ static void post_fep_init(unsigned int crd) } printk(KERN_INFO - "Digi PC/Xx Driver V%s: %s I/O = 0x%lx Mem = 0x%lx Ports = %d\n", - VERSION, board_desc[bd->type], (long)bd->port, - (long)bd->membase, bd->numports); + "Digi PC/Xx Driver V%s: %s I/O = 0x%lx Mem = 0x%lx Ports = %d\n", + VERSION, board_desc[bd->type], (long)bd->port, (long)bd->membase, bd->numports); memwinoff(bd, 0); } @@ -1529,7 +1527,7 @@ static void epcapoll(unsigned long ignored) { unsigned long flags; int crd; - unsigned int head, tail; + volatile unsigned int head, tail; struct channel *ch; struct board_info *bd; @@ -1595,9 +1593,7 @@ static void doevent(int crd) chan0 = card_ptr[crd]; epcaassert(chan0 <= &digi_channels[nbdevs - 1], "ch out of range"); assertgwinon(chan0); - while ((tail = readw(&chan0->mailbox->eout)) != - (head = readw(&chan0->mailbox->ein))) { - /* Begin while something in event queue */ + while ((tail = readw(&chan0->mailbox->eout)) != (head = readw(&chan0->mailbox->ein))) { /* Begin while something in event queue */ assertgwinon(chan0); eventbuf = bd->re_map_membase + tail + ISTART; /* Get the channel the event occurred on */ @@ -1621,8 +1617,7 @@ static void doevent(int crd) goto next; } - bc = ch->brdchan; - if (bc == NULL) + if ((bc = ch->brdchan) == NULL) goto next; if (event & DATA_IND) { /* Begin DATA_IND */ @@ -1634,11 +1629,10 @@ static void doevent(int crd) /* A modem signal change has been indicated */ ch->imodem = mstat; if (ch->asyncflags & ASYNC_CHECK_CD) { - /* We are now receiving dcd */ - if (mstat & ch->dcd) + if (mstat & ch->dcd) /* We are now receiving dcd */ wake_up_interruptible(&ch->open_wait); - else /* No dcd; hangup */ - pc_sched_event(ch, EPCA_EVENT_HANGUP); + else + pc_sched_event(ch, EPCA_EVENT_HANGUP); /* No dcd; hangup */ } } tty = ch->tty; @@ -1653,8 +1647,7 @@ static void doevent(int crd) tty_wakeup(tty); } } else if (event & EMPTYTX_IND) { - /* This event is generated by - setup_empty_event */ + /* This event is generated by setup_empty_event */ ch->statusflags &= ~TXBUSY; if (ch->statusflags & EMPTYWAIT) { ch->statusflags &= ~EMPTYWAIT; @@ -1662,7 +1655,7 @@ static void doevent(int crd) } } } -next: + next: globalwinon(ch); BUG_ON(!bc); writew(1, &bc->idata); @@ -1672,7 +1665,7 @@ static void doevent(int crd) } static void fepcmd(struct channel *ch, int cmd, int word_or_byte, - int byte2, int ncmds, int bytecmd) + int byte2, int ncmds, int bytecmd) { unchar __iomem *memaddr; unsigned int head, cmdTail, cmdStart, cmdMax; @@ -1697,10 +1690,8 @@ static void fepcmd(struct channel *ch, int cmd, int word_or_byte, memaddr = ch->board->re_map_membase; if (head >= (cmdMax - cmdStart) || (head & 03)) { - printk(KERN_ERR "line %d: Out of range, cmd = %x, head = %x\n", - __LINE__, cmd, head); - printk(KERN_ERR "line %d: Out of range, cmdMax = %x, cmdStart = %x\n", - __LINE__, cmdMax, cmdStart); + printk(KERN_ERR "line %d: Out of range, cmd = %x, head = %x\n", __LINE__, cmd, head); + printk(KERN_ERR "line %d: Out of range, cmdMax = %x, cmdStart = %x\n", __LINE__, cmdMax, cmdStart); return; } if (bytecmd) { @@ -1779,7 +1770,7 @@ static unsigned termios2digi_h(struct channel *ch, unsigned cflag) static unsigned termios2digi_i(struct channel *ch, unsigned iflag) { unsigned res = iflag & (IGNBRK | BRKINT | IGNPAR | PARMRK | - INPCK | ISTRIP | IXON | IXANY | IXOFF); + INPCK | ISTRIP|IXON|IXANY|IXOFF); if (ch->digiext.digi_flags & DIGI_AIXON) res |= IAIXON; return res; @@ -1847,7 +1838,7 @@ static void epcaparam(struct tty_struct *tty, struct channel *ch) unsigned mval, hflow, cflag, iflag; bc = ch->brdchan; - epcaassert(bc != NULL, "bc out of range"); + epcaassert(bc !=0, "bc out of range"); assertgwinon(ch); ts = tty->termios; @@ -1893,10 +1884,8 @@ static void epcaparam(struct tty_struct *tty, struct channel *ch) * Command sets channels iflag structure on the board. Such * things as input soft flow control, handling of parity * errors, and break handling are all set here. - * - * break handling, parity handling, input stripping, - * flow control chars */ + /* break handling, parity handling, input stripping, flow control chars */ fepcmd(ch, SETIFLAGS, (unsigned int) ch->fepiflag, 0, 0, 0); } /* @@ -1992,7 +1981,7 @@ static void receive_data(struct channel *ch) return; /* If CREAD bit is off or device not open, set TX tail to head */ - if (!tty || !ts || !(ts->c_cflag & CREAD)) { + if (!tty || !ts || !(ts->c_cflag & CREAD)) { writew(head, &bc->rout); return; } @@ -2002,21 +1991,18 @@ static void receive_data(struct channel *ch) if (readb(&bc->orun)) { writeb(0, &bc->orun); - printk(KERN_WARNING "epca; overrun! DigiBoard device %s\n", - tty->name); + printk(KERN_WARNING "epca; overrun! DigiBoard device %s\n",tty->name); tty_insert_flip_char(tty, 0, TTY_OVERRUN); } rxwinon(ch); - while (bytesAvailable > 0) { - /* Begin while there is data on the card */ + while (bytesAvailable > 0) { /* Begin while there is data on the card */ wrapgap = (head >= tail) ? head - tail : ch->rxbufsize - tail; /* * Even if head has wrapped around only report the amount of * data to be equal to the size - tail. Remember memcpy can't * automaticly wrap around the receive buffer. */ - dataToRead = (wrapgap < bytesAvailable) ? wrapgap - : bytesAvailable; + dataToRead = (wrapgap < bytesAvailable) ? wrapgap : bytesAvailable; /* Make sure we don't overflow the buffer */ dataToRead = tty_prepare_flip_string(tty, &rptr, dataToRead); if (dataToRead == 0) @@ -2167,14 +2153,14 @@ static int pc_tiocmset(struct tty_struct *tty, struct file *file, * The below routine generally sets up parity, baud, flow control * issues, etc.... It effect both control flags and input flags. */ - epcaparam(tty, ch); + epcaparam(tty,ch); memoff(ch); spin_unlock_irqrestore(&epca_lock, flags); return 0; } -static int pc_ioctl(struct tty_struct *tty, struct file *file, - unsigned int cmd, unsigned long arg) +static int pc_ioctl(struct tty_struct *tty, struct file * file, + unsigned int cmd, unsigned long arg) { digiflow_t dflow; int retval; @@ -2189,6 +2175,7 @@ static int pc_ioctl(struct tty_struct *tty, struct file *file, bc = ch->brdchan; else return -EINVAL; + /* * For POSIX compliance we need to add more ioctls. See tty_ioctl.c in * /usr/src/linux/drivers/char for a good example. In particular think @@ -2199,10 +2186,9 @@ static int pc_ioctl(struct tty_struct *tty, struct file *file, retval = tty_check_change(tty); if (retval) return retval; - /* Setup an event to indicate when the transmit - buffer empties */ + /* Setup an event to indicate when the transmit buffer empties */ spin_lock_irqsave(&epca_lock, flags); - setup_empty_event(tty, ch); + setup_empty_event(tty,ch); spin_unlock_irqrestore(&epca_lock, flags); tty_wait_until_sent(tty, 0); if (!arg) @@ -2212,14 +2198,29 @@ static int pc_ioctl(struct tty_struct *tty, struct file *file, retval = tty_check_change(tty); if (retval) return retval; - /* Setup an event to indicate when the transmit buffer - empties */ + + /* Setup an event to indicate when the transmit buffer empties */ spin_lock_irqsave(&epca_lock, flags); - setup_empty_event(tty, ch); + setup_empty_event(tty,ch); spin_unlock_irqrestore(&epca_lock, flags); tty_wait_until_sent(tty, 0); digi_send_break(ch, arg ? arg*(HZ/10) : HZ/4); return 0; + case TIOCGSOFTCAR: + if (put_user(C_CLOCAL(tty)?1:0, (unsigned long __user *)arg)) + return -EFAULT; + return 0; + case TIOCSSOFTCAR: + { + unsigned int value; + + if (get_user(value, (unsigned __user *)argp)) + return -EFAULT; + tty->termios->c_cflag = + ((tty->termios->c_cflag & ~CLOCAL) | + (value ? CLOCAL : 0)); + return 0; + } case TIOCMODG: mflag = pc_tiocmget(tty, file); if (put_user(mflag, (unsigned long __user *)argp)) @@ -2252,12 +2253,10 @@ static int pc_ioctl(struct tty_struct *tty, struct file *file, break; case DIGI_SETAW: case DIGI_SETAF: - lock_kernel(); if (cmd == DIGI_SETAW) { - /* Setup an event to indicate when the transmit - buffer empties */ + /* Setup an event to indicate when the transmit buffer empties */ spin_lock_irqsave(&epca_lock, flags); - setup_empty_event(tty, ch); + setup_empty_event(tty,ch); spin_unlock_irqrestore(&epca_lock, flags); tty_wait_until_sent(tty, 0); } else { @@ -2265,7 +2264,6 @@ static int pc_ioctl(struct tty_struct *tty, struct file *file, if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); } - unlock_kernel(); /* Fall Thru */ case DIGI_SETA: if (copy_from_user(&ch->digiext, argp, sizeof(digi_t))) @@ -2287,7 +2285,7 @@ static int pc_ioctl(struct tty_struct *tty, struct file *file, * control issues, etc.... It effect both control flags and * input flags. */ - epcaparam(tty, ch); + epcaparam(tty,ch); memoff(ch); spin_unlock_irqrestore(&epca_lock, flags); break; @@ -2323,21 +2321,18 @@ static int pc_ioctl(struct tty_struct *tty, struct file *file, if (copy_from_user(&dflow, argp, sizeof(dflow))) return -EFAULT; - if (dflow.startc != startc || dflow.stopc != stopc) { - /* Begin if setflow toggled */ + if (dflow.startc != startc || dflow.stopc != stopc) { /* Begin if setflow toggled */ spin_lock_irqsave(&epca_lock, flags); globalwinon(ch); if (cmd == DIGI_SETFLOW) { ch->fepstartc = ch->startc = dflow.startc; ch->fepstopc = ch->stopc = dflow.stopc; - fepcmd(ch, SONOFFC, ch->fepstartc, - ch->fepstopc, 0, 1); + fepcmd(ch, SONOFFC, ch->fepstartc, ch->fepstopc, 0, 1); } else { ch->fepstartca = ch->startca = dflow.startc; ch->fepstopca = ch->stopca = dflow.stopc; - fepcmd(ch, SAUXONOFFC, ch->fepstartca, - ch->fepstopca, 0, 1); + fepcmd(ch, SAUXONOFFC, ch->fepstartca, ch->fepstopca, 0, 1); } if (ch->statusflags & TXSTOPPED) @@ -2361,9 +2356,7 @@ static void pc_set_termios(struct tty_struct *tty, struct ktermios *old_termios) * verifyChannel returns the channel from the tty struct if it is * valid. This serves as a sanity check. */ - ch = verifyChannel(tty); - - if (ch != NULL) { /* Begin if channel valid */ + if ((ch = verifyChannel(tty)) != NULL) { /* Begin if channel valid */ spin_lock_irqsave(&epca_lock, flags); globalwinon(ch); epcaparam(tty, ch); @@ -2390,7 +2383,7 @@ static void do_softint(struct work_struct *work) if (tty && tty->driver_data) { if (test_and_clear_bit(EPCA_EVENT_HANGUP, &ch->event)) { - tty_hangup(tty); + tty_hangup(tty); /* FIXME: module removal race here - AKPM */ wake_up_interruptible(&ch->open_wait); ch->asyncflags &= ~ASYNC_NORMAL_ACTIVE; } @@ -2410,11 +2403,9 @@ static void pc_stop(struct tty_struct *tty) * verifyChannel returns the channel from the tty struct if it is * valid. This serves as a sanity check. */ - ch = verifyChannel(tty); - if (ch != NULL) { + if ((ch = verifyChannel(tty)) != NULL) { spin_lock_irqsave(&epca_lock, flags); - if ((ch->statusflags & TXSTOPPED) == 0) { - /* Begin if transmit stop requested */ + if ((ch->statusflags & TXSTOPPED) == 0) { /* Begin if transmit stop requested */ globalwinon(ch); /* STOP transmitting now !! */ fepcmd(ch, PAUSETX, 0, 0, 0, 0); @@ -2432,14 +2423,11 @@ static void pc_start(struct tty_struct *tty) * verifyChannel returns the channel from the tty struct if it is * valid. This serves as a sanity check. */ - ch = verifyChannel(tty); - if (ch != NULL) { + if ((ch = verifyChannel(tty)) != NULL) { unsigned long flags; spin_lock_irqsave(&epca_lock, flags); - /* Just in case output was resumed because of a change - in Digi-flow */ - if (ch->statusflags & TXSTOPPED) { - /* Begin transmit resume requested */ + /* Just in case output was resumed because of a change in Digi-flow */ + if (ch->statusflags & TXSTOPPED) { /* Begin transmit resume requested */ struct board_chan __iomem *bc; globalwinon(ch); bc = ch->brdchan; @@ -2469,8 +2457,7 @@ static void pc_throttle(struct tty_struct *tty) * verifyChannel returns the channel from the tty struct if it is * valid. This serves as a sanity check. */ - ch = verifyChannel(tty); - if (ch != NULL) { + if ((ch = verifyChannel(tty)) != NULL) { spin_lock_irqsave(&epca_lock, flags); if ((ch->statusflags & RXSTOPPED) == 0) { globalwinon(ch); @@ -2490,10 +2477,8 @@ static void pc_unthrottle(struct tty_struct *tty) * verifyChannel returns the channel from the tty struct if it is * valid. This serves as a sanity check. */ - ch = verifyChannel(tty); - if (ch != NULL) { - /* Just in case output was resumed because of a change - in Digi-flow */ + if ((ch = verifyChannel(tty)) != NULL) { + /* Just in case output was resumed because of a change in Digi-flow */ spin_lock_irqsave(&epca_lock, flags); if (ch->statusflags & RXSTOPPED) { globalwinon(ch); @@ -2505,7 +2490,7 @@ static void pc_unthrottle(struct tty_struct *tty) } } -static void digi_send_break(struct channel *ch, int msec) +void digi_send_break(struct channel *ch, int msec) { unsigned long flags; @@ -2538,7 +2523,7 @@ static void setup_empty_event(struct tty_struct *tty, struct channel *ch) memoff(ch); } -static void epca_setup(char *str, int *ints) +void epca_setup(char *str, int *ints) { struct board_info board; int index, loop, last; @@ -2567,16 +2552,14 @@ static void epca_setup(char *str, int *ints) * instructing the driver to ignore epcaconfig.) For * this reason we check for 2. */ - if (board.status == 2) { - /* Begin ignore epcaconfig as well as lilo cmd line */ + if (board.status == 2) { /* Begin ignore epcaconfig as well as lilo cmd line */ nbdevs = 0; num_cards = 0; return; } /* End ignore epcaconfig as well as lilo cmd line */ if (board.status > 2) { - printk(KERN_ERR "epca_setup: Invalid board status 0x%x\n", - board.status); + printk(KERN_ERR "epca_setup: Invalid board status 0x%x\n", board.status); invalid_lilo_config = 1; setup_error_code |= INVALID_BOARD_STATUS; return; @@ -2630,8 +2613,7 @@ static void epca_setup(char *str, int *ints) case 6: board.membase = ints[index]; if (ints[index] <= 0) { - printk(KERN_ERR "epca_setup: Invalid memory base 0x%x\n", - (unsigned int)board.membase); + printk(KERN_ERR "epca_setup: Invalid memory base 0x%x\n",(unsigned int)board.membase); invalid_lilo_config = 1; setup_error_code |= INVALID_MEM_BASE; return; @@ -2762,7 +2744,7 @@ static void epca_setup(char *str, int *ints) t2++; if (*t2) { - printk(KERN_ERR "epca_setup: Invalid memory base %s\n", str); + printk(KERN_ERR "epca_setup: Invalid memory base %s\n",str); invalid_lilo_config = 1; setup_error_code |= INVALID_MEM_BASE; return; @@ -2784,7 +2766,7 @@ static void epca_setup(char *str, int *ints) /* I should REALLY validate the stuff here */ /* Copies our local copy of board into boards */ - memcpy((void *)&boards[num_cards], (void *)&board, sizeof(board)); + memcpy((void *)&boards[num_cards],(void *)&board, sizeof(board)); /* Does this get called once per lilo arg are what ? */ printk(KERN_INFO "PC/Xx: Added board %i, %s %i ports at 0x%4.4X base 0x%6.6X\n", num_cards, board_desc[board.type], @@ -2825,9 +2807,9 @@ static int __devinit epca_init_one(struct pci_dev *pdev, if (board_idx >= MAXBOARDS) goto err_out; - addr = pci_resource_start(pdev, epca_info_tbl[info_idx].bar_idx); + addr = pci_resource_start (pdev, epca_info_tbl[info_idx].bar_idx); if (!addr) { - printk(KERN_ERR PFX "PCI region #%d not available (size 0)\n", + printk (KERN_ERR PFX "PCI region #%d not available (size 0)\n", epca_info_tbl[info_idx].bar_idx); goto err_out; } @@ -2838,29 +2820,28 @@ static int __devinit epca_init_one(struct pci_dev *pdev, boards[board_idx].port = addr + PCI_IO_OFFSET; boards[board_idx].membase = addr; - if (!request_mem_region(addr + PCI_IO_OFFSET, 0x200000, "epca")) { - printk(KERN_ERR PFX "resource 0x%x @ 0x%lx unavailable\n", + if (!request_mem_region (addr + PCI_IO_OFFSET, 0x200000, "epca")) { + printk (KERN_ERR PFX "resource 0x%x @ 0x%lx unavailable\n", 0x200000, addr + PCI_IO_OFFSET); goto err_out; } - boards[board_idx].re_map_port = ioremap_nocache(addr + PCI_IO_OFFSET, - 0x200000); + boards[board_idx].re_map_port = ioremap(addr + PCI_IO_OFFSET, 0x200000); if (!boards[board_idx].re_map_port) { - printk(KERN_ERR PFX "cannot map 0x%x @ 0x%lx\n", + printk (KERN_ERR PFX "cannot map 0x%x @ 0x%lx\n", 0x200000, addr + PCI_IO_OFFSET); goto err_out_free_pciio; } - if (!request_mem_region(addr, 0x200000, "epca")) { - printk(KERN_ERR PFX "resource 0x%x @ 0x%lx unavailable\n", + if (!request_mem_region (addr, 0x200000, "epca")) { + printk (KERN_ERR PFX "resource 0x%x @ 0x%lx unavailable\n", 0x200000, addr); goto err_out_free_iounmap; } - boards[board_idx].re_map_membase = ioremap_nocache(addr, 0x200000); + boards[board_idx].re_map_membase = ioremap(addr, 0x200000); if (!boards[board_idx].re_map_membase) { - printk(KERN_ERR PFX "cannot map 0x%x @ 0x%lx\n", + printk (KERN_ERR PFX "cannot map 0x%x @ 0x%lx\n", 0x200000, addr + PCI_IO_OFFSET); goto err_out_free_memregion; } @@ -2877,11 +2858,11 @@ static int __devinit epca_init_one(struct pci_dev *pdev, return 0; err_out_free_memregion: - release_mem_region(addr, 0x200000); + release_mem_region (addr, 0x200000); err_out_free_iounmap: - iounmap(boards[board_idx].re_map_port); + iounmap (boards[board_idx].re_map_port); err_out_free_pciio: - release_mem_region(addr + PCI_IO_OFFSET, 0x200000); + release_mem_region (addr + PCI_IO_OFFSET, 0x200000); err_out: return -ENODEV; } @@ -2897,9 +2878,9 @@ static struct pci_device_id epca_pci_tbl[] = { MODULE_DEVICE_TABLE(pci, epca_pci_tbl); -static int __init init_PCI(void) +int __init init_PCI (void) { - memset(&epca_driver, 0, sizeof(epca_driver)); + memset (&epca_driver, 0, sizeof (epca_driver)); epca_driver.name = "epca"; epca_driver.id_table = epca_pci_tbl; epca_driver.probe = epca_init_one; diff --git a/trunk/drivers/char/esp.c b/trunk/drivers/char/esp.c index 84840ba13ff0..f3fe62067344 100644 --- a/trunk/drivers/char/esp.c +++ b/trunk/drivers/char/esp.c @@ -8,7 +8,7 @@ * Extensively rewritten by Theodore Ts'o, 8/16/92 -- 9/14/92. Now * much more extensible to support other serial cards based on the * 16450/16550A UART's. Added support for the AST FourPort and the - * Accent Async board. + * Accent Async board. * * set_serial_info fixed to set the flags, custom divisor, and uart * type fields. Fix suggested by Michael K. Johnson 12/12/92. @@ -61,11 +61,11 @@ #include #include -#include +#include #include #include -#include +#include #include @@ -127,10 +127,8 @@ static struct tty_driver *esp_driver; #undef SERIAL_DEBUG_FLOW #if defined(MODULE) && defined(SERIAL_DEBUG_MCOUNT) -#define DBG_CNT(s) printk(KERN_DEBUG "(%s): [%x] refc=%d, serc=%d, ttyc=%d -> %s\n", \ - tty->name, info->flags, \ - serial_driver.refcount, \ - info->count, tty->count, s) +#define DBG_CNT(s) printk("(%s): [%x] refc=%d, serc=%d, ttyc=%d -> %s\n", \ + tty->name, (info->flags), serial_driver.refcount,info->count,tty->count,s) #else #define DBG_CNT(s) #endif @@ -191,7 +189,7 @@ static inline void serial_out(struct esp_struct *info, int offset, */ static void rs_stop(struct tty_struct *tty) { - struct esp_struct *info = tty->driver_data; + struct esp_struct *info = (struct esp_struct *)tty->driver_data; unsigned long flags; if (serial_paranoia_check(info, tty->name, "rs_stop")) @@ -208,12 +206,12 @@ static void rs_stop(struct tty_struct *tty) static void rs_start(struct tty_struct *tty) { - struct esp_struct *info = tty->driver_data; + struct esp_struct *info = (struct esp_struct *)tty->driver_data; unsigned long flags; - + if (serial_paranoia_check(info, tty->name, "rs_start")) return; - + spin_lock_irqsave(&info->lock, flags); if (info->xmit_cnt && info->xmit_buf && !(info->IER & UART_IER_THRI)) { info->IER |= UART_IER_THRI; @@ -235,7 +233,7 @@ static void rs_start(struct tty_struct *tty) * rs_interrupt() should try to keep the interrupt handler as fast as * possible. After you are done making modifications, it is not a bad * idea to do: - * + * * gcc -S -DKERNEL -Wall -Wstrict-prototypes -O6 -fomit-frame-pointer serial.c * * and look at the resulting assemble code in serial.s. @@ -292,7 +290,7 @@ static inline void receive_chars_pio(struct esp_struct *info, int num_bytes) } status_mask = (info->read_status_mask >> 2) & 0x07; - + for (i = 0; i < num_bytes - 1; i += 2) { *((unsigned short *)(pio_buf->data + i)) = inw(info->port + UART_ESI_RX); @@ -327,7 +325,8 @@ static inline void receive_chars_pio(struct esp_struct *info, int num_bytes) flag = TTY_BREAK; if (info->flags & ASYNC_SAK) do_SAK(tty); - } else if (err_buf->data[i] & 0x02) + } + else if (err_buf->data[i] & 0x02) flag = TTY_FRAME; else if (err_buf->data[i] & 0x01) flag = TTY_PARITY; @@ -342,29 +341,23 @@ static inline void receive_chars_pio(struct esp_struct *info, int num_bytes) release_pio_buffer(err_buf); } -static void program_isa_dma(int dma, int dir, unsigned long addr, int len) +static inline void receive_chars_dma(struct esp_struct *info, int num_bytes) { unsigned long flags; - - flags = claim_dma_lock(); - disable_dma(dma); - clear_dma_ff(dma); - set_dma_mode(dma, dir); - set_dma_addr(dma, addr); - set_dma_count(dma, len); - enable_dma(dma); - release_dma_lock(flags); -} - -static void receive_chars_dma(struct esp_struct *info, int num_bytes) -{ info->stat_flags &= ~ESP_STAT_RX_TIMEOUT; dma_bytes = num_bytes; info->stat_flags |= ESP_STAT_DMA_RX; - - program_isa_dma(dma, DMA_MODE_READ, isa_virt_to_bus(dma_buffer), - dma_bytes); - serial_out(info, UART_ESI_CMD1, ESI_START_DMA_RX); + + flags=claim_dma_lock(); + disable_dma(dma); + clear_dma_ff(dma); + set_dma_mode(dma, DMA_MODE_READ); + set_dma_addr(dma, isa_virt_to_bus(dma_buffer)); + set_dma_count(dma, dma_bytes); + enable_dma(dma); + release_dma_lock(flags); + + serial_out(info, UART_ESI_CMD1, ESI_START_DMA_RX); } static inline void receive_chars_dma_done(struct esp_struct *info, @@ -373,22 +366,22 @@ static inline void receive_chars_dma_done(struct esp_struct *info, struct tty_struct *tty = info->tty; int num_bytes; unsigned long flags; - - flags = claim_dma_lock(); + + flags=claim_dma_lock(); disable_dma(dma); clear_dma_ff(dma); info->stat_flags &= ~ESP_STAT_DMA_RX; num_bytes = dma_bytes - get_dma_residue(dma); release_dma_lock(flags); - + info->icount.rx += num_bytes; if (num_bytes > 0) { tty_insert_flip_string(tty, dma_buffer, num_bytes - 1); status &= (0x1c & info->read_status_mask); - + /* Is the status significant or do we throw the last byte ? */ if (!(status & info->ignore_status_mask)) { int statflag = 0; @@ -400,13 +393,13 @@ static inline void receive_chars_dma_done(struct esp_struct *info, do_SAK(tty); } else if (status & 0x08) { statflag = TTY_FRAME; - info->icount.frame++; - } else if (status & 0x04) { + (info->icount.frame)++; + } + else if (status & 0x04) { statflag = TTY_PARITY; - info->icount.parity++; + (info->icount.parity)++; } - tty_insert_flip_char(tty, dma_buffer[num_bytes - 1], - statflag); + tty_insert_flip_char(tty, dma_buffer[num_bytes - 1], statflag); } tty_schedule_flip(tty); } @@ -491,6 +484,8 @@ static inline void transmit_chars_pio(struct esp_struct *info, /* Caller must hold info->lock */ static inline void transmit_chars_dma(struct esp_struct *info, int num_bytes) { + unsigned long flags; + dma_bytes = num_bytes; if (info->xmit_tail + dma_bytes <= ESP_XMIT_SIZE) { @@ -522,18 +517,26 @@ static inline void transmit_chars_dma(struct esp_struct *info, int num_bytes) } info->stat_flags |= ESP_STAT_DMA_TX; - - program_isa_dma(dma, DMA_MODE_WRITE, isa_virt_to_bus(dma_buffer), - dma_bytes); - serial_out(info, UART_ESI_CMD1, ESI_START_DMA_TX); + + flags=claim_dma_lock(); + disable_dma(dma); + clear_dma_ff(dma); + set_dma_mode(dma, DMA_MODE_WRITE); + set_dma_addr(dma, isa_virt_to_bus(dma_buffer)); + set_dma_count(dma, dma_bytes); + enable_dma(dma); + release_dma_lock(flags); + + serial_out(info, UART_ESI_CMD1, ESI_START_DMA_TX); } static inline void transmit_chars_dma_done(struct esp_struct *info) { int num_bytes; unsigned long flags; + - flags = claim_dma_lock(); + flags=claim_dma_lock(); disable_dma(dma); clear_dma_ff(dma); @@ -544,21 +547,27 @@ static inline void transmit_chars_dma_done(struct esp_struct *info) if (dma_bytes != num_bytes) { dma_bytes -= num_bytes; memmove(dma_buffer, dma_buffer + num_bytes, dma_bytes); - - program_isa_dma(dma, DMA_MODE_WRITE, - isa_virt_to_bus(dma_buffer), dma_bytes); - - serial_out(info, UART_ESI_CMD1, ESI_START_DMA_TX); + + flags=claim_dma_lock(); + disable_dma(dma); + clear_dma_ff(dma); + set_dma_mode(dma, DMA_MODE_WRITE); + set_dma_addr(dma, isa_virt_to_bus(dma_buffer)); + set_dma_count(dma, dma_bytes); + enable_dma(dma); + release_dma_lock(flags); + + serial_out(info, UART_ESI_CMD1, ESI_START_DMA_TX); } else { dma_bytes = 0; info->stat_flags &= ~ESP_STAT_DMA_TX; } } -static void check_modem_status(struct esp_struct *info) +static inline void check_modem_status(struct esp_struct *info) { int status; - + serial_out(info, UART_ESI_CMD1, ESI_GET_UART_STAT); status = serial_in(info, UART_ESI_STAT2); @@ -579,7 +588,7 @@ static void check_modem_status(struct esp_struct *info) #if (defined(SERIAL_DEBUG_OPEN) || defined(SERIAL_DEBUG_INTR)) printk("ttys%d CD now %s...", info->line, (status & UART_MSR_DCD) ? "on" : "off"); -#endif +#endif if (status & UART_MSR_DCD) wake_up_interruptible(&info->open_wait); else { @@ -596,7 +605,7 @@ static void check_modem_status(struct esp_struct *info) */ static irqreturn_t rs_interrupt_single(int irq, void *dev_id) { - struct esp_struct *info; + struct esp_struct * info; unsigned err_status; unsigned int scratch; @@ -608,7 +617,7 @@ static irqreturn_t rs_interrupt_single(int irq, void *dev_id) scratch = serial_in(info, UART_ESI_SID); spin_lock(&info->lock); - + if (!info->tty) { spin_unlock(&info->lock); return IRQ_NONE; @@ -628,7 +637,7 @@ static irqreturn_t rs_interrupt_single(int irq, void *dev_id) if (err_status & 0x80) /* Start break */ wake_up_interruptible(&info->break_wait); } - + if ((scratch & 0x88) || /* DMA completed or timed out */ (err_status & 0x1c) /* receive error */) { if (info->stat_flags & ESP_STAT_DMA_RX) @@ -658,7 +667,7 @@ static irqreturn_t rs_interrupt_single(int irq, void *dev_id) receive_chars_dma(info, num_bytes); } } - + if (!(info->stat_flags & (ESP_STAT_DMA_RX | ESP_STAT_DMA_TX)) && (scratch & 0x02) && (info->IER & UART_IER_THRI)) { if ((info->xmit_cnt <= 0) || info->tty->stopped) { @@ -713,11 +722,11 @@ static irqreturn_t rs_interrupt_single(int irq, void *dev_id) * --------------------------------------------------------------- */ -static void esp_basic_init(struct esp_struct *info) +static inline void esp_basic_init(struct esp_struct * info) { /* put ESPC in enhanced mode */ serial_out(info, UART_ESI_CMD1, ESI_SET_MODE); - + if (info->stat_flags & ESP_STAT_NEVER_DMA) serial_out(info, UART_ESI_CMD2, 0x01); else @@ -774,13 +783,13 @@ static void esp_basic_init(struct esp_struct *info) serial_out(info, UART_ESI_CMD2, 0xff); } -static int startup(struct esp_struct *info) +static int startup(struct esp_struct * info) { unsigned long flags; - int retval = 0; - unsigned int num_chars; + int retval=0; + unsigned int num_chars; - spin_lock_irqsave(&info->lock, flags); + spin_lock_irqsave(&info->lock, flags); if (info->flags & ASYNC_INITIALIZED) goto out; @@ -793,8 +802,7 @@ static int startup(struct esp_struct *info) } #ifdef SERIAL_DEBUG_OPEN - printk(KERN_DEBUG "starting up ttys%d (irq %d)...", - info->line, info->irq); + printk("starting up ttys%d (irq %d)...", info->line, info->irq); #endif /* Flush the RX buffer. Using the ESI flush command may cause */ @@ -855,7 +863,7 @@ static int startup(struct esp_struct *info) dma_buffer = NULL; info->stat_flags |= ESP_STAT_USE_PIO; } - + } info->MCR = UART_MCR_DTR | UART_MCR_RTS | UART_MCR_OUT2; @@ -864,7 +872,7 @@ static int startup(struct esp_struct *info) serial_out(info, UART_ESI_CMD1, ESI_WRITE_UART); serial_out(info, UART_ESI_CMD2, UART_MCR); serial_out(info, UART_ESI_CMD2, info->MCR); - + /* * Finally, enable interrupts */ @@ -873,7 +881,7 @@ static int startup(struct esp_struct *info) UART_IER_DMA_TC; serial_out(info, UART_ESI_CMD1, ESI_SET_SRV_MASK); serial_out(info, UART_ESI_CMD2, info->IER); - + if (info->tty) clear_bit(TTY_IO_ERROR, &info->tty->flags); info->xmit_cnt = info->xmit_head = info->xmit_tail = 0; @@ -892,7 +900,7 @@ static int startup(struct esp_struct *info) if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP) info->tty->alt_speed = 460800; } - + /* * set the speed of the serial port */ @@ -910,7 +918,7 @@ static int startup(struct esp_struct *info) * This routine will shutdown a serial port; interrupts are disabled, and * DTR is dropped if the hangup on close termio flag is on. */ -static void shutdown(struct esp_struct *info) +static void shutdown(struct esp_struct * info) { unsigned long flags, f; @@ -921,7 +929,7 @@ static void shutdown(struct esp_struct *info) printk("Shutting down serial port %d (irq %d)....", info->line, info->irq); #endif - + spin_lock_irqsave(&info->lock, flags); /* * clear delta_msr_wait queue to avoid mem leaks: we may free the irq @@ -933,14 +941,14 @@ static void shutdown(struct esp_struct *info) /* stop a DMA transfer on the port being closed */ /* DMA lock is higher priority always */ if (info->stat_flags & (ESP_STAT_DMA_RX | ESP_STAT_DMA_TX)) { - f = claim_dma_lock(); + f=claim_dma_lock(); disable_dma(dma); clear_dma_ff(dma); release_dma_lock(f); - + dma_bytes = 0; } - + /* * Free the IRQ */ @@ -962,7 +970,7 @@ static void shutdown(struct esp_struct *info) free_pages((unsigned long)dma_buffer, get_order(DMA_BUFFER_SZ)); dma_buffer = NULL; - } + } } if (info->xmit_buf) { @@ -984,7 +992,7 @@ static void shutdown(struct esp_struct *info) if (info->tty) set_bit(TTY_IO_ERROR, &info->tty->flags); - + info->flags &= ~ASYNC_INITIALIZED; spin_unlock_irqrestore(&info->lock, flags); } @@ -997,7 +1005,7 @@ static void change_speed(struct esp_struct *info) { unsigned short port; int quot = 0; - unsigned cflag, cval; + unsigned cflag,cval; int baud, bits; unsigned char flow1 = 0, flow2 = 0; unsigned long flags; @@ -1006,14 +1014,14 @@ static void change_speed(struct esp_struct *info) return; cflag = info->tty->termios->c_cflag; port = info->port; - + /* byte size and parity */ switch (cflag & CSIZE) { - case CS5: cval = 0x00; bits = 7; break; - case CS6: cval = 0x01; bits = 8; break; - case CS7: cval = 0x02; bits = 9; break; - case CS8: cval = 0x03; bits = 10; break; - default: cval = 0x00; bits = 7; break; + case CS5: cval = 0x00; bits = 7; break; + case CS6: cval = 0x01; bits = 8; break; + case CS7: cval = 0x02; bits = 9; break; + case CS8: cval = 0x03; bits = 10; break; + default: cval = 0x00; bits = 7; break; } if (cflag & CSTOPB) { cval |= 0x04; @@ -1029,12 +1037,14 @@ static void change_speed(struct esp_struct *info) if (cflag & CMSPAR) cval |= UART_LCR_SPAR; #endif + baud = tty_get_baud_rate(info->tty); if (baud == 38400 && - ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST)) + ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST)) quot = info->custom_divisor; else { - if (baud == 134) /* Special case since 134 is really 134.5 */ + if (baud == 134) + /* Special case since 134 is really 134.5 */ quot = (2*BASE_BAUD / 269); else if (baud) quot = BASE_BAUD / baud; @@ -1042,12 +1052,7 @@ static void change_speed(struct esp_struct *info) /* If the quotient is ever zero, default to 9600 bps */ if (!quot) quot = BASE_BAUD / 9600; - - if (baud) { - /* Actual rate */ - baud = BASE_BAUD/quot; - tty_encode_baud_rate(info->tty, baud, baud); - } + info->timeout = ((1024 * HZ * bits * quot) / BASE_BAUD) + (HZ / 50); /* CTS flow control flag and modem status interrupts */ @@ -1061,8 +1066,10 @@ static void change_speed(struct esp_struct *info) info->flags &= ~ASYNC_CTS_FLOW; if (cflag & CLOCAL) info->flags &= ~ASYNC_CHECK_CD; - else + else { info->flags |= ASYNC_CHECK_CD; + /* info->IER |= UART_IER_MSI; */ + } /* * Set up parity check flag @@ -1072,7 +1079,7 @@ static void change_speed(struct esp_struct *info) info->read_status_mask |= UART_LSR_FE | UART_LSR_PE; if (I_BRKINT(info->tty) || I_PARMRK(info->tty)) info->read_status_mask |= UART_LSR_BI; - + info->ignore_status_mask = 0; #if 0 /* This should be safe, but for some broken bits of hardware... */ @@ -1085,7 +1092,7 @@ static void change_speed(struct esp_struct *info) info->ignore_status_mask |= UART_LSR_BI; info->read_status_mask |= UART_LSR_BI; /* - * If we're ignore parity and break indicators, ignore + * If we're ignore parity and break indicators, ignore * overruns too. (For real raw support). */ if (I_IGNPAR(info->tty)) { @@ -1123,19 +1130,19 @@ static void change_speed(struct esp_struct *info) serial_out(info, UART_ESI_CMD2, 0x10); serial_out(info, UART_ESI_CMD2, 0x21); switch (cflag & CSIZE) { - case CS5: - serial_out(info, UART_ESI_CMD2, 0x1f); - break; - case CS6: - serial_out(info, UART_ESI_CMD2, 0x3f); - break; - case CS7: - case CS8: - serial_out(info, UART_ESI_CMD2, 0x7f); - break; - default: - serial_out(info, UART_ESI_CMD2, 0xff); - break; + case CS5: + serial_out(info, UART_ESI_CMD2, 0x1f); + break; + case CS6: + serial_out(info, UART_ESI_CMD2, 0x3f); + break; + case CS7: + case CS8: + serial_out(info, UART_ESI_CMD2, 0x7f); + break; + default: + serial_out(info, UART_ESI_CMD2, 0xff); + break; } } @@ -1149,34 +1156,31 @@ static void change_speed(struct esp_struct *info) spin_unlock_irqrestore(&info->lock, flags); } -static int rs_put_char(struct tty_struct *tty, unsigned char ch) +static void rs_put_char(struct tty_struct *tty, unsigned char ch) { - struct esp_struct *info = tty->driver_data; + struct esp_struct *info = (struct esp_struct *)tty->driver_data; unsigned long flags; - int ret = 0; if (serial_paranoia_check(info, tty->name, "rs_put_char")) - return 0; + return; if (!info->xmit_buf) - return 0; + return; spin_lock_irqsave(&info->lock, flags); if (info->xmit_cnt < ESP_XMIT_SIZE - 1) { info->xmit_buf[info->xmit_head++] = ch; info->xmit_head &= ESP_XMIT_SIZE-1; info->xmit_cnt++; - ret = 1; } spin_unlock_irqrestore(&info->lock, flags); - return ret; } static void rs_flush_chars(struct tty_struct *tty) { - struct esp_struct *info = tty->driver_data; + struct esp_struct *info = (struct esp_struct *)tty->driver_data; unsigned long flags; - + if (serial_paranoia_check(info, tty->name, "rs_flush_chars")) return; @@ -1194,11 +1198,11 @@ static void rs_flush_chars(struct tty_struct *tty) spin_unlock_irqrestore(&info->lock, flags); } -static int rs_write(struct tty_struct *tty, +static int rs_write(struct tty_struct * tty, const unsigned char *buf, int count) { int c, t, ret = 0; - struct esp_struct *info = tty->driver_data; + struct esp_struct *info = (struct esp_struct *)tty->driver_data; unsigned long flags; if (serial_paranoia_check(info, tty->name, "rs_write")) @@ -1206,19 +1210,19 @@ static int rs_write(struct tty_struct *tty, if (!info->xmit_buf) return 0; - + while (1) { /* Thanks to R. Wolff for suggesting how to do this with */ /* interrupts enabled */ c = count; t = ESP_XMIT_SIZE - info->xmit_cnt - 1; - + if (t < c) c = t; t = ESP_XMIT_SIZE - info->xmit_head; - + if (t < c) c = t; @@ -1248,10 +1252,10 @@ static int rs_write(struct tty_struct *tty, static int rs_write_room(struct tty_struct *tty) { - struct esp_struct *info = tty->driver_data; + struct esp_struct *info = (struct esp_struct *)tty->driver_data; int ret; unsigned long flags; - + if (serial_paranoia_check(info, tty->name, "rs_write_room")) return 0; @@ -1266,8 +1270,8 @@ static int rs_write_room(struct tty_struct *tty) static int rs_chars_in_buffer(struct tty_struct *tty) { - struct esp_struct *info = tty->driver_data; - + struct esp_struct *info = (struct esp_struct *)tty->driver_data; + if (serial_paranoia_check(info, tty->name, "rs_chars_in_buffer")) return 0; return info->xmit_cnt; @@ -1275,9 +1279,9 @@ static int rs_chars_in_buffer(struct tty_struct *tty) static void rs_flush_buffer(struct tty_struct *tty) { - struct esp_struct *info = tty->driver_data; + struct esp_struct *info = (struct esp_struct *)tty->driver_data; unsigned long flags; - + if (serial_paranoia_check(info, tty->name, "rs_flush_buffer")) return; spin_lock_irqsave(&info->lock, flags); @@ -1289,20 +1293,20 @@ static void rs_flush_buffer(struct tty_struct *tty) /* * ------------------------------------------------------------ * rs_throttle() - * + * * This routine is called by the upper-layer tty layer to signal that * incoming characters should be throttled. * ------------------------------------------------------------ */ -static void rs_throttle(struct tty_struct *tty) +static void rs_throttle(struct tty_struct * tty) { - struct esp_struct *info = tty->driver_data; + struct esp_struct *info = (struct esp_struct *)tty->driver_data; unsigned long flags; #ifdef SERIAL_DEBUG_THROTTLE char buf[64]; - + printk("throttle %s: %d....\n", tty_name(tty, buf), - tty_chars_in_buffer(tty)); + tty->ldisc.chars_in_buffer(tty)); #endif if (serial_paranoia_check(info, tty->name, "rs_throttle")) @@ -1317,20 +1321,20 @@ static void rs_throttle(struct tty_struct *tty) spin_unlock_irqrestore(&info->lock, flags); } -static void rs_unthrottle(struct tty_struct *tty) +static void rs_unthrottle(struct tty_struct * tty) { - struct esp_struct *info = tty->driver_data; + struct esp_struct *info = (struct esp_struct *)tty->driver_data; unsigned long flags; #ifdef SERIAL_DEBUG_THROTTLE char buf[64]; - - printk(KERN_DEBUG "unthrottle %s: %d....\n", tty_name(tty, buf), - tty_chars_in_buffer(tty)); + + printk("unthrottle %s: %d....\n", tty_name(tty, buf), + tty->ldisc.chars_in_buffer(tty)); #endif if (serial_paranoia_check(info, tty->name, "rs_unthrottle")) return; - + spin_lock_irqsave(&info->lock, flags); info->IER |= UART_IER_RDI; serial_out(info, UART_ESI_CMD1, ESI_SET_SRV_MASK); @@ -1346,12 +1350,11 @@ static void rs_unthrottle(struct tty_struct *tty) * ------------------------------------------------------------ */ -static int get_serial_info(struct esp_struct *info, +static int get_serial_info(struct esp_struct * info, struct serial_struct __user *retinfo) { struct serial_struct tmp; - - lock_kernel(); + memset(&tmp, 0, sizeof(tmp)); tmp.type = PORT_16550A; tmp.line = info->line; @@ -1364,22 +1367,20 @@ static int get_serial_info(struct esp_struct *info, tmp.closing_wait = info->closing_wait; tmp.custom_divisor = info->custom_divisor; tmp.hub6 = 0; - unlock_kernel(); - if (copy_to_user(retinfo, &tmp, sizeof(*retinfo))) + if (copy_to_user(retinfo,&tmp,sizeof(*retinfo))) return -EFAULT; return 0; } -static int get_esp_config(struct esp_struct *info, +static int get_esp_config(struct esp_struct * info, struct hayes_esp_config __user *retinfo) { struct hayes_esp_config tmp; - + if (!retinfo) return -EFAULT; memset(&tmp, 0, sizeof(tmp)); - lock_kernel(); tmp.rx_timeout = info->config.rx_timeout; tmp.rx_trigger = info->config.rx_trigger; tmp.tx_trigger = info->config.tx_trigger; @@ -1387,12 +1388,11 @@ static int get_esp_config(struct esp_struct *info, tmp.flow_on = info->config.flow_on; tmp.pio_threshold = info->config.pio_threshold; tmp.dma_channel = (info->stat_flags & ESP_STAT_NEVER_DMA ? 0 : dma); - unlock_kernel(); return copy_to_user(retinfo, &tmp, sizeof(*retinfo)) ? -EFAULT : 0; } -static int set_serial_info(struct esp_struct *info, +static int set_serial_info(struct esp_struct * info, struct serial_struct __user *new_info) { struct serial_struct new_serial; @@ -1401,7 +1401,7 @@ static int set_serial_info(struct esp_struct *info, int retval = 0; struct esp_struct *current_async; - if (copy_from_user(&new_serial, new_info, sizeof(new_serial))) + if (copy_from_user(&new_serial,new_info,sizeof(new_serial))) return -EFAULT; old_info = *info; @@ -1422,7 +1422,7 @@ static int set_serial_info(struct esp_struct *info, return -EINVAL; if (!capable(CAP_SYS_ADMIN)) { - if (change_irq || + if (change_irq || (new_serial.close_delay != info->close_delay) || ((new_serial.flags & ~ASYNC_USR_MASK) != (info->flags & ~ASYNC_USR_MASK))) @@ -1507,8 +1507,8 @@ static int set_serial_info(struct esp_struct *info, return retval; } -static int set_esp_config(struct esp_struct *info, - struct hayes_esp_config __user *new_info) +static int set_esp_config(struct esp_struct * info, + struct hayes_esp_config __user * new_info) { struct hayes_esp_config new_config; unsigned int change_dma; @@ -1550,6 +1550,7 @@ static int set_esp_config(struct esp_struct *info, if (new_config.dma_channel) { /* PIO mode to DMA mode transition OR */ /* change current DMA channel */ + current_async = ports; while (current_async) { @@ -1558,15 +1559,16 @@ static int set_esp_config(struct esp_struct *info, return -EBUSY; } else if (current_async->count) return -EBUSY; - - current_async = current_async->next_port; + + current_async = + current_async->next_port; } shutdown(info); dma = new_config.dma_channel; info->stat_flags &= ~ESP_STAT_NEVER_DMA; - - /* all ports must use the same DMA channel */ + + /* all ports must use the same DMA channel */ spin_lock_irqsave(&info->lock, flags); current_async = ports; @@ -1578,6 +1580,7 @@ static int set_esp_config(struct esp_struct *info, spin_unlock_irqrestore(&info->lock, flags); } else { /* DMA mode to PIO mode only */ + if (info->count > 1) return -EBUSY; @@ -1593,6 +1596,8 @@ static int set_esp_config(struct esp_struct *info, if ((new_config.flow_off != info->config.flow_off) || (new_config.flow_on != info->config.flow_on)) { + unsigned long flags; + info->config.flow_off = new_config.flow_off; info->config.flow_on = new_config.flow_on; @@ -1607,6 +1612,8 @@ static int set_esp_config(struct esp_struct *info, if ((new_config.rx_trigger != info->config.rx_trigger) || (new_config.tx_trigger != info->config.tx_trigger)) { + unsigned long flags; + info->config.rx_trigger = new_config.rx_trigger; info->config.tx_trigger = new_config.tx_trigger; spin_lock_irqsave(&info->lock, flags); @@ -1621,6 +1628,8 @@ static int set_esp_config(struct esp_struct *info, } if (new_config.rx_timeout != info->config.rx_timeout) { + unsigned long flags; + info->config.rx_timeout = new_config.rx_timeout; spin_lock_irqsave(&info->lock, flags); @@ -1648,9 +1657,9 @@ static int set_esp_config(struct esp_struct *info, * release the bus after transmitting. This must be done when * the transmit shift register is empty, not be done when the * transmit holding register is empty. This functionality - * allows an RS485 driver to be written in user space. + * allows an RS485 driver to be written in user space. */ -static int get_lsr_info(struct esp_struct *info, unsigned int __user *value) +static int get_lsr_info(struct esp_struct * info, unsigned int __user *value) { unsigned char status; unsigned int result; @@ -1661,17 +1670,17 @@ static int get_lsr_info(struct esp_struct *info, unsigned int __user *value) status = serial_in(info, UART_ESI_STAT1); spin_unlock_irqrestore(&info->lock, flags); result = ((status & UART_LSR_TEMT) ? TIOCSER_TEMT : 0); - return put_user(result, value); + return put_user(result,value); } static int esp_tiocmget(struct tty_struct *tty, struct file *file) { - struct esp_struct *info = tty->driver_data; + struct esp_struct * info = (struct esp_struct *)tty->driver_data; unsigned char control, status; unsigned long flags; - if (serial_paranoia_check(info, tty->name, __func__)) + if (serial_paranoia_check(info, tty->name, __FUNCTION__)) return -ENODEV; if (tty->flags & (1 << TTY_IO_ERROR)) return -EIO; @@ -1694,10 +1703,10 @@ static int esp_tiocmget(struct tty_struct *tty, struct file *file) static int esp_tiocmset(struct tty_struct *tty, struct file *file, unsigned int set, unsigned int clear) { - struct esp_struct *info = tty->driver_data; + struct esp_struct * info = (struct esp_struct *)tty->driver_data; unsigned long flags; - if (serial_paranoia_check(info, tty->name, __func__)) + if (serial_paranoia_check(info, tty->name, __FUNCTION__)) return -ENODEV; if (tty->flags & (1 << TTY_IO_ERROR)) return -EIO; @@ -1727,9 +1736,9 @@ static int esp_tiocmset(struct tty_struct *tty, struct file *file, */ static void esp_break(struct tty_struct *tty, int break_state) { - struct esp_struct *info = tty->driver_data; + struct esp_struct * info = (struct esp_struct *)tty->driver_data; unsigned long flags; - + if (serial_paranoia_check(info, tty->name, "esp_break")) return; @@ -1749,15 +1758,14 @@ static void esp_break(struct tty_struct *tty, int break_state) } } -static int rs_ioctl(struct tty_struct *tty, struct file *file, +static int rs_ioctl(struct tty_struct *tty, struct file * file, unsigned int cmd, unsigned long arg) { - struct esp_struct *info = tty->driver_data; + struct esp_struct * info = (struct esp_struct *)tty->driver_data; struct async_icount cprev, cnow; /* kernel counter temps */ struct serial_icounter_struct __user *p_cuser; /* user space */ void __user *argp = (void __user *)arg; unsigned long flags; - int ret; if (serial_paranoia_check(info, tty->name, "rs_ioctl")) return -ENODEV; @@ -1770,93 +1778,97 @@ static int rs_ioctl(struct tty_struct *tty, struct file *file, if (tty->flags & (1 << TTY_IO_ERROR)) return -EIO; } - + switch (cmd) { - case TIOCGSERIAL: - return get_serial_info(info, argp); - case TIOCSSERIAL: - lock_kernel(); - ret = set_serial_info(info, argp); - unlock_kernel(); - return ret; - case TIOCSERGWILD: - return put_user(0L, (unsigned long __user *)argp); - case TIOCSERGETLSR: /* Get line status register */ - return get_lsr_info(info, argp); - case TIOCSERSWILD: - if (!capable(CAP_SYS_ADMIN)) - return -EPERM; - return 0; - /* - * Wait for any of the 4 modem inputs (DCD,RI,DSR,CTS) to change - * - mask passed in arg for lines of interest - * (use |'ed TIOCM_RNG/DSR/CD/CTS for masking) - * Caller should use TIOCGICOUNT to see which one it was - */ - case TIOCMIWAIT: - spin_lock_irqsave(&info->lock, flags); - cprev = info->icount; /* note the counters on entry */ - spin_unlock_irqrestore(&info->lock, flags); - while (1) { - /* FIXME: convert to new style wakeup */ - interruptible_sleep_on(&info->delta_msr_wait); - /* see if a signal did it */ - if (signal_pending(current)) - return -ERESTARTSYS; + case TIOCGSERIAL: + return get_serial_info(info, argp); + case TIOCSSERIAL: + return set_serial_info(info, argp); + case TIOCSERCONFIG: + /* do not reconfigure after initial configuration */ + return 0; + + case TIOCSERGWILD: + return put_user(0L, (unsigned long __user *)argp); + + case TIOCSERGETLSR: /* Get line status register */ + return get_lsr_info(info, argp); + + case TIOCSERSWILD: + if (!capable(CAP_SYS_ADMIN)) + return -EPERM; + return 0; + + /* + * Wait for any of the 4 modem inputs (DCD,RI,DSR,CTS) to change + * - mask passed in arg for lines of interest + * (use |'ed TIOCM_RNG/DSR/CD/CTS for masking) + * Caller should use TIOCGICOUNT to see which one it was + */ + case TIOCMIWAIT: spin_lock_irqsave(&info->lock, flags); - cnow = info->icount; /* atomic copy */ + cprev = info->icount; /* note the counters on entry */ spin_unlock_irqrestore(&info->lock, flags); - if (cnow.rng == cprev.rng && - cnow.dsr == cprev.dsr && - cnow.dcd == cprev.dcd && - cnow.cts == cprev.cts) - return -EIO; /* no change => error */ - if (((arg & TIOCM_RNG) && - (cnow.rng != cprev.rng)) || - ((arg & TIOCM_DSR) && - (cnow.dsr != cprev.dsr)) || - ((arg & TIOCM_CD) && - (cnow.dcd != cprev.dcd)) || - ((arg & TIOCM_CTS) && - (cnow.cts != cprev.cts))) { - return 0; + while (1) { + /* FIXME: convert to new style wakeup */ + interruptible_sleep_on(&info->delta_msr_wait); + /* see if a signal did it */ + if (signal_pending(current)) + return -ERESTARTSYS; + spin_lock_irqsave(&info->lock, flags); + cnow = info->icount; /* atomic copy */ + spin_unlock_irqrestore(&info->lock, flags); + if (cnow.rng == cprev.rng && + cnow.dsr == cprev.dsr && + cnow.dcd == cprev.dcd && + cnow.cts == cprev.cts) + return -EIO; /* no change => error */ + if (((arg & TIOCM_RNG) && + (cnow.rng != cprev.rng)) || + ((arg & TIOCM_DSR) && + (cnow.dsr != cprev.dsr)) || + ((arg & TIOCM_CD) && + (cnow.dcd != cprev.dcd)) || + ((arg & TIOCM_CTS) && + (cnow.cts != cprev.cts)) ) { + return 0; + } + cprev = cnow; } - cprev = cnow; - } - /* NOTREACHED */ - /* - * Get counter of input serial line interrupts (DCD,RI,DSR,CTS) - * Return: write counters to the user passed counter struct - * NB: both 1->0 and 0->1 transitions are counted except for - * RI where only 0->1 is counted. - */ - case TIOCGICOUNT: - spin_lock_irqsave(&info->lock, flags); - cnow = info->icount; - spin_unlock_irqrestore(&info->lock, flags); - p_cuser = argp; - if (put_user(cnow.cts, &p_cuser->cts) || - put_user(cnow.dsr, &p_cuser->dsr) || - put_user(cnow.rng, &p_cuser->rng) || - put_user(cnow.dcd, &p_cuser->dcd)) - return -EFAULT; + /* NOTREACHED */ + + /* + * Get counter of input serial line interrupts (DCD,RI,DSR,CTS) + * Return: write counters to the user passed counter struct + * NB: both 1->0 and 0->1 transitions are counted except for + * RI where only 0->1 is counted. + */ + case TIOCGICOUNT: + spin_lock_irqsave(&info->lock, flags); + cnow = info->icount; + spin_unlock_irqrestore(&info->lock, flags); + p_cuser = argp; + if (put_user(cnow.cts, &p_cuser->cts) || + put_user(cnow.dsr, &p_cuser->dsr) || + put_user(cnow.rng, &p_cuser->rng) || + put_user(cnow.dcd, &p_cuser->dcd)) + return -EFAULT; + return 0; case TIOCGHAYESESP: return get_esp_config(info, argp); case TIOCSHAYESESP: - lock_kernel(); - ret = set_esp_config(info, argp); - unlock_kernel(); - return ret; - default: - return -ENOIOCTLCMD; - } + return set_esp_config(info, argp); + + default: + return -ENOIOCTLCMD; + } return 0; } static void rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios) { - struct esp_struct *info = tty->driver_data; + struct esp_struct *info = (struct esp_struct *)tty->driver_data; unsigned long flags; change_speed(info); @@ -1893,33 +1905,32 @@ static void rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios) /* * ------------------------------------------------------------ * rs_close() - * + * * This routine is called when the serial port gets closed. First, we * wait for the last remaining data to be sent. Then, we unlink its * async structure from the interrupt chain if necessary, and we free * that IRQ if nothing is left in the chain. * ------------------------------------------------------------ */ -static void rs_close(struct tty_struct *tty, struct file *filp) +static void rs_close(struct tty_struct *tty, struct file * filp) { - struct esp_struct *info = tty->driver_data; + struct esp_struct * info = (struct esp_struct *)tty->driver_data; unsigned long flags; if (!info || serial_paranoia_check(info, tty->name, "rs_close")) return; - + spin_lock_irqsave(&info->lock, flags); - + if (tty_hung_up_p(filp)) { DBG_CNT("before DEC-hung"); goto out; } - + #ifdef SERIAL_DEBUG_OPEN - printk(KERN_DEBUG "rs_close ttys%d, count = %d\n", - info->line, info->count); + printk("rs_close ttys%d, count = %d\n", info->line, info->count); #endif - if (tty->count == 1 && info->count != 1) { + if ((tty->count == 1) && (info->count != 1)) { /* * Uh, oh. tty->count is 1, which means that the tty * structure will be freed. Info->count should always @@ -1927,11 +1938,12 @@ static void rs_close(struct tty_struct *tty, struct file *filp) * one, we've got real problems, since it means the * serial port won't be shutdown. */ - printk(KERN_DEBUG "rs_close: bad serial port count; tty->count is 1, info->count is %d\n", info->count); + printk("rs_close: bad serial port count; tty->count is 1, " + "info->count is %d\n", info->count); info->count = 1; } if (--info->count < 0) { - printk(KERN_ERR "rs_close: bad serial port count for ttys%d: %d\n", + printk("rs_close: bad serial port count for ttys%d: %d\n", info->line, info->count); info->count = 0; } @@ -1943,7 +1955,7 @@ static void rs_close(struct tty_struct *tty, struct file *filp) spin_unlock_irqrestore(&info->lock, flags); /* - * Now we wait for the transmit buffer to clear; and we notify + * Now we wait for the transmit buffer to clear; and we notify * the line discipline to only process XON/XOFF characters. */ tty->closing = 1; @@ -1978,14 +1990,16 @@ static void rs_close(struct tty_struct *tty, struct file *filp) rs_wait_until_sent(tty, info->timeout); } shutdown(info); - rs_flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); tty_ldisc_flush(tty); tty->closing = 0; info->tty = NULL; if (info->blocked_open) { - if (info->close_delay) + if (info->close_delay) { msleep_interruptible(jiffies_to_msecs(info->close_delay)); + } wake_up_interruptible(&info->open_wait); } info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING); @@ -1998,7 +2012,7 @@ static void rs_close(struct tty_struct *tty, struct file *filp) static void rs_wait_until_sent(struct tty_struct *tty, int timeout) { - struct esp_struct *info = tty->driver_data; + struct esp_struct *info = (struct esp_struct *)tty->driver_data; unsigned long orig_jiffies, char_time; unsigned long flags; @@ -2022,10 +2036,10 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout) msleep_interruptible(jiffies_to_msecs(char_time)); if (signal_pending(current)) - return; + break; if (timeout && time_after(jiffies, orig_jiffies + timeout)) - return; + break; spin_lock_irqsave(&info->lock, flags); serial_out(info, UART_ESI_CMD1, ESI_NO_COMMAND); @@ -2040,11 +2054,11 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout) */ static void esp_hangup(struct tty_struct *tty) { - struct esp_struct *info = tty->driver_data; - + struct esp_struct * info = (struct esp_struct *)tty->driver_data; + if (serial_paranoia_check(info, tty->name, "esp_hangup")) return; - + rs_flush_buffer(tty); shutdown(info); info->count = 0; @@ -2058,7 +2072,7 @@ static void esp_hangup(struct tty_struct *tty) * esp_open() and friends * ------------------------------------------------------------ */ -static int block_til_ready(struct tty_struct *tty, struct file *filp, +static int block_til_ready(struct tty_struct *tty, struct file * filp, struct esp_struct *info) { DECLARE_WAITQUEUE(wait, current); @@ -2107,11 +2121,11 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, retval = 0; add_wait_queue(&info->open_wait, &wait); #ifdef SERIAL_DEBUG_OPEN - printk(KERN_DEBUG "block_til_ready before block: ttys%d, count = %d\n", + printk("block_til_ready before block: ttys%d, count = %d\n", info->line, info->count); #endif spin_lock_irqsave(&info->lock, flags); - if (!tty_hung_up_p(filp)) + if (!tty_hung_up_p(filp)) info->count--; info->blocked_open++; while (1) { @@ -2133,7 +2147,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, if (info->flags & ASYNC_HUP_NOTIFY) retval = -EAGAIN; else - retval = -ERESTARTSYS; + retval = -ERESTARTSYS; #else retval = -EAGAIN; #endif @@ -2152,7 +2166,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, break; } #ifdef SERIAL_DEBUG_OPEN - printk(KERN_DEBUG "block_til_ready blocking: ttys%d, count = %d\n", + printk("block_til_ready blocking: ttys%d, count = %d\n", info->line, info->count); #endif spin_unlock_irqrestore(&info->lock, flags); @@ -2166,14 +2180,14 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, info->blocked_open--; spin_unlock_irqrestore(&info->lock, flags); #ifdef SERIAL_DEBUG_OPEN - printk(KERN_DEBUG "block_til_ready after blocking: ttys%d, count = %d\n", + printk("block_til_ready after blocking: ttys%d, count = %d\n", info->line, info->count); #endif if (retval) return retval; info->flags |= ASYNC_NORMAL_ACTIVE; return 0; -} +} /* * This routine is called whenever a serial port is opened. It @@ -2181,7 +2195,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, * the IRQ chain. It also performs the serial-specific * initialization for the tty structure. */ -static int esp_open(struct tty_struct *tty, struct file *filp) +static int esp_open(struct tty_struct *tty, struct file * filp) { struct esp_struct *info; int retval, line; @@ -2204,7 +2218,7 @@ static int esp_open(struct tty_struct *tty, struct file *filp) } #ifdef SERIAL_DEBUG_OPEN - printk(KERN_DEBUG "esp_open %s, count = %d\n", tty->name, info->count); + printk("esp_open %s, count = %d\n", tty->name, info->count); #endif spin_lock_irqsave(&info->lock, flags); info->count++; @@ -2212,7 +2226,7 @@ static int esp_open(struct tty_struct *tty, struct file *filp) info->tty = tty; spin_unlock_irqrestore(&info->lock, flags); - + /* * Start up serial port */ @@ -2223,13 +2237,14 @@ static int esp_open(struct tty_struct *tty, struct file *filp) retval = block_til_ready(tty, filp, info); if (retval) { #ifdef SERIAL_DEBUG_OPEN - printk(KERN_DEBUG "esp_open returning after block_til_ready with %d\n", + printk("esp_open returning after block_til_ready with %d\n", retval); #endif return retval; } + #ifdef SERIAL_DEBUG_OPEN - printk(KERN_DEBUG "esp_open %s successful...", tty->name); + printk("esp_open %s successful...", tty->name); #endif return 0; } @@ -2247,10 +2262,10 @@ static int esp_open(struct tty_struct *tty, struct file *filp) * number, and identifies which options were configured into this * driver. */ - -static void show_serial_version(void) + +static inline void show_serial_version(void) { - printk(KERN_INFO "%s version %s (DMA %u)\n", + printk(KERN_INFO "%s version %s (DMA %u)\n", serial_name, serial_version, dma); } @@ -2258,7 +2273,7 @@ static void show_serial_version(void) * This routine is called by espserial_init() to initialize a specific serial * port. */ -static int autoconfig(struct esp_struct *info) +static inline int autoconfig(struct esp_struct * info) { int port_detected = 0; unsigned long flags; @@ -2334,14 +2349,14 @@ static const struct tty_operations esp_ops = { static int __init espserial_init(void) { int i, offset; - struct esp_struct *info; + struct esp_struct * info; struct esp_struct *last_primary = NULL; - int esp[] = { 0x100, 0x140, 0x180, 0x200, 0x240, 0x280, 0x300, 0x380 }; + int esp[] = {0x100,0x140,0x180,0x200,0x240,0x280,0x300,0x380}; esp_driver = alloc_tty_driver(NR_PORTS); if (!esp_driver) return -ENOMEM; - + for (i = 0; i < NR_PRIMARY; i++) { if (irq[i] != 0) { if ((irq[i] < 2) || (irq[i] > 15) || (irq[i] == 6) || @@ -2363,20 +2378,20 @@ static int __init espserial_init(void) if ((flow_off < 1) || (flow_off > 1023)) flow_off = 1016; - + if ((flow_on < 1) || (flow_on > 1023)) flow_on = 944; if ((rx_timeout < 0) || (rx_timeout > 255)) rx_timeout = 128; - + if (flow_on >= flow_off) flow_on = flow_off - 1; show_serial_version(); /* Initialize the tty_driver structure */ - + esp_driver->owner = THIS_MODULE; esp_driver->name = "ttyP"; esp_driver->major = ESP_IN_MAJOR; @@ -2386,11 +2401,10 @@ static int __init espserial_init(void) esp_driver->init_termios = tty_std_termios; esp_driver->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL; - esp_driver->init_termios.c_ispeed = 9600; - esp_driver->init_termios.c_ospeed = 9600; esp_driver->flags = TTY_DRIVER_REAL_RAW; tty_set_operations(esp_driver, &esp_ops); - if (tty_register_driver(esp_driver)) { + if (tty_register_driver(esp_driver)) + { printk(KERN_ERR "Couldn't register esp serial driver"); put_tty_driver(esp_driver); return 1; @@ -2398,7 +2412,8 @@ static int __init espserial_init(void) info = kzalloc(sizeof(struct esp_struct), GFP_KERNEL); - if (!info) { + if (!info) + { printk(KERN_ERR "Couldn't allocate memory for esp serial device information\n"); tty_unregister_driver(esp_driver); put_tty_driver(esp_driver); @@ -2461,8 +2476,10 @@ static int __init espserial_init(void) info->stat_flags |= ESP_STAT_NEVER_DMA; info = kzalloc(sizeof(struct esp_struct), GFP_KERNEL); - if (!info) { - printk(KERN_ERR "Couldn't allocate memory for esp serial device information\n"); + if (!info) + { + printk(KERN_ERR "Couldn't allocate memory for esp serial device information\n"); + /* allow use of the already detected ports */ return 0; } @@ -2486,20 +2503,22 @@ static int __init espserial_init(void) return 0; } -static void __exit espserial_exit(void) +static void __exit espserial_exit(void) { int e1; struct esp_struct *temp_async; struct esp_pio_buffer *pio_buf; - e1 = tty_unregister_driver(esp_driver); - if (e1) - printk(KERN_ERR "esp: failed to unregister driver (%d)\n", e1); + /* printk("Unloading %s: version %s\n", serial_name, serial_version); */ + if ((e1 = tty_unregister_driver(esp_driver))) + printk("SERIAL: failed to unregister serial driver (%d)\n", + e1); put_tty_driver(esp_driver); while (ports) { - if (ports->port) + if (ports->port) { release_region(ports->port, REGION_SIZE); + } temp_async = ports->next_port; kfree(ports); ports = temp_async; diff --git a/trunk/drivers/char/generic_serial.c b/trunk/drivers/char/generic_serial.c index 252f73e48596..7ed7da1d99cf 100644 --- a/trunk/drivers/char/generic_serial.c +++ b/trunk/drivers/char/generic_serial.c @@ -40,27 +40,27 @@ static int gs_debug; #define gs_dprintk(f, str...) /* nothing */ #endif -#define func_enter() gs_dprintk (GS_DEBUG_FLOW, "gs: enter %s\n", __func__) -#define func_exit() gs_dprintk (GS_DEBUG_FLOW, "gs: exit %s\n", __func__) +#define func_enter() gs_dprintk (GS_DEBUG_FLOW, "gs: enter %s\n", __FUNCTION__) +#define func_exit() gs_dprintk (GS_DEBUG_FLOW, "gs: exit %s\n", __FUNCTION__) #define RS_EVENT_WRITE_WAKEUP 1 module_param(gs_debug, int, 0644); -int gs_put_char(struct tty_struct * tty, unsigned char ch) +void gs_put_char(struct tty_struct * tty, unsigned char ch) { struct gs_port *port; func_enter (); - if (!tty) return 0; + if (!tty) return; port = tty->driver_data; - if (!port) return 0; + if (!port) return; - if (! (port->flags & ASYNC_INITIALIZED)) return 0; + if (! (port->flags & ASYNC_INITIALIZED)) return; /* Take a lock on the serial tranmit buffer! */ mutex_lock(& port->port_write_mutex); @@ -68,7 +68,7 @@ int gs_put_char(struct tty_struct * tty, unsigned char ch) if (port->xmit_cnt >= SERIAL_XMIT_SIZE - 1) { /* Sorry, buffer is full, drop character. Update statistics???? -- REW */ mutex_unlock(&port->port_write_mutex); - return 0; + return; } port->xmit_buf[port->xmit_head++] = ch; @@ -77,7 +77,6 @@ int gs_put_char(struct tty_struct * tty, unsigned char ch) mutex_unlock(&port->port_write_mutex); func_exit (); - return 1; } @@ -587,7 +586,8 @@ void gs_close(struct tty_struct * tty, struct file * filp) port->flags &= ~GS_ACTIVE; - gs_flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); tty_ldisc_flush(tty); tty->closing = 0; diff --git a/trunk/drivers/char/hpet.c b/trunk/drivers/char/hpet.c index e7fb0bca3667..1399971be689 100644 --- a/trunk/drivers/char/hpet.c +++ b/trunk/drivers/char/hpet.c @@ -308,7 +308,7 @@ static int hpet_mmap(struct file *file, struct vm_area_struct *vma) if (io_remap_pfn_range(vma, vma->vm_start, addr >> PAGE_SHIFT, PAGE_SIZE, vma->vm_page_prot)) { printk(KERN_ERR "%s: io_remap_pfn_range failed\n", - __func__); + __FUNCTION__); return -EAGAIN; } @@ -748,7 +748,7 @@ int hpet_alloc(struct hpet_data *hdp) */ if (hpet_is_known(hdp)) { printk(KERN_DEBUG "%s: duplicate HPET ignored\n", - __func__); + __FUNCTION__); return 0; } @@ -869,7 +869,7 @@ static acpi_status hpet_resources(struct acpi_resource *res, void *data) if (hpet_is_known(hdp)) { printk(KERN_DEBUG "%s: 0x%lx is busy\n", - __func__, hdp->hd_phys_address); + __FUNCTION__, hdp->hd_phys_address); iounmap(hdp->hd_address); return AE_ALREADY_EXISTS; } @@ -886,7 +886,7 @@ static acpi_status hpet_resources(struct acpi_resource *res, void *data) if (hpet_is_known(hdp)) { printk(KERN_DEBUG "%s: 0x%lx is busy\n", - __func__, hdp->hd_phys_address); + __FUNCTION__, hdp->hd_phys_address); iounmap(hdp->hd_address); return AE_ALREADY_EXISTS; } @@ -925,7 +925,7 @@ static int hpet_acpi_add(struct acpi_device *device) return -ENODEV; if (!data.hd_address || !data.hd_nirqs) { - printk("%s: no address or irqs in _CRS\n", __func__); + printk("%s: no address or irqs in _CRS\n", __FUNCTION__); return -ENODEV; } diff --git a/trunk/drivers/char/hvsi.c b/trunk/drivers/char/hvsi.c index 59c6f9ab94e4..d5a752da322f 100644 --- a/trunk/drivers/char/hvsi.c +++ b/trunk/drivers/char/hvsi.c @@ -246,7 +246,7 @@ static void compact_inbuf(struct hvsi_struct *hp, uint8_t *read_to) { int remaining = (int)(hp->inbuf_end - read_to); - pr_debug("%s: %i chars remain\n", __func__, remaining); + pr_debug("%s: %i chars remain\n", __FUNCTION__, remaining); if (read_to != hp->inbuf) memmove(hp->inbuf, read_to, remaining); @@ -365,7 +365,7 @@ static int hvsi_version_respond(struct hvsi_struct *hp, uint16_t query_seqno) packet.u.version = HVSI_VERSION; packet.query_seqno = query_seqno+1; - pr_debug("%s: sending %i bytes\n", __func__, packet.len); + pr_debug("%s: sending %i bytes\n", __FUNCTION__, packet.len); dbg_dump_hex((uint8_t*)&packet, packet.len); wrote = hvc_put_chars(hp->vtermno, (char *)&packet, packet.len); @@ -437,7 +437,7 @@ static struct tty_struct *hvsi_recv_data(struct hvsi_struct *hp, return NULL; if (overflow > 0) { - pr_debug("%s: got >TTY_THRESHOLD_THROTTLE bytes\n", __func__); + pr_debug("%s: got >TTY_THRESHOLD_THROTTLE bytes\n", __FUNCTION__); datalen = TTY_THRESHOLD_THROTTLE; } @@ -448,7 +448,7 @@ static struct tty_struct *hvsi_recv_data(struct hvsi_struct *hp, * we still have more data to deliver, so we need to save off the * overflow and send it later */ - pr_debug("%s: deferring overflow\n", __func__); + pr_debug("%s: deferring overflow\n", __FUNCTION__); memcpy(hp->throttle_buf, data + TTY_THRESHOLD_THROTTLE, overflow); hp->n_throttle = overflow; } @@ -474,11 +474,11 @@ static int hvsi_load_chunk(struct hvsi_struct *hp, struct tty_struct **flip, chunklen = hvsi_read(hp, hp->inbuf_end, HVSI_MAX_READ); if (chunklen == 0) { - pr_debug("%s: 0-length read\n", __func__); + pr_debug("%s: 0-length read\n", __FUNCTION__); return 0; } - pr_debug("%s: got %i bytes\n", __func__, chunklen); + pr_debug("%s: got %i bytes\n", __FUNCTION__, chunklen); dbg_dump_hex(hp->inbuf_end, chunklen); hp->inbuf_end += chunklen; @@ -495,7 +495,7 @@ static int hvsi_load_chunk(struct hvsi_struct *hp, struct tty_struct **flip, continue; } - pr_debug("%s: handling %i-byte packet\n", __func__, + pr_debug("%s: handling %i-byte packet\n", __FUNCTION__, len_packet(packet)); dbg_dump_packet(packet); @@ -526,7 +526,7 @@ static int hvsi_load_chunk(struct hvsi_struct *hp, struct tty_struct **flip, packet += len_packet(packet); if (*hangup || *handshake) { - pr_debug("%s: hangup or handshake\n", __func__); + pr_debug("%s: hangup or handshake\n", __FUNCTION__); /* * we need to send the hangup now before receiving any more data. * If we get "data, hangup, data", we can't deliver the second @@ -543,7 +543,7 @@ static int hvsi_load_chunk(struct hvsi_struct *hp, struct tty_struct **flip, static void hvsi_send_overflow(struct hvsi_struct *hp) { - pr_debug("%s: delivering %i bytes overflow\n", __func__, + pr_debug("%s: delivering %i bytes overflow\n", __FUNCTION__, hp->n_throttle); hvsi_insert_chars(hp, hp->throttle_buf, hp->n_throttle); @@ -563,7 +563,7 @@ static irqreturn_t hvsi_interrupt(int irq, void *arg) unsigned long flags; int again = 1; - pr_debug("%s\n", __func__); + pr_debug("%s\n", __FUNCTION__); while (again) { spin_lock_irqsave(&hp->lock, flags); @@ -647,7 +647,7 @@ static int hvsi_query(struct hvsi_struct *hp, uint16_t verb) packet.seqno = atomic_inc_return(&hp->seqno); packet.verb = verb; - pr_debug("%s: sending %i bytes\n", __func__, packet.len); + pr_debug("%s: sending %i bytes\n", __FUNCTION__, packet.len); dbg_dump_hex((uint8_t*)&packet, packet.len); wrote = hvc_put_chars(hp->vtermno, (char *)&packet, packet.len); @@ -674,7 +674,7 @@ static int hvsi_get_mctrl(struct hvsi_struct *hp) return ret; } - pr_debug("%s: mctrl 0x%x\n", __func__, hp->mctrl); + pr_debug("%s: mctrl 0x%x\n", __FUNCTION__, hp->mctrl); return 0; } @@ -694,7 +694,7 @@ static int hvsi_set_mctrl(struct hvsi_struct *hp, uint16_t mctrl) if (mctrl & TIOCM_DTR) packet.word = HVSI_TSDTR; - pr_debug("%s: sending %i bytes\n", __func__, packet.len); + pr_debug("%s: sending %i bytes\n", __FUNCTION__, packet.len); dbg_dump_hex((uint8_t*)&packet, packet.len); wrote = hvc_put_chars(hp->vtermno, (char *)&packet, packet.len); @@ -790,7 +790,7 @@ static void hvsi_close_protocol(struct hvsi_struct *hp) packet.len = 6; packet.verb = VSV_CLOSE_PROTOCOL; - pr_debug("%s: sending %i bytes\n", __func__, packet.len); + pr_debug("%s: sending %i bytes\n", __FUNCTION__, packet.len); dbg_dump_hex((uint8_t*)&packet, packet.len); hvc_put_chars(hp->vtermno, (char *)&packet, packet.len); @@ -803,7 +803,7 @@ static int hvsi_open(struct tty_struct *tty, struct file *filp) int line = tty->index; int ret; - pr_debug("%s\n", __func__); + pr_debug("%s\n", __FUNCTION__); if (line < 0 || line >= hvsi_count) return -ENODEV; @@ -868,7 +868,7 @@ static void hvsi_close(struct tty_struct *tty, struct file *filp) struct hvsi_struct *hp = tty->driver_data; unsigned long flags; - pr_debug("%s\n", __func__); + pr_debug("%s\n", __FUNCTION__); if (tty_hung_up_p(filp)) return; @@ -920,7 +920,7 @@ static void hvsi_hangup(struct tty_struct *tty) struct hvsi_struct *hp = tty->driver_data; unsigned long flags; - pr_debug("%s\n", __func__); + pr_debug("%s\n", __FUNCTION__); spin_lock_irqsave(&hp->lock, flags); @@ -942,7 +942,7 @@ static void hvsi_push(struct hvsi_struct *hp) n = hvsi_put_chars(hp, hp->outbuf, hp->n_outbuf); if (n > 0) { /* success */ - pr_debug("%s: wrote %i chars\n", __func__, n); + pr_debug("%s: wrote %i chars\n", __FUNCTION__, n); hp->n_outbuf = 0; } else if (n == -EIO) { __set_state(hp, HVSI_FSP_DIED); @@ -965,7 +965,7 @@ static void hvsi_write_worker(struct work_struct *work) spin_lock_irqsave(&hp->lock, flags); - pr_debug("%s: %i chars in buffer\n", __func__, hp->n_outbuf); + pr_debug("%s: %i chars in buffer\n", __FUNCTION__, hp->n_outbuf); if (!is_open(hp)) { /* @@ -983,7 +983,7 @@ static void hvsi_write_worker(struct work_struct *work) schedule_delayed_work(&hp->writer, 10); else { #ifdef DEBUG - pr_debug("%s: outbuf emptied after %li jiffies\n", __func__, + pr_debug("%s: outbuf emptied after %li jiffies\n", __FUNCTION__, jiffies - start_j); start_j = 0; #endif /* DEBUG */ @@ -1020,11 +1020,11 @@ static int hvsi_write(struct tty_struct *tty, spin_lock_irqsave(&hp->lock, flags); - pr_debug("%s: %i chars in buffer\n", __func__, hp->n_outbuf); + pr_debug("%s: %i chars in buffer\n", __FUNCTION__, hp->n_outbuf); if (!is_open(hp)) { /* we're either closing or not yet open; don't accept data */ - pr_debug("%s: not open\n", __func__); + pr_debug("%s: not open\n", __FUNCTION__); goto out; } @@ -1058,7 +1058,7 @@ static int hvsi_write(struct tty_struct *tty, spin_unlock_irqrestore(&hp->lock, flags); if (total != origcount) - pr_debug("%s: wanted %i, only wrote %i\n", __func__, origcount, + pr_debug("%s: wanted %i, only wrote %i\n", __FUNCTION__, origcount, total); return total; @@ -1072,7 +1072,7 @@ static void hvsi_throttle(struct tty_struct *tty) { struct hvsi_struct *hp = (struct hvsi_struct *)tty->driver_data; - pr_debug("%s\n", __func__); + pr_debug("%s\n", __FUNCTION__); h_vio_signal(hp->vtermno, VIO_IRQ_DISABLE); } @@ -1083,7 +1083,7 @@ static void hvsi_unthrottle(struct tty_struct *tty) unsigned long flags; int shouldflip = 0; - pr_debug("%s\n", __func__); + pr_debug("%s\n", __FUNCTION__); spin_lock_irqsave(&hp->lock, flags); if (hp->n_throttle) { @@ -1302,7 +1302,7 @@ static int __init hvsi_console_init(void) hp->virq = irq_create_mapping(NULL, irq[0]); if (hp->virq == NO_IRQ) { printk(KERN_ERR "%s: couldn't create irq mapping for 0x%x\n", - __func__, irq[0]); + __FUNCTION__, irq[0]); continue; } diff --git a/trunk/drivers/char/ip2/i2ellis.c b/trunk/drivers/char/ip2/i2ellis.c index 3601017f58cf..61ef013b8445 100644 --- a/trunk/drivers/char/ip2/i2ellis.c +++ b/trunk/drivers/char/ip2/i2ellis.c @@ -53,7 +53,7 @@ static int ii2Safe; // Safe I/O address for delay routine static int iiDelayed; // Set when the iiResetDelay function is // called. Cleared when ANY board is reset. -static DEFINE_RWLOCK(Dl_spinlock); +static rwlock_t Dl_spinlock; //******** //* Code * @@ -82,6 +82,7 @@ static DEFINE_RWLOCK(Dl_spinlock); static void iiEllisInit(void) { + LOCK_INIT(&Dl_spinlock); } //****************************************************************************** @@ -131,7 +132,7 @@ iiSetAddress( i2eBordStrPtr pB, int address, delayFunc_t delay ) || (address & 0x7) ) { - I2_COMPLETE(pB, I2EE_BADADDR); + COMPLETE(pB,I2EE_BADADDR); } // Initialize accelerators @@ -151,7 +152,7 @@ iiSetAddress( i2eBordStrPtr pB, int address, delayFunc_t delay ) pB->i2eValid = I2E_MAGIC; pB->i2eState = II_STATE_COLD; - I2_COMPLETE(pB, I2EE_GOOD); + COMPLETE(pB, I2EE_GOOD); } //****************************************************************************** @@ -176,12 +177,12 @@ iiReset(i2eBordStrPtr pB) // Magic number should be set, else even the address is suspect if (pB->i2eValid != I2E_MAGIC) { - I2_COMPLETE(pB, I2EE_BADMAGIC); + COMPLETE(pB, I2EE_BADMAGIC); } - outb(0, pB->i2eBase + FIFO_RESET); /* Any data will do */ + OUTB(pB->i2eBase + FIFO_RESET, 0); // Any data will do iiDelay(pB, 50); // Pause between resets - outb(0, pB->i2eBase + FIFO_RESET); /* Second reset */ + OUTB(pB->i2eBase + FIFO_RESET, 0); // Second reset // We must wait before even attempting to read anything from the FIFO: the // board's P.O.S.T may actually attempt to read and write its end of the @@ -202,7 +203,7 @@ iiReset(i2eBordStrPtr pB) // Ensure anything which would have been of use to standard loadware is // blanked out, since board has now forgotten everything!. - pB->i2eUsingIrq = I2_IRQ_UNDEFINED; /* to not use an interrupt so far */ + pB->i2eUsingIrq = IRQ_UNDEFINED; // Not set up to use an interrupt yet pB->i2eWaitingForEmptyFifo = 0; pB->i2eOutMailWaiting = 0; pB->i2eChannelPtr = NULL; @@ -214,7 +215,7 @@ iiReset(i2eBordStrPtr pB) pB->i2eFatalTrap = NULL; pB->i2eFatal = 0; - I2_COMPLETE(pB, I2EE_GOOD); + COMPLETE(pB, I2EE_GOOD); } //****************************************************************************** @@ -234,14 +235,14 @@ static int iiResetDelay(i2eBordStrPtr pB) { if (pB->i2eValid != I2E_MAGIC) { - I2_COMPLETE(pB, I2EE_BADMAGIC); + COMPLETE(pB, I2EE_BADMAGIC); } if (pB->i2eState != II_STATE_RESET) { - I2_COMPLETE(pB, I2EE_BADSTATE); + COMPLETE(pB, I2EE_BADSTATE); } iiDelay(pB,2000); /* Now we wait for two seconds. */ iiDelayed = 1; /* Delay has been called: ok to initialize */ - I2_COMPLETE(pB, I2EE_GOOD); + COMPLETE(pB, I2EE_GOOD); } //****************************************************************************** @@ -272,12 +273,12 @@ iiInitialize(i2eBordStrPtr pB) if (pB->i2eValid != I2E_MAGIC) { - I2_COMPLETE(pB, I2EE_BADMAGIC); + COMPLETE(pB, I2EE_BADMAGIC); } if (pB->i2eState != II_STATE_RESET || !iiDelayed) { - I2_COMPLETE(pB, I2EE_BADSTATE); + COMPLETE(pB, I2EE_BADSTATE); } // In case there is a failure short of our completely reading the power-up @@ -290,12 +291,13 @@ iiInitialize(i2eBordStrPtr pB) for (itemp = 0; itemp < sizeof(porStr); itemp++) { // We expect the entire message is ready. - if (!I2_HAS_INPUT(pB)) { + if (HAS_NO_INPUT(pB)) + { pB->i2ePomSize = itemp; - I2_COMPLETE(pB, I2EE_PORM_SHORT); + COMPLETE(pB, I2EE_PORM_SHORT); } - pB->i2ePom.c[itemp] = c = inb(pB->i2eData); + pB->i2ePom.c[itemp] = c = BYTE_FROM(pB); // We check the magic numbers as soon as they are supposed to be read // (rather than after) to minimize effect of reading something we @@ -304,22 +306,22 @@ iiInitialize(i2eBordStrPtr pB) (itemp == POR_2_INDEX && c != POR_MAGIC_2)) { pB->i2ePomSize = itemp+1; - I2_COMPLETE(pB, I2EE_BADMAGIC); + COMPLETE(pB, I2EE_BADMAGIC); } } pB->i2ePomSize = itemp; // Ensure that this was all the data... - if (I2_HAS_INPUT(pB)) - I2_COMPLETE(pB, I2EE_PORM_LONG); + if (HAS_INPUT(pB)) + COMPLETE(pB, I2EE_PORM_LONG); // For now, we'll fail to initialize if P.O.S.T reports bad chip mapper: // Implying we will not be able to download any code either: That's ok: the // condition is pretty explicit. if (pB->i2ePom.e.porDiag1 & POR_BAD_MAPPER) { - I2_COMPLETE(pB, I2EE_POSTERR); + COMPLETE(pB, I2EE_POSTERR); } // Determine anything which must be done differently depending on the family @@ -330,7 +332,7 @@ iiInitialize(i2eBordStrPtr pB) pB->i2eFifoStyle = FIFO_II; pB->i2eFifoSize = 512; // 512 bytes, always - pB->i2eDataWidth16 = false; + pB->i2eDataWidth16 = NO; pB->i2eMaxIrq = 15; // Because board cannot tell us it is in an 8-bit // slot, we do allow it to be done (documentation!) @@ -352,7 +354,7 @@ iiInitialize(i2eBordStrPtr pB) // should always be consistent for IntelliPort-II. Ditto below... if (pB->i2ePom.e.porPorts1 != 4) { - I2_COMPLETE(pB, I2EE_INCONSIST); + COMPLETE(pB, I2EE_INCONSIST); } break; @@ -362,7 +364,7 @@ iiInitialize(i2eBordStrPtr pB) pB->i2eChannelMap[0] = 0xff; // Eight port if (pB->i2ePom.e.porPorts1 != 8) { - I2_COMPLETE(pB, I2EE_INCONSIST); + COMPLETE(pB, I2EE_INCONSIST); } break; @@ -371,7 +373,7 @@ iiInitialize(i2eBordStrPtr pB) pB->i2eChannelMap[0] = 0x3f; // Six Port if (pB->i2ePom.e.porPorts1 != 6) { - I2_COMPLETE(pB, I2EE_INCONSIST); + COMPLETE(pB, I2EE_INCONSIST); } break; } @@ -400,7 +402,7 @@ iiInitialize(i2eBordStrPtr pB) if (itemp < 8 || itemp > 15) { - I2_COMPLETE(pB, I2EE_INCONSIST); + COMPLETE(pB, I2EE_INCONSIST); } pB->i2eFifoSize = (1 << itemp); @@ -448,26 +450,26 @@ iiInitialize(i2eBordStrPtr pB) switch (pB->i2ePom.e.porBus & (POR_BUS_SLOT16 | POR_BUS_DIP16) ) { case POR_BUS_SLOT16 | POR_BUS_DIP16: - pB->i2eDataWidth16 = true; + pB->i2eDataWidth16 = YES; pB->i2eMaxIrq = 15; break; case POR_BUS_SLOT16: - pB->i2eDataWidth16 = false; + pB->i2eDataWidth16 = NO; pB->i2eMaxIrq = 15; break; case 0: case POR_BUS_DIP16: // In an 8-bit slot, DIP switch don't care. default: - pB->i2eDataWidth16 = false; + pB->i2eDataWidth16 = NO; pB->i2eMaxIrq = 7; break; } break; // POR_ID_FIIEX case default: // Unknown type of board - I2_COMPLETE(pB, I2EE_BAD_FAMILY); + COMPLETE(pB, I2EE_BAD_FAMILY); break; } // End the switch based on family @@ -481,14 +483,17 @@ iiInitialize(i2eBordStrPtr pB) { case POR_BUS_T_ISA: case POR_BUS_T_UNK: // If the type of bus is undeclared, assume ok. + pB->i2eChangeIrq = YES; + break; case POR_BUS_T_MCA: case POR_BUS_T_EISA: + pB->i2eChangeIrq = NO; break; default: - I2_COMPLETE(pB, I2EE_BADBUS); + COMPLETE(pB, I2EE_BADBUS); } - if (pB->i2eDataWidth16) + if (pB->i2eDataWidth16 == YES) { pB->i2eWriteBuf = iiWriteBuf16; pB->i2eReadBuf = iiReadBuf16; @@ -524,7 +529,7 @@ iiInitialize(i2eBordStrPtr pB) break; default: - I2_COMPLETE(pB, I2EE_INCONSIST); + COMPLETE(pB, I2EE_INCONSIST); } // Initialize state information. @@ -544,7 +549,7 @@ iiInitialize(i2eBordStrPtr pB) // Everything is ok now, return with good status/ pB->i2eValid = I2E_MAGIC; - I2_COMPLETE(pB, I2EE_GOOD); + COMPLETE(pB, I2EE_GOOD); } //****************************************************************************** @@ -653,7 +658,7 @@ ii2DelayIO(unsigned int mseconds) while(mseconds--) { int i = ii2DelValue; while ( i-- ) { - inb(ii2Safe); + INB ( ii2Safe ); } } } @@ -704,11 +709,11 @@ iiWriteBuf16(i2eBordStrPtr pB, unsigned char *address, int count) { // Rudimentary sanity checking here. if (pB->i2eValid != I2E_MAGIC) - I2_COMPLETE(pB, I2EE_INVALID); + COMPLETE(pB, I2EE_INVALID); - I2_OUTSW(pB->i2eData, address, count); + OUTSW ( pB->i2eData, address, count); - I2_COMPLETE(pB, I2EE_GOOD); + COMPLETE(pB, I2EE_GOOD); } //****************************************************************************** @@ -733,11 +738,11 @@ iiWriteBuf8(i2eBordStrPtr pB, unsigned char *address, int count) { /* Rudimentary sanity checking here */ if (pB->i2eValid != I2E_MAGIC) - I2_COMPLETE(pB, I2EE_INVALID); + COMPLETE(pB, I2EE_INVALID); - I2_OUTSB(pB->i2eData, address, count); + OUTSB ( pB->i2eData, address, count ); - I2_COMPLETE(pB, I2EE_GOOD); + COMPLETE(pB, I2EE_GOOD); } //****************************************************************************** @@ -762,11 +767,11 @@ iiReadBuf16(i2eBordStrPtr pB, unsigned char *address, int count) { // Rudimentary sanity checking here. if (pB->i2eValid != I2E_MAGIC) - I2_COMPLETE(pB, I2EE_INVALID); + COMPLETE(pB, I2EE_INVALID); - I2_INSW(pB->i2eData, address, count); + INSW ( pB->i2eData, address, count); - I2_COMPLETE(pB, I2EE_GOOD); + COMPLETE(pB, I2EE_GOOD); } //****************************************************************************** @@ -791,11 +796,11 @@ iiReadBuf8(i2eBordStrPtr pB, unsigned char *address, int count) { // Rudimentary sanity checking here. if (pB->i2eValid != I2E_MAGIC) - I2_COMPLETE(pB, I2EE_INVALID); + COMPLETE(pB, I2EE_INVALID); - I2_INSB(pB->i2eData, address, count); + INSB ( pB->i2eData, address, count); - I2_COMPLETE(pB, I2EE_GOOD); + COMPLETE(pB, I2EE_GOOD); } //****************************************************************************** @@ -815,7 +820,7 @@ iiReadBuf8(i2eBordStrPtr pB, unsigned char *address, int count) static unsigned short iiReadWord16(i2eBordStrPtr pB) { - return inw(pB->i2eData); + return (unsigned short)( INW(pB->i2eData) ); } //****************************************************************************** @@ -837,9 +842,9 @@ iiReadWord8(i2eBordStrPtr pB) { unsigned short urs; - urs = inb(pB->i2eData); + urs = INB ( pB->i2eData ); - return (inb(pB->i2eData) << 8) | urs; + return ( ( INB ( pB->i2eData ) << 8 ) | urs ); } //****************************************************************************** @@ -860,7 +865,7 @@ iiReadWord8(i2eBordStrPtr pB) static void iiWriteWord16(i2eBordStrPtr pB, unsigned short value) { - outw((int)value, pB->i2eData); + WORD_TO(pB, (int)value); } //****************************************************************************** @@ -881,8 +886,8 @@ iiWriteWord16(i2eBordStrPtr pB, unsigned short value) static void iiWriteWord8(i2eBordStrPtr pB, unsigned short value) { - outb((char)value, pB->i2eData); - outb((char)(value >> 8), pB->i2eData); + BYTE_TO(pB, (char)value); + BYTE_TO(pB, (char)(value >> 8) ); } //****************************************************************************** @@ -934,30 +939,30 @@ iiWaitForTxEmptyII(i2eBordStrPtr pB, int mSdelay) // interrupts of any kind. - write_lock_irqsave(&Dl_spinlock, flags); - outb(SEL_COMMAND, pB->i2ePointer); - outb(SEL_CMD_SH, pB->i2ePointer); + WRITE_LOCK_IRQSAVE(&Dl_spinlock,flags) + OUTB(pB->i2ePointer, SEL_COMMAND); + OUTB(pB->i2ePointer, SEL_CMD_SH); - itemp = inb(pB->i2eStatus); + itemp = INB(pB->i2eStatus); - outb(SEL_COMMAND, pB->i2ePointer); - outb(SEL_CMD_UNSH, pB->i2ePointer); + OUTB(pB->i2ePointer, SEL_COMMAND); + OUTB(pB->i2ePointer, SEL_CMD_UNSH); if (itemp & ST_IN_EMPTY) { - I2_UPDATE_FIFO_ROOM(pB); - write_unlock_irqrestore(&Dl_spinlock, flags); - I2_COMPLETE(pB, I2EE_GOOD); + UPDATE_FIFO_ROOM(pB); + WRITE_UNLOCK_IRQRESTORE(&Dl_spinlock,flags) + COMPLETE(pB, I2EE_GOOD); } - write_unlock_irqrestore(&Dl_spinlock, flags); + WRITE_UNLOCK_IRQRESTORE(&Dl_spinlock,flags) if (mSdelay-- == 0) break; iiDelay(pB, 1); /* 1 mS granularity on checking condition */ } - I2_COMPLETE(pB, I2EE_TXE_TIME); + COMPLETE(pB, I2EE_TXE_TIME); } //****************************************************************************** @@ -997,21 +1002,21 @@ iiWaitForTxEmptyIIEX(i2eBordStrPtr pB, int mSdelay) // you will generally not want to service interrupts or in any way // disrupt the assumptions implicit in the larger context. - write_lock_irqsave(&Dl_spinlock, flags); + WRITE_LOCK_IRQSAVE(&Dl_spinlock,flags) - if (inb(pB->i2eStatus) & STE_OUT_MT) { - I2_UPDATE_FIFO_ROOM(pB); - write_unlock_irqrestore(&Dl_spinlock, flags); - I2_COMPLETE(pB, I2EE_GOOD); + if (INB(pB->i2eStatus) & STE_OUT_MT) { + UPDATE_FIFO_ROOM(pB); + WRITE_UNLOCK_IRQRESTORE(&Dl_spinlock,flags) + COMPLETE(pB, I2EE_GOOD); } - write_unlock_irqrestore(&Dl_spinlock, flags); + WRITE_UNLOCK_IRQRESTORE(&Dl_spinlock,flags) if (mSdelay-- == 0) break; iiDelay(pB, 1); // 1 mS granularity on checking condition } - I2_COMPLETE(pB, I2EE_TXE_TIME); + COMPLETE(pB, I2EE_TXE_TIME); } //****************************************************************************** @@ -1033,8 +1038,8 @@ static int iiTxMailEmptyII(i2eBordStrPtr pB) { int port = pB->i2ePointer; - outb(SEL_OUTMAIL, port); - return inb(port) == 0; + OUTB ( port, SEL_OUTMAIL ); + return ( INB(port) == 0 ); } //****************************************************************************** @@ -1055,7 +1060,7 @@ iiTxMailEmptyII(i2eBordStrPtr pB) static int iiTxMailEmptyIIEX(i2eBordStrPtr pB) { - return !(inb(pB->i2eStatus) & STE_OUT_MAIL); + return !(INB(pB->i2eStatus) & STE_OUT_MAIL); } //****************************************************************************** @@ -1079,10 +1084,10 @@ iiTrySendMailII(i2eBordStrPtr pB, unsigned char mail) { int port = pB->i2ePointer; - outb(SEL_OUTMAIL, port); - if (inb(port) == 0) { - outb(SEL_OUTMAIL, port); - outb(mail, port); + OUTB(port, SEL_OUTMAIL); + if (INB(port) == 0) { + OUTB(port, SEL_OUTMAIL); + OUTB(port, mail); return 1; } return 0; @@ -1107,9 +1112,10 @@ iiTrySendMailII(i2eBordStrPtr pB, unsigned char mail) static int iiTrySendMailIIEX(i2eBordStrPtr pB, unsigned char mail) { - if (inb(pB->i2eStatus) & STE_OUT_MAIL) + if(INB(pB->i2eStatus) & STE_OUT_MAIL) { return 0; - outb(mail, pB->i2eXMail); + } + OUTB(pB->i2eXMail, mail); return 1; } @@ -1130,9 +1136,9 @@ iiTrySendMailIIEX(i2eBordStrPtr pB, unsigned char mail) static unsigned short iiGetMailII(i2eBordStrPtr pB) { - if (I2_HAS_MAIL(pB)) { - outb(SEL_INMAIL, pB->i2ePointer); - return inb(pB->i2ePointer); + if (HAS_MAIL(pB)) { + OUTB(pB->i2ePointer, SEL_INMAIL); + return INB(pB->i2ePointer); } else { return NO_MAIL_HERE; } @@ -1155,10 +1161,11 @@ iiGetMailII(i2eBordStrPtr pB) static unsigned short iiGetMailIIEX(i2eBordStrPtr pB) { - if (I2_HAS_MAIL(pB)) - return inb(pB->i2eXMail); - else + if (HAS_MAIL(pB)) { + return INB(pB->i2eXMail); + } else { return NO_MAIL_HERE; + } } //****************************************************************************** @@ -1177,8 +1184,8 @@ iiGetMailIIEX(i2eBordStrPtr pB) static void iiEnableMailIrqII(i2eBordStrPtr pB) { - outb(SEL_MASK, pB->i2ePointer); - outb(ST_IN_MAIL, pB->i2ePointer); + OUTB(pB->i2ePointer, SEL_MASK); + OUTB(pB->i2ePointer, ST_IN_MAIL); } //****************************************************************************** @@ -1197,7 +1204,7 @@ iiEnableMailIrqII(i2eBordStrPtr pB) static void iiEnableMailIrqIIEX(i2eBordStrPtr pB) { - outb(MX_IN_MAIL, pB->i2eXMask); + OUTB(pB->i2eXMask, MX_IN_MAIL); } //****************************************************************************** @@ -1216,8 +1223,8 @@ iiEnableMailIrqIIEX(i2eBordStrPtr pB) static void iiWriteMaskII(i2eBordStrPtr pB, unsigned char value) { - outb(SEL_MASK, pB->i2ePointer); - outb(value, pB->i2ePointer); + OUTB(pB->i2ePointer, SEL_MASK); + OUTB(pB->i2ePointer, value); } //****************************************************************************** @@ -1236,7 +1243,7 @@ iiWriteMaskII(i2eBordStrPtr pB, unsigned char value) static void iiWriteMaskIIEX(i2eBordStrPtr pB, unsigned char value) { - outb(value, pB->i2eXMask); + OUTB(pB->i2eXMask, value); } //****************************************************************************** @@ -1347,8 +1354,9 @@ iiDownloadBlock ( i2eBordStrPtr pB, loadHdrStrPtr pSource, int isStandard) // immediately and be harmless, though not strictly necessary. itemp = MAX_DLOAD_ACK_TIME/10; while (--itemp) { - if (I2_HAS_INPUT(pB)) { - switch (inb(pB->i2eData)) { + if (HAS_INPUT(pB)) { + switch(BYTE_FROM(pB)) + { case LOADWARE_OK: pB->i2eState = isStandard ? II_STATE_STDLOADED :II_STATE_LOADED; diff --git a/trunk/drivers/char/ip2/i2ellis.h b/trunk/drivers/char/ip2/i2ellis.h index c88a64e527aa..433305062fb8 100644 --- a/trunk/drivers/char/ip2/i2ellis.h +++ b/trunk/drivers/char/ip2/i2ellis.h @@ -185,6 +185,10 @@ typedef struct _i2eBordStr // The highest allowable IRQ, based on the // slot size. + unsigned char i2eChangeIrq; + // Whether tis valid to change IRQ's + // ISA = ok, EISA, MicroChannel, no + // Accelerators for various addresses on the board int i2eBase; // I/O Address of the Board int i2eData; // From here data transfers happen @@ -427,6 +431,12 @@ typedef struct _i2eBordStr // Manifests for i2eBordStr: //------------------------------------------- +#define YES 1 +#define NO 0 + +#define NULLFUNC (void (*)(void))0 +#define NULLPTR (void *)0 + typedef void (*delayFunc_t)(unsigned int); // i2eValid @@ -484,8 +494,8 @@ typedef void (*delayFunc_t)(unsigned int); // i2eUsingIrq // -#define I2_IRQ_UNDEFINED 0x1352 /* No valid irq (or polling = 0) can - * ever promote to this! */ +#define IRQ_UNDEFINED 0x1352 // No valid irq (or polling = 0) can ever + // promote to this! //------------------------------------------ // Handy Macros for i2ellis.c and others // Note these are common to -II and -IIEX @@ -494,14 +504,41 @@ typedef void (*delayFunc_t)(unsigned int); // Given a pointer to the board structure, does the input FIFO have any data or // not? // -#define I2_HAS_INPUT(pB) !(inb(pB->i2eStatus) & ST_IN_EMPTY) +#define HAS_INPUT(pB) !(INB(pB->i2eStatus) & ST_IN_EMPTY) +#define HAS_NO_INPUT(pB) (INB(pB->i2eStatus) & ST_IN_EMPTY) + +// Given a pointer to board structure, read a byte or word from the fifo +// +#define BYTE_FROM(pB) (unsigned char)INB(pB->i2eData) +#define WORD_FROM(pB) (unsigned short)INW(pB->i2eData) + +// Given a pointer to board structure, is there room for any data to be written +// to the data fifo? +// +#define HAS_OUTROOM(pB) !(INB(pB->i2eStatus) & ST_OUT_FULL) +#define HAS_NO_OUTROOM(pB) (INB(pB->i2eStatus) & ST_OUT_FULL) + +// Given a pointer to board structure, write a single byte to the fifo +// structure. Note that for 16-bit interfaces, the high order byte is undefined +// and unknown. +// +#define BYTE_TO(pB, c) OUTB(pB->i2eData,(c)) + +// Write a word to the fifo structure. For 8-bit interfaces, this may have +// unknown results. +// +#define WORD_TO(pB, c) OUTW(pB->i2eData,(c)) // Given a pointer to the board structure, is there anything in the incoming // mailbox? // -#define I2_HAS_MAIL(pB) (inb(pB->i2eStatus) & ST_IN_MAIL) +#define HAS_MAIL(pB) (INB(pB->i2eStatus) & ST_IN_MAIL) -#define I2_UPDATE_FIFO_ROOM(pB) ((pB)->i2eFifoRemains = (pB)->i2eFifoSize) +#define UPDATE_FIFO_ROOM(pB) (pB)->i2eFifoRemains=(pB)->i2eFifoSize + +// Handy macro to round up a number (like the buffer write and read routines do) +// +#define ROUNDUP(number) (((number)+1) & (~1)) //------------------------------------------ // Function Declarations for i2ellis.c @@ -556,11 +593,20 @@ static int iiDownloadBlock(i2eBordStrPtr, loadHdrStrPtr, int); // static int iiDownloadAll(i2eBordStrPtr, loadHdrStrPtr, int, int); +// Called indirectly always. Needed externally so the routine might be +// SPECIFIED as an argument to iiReset() +// +//static void ii2DelayIO(unsigned int); // N-millisecond delay using + //hardware spin +//static void ii2DelayTimer(unsigned int); // N-millisecond delay using Linux + //timer + // Many functions defined here return True if good, False otherwise, with an // error code in i2eError field. Here is a handy macro for setting the error // code and returning. // -#define I2_COMPLETE(pB,code) do { \ +#define COMPLETE(pB,code) \ + do { \ pB->i2eError = code; \ return (code == I2EE_GOOD);\ } while (0) diff --git a/trunk/drivers/char/ip2/i2hw.h b/trunk/drivers/char/ip2/i2hw.h index 8aa6e7ab8d5b..15fe04e748f4 100644 --- a/trunk/drivers/char/ip2/i2hw.h +++ b/trunk/drivers/char/ip2/i2hw.h @@ -129,6 +129,7 @@ registers, use byte operations only. //------------------------------------------------ // #include "ip2types.h" +#include "i2os.h" /* For any o.s., compiler, or host-related issues */ //------------------------------------------------------------------------- // Manifests for the I/O map: @@ -643,10 +644,5 @@ typedef union _loadHdrStr #define ABS_BIGGEST_BOX 16 // Absolute the most ports per box #define ABS_MOST_PORTS (ABS_MAX_BOXES * ABS_BIGGEST_BOX) -#define I2_OUTSW(port, addr, count) outsw((port), (addr), (((count)+1)/2)) -#define I2_OUTSB(port, addr, count) outsb((port), (addr), (((count)+1))&-2) -#define I2_INSW(port, addr, count) insw((port), (addr), (((count)+1)/2)) -#define I2_INSB(port, addr, count) insb((port), (addr), (((count)+1))&-2) - #endif // I2HW_H diff --git a/trunk/drivers/char/ip2/i2lib.c b/trunk/drivers/char/ip2/i2lib.c index 938879cc7bcc..9c25320121ef 100644 --- a/trunk/drivers/char/ip2/i2lib.c +++ b/trunk/drivers/char/ip2/i2lib.c @@ -227,17 +227,17 @@ i2InitChannels ( i2eBordStrPtr pB, int nChannels, i2ChanStrPtr pCh) i2ChanStrPtr *ppCh; if (pB->i2eValid != I2E_MAGIC) { - I2_COMPLETE(pB, I2EE_BADMAGIC); + COMPLETE(pB, I2EE_BADMAGIC); } if (pB->i2eState != II_STATE_STDLOADED) { - I2_COMPLETE(pB, I2EE_BADSTATE); + COMPLETE(pB, I2EE_BADSTATE); } - rwlock_init(&pB->read_fifo_spinlock); - rwlock_init(&pB->write_fifo_spinlock); - rwlock_init(&pB->Dbuf_spinlock); - rwlock_init(&pB->Bbuf_spinlock); - rwlock_init(&pB->Fbuf_spinlock); + LOCK_INIT(&pB->read_fifo_spinlock); + LOCK_INIT(&pB->write_fifo_spinlock); + LOCK_INIT(&pB->Dbuf_spinlock); + LOCK_INIT(&pB->Bbuf_spinlock); + LOCK_INIT(&pB->Fbuf_spinlock); // NO LOCK needed yet - this is init @@ -259,10 +259,10 @@ i2InitChannels ( i2eBordStrPtr pB, int nChannels, i2ChanStrPtr pCh) if ( !(pB->i2eChannelMap[index >> 4] & (1 << (index & 0xf)) ) ) { continue; } - rwlock_init(&pCh->Ibuf_spinlock); - rwlock_init(&pCh->Obuf_spinlock); - rwlock_init(&pCh->Cbuf_spinlock); - rwlock_init(&pCh->Pbuf_spinlock); + LOCK_INIT(&pCh->Ibuf_spinlock); + LOCK_INIT(&pCh->Obuf_spinlock); + LOCK_INIT(&pCh->Cbuf_spinlock); + LOCK_INIT(&pCh->Pbuf_spinlock); // NO LOCK needed yet - this is init // Set up validity flag according to support level if (pB->i2eGoodMap[index >> 4] & (1 << (index & 0xf)) ) { @@ -347,7 +347,7 @@ i2InitChannels ( i2eBordStrPtr pB, int nChannels, i2ChanStrPtr pCh) } // No need to check for wrap here; this is initialization. pB->i2Fbuf_stuff = stuffIndex; - I2_COMPLETE(pB, I2EE_GOOD); + COMPLETE(pB, I2EE_GOOD); } @@ -374,7 +374,7 @@ i2DeQueueNeeds(i2eBordStrPtr pB, int type) case NEED_INLINE: - write_lock_irqsave(&pB->Dbuf_spinlock, flags); + WRITE_LOCK_IRQSAVE(&pB->Dbuf_spinlock,flags); if ( pB->i2Dbuf_stuff != pB->i2Dbuf_strip) { queueIndex = pB->i2Dbuf_strip; @@ -386,12 +386,12 @@ i2DeQueueNeeds(i2eBordStrPtr pB, int type) pB->i2Dbuf_strip = queueIndex; pCh->channelNeeds &= ~NEED_INLINE; } - write_unlock_irqrestore(&pB->Dbuf_spinlock, flags); + WRITE_UNLOCK_IRQRESTORE(&pB->Dbuf_spinlock,flags); break; case NEED_BYPASS: - write_lock_irqsave(&pB->Bbuf_spinlock, flags); + WRITE_LOCK_IRQSAVE(&pB->Bbuf_spinlock,flags); if (pB->i2Bbuf_stuff != pB->i2Bbuf_strip) { queueIndex = pB->i2Bbuf_strip; @@ -403,12 +403,12 @@ i2DeQueueNeeds(i2eBordStrPtr pB, int type) pB->i2Bbuf_strip = queueIndex; pCh->channelNeeds &= ~NEED_BYPASS; } - write_unlock_irqrestore(&pB->Bbuf_spinlock, flags); + WRITE_UNLOCK_IRQRESTORE(&pB->Bbuf_spinlock,flags); break; case NEED_FLOW: - write_lock_irqsave(&pB->Fbuf_spinlock, flags); + WRITE_LOCK_IRQSAVE(&pB->Fbuf_spinlock,flags); if (pB->i2Fbuf_stuff != pB->i2Fbuf_strip) { queueIndex = pB->i2Fbuf_strip; @@ -420,7 +420,7 @@ i2DeQueueNeeds(i2eBordStrPtr pB, int type) pB->i2Fbuf_strip = queueIndex; pCh->channelNeeds &= ~NEED_FLOW; } - write_unlock_irqrestore(&pB->Fbuf_spinlock, flags); + WRITE_UNLOCK_IRQRESTORE(&pB->Fbuf_spinlock,flags); break; default: printk(KERN_ERR "i2DeQueueNeeds called with bad type:%x\n",type); @@ -453,7 +453,7 @@ i2QueueNeeds(i2eBordStrPtr pB, i2ChanStrPtr pCh, int type) case NEED_INLINE: - write_lock_irqsave(&pB->Dbuf_spinlock, flags); + WRITE_LOCK_IRQSAVE(&pB->Dbuf_spinlock,flags); if ( !(pCh->channelNeeds & NEED_INLINE) ) { pCh->channelNeeds |= NEED_INLINE; @@ -463,12 +463,12 @@ i2QueueNeeds(i2eBordStrPtr pB, i2ChanStrPtr pCh, int type) queueIndex = 0; pB->i2Dbuf_stuff = queueIndex; } - write_unlock_irqrestore(&pB->Dbuf_spinlock, flags); + WRITE_UNLOCK_IRQRESTORE(&pB->Dbuf_spinlock,flags); break; case NEED_BYPASS: - write_lock_irqsave(&pB->Bbuf_spinlock, flags); + WRITE_LOCK_IRQSAVE(&pB->Bbuf_spinlock,flags); if ((type & NEED_BYPASS) && !(pCh->channelNeeds & NEED_BYPASS)) { pCh->channelNeeds |= NEED_BYPASS; @@ -478,12 +478,12 @@ i2QueueNeeds(i2eBordStrPtr pB, i2ChanStrPtr pCh, int type) queueIndex = 0; pB->i2Bbuf_stuff = queueIndex; } - write_unlock_irqrestore(&pB->Bbuf_spinlock, flags); + WRITE_UNLOCK_IRQRESTORE(&pB->Bbuf_spinlock,flags); break; case NEED_FLOW: - write_lock_irqsave(&pB->Fbuf_spinlock, flags); + WRITE_LOCK_IRQSAVE(&pB->Fbuf_spinlock,flags); if ((type & NEED_FLOW) && !(pCh->channelNeeds & NEED_FLOW)) { pCh->channelNeeds |= NEED_FLOW; @@ -493,7 +493,7 @@ i2QueueNeeds(i2eBordStrPtr pB, i2ChanStrPtr pCh, int type) queueIndex = 0; pB->i2Fbuf_stuff = queueIndex; } - write_unlock_irqrestore(&pB->Fbuf_spinlock, flags); + WRITE_UNLOCK_IRQRESTORE(&pB->Fbuf_spinlock,flags); break; case NEED_CREDIT: @@ -562,8 +562,9 @@ i2QueueCommands(int type, i2ChanStrPtr pCh, int timeout, int nCommands, pB = pCh->pMyBord; // Board must also exist, and THE INTERRUPT COMMAND ALREADY SENT - if (pB->i2eValid != I2E_MAGIC || pB->i2eUsingIrq == I2_IRQ_UNDEFINED) + if (pB->i2eValid != I2E_MAGIC || pB->i2eUsingIrq == IRQ_UNDEFINED) { return -2; + } // If the board has gone fatal, return bad, and also hit the trap routine if // it exists. if (pB->i2eFatal) { @@ -619,13 +620,13 @@ i2QueueCommands(int type, i2ChanStrPtr pCh, int timeout, int nCommands, switch(type) { case PTYPE_INLINE: lock_var_p = &pCh->Obuf_spinlock; - write_lock_irqsave(lock_var_p, flags); + WRITE_LOCK_IRQSAVE(lock_var_p,flags); stuffIndex = pCh->Obuf_stuff; bufroom = pCh->Obuf_strip - stuffIndex; break; case PTYPE_BYPASS: lock_var_p = &pCh->Cbuf_spinlock; - write_lock_irqsave(lock_var_p, flags); + WRITE_LOCK_IRQSAVE(lock_var_p,flags); stuffIndex = pCh->Cbuf_stuff; bufroom = pCh->Cbuf_strip - stuffIndex; break; @@ -644,7 +645,7 @@ i2QueueCommands(int type, i2ChanStrPtr pCh, int timeout, int nCommands, break; /* from for()- Enough room: goto proceed */ } ip2trace(CHANN, ITRC_QUEUE, 3, 1, totalsize); - write_unlock_irqrestore(lock_var_p, flags); + WRITE_UNLOCK_IRQRESTORE(lock_var_p, flags); } else ip2trace(CHANN, ITRC_QUEUE, 3, 1, totalsize); @@ -746,7 +747,7 @@ i2QueueCommands(int type, i2ChanStrPtr pCh, int timeout, int nCommands, { case PTYPE_INLINE: pCh->Obuf_stuff = stuffIndex; // Store buffer pointer - write_unlock_irqrestore(&pCh->Obuf_spinlock, flags); + WRITE_UNLOCK_IRQRESTORE(&pCh->Obuf_spinlock,flags); pB->debugInlineQueued++; // Add the channel pointer to list of channels needing service (first @@ -756,7 +757,7 @@ i2QueueCommands(int type, i2ChanStrPtr pCh, int timeout, int nCommands, case PTYPE_BYPASS: pCh->Cbuf_stuff = stuffIndex; // Store buffer pointer - write_unlock_irqrestore(&pCh->Cbuf_spinlock, flags); + WRITE_UNLOCK_IRQRESTORE(&pCh->Cbuf_spinlock,flags); pB->debugBypassQueued++; // Add the channel pointer to list of channels needing service (first @@ -839,7 +840,7 @@ i2Input(i2ChanStrPtr pCh) count = -1; goto i2Input_exit; } - write_lock_irqsave(&pCh->Ibuf_spinlock, flags); + WRITE_LOCK_IRQSAVE(&pCh->Ibuf_spinlock,flags); // initialize some accelerators and private copies stripIndex = pCh->Ibuf_strip; @@ -849,7 +850,7 @@ i2Input(i2ChanStrPtr pCh) // If buffer is empty or requested data count was 0, (trivial case) return // without any further thought. if ( count == 0 ) { - write_unlock_irqrestore(&pCh->Ibuf_spinlock, flags); + WRITE_UNLOCK_IRQRESTORE(&pCh->Ibuf_spinlock,flags); goto i2Input_exit; } // Adjust for buffer wrap @@ -890,10 +891,10 @@ i2Input(i2ChanStrPtr pCh) if ((pCh->sinceLastFlow += count) >= pCh->whenSendFlow) { pCh->sinceLastFlow -= pCh->whenSendFlow; - write_unlock_irqrestore(&pCh->Ibuf_spinlock, flags); + WRITE_UNLOCK_IRQRESTORE(&pCh->Ibuf_spinlock,flags); i2QueueNeeds(pCh->pMyBord, pCh, NEED_FLOW); } else { - write_unlock_irqrestore(&pCh->Ibuf_spinlock, flags); + WRITE_UNLOCK_IRQRESTORE(&pCh->Ibuf_spinlock,flags); } i2Input_exit: @@ -925,7 +926,7 @@ i2InputFlush(i2ChanStrPtr pCh) ip2trace (CHANN, ITRC_INPUT, 10, 0); - write_lock_irqsave(&pCh->Ibuf_spinlock, flags); + WRITE_LOCK_IRQSAVE(&pCh->Ibuf_spinlock,flags); count = pCh->Ibuf_stuff - pCh->Ibuf_strip; // Adjust for buffer wrap @@ -946,10 +947,10 @@ i2InputFlush(i2ChanStrPtr pCh) if ( (pCh->sinceLastFlow += count) >= pCh->whenSendFlow ) { pCh->sinceLastFlow -= pCh->whenSendFlow; - write_unlock_irqrestore(&pCh->Ibuf_spinlock, flags); + WRITE_UNLOCK_IRQRESTORE(&pCh->Ibuf_spinlock,flags); i2QueueNeeds(pCh->pMyBord, pCh, NEED_FLOW); } else { - write_unlock_irqrestore(&pCh->Ibuf_spinlock, flags); + WRITE_UNLOCK_IRQRESTORE(&pCh->Ibuf_spinlock,flags); } ip2trace (CHANN, ITRC_INPUT, 19, 1, count); @@ -978,9 +979,9 @@ i2InputAvailable(i2ChanStrPtr pCh) // initialize some accelerators and private copies - read_lock_irqsave(&pCh->Ibuf_spinlock, flags); + READ_LOCK_IRQSAVE(&pCh->Ibuf_spinlock,flags); count = pCh->Ibuf_stuff - pCh->Ibuf_strip; - read_unlock_irqrestore(&pCh->Ibuf_spinlock, flags); + READ_UNLOCK_IRQRESTORE(&pCh->Ibuf_spinlock,flags); // Adjust for buffer wrap if (count < 0) @@ -1044,9 +1045,9 @@ i2Output(i2ChanStrPtr pCh, const char *pSource, int count) while ( count > 0 ) { // How much room in output buffer is there? - read_lock_irqsave(&pCh->Obuf_spinlock, flags); + READ_LOCK_IRQSAVE(&pCh->Obuf_spinlock,flags); amountToMove = pCh->Obuf_strip - pCh->Obuf_stuff - 1; - read_unlock_irqrestore(&pCh->Obuf_spinlock, flags); + READ_UNLOCK_IRQRESTORE(&pCh->Obuf_spinlock,flags); if (amountToMove < 0) { amountToMove += OBUF_SIZE; } @@ -1074,7 +1075,7 @@ i2Output(i2ChanStrPtr pCh, const char *pSource, int count) if ( !(pCh->flush_flags && i2RetryFlushOutput(pCh) ) && amountToMove > 0 ) { - write_lock_irqsave(&pCh->Obuf_spinlock, flags); + WRITE_LOCK_IRQSAVE(&pCh->Obuf_spinlock,flags); stuffIndex = pCh->Obuf_stuff; // Had room to move some data: don't know whether the block size, @@ -1101,7 +1102,7 @@ i2Output(i2ChanStrPtr pCh, const char *pSource, int count) } pCh->Obuf_stuff = stuffIndex; - write_unlock_irqrestore(&pCh->Obuf_spinlock, flags); + WRITE_UNLOCK_IRQRESTORE(&pCh->Obuf_spinlock,flags); ip2trace (CHANN, ITRC_OUTPUT, 13, 1, stuffIndex ); @@ -1351,9 +1352,9 @@ i2OutputFree(i2ChanStrPtr pCh) if ( !i2Validate ( pCh ) ) { return -1; } - read_lock_irqsave(&pCh->Obuf_spinlock, flags); + READ_LOCK_IRQSAVE(&pCh->Obuf_spinlock,flags); amountToMove = pCh->Obuf_strip - pCh->Obuf_stuff - 1; - read_unlock_irqrestore(&pCh->Obuf_spinlock, flags); + READ_UNLOCK_IRQRESTORE(&pCh->Obuf_spinlock,flags); if (amountToMove < 0) { amountToMove += OBUF_SIZE; @@ -1463,11 +1464,11 @@ i2StripFifo(i2eBordStrPtr pB) // ip2trace (ITRC_NO_PORT, ITRC_SFIFO, ITRC_ENTER, 0 ); - while (I2_HAS_INPUT(pB)) { + while (HAS_INPUT(pB)) { // ip2trace (ITRC_NO_PORT, ITRC_SFIFO, 2, 0 ); // Process packet from fifo a one atomic unit - write_lock_irqsave(&pB->read_fifo_spinlock, bflags); + WRITE_LOCK_IRQSAVE(&pB->read_fifo_spinlock,bflags); // The first word (or two bytes) will have channel number and type of // packet, possibly other information @@ -1489,8 +1490,7 @@ i2StripFifo(i2eBordStrPtr pB) // sick! if ( ((unsigned int)count) > IBUF_SIZE ) { pB->i2eFatal = 2; - write_unlock_irqrestore(&pB->read_fifo_spinlock, - bflags); + WRITE_UNLOCK_IRQRESTORE(&pB->read_fifo_spinlock,bflags); return; /* Bail out ASAP */ } // Channel is illegally big ? @@ -1498,8 +1498,7 @@ i2StripFifo(i2eBordStrPtr pB) (NULL==(pCh = ((i2ChanStrPtr*)pB->i2eChannelPtr)[channel]))) { iiReadBuf(pB, junkBuffer, count); - write_unlock_irqrestore(&pB->read_fifo_spinlock, - bflags); + WRITE_UNLOCK_IRQRESTORE(&pB->read_fifo_spinlock,bflags); break; /* From switch: ready for next packet */ } @@ -1513,15 +1512,14 @@ i2StripFifo(i2eBordStrPtr pB) if(ID_OF(pB->i2eLeadoffWord) == ID_HOT_KEY) { pCh->hotKeyIn = iiReadWord(pB) & 0xff; - write_unlock_irqrestore(&pB->read_fifo_spinlock, - bflags); + WRITE_UNLOCK_IRQRESTORE(&pB->read_fifo_spinlock,bflags); i2QueueCommands(PTYPE_BYPASS, pCh, 0, 1, CMD_HOTACK); break; /* From the switch: ready for next packet */ } // Normal data! We crudely assume there is room for the data in our // buffer because the board wouldn't have exceeded his credit limit. - write_lock_irqsave(&pCh->Ibuf_spinlock, cflags); + WRITE_LOCK_IRQSAVE(&pCh->Ibuf_spinlock,cflags); // We have 2 locks now stuffIndex = pCh->Ibuf_stuff; amountToRead = IBUF_SIZE - stuffIndex; @@ -1564,9 +1562,8 @@ i2StripFifo(i2eBordStrPtr pB) // Update stuff index pCh->Ibuf_stuff = stuffIndex; - write_unlock_irqrestore(&pCh->Ibuf_spinlock, cflags); - write_unlock_irqrestore(&pB->read_fifo_spinlock, - bflags); + WRITE_UNLOCK_IRQRESTORE(&pCh->Ibuf_spinlock,cflags); + WRITE_UNLOCK_IRQRESTORE(&pB->read_fifo_spinlock,bflags); #ifdef USE_IQ schedule_work(&pCh->tqueue_input); @@ -1588,8 +1585,7 @@ i2StripFifo(i2eBordStrPtr pB) iiReadBuf(pB, cmdBuffer, count); // We can release early with buffer grab - write_unlock_irqrestore(&pB->read_fifo_spinlock, - bflags); + WRITE_UNLOCK_IRQRESTORE(&pB->read_fifo_spinlock,bflags); pc = cmdBuffer; pcLimit = &(cmdBuffer[count]); @@ -1834,12 +1830,12 @@ i2StripFifo(i2eBordStrPtr pB) default: // Neither packet? should be impossible ip2trace (ITRC_NO_PORT, ITRC_SFIFO, 5, 1, PTYPE_OF(pB->i2eLeadoffWord) ); - write_unlock_irqrestore(&pB->read_fifo_spinlock, + WRITE_UNLOCK_IRQRESTORE(&pB->read_fifo_spinlock, bflags); break; } // End of switch on type of packets - } /*while(board I2_HAS_INPUT)*/ + } //while(board HAS_INPUT) ip2trace (ITRC_NO_PORT, ITRC_SFIFO, ITRC_RETURN, 0 ); @@ -1862,7 +1858,7 @@ i2Write2Fifo(i2eBordStrPtr pB, unsigned char *source, int count,int reserve) { int rc = 0; unsigned long flags; - write_lock_irqsave(&pB->write_fifo_spinlock, flags); + WRITE_LOCK_IRQSAVE(&pB->write_fifo_spinlock,flags); if (!pB->i2eWaitingForEmptyFifo) { if (pB->i2eFifoRemains > (count+reserve)) { pB->i2eFifoRemains -= count; @@ -1871,7 +1867,7 @@ i2Write2Fifo(i2eBordStrPtr pB, unsigned char *source, int count,int reserve) rc = count; } } - write_unlock_irqrestore(&pB->write_fifo_spinlock, flags); + WRITE_UNLOCK_IRQRESTORE(&pB->write_fifo_spinlock,flags); return rc; } //****************************************************************************** @@ -1902,7 +1898,7 @@ i2StuffFifoBypass(i2eBordStrPtr pB) while ( --bailout && notClogged && (NULL != (pCh = i2DeQueueNeeds(pB,NEED_BYPASS)))) { - write_lock_irqsave(&pCh->Cbuf_spinlock, flags); + WRITE_LOCK_IRQSAVE(&pCh->Cbuf_spinlock,flags); stripIndex = pCh->Cbuf_strip; // as long as there are packets for this channel... @@ -1910,7 +1906,7 @@ i2StuffFifoBypass(i2eBordStrPtr pB) while (stripIndex != pCh->Cbuf_stuff) { pRemove = &(pCh->Cbuf[stripIndex]); packetSize = CMD_COUNT_OF(pRemove) + sizeof(i2CmdHeader); - paddedSize = roundup(packetSize, 2); + paddedSize = ROUNDUP(packetSize); if (paddedSize > 0) { if ( 0 == i2Write2Fifo(pB, pRemove, paddedSize,0)) { @@ -1934,7 +1930,7 @@ WriteDBGBuf("BYPS", pRemove, paddedSize); // Done with this channel. Move to next, removing this one from // the queue of channels if we cleaned it out (i.e., didn't get clogged. pCh->Cbuf_strip = stripIndex; - write_unlock_irqrestore(&pCh->Cbuf_spinlock, flags); + WRITE_UNLOCK_IRQRESTORE(&pCh->Cbuf_spinlock,flags); } // Either clogged or finished all the work #ifdef IP2DEBUG_TRACE @@ -1958,7 +1954,7 @@ static inline void i2StuffFifoFlow(i2eBordStrPtr pB) { i2ChanStrPtr pCh; - unsigned short paddedSize = roundup(sizeof(flowIn), 2); + unsigned short paddedSize = ROUNDUP(sizeof(flowIn)); ip2trace (ITRC_NO_PORT, ITRC_SFLOW, ITRC_ENTER, 2, pB->i2eFifoRemains, paddedSize ); @@ -2014,7 +2010,7 @@ i2StuffFifoInline(i2eBordStrPtr pB) while ( --bailout && notClogged && (NULL != (pCh = i2DeQueueNeeds(pB,NEED_INLINE))) ) { - write_lock_irqsave(&pCh->Obuf_spinlock, flags); + WRITE_LOCK_IRQSAVE(&pCh->Obuf_spinlock,flags); stripIndex = pCh->Obuf_strip; ip2trace (CHANN, ITRC_SICMD, 3, 2, stripIndex, pCh->Obuf_stuff ); @@ -2035,7 +2031,7 @@ i2StuffFifoInline(i2eBordStrPtr pB) packetSize = flowsize + sizeof(i2CmdHeader); } flowsize = CREDIT_USAGE(flowsize); - paddedSize = roundup(packetSize, 2); + paddedSize = ROUNDUP(packetSize); ip2trace (CHANN, ITRC_SICMD, 4, 2, pB->i2eFifoRemains, paddedSize ); @@ -2090,7 +2086,7 @@ WriteDBGBuf("DATA", pRemove, paddedSize); // Done with this channel. Move to next, removing this one from the // queue of channels if we cleaned it out (i.e., didn't get clogged. pCh->Obuf_strip = stripIndex; - write_unlock_irqrestore(&pCh->Obuf_spinlock, flags); + WRITE_UNLOCK_IRQRESTORE(&pCh->Obuf_spinlock,flags); if ( notClogged ) { @@ -2194,11 +2190,10 @@ i2ServiceBoard ( i2eBordStrPtr pB ) if (inmail & MB_OUT_STRIPPED) { pB->i2eFifoOutInts++; - write_lock_irqsave(&pB->write_fifo_spinlock, flags); + WRITE_LOCK_IRQSAVE(&pB->write_fifo_spinlock,flags); pB->i2eFifoRemains = pB->i2eFifoSize; pB->i2eWaitingForEmptyFifo = 0; - write_unlock_irqrestore(&pB->write_fifo_spinlock, - flags); + WRITE_UNLOCK_IRQRESTORE(&pB->write_fifo_spinlock,flags); ip2trace (ITRC_NO_PORT, ITRC_INTR, 30, 1, pB->i2eFifoRemains ); diff --git a/trunk/drivers/char/ip2/i2os.h b/trunk/drivers/char/ip2/i2os.h new file mode 100644 index 000000000000..eff9b542d699 --- /dev/null +++ b/trunk/drivers/char/ip2/i2os.h @@ -0,0 +1,127 @@ +/******************************************************************************* +* +* (c) 1999 by Computone Corporation +* +******************************************************************************** +* +* +* PACKAGE: Linux tty Device Driver for IntelliPort II family of multiport +* serial I/O controllers. +* +* DESCRIPTION: Defines, definitions and includes which are heavily dependent +* on O/S, host, compiler, etc. This file is tailored for: +* Linux v2.0.0 and later +* Gnu gcc c2.7.2 +* 80x86 architecture +* +*******************************************************************************/ + +#ifndef I2OS_H /* To prevent multiple includes */ +#define I2OS_H 1 + +//------------------------------------------------- +// Required Includes +//------------------------------------------------- + +#include "ip2types.h" +#include /* For inb, etc */ + +//------------------------------------ +// Defines for I/O instructions: +//------------------------------------ + +#define INB(port) inb(port) +#define OUTB(port,value) outb((value),(port)) +#define INW(port) inw(port) +#define OUTW(port,value) outw((value),(port)) +#define OUTSW(port,addr,count) outsw((port),(addr),(((count)+1)/2)) +#define OUTSB(port,addr,count) outsb((port),(addr),(((count)+1))&-2) +#define INSW(port,addr,count) insw((port),(addr),(((count)+1)/2)) +#define INSB(port,addr,count) insb((port),(addr),(((count)+1))&-2) + +//-------------------------------------------- +// Interrupt control +//-------------------------------------------- + +#define LOCK_INIT(a) rwlock_init(a) + +#define SAVE_AND_DISABLE_INTS(a,b) { \ + /* printk("get_lock: 0x%x,%4d,%s\n",(int)a,__LINE__,__FILE__);*/ \ + spin_lock_irqsave(a,b); \ +} + +#define RESTORE_INTS(a,b) { \ + /* printk("rel_lock: 0x%x,%4d,%s\n",(int)a,__LINE__,__FILE__);*/ \ + spin_unlock_irqrestore(a,b); \ +} + +#define READ_LOCK_IRQSAVE(a,b) { \ + /* printk("get_read_lock: 0x%x,%4d,%s\n",(int)a,__LINE__,__FILE__);*/ \ + read_lock_irqsave(a,b); \ +} + +#define READ_UNLOCK_IRQRESTORE(a,b) { \ + /* printk("rel_read_lock: 0x%x,%4d,%s\n",(int)a,__LINE__,__FILE__);*/ \ + read_unlock_irqrestore(a,b); \ +} + +#define WRITE_LOCK_IRQSAVE(a,b) { \ + /* printk("get_write_lock: 0x%x,%4d,%s\n",(int)a,__LINE__,__FILE__);*/ \ + write_lock_irqsave(a,b); \ +} + +#define WRITE_UNLOCK_IRQRESTORE(a,b) { \ + /* printk("rel_write_lock: 0x%x,%4d,%s\n",(int)a,__LINE__,__FILE__);*/ \ + write_unlock_irqrestore(a,b); \ +} + + +//------------------------------------------------------------------------------ +// Hardware-delay loop +// +// Probably used in only one place (see i2ellis.c) but this helps keep things +// together. Note we have unwound the IN instructions. On machines with a +// reasonable cache, the eight instructions (1 byte each) should fit in cache +// nicely, and on un-cached machines, the code-fetch would tend not to dominate. +// Note that cx is shifted so that "count" still reflects the total number of +// iterations assuming no unwinding. +//------------------------------------------------------------------------------ + +//#define DELAY1MS(port,count,label) + +//------------------------------------------------------------------------------ +// Macros to switch to a new stack, saving stack pointers, and to restore the +// old stack (Used, for example, in i2lib.c) "heap" is the address of some +// buffer which will become the new stack (working down from highest address). +// The two words at the two lowest addresses in this stack are for storing the +// SS and SP. +//------------------------------------------------------------------------------ + +//#define TO_NEW_STACK(heap,size) +//#define TO_OLD_STACK(heap) + +//------------------------------------------------------------------------------ +// Macros to save the original IRQ vectors and masks, and to patch in new ones. +//------------------------------------------------------------------------------ + +//#define SAVE_IRQ_MASKS(dest) +//#define WRITE_IRQ_MASKS(src) +//#define SAVE_IRQ_VECTOR(value,dest) +//#define WRITE_IRQ_VECTOR(value,src) + +//------------------------------------------------------------------------------ +// Macro to copy data from one far pointer to another. +//------------------------------------------------------------------------------ + +#define I2_MOVE_DATA(fpSource,fpDest,count) memmove(fpDest,fpSource,count); + +//------------------------------------------------------------------------------ +// Macros to issue eoi's to host interrupt control (IBM AT 8259-style). +//------------------------------------------------------------------------------ + +//#define MASTER_EOI +//#define SLAVE_EOI + +#endif /* I2OS_H */ + + diff --git a/trunk/drivers/char/ip2/ip2main.c b/trunk/drivers/char/ip2/ip2main.c index 70957acaa960..0a61856c631f 100644 --- a/trunk/drivers/char/ip2/ip2main.c +++ b/trunk/drivers/char/ip2/ip2main.c @@ -169,7 +169,7 @@ static int Fip_firmware_size; static int ip2_open(PTTY, struct file *); static void ip2_close(PTTY, struct file *); static int ip2_write(PTTY, const unsigned char *, int); -static int ip2_putchar(PTTY, unsigned char); +static void ip2_putchar(PTTY, unsigned char); static void ip2_flush_chars(PTTY); static int ip2_write_room(PTTY); static int ip2_chars_in_buf(PTTY); @@ -355,15 +355,14 @@ have_requested_irq( char irq ) /* the driver initialisation function and returns what it returns. */ /******************************************************************************/ #ifdef MODULE -static int __init -ip2_init_module(void) +int +init_module(void) { #ifdef IP2DEBUG_INIT printk (KERN_DEBUG "Loading module ...\n" ); #endif return 0; } -module_init(ip2_init_module); #endif /* MODULE */ /******************************************************************************/ @@ -382,8 +381,8 @@ module_init(ip2_init_module); /* driver should be returned since it may be unloaded from memory. */ /******************************************************************************/ #ifdef MODULE -void __exit -ip2_cleanup_module(void) +void +cleanup_module(void) { int err; int i; @@ -453,7 +452,6 @@ ip2_cleanup_module(void) printk (KERN_DEBUG "IP2 Unloaded\n" ); #endif } -module_exit(ip2_cleanup_module); #endif /* MODULE */ static const struct tty_operations ip2_ops = { @@ -1052,9 +1050,9 @@ set_irq( int boardnum, int boardIrq ) * Write to FIFO; don't bother to adjust fifo capacity for this, since * board will respond almost immediately after SendMail hit. */ - write_lock_irqsave(&pB->write_fifo_spinlock, flags); + WRITE_LOCK_IRQSAVE(&pB->write_fifo_spinlock,flags); iiWriteBuf(pB, tempCommand, 4); - write_unlock_irqrestore(&pB->write_fifo_spinlock, flags); + WRITE_UNLOCK_IRQRESTORE(&pB->write_fifo_spinlock,flags); pB->i2eUsingIrq = boardIrq; pB->i2eOutMailWaiting |= MB_OUT_STUFFED; @@ -1072,9 +1070,9 @@ set_irq( int boardnum, int boardIrq ) (CMD_OF(tempCommand))[4] = 64; // chars (CMD_OF(tempCommand))[5] = 87; // HW_TEST - write_lock_irqsave(&pB->write_fifo_spinlock, flags); + WRITE_LOCK_IRQSAVE(&pB->write_fifo_spinlock,flags); iiWriteBuf(pB, tempCommand, 8); - write_unlock_irqrestore(&pB->write_fifo_spinlock, flags); + WRITE_UNLOCK_IRQRESTORE(&pB->write_fifo_spinlock,flags); CHANNEL_OF(tempCommand) = 0; PTYPE_OF(tempCommand) = PTYPE_BYPASS; @@ -1089,9 +1087,9 @@ set_irq( int boardnum, int boardIrq ) CMD_COUNT_OF(tempCommand) = 2; (CMD_OF(tempCommand))[0] = 44; /* get ping */ (CMD_OF(tempCommand))[1] = 200; /* 200 ms */ - write_lock_irqsave(&pB->write_fifo_spinlock, flags); + WRITE_LOCK_IRQSAVE(&pB->write_fifo_spinlock,flags); iiWriteBuf(pB, tempCommand, 4); - write_unlock_irqrestore(&pB->write_fifo_spinlock, flags); + WRITE_UNLOCK_IRQRESTORE(&pB->write_fifo_spinlock,flags); #endif iiEnableMailIrq(pB); @@ -1270,12 +1268,12 @@ static void do_input(struct work_struct *work) // Data input if ( pCh->pTTY != NULL ) { - read_lock_irqsave(&pCh->Ibuf_spinlock, flags); + READ_LOCK_IRQSAVE(&pCh->Ibuf_spinlock,flags) if (!pCh->throttled && (pCh->Ibuf_stuff != pCh->Ibuf_strip)) { - read_unlock_irqrestore(&pCh->Ibuf_spinlock, flags); + READ_UNLOCK_IRQRESTORE(&pCh->Ibuf_spinlock,flags) i2Input( pCh ); } else - read_unlock_irqrestore(&pCh->Ibuf_spinlock, flags); + READ_UNLOCK_IRQRESTORE(&pCh->Ibuf_spinlock,flags) } else { ip2trace(CHANN, ITRC_INPUT, 22, 0 ); @@ -1616,8 +1614,10 @@ ip2_close( PTTY tty, struct file *pFile ) serviceOutgoingFifo ( pCh->pMyBord ); - tty_ldisc_flush(tty); - tty_driver_flush_buffer(tty); + if ( tty->driver->flush_buffer ) + tty->driver->flush_buffer(tty); + if ( tty->ldisc.flush_buffer ) + tty->ldisc.flush_buffer(tty); tty->closing = 0; pCh->pTTY = NULL; @@ -1717,9 +1717,9 @@ ip2_write( PTTY tty, const unsigned char *pData, int count) ip2_flush_chars( tty ); /* This is the actual move bit. Make sure it does what we need!!!!! */ - write_lock_irqsave(&pCh->Pbuf_spinlock, flags); + WRITE_LOCK_IRQSAVE(&pCh->Pbuf_spinlock,flags); bytesSent = i2Output( pCh, pData, count); - write_unlock_irqrestore(&pCh->Pbuf_spinlock, flags); + WRITE_UNLOCK_IRQRESTORE(&pCh->Pbuf_spinlock,flags); ip2trace (CHANN, ITRC_WRITE, ITRC_RETURN, 1, bytesSent ); @@ -1736,7 +1736,7 @@ ip2_write( PTTY tty, const unsigned char *pData, int count) /* */ /* */ /******************************************************************************/ -static int +static void ip2_putchar( PTTY tty, unsigned char ch ) { i2ChanStrPtr pCh = tty->driver_data; @@ -1744,14 +1744,13 @@ ip2_putchar( PTTY tty, unsigned char ch ) // ip2trace (CHANN, ITRC_PUTC, ITRC_ENTER, 1, ch ); - write_lock_irqsave(&pCh->Pbuf_spinlock, flags); + WRITE_LOCK_IRQSAVE(&pCh->Pbuf_spinlock,flags); pCh->Pbuf[pCh->Pbuf_stuff++] = ch; if ( pCh->Pbuf_stuff == sizeof pCh->Pbuf ) { - write_unlock_irqrestore(&pCh->Pbuf_spinlock, flags); + WRITE_UNLOCK_IRQRESTORE(&pCh->Pbuf_spinlock,flags); ip2_flush_chars( tty ); } else - write_unlock_irqrestore(&pCh->Pbuf_spinlock, flags); - return 1; + WRITE_UNLOCK_IRQRESTORE(&pCh->Pbuf_spinlock,flags); // ip2trace (CHANN, ITRC_PUTC, ITRC_RETURN, 1, ch ); } @@ -1771,7 +1770,7 @@ ip2_flush_chars( PTTY tty ) i2ChanStrPtr pCh = tty->driver_data; unsigned long flags; - write_lock_irqsave(&pCh->Pbuf_spinlock, flags); + WRITE_LOCK_IRQSAVE(&pCh->Pbuf_spinlock,flags); if ( pCh->Pbuf_stuff ) { // ip2trace (CHANN, ITRC_PUTC, 10, 1, strip ); @@ -1785,7 +1784,7 @@ ip2_flush_chars( PTTY tty ) } pCh->Pbuf_stuff -= strip; } - write_unlock_irqrestore(&pCh->Pbuf_spinlock, flags); + WRITE_UNLOCK_IRQRESTORE(&pCh->Pbuf_spinlock,flags); } /******************************************************************************/ @@ -1803,9 +1802,9 @@ ip2_write_room ( PTTY tty ) i2ChanStrPtr pCh = tty->driver_data; unsigned long flags; - read_lock_irqsave(&pCh->Pbuf_spinlock, flags); + READ_LOCK_IRQSAVE(&pCh->Pbuf_spinlock,flags); bytesFree = i2OutputFree( pCh ) - pCh->Pbuf_stuff; - read_unlock_irqrestore(&pCh->Pbuf_spinlock, flags); + READ_UNLOCK_IRQRESTORE(&pCh->Pbuf_spinlock,flags); ip2trace (CHANN, ITRC_WRITE, 11, 1, bytesFree ); @@ -1835,12 +1834,12 @@ ip2_chars_in_buf ( PTTY tty ) pCh->Obuf_char_count + pCh->Pbuf_stuff, pCh->Obuf_char_count, pCh->Pbuf_stuff ); #endif - read_lock_irqsave(&pCh->Obuf_spinlock, flags); + READ_LOCK_IRQSAVE(&pCh->Obuf_spinlock,flags); rc = pCh->Obuf_char_count; - read_unlock_irqrestore(&pCh->Obuf_spinlock, flags); - read_lock_irqsave(&pCh->Pbuf_spinlock, flags); + READ_UNLOCK_IRQRESTORE(&pCh->Obuf_spinlock,flags); + READ_LOCK_IRQSAVE(&pCh->Pbuf_spinlock,flags); rc += pCh->Pbuf_stuff; - read_unlock_irqrestore(&pCh->Pbuf_spinlock, flags); + READ_UNLOCK_IRQRESTORE(&pCh->Pbuf_spinlock,flags); return rc; } @@ -1864,9 +1863,9 @@ ip2_flush_buffer( PTTY tty ) #ifdef IP2DEBUG_WRITE printk (KERN_DEBUG "IP2: flush buffer\n" ); #endif - write_lock_irqsave(&pCh->Pbuf_spinlock, flags); + WRITE_LOCK_IRQSAVE(&pCh->Pbuf_spinlock,flags); pCh->Pbuf_stuff = 0; - write_unlock_irqrestore(&pCh->Pbuf_spinlock, flags); + WRITE_UNLOCK_IRQRESTORE(&pCh->Pbuf_spinlock,flags); i2FlushOutput( pCh ); ip2_owake(tty); @@ -1952,15 +1951,15 @@ ip2_unthrottle ( PTTY tty ) pCh->throttled = 0; i2QueueCommands(PTYPE_BYPASS, pCh, 0, 1, CMD_RESUME); serviceOutgoingFifo( pCh->pMyBord ); - read_lock_irqsave(&pCh->Ibuf_spinlock, flags); + READ_LOCK_IRQSAVE(&pCh->Ibuf_spinlock,flags) if ( pCh->Ibuf_stuff != pCh->Ibuf_strip ) { - read_unlock_irqrestore(&pCh->Ibuf_spinlock, flags); + READ_UNLOCK_IRQRESTORE(&pCh->Ibuf_spinlock,flags) #ifdef IP2DEBUG_READ printk (KERN_DEBUG "i2Input called from unthrottle\n" ); #endif i2Input( pCh ); } else - read_unlock_irqrestore(&pCh->Ibuf_spinlock, flags); + READ_UNLOCK_IRQRESTORE(&pCh->Ibuf_spinlock,flags) } static void @@ -2203,9 +2202,9 @@ ip2_ioctl ( PTTY tty, struct file *pFile, UINT cmd, ULONG arg ) * for masking). Caller should use TIOCGICOUNT to see which one it was */ case TIOCMIWAIT: - write_lock_irqsave(&pB->read_fifo_spinlock, flags); + WRITE_LOCK_IRQSAVE(&pB->read_fifo_spinlock, flags); cprev = pCh->icount; /* note the counters on entry */ - write_unlock_irqrestore(&pB->read_fifo_spinlock, flags); + WRITE_UNLOCK_IRQRESTORE(&pB->read_fifo_spinlock, flags); i2QueueCommands(PTYPE_BYPASS, pCh, 100, 4, CMD_DCD_REP, CMD_CTS_REP, CMD_DSR_REP, CMD_RI_REP); init_waitqueue_entry(&wait, current); @@ -2225,9 +2224,9 @@ ip2_ioctl ( PTTY tty, struct file *pFile, UINT cmd, ULONG arg ) rc = -ERESTARTSYS; break; } - write_lock_irqsave(&pB->read_fifo_spinlock, flags); + WRITE_LOCK_IRQSAVE(&pB->read_fifo_spinlock, flags); cnow = pCh->icount; /* atomic copy */ - write_unlock_irqrestore(&pB->read_fifo_spinlock, flags); + WRITE_UNLOCK_IRQRESTORE(&pB->read_fifo_spinlock, flags); if (cnow.rng == cprev.rng && cnow.dsr == cprev.dsr && cnow.dcd == cprev.dcd && cnow.cts == cprev.cts) { rc = -EIO; /* no change => rc */ @@ -2265,9 +2264,9 @@ ip2_ioctl ( PTTY tty, struct file *pFile, UINT cmd, ULONG arg ) case TIOCGICOUNT: ip2trace (CHANN, ITRC_IOCTL, 11, 1, rc ); - write_lock_irqsave(&pB->read_fifo_spinlock, flags); + WRITE_LOCK_IRQSAVE(&pB->read_fifo_spinlock, flags); cnow = pCh->icount; - write_unlock_irqrestore(&pB->read_fifo_spinlock, flags); + WRITE_UNLOCK_IRQRESTORE(&pB->read_fifo_spinlock, flags); p_cuser = argp; rc = put_user(cnow.cts, &p_cuser->cts); rc = put_user(cnow.dsr, &p_cuser->dsr); @@ -2873,7 +2872,7 @@ ip2_ipl_ioctl ( struct inode *pInode, struct file *pFile, UINT cmd, ULONG arg ) case 65: /* Board - ip2stat */ if ( pB ) { rc = copy_to_user(argp, pB, sizeof(i2eBordStr)); - rc = put_user(inb(pB->i2eStatus), + rc = put_user(INB(pB->i2eStatus), (ULONG __user *)(arg + (ULONG)(&pB->i2eStatus) - (ULONG)pB ) ); } else { rc = -ENODEV; diff --git a/trunk/drivers/char/isicom.c b/trunk/drivers/char/isicom.c index 4f3cefa8eb0e..eba2883b630e 100644 --- a/trunk/drivers/char/isicom.c +++ b/trunk/drivers/char/isicom.c @@ -126,8 +126,8 @@ #include #include -#include -#include +#include +#include #include #include @@ -189,7 +189,7 @@ struct isi_board { unsigned short status; unsigned short port_status; /* each bit for each port */ unsigned short shift_count; - struct isi_port *ports; + struct isi_port * ports; signed char count; spinlock_t card_lock; /* Card wide lock 11/5/00 -sameer */ unsigned long flags; @@ -205,11 +205,11 @@ struct isi_port { u16 channel; u16 status; u16 closing_wait; - struct isi_board *card; - struct tty_struct *tty; + struct isi_board * card; + struct tty_struct * tty; wait_queue_head_t close_wait; wait_queue_head_t open_wait; - unsigned char *xmit_buf; + unsigned char * xmit_buf; int xmit_head; int xmit_tail; int xmit_cnt; @@ -405,7 +405,7 @@ static void isicom_tx(unsigned long _data) /* find next active board */ card = (prev_card + 1) & 0x0003; - while (count-- > 0) { + while(count-- > 0) { if (isi_card[card].status & BOARD_ACTIVE) break; card = (card + 1) & 0x0003; @@ -428,7 +428,7 @@ static void isicom_tx(unsigned long _data) if (retries >= 100) goto unlock; - for (; count > 0; count--, port++) { + for (;count > 0;count--, port++) { /* port not active or tx disabled to force flow control */ if (!(port->flags & ASYNC_INITIALIZED) || !(port->status & ISI_TXOK)) @@ -471,10 +471,9 @@ static void isicom_tx(unsigned long _data) break; } } - if (cnt <= 0) - break; + if (cnt <= 0) break; word_count = cnt >> 1; - outsw(base, port->xmit_buf+port->xmit_tail, word_count); + outsw(base, port->xmit_buf+port->xmit_tail,word_count); port->xmit_tail = (port->xmit_tail + (word_count << 1)) & (SERIAL_XMIT_SIZE - 1); txcount -= (word_count << 1); @@ -557,7 +556,7 @@ static irqreturn_t isicom_interrupt(int irq, void *dev_id) tty = port->tty; if (tty == NULL) { word_count = byte_count >> 1; - while (byte_count > 1) { + while(byte_count > 1) { inw(base); byte_count -= 2; } @@ -570,7 +569,7 @@ static irqreturn_t isicom_interrupt(int irq, void *dev_id) if (header & 0x8000) { /* Status Packet */ header = inw(base); - switch (header & 0xff) { + switch(header & 0xff) { case 0: /* Change in EIA signals */ if (port->flags & ASYNC_CHECK_CD) { if (port->status & ISI_DCD) { @@ -657,8 +656,7 @@ static irqreturn_t isicom_interrupt(int irq, void *dev_id) if (byte_count > 0) { pr_dbg("Intr(0x%lx:%d): Flip buffer overflow! dropping " "bytes...\n", base, channel + 1); - /* drain out unread xtra data */ - while (byte_count > 0) { + while(byte_count > 0) { /* drain out unread xtra data */ inw(base); byte_count -= 2; } @@ -681,11 +679,8 @@ static void isicom_config_port(struct isi_port *port) shift_count = card->shift_count; unsigned char flow_ctrl; - tty = port->tty; - - if (tty == NULL) + if (!(tty = port->tty) || !tty->termios) return; - /* FIXME: Switch to new tty baud API */ baud = C_BAUD(tty); if (baud & CBAUDEX) { baud &= ~CBAUDEX; @@ -711,7 +706,7 @@ static void isicom_config_port(struct isi_port *port) if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) baud++; /* 57.6 Kbps */ if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI) - baud += 2; /* 115 Kbps */ + baud +=2; /* 115 Kbps */ if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI) baud += 3; /* 230 kbps*/ if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP) @@ -721,14 +716,15 @@ static void isicom_config_port(struct isi_port *port) /* hang up */ drop_dtr(port); return; - } else + } + else raise_dtr(port); if (WaitTillCardIsFree(base) == 0) { - outw(0x8000 | (channel << shift_count) | 0x03, base); + outw(0x8000 | (channel << shift_count) |0x03, base); outw(linuxb_to_isib[baud] << 8 | 0x03, base); channel_setup = 0; - switch (C_CSIZE(tty)) { + switch(C_CSIZE(tty)) { case CS5: channel_setup |= ISICOM_CS5; break; @@ -771,7 +767,7 @@ static void isicom_config_port(struct isi_port *port) flow_ctrl |= ISICOM_INITIATE_XONXOFF; if (WaitTillCardIsFree(base) == 0) { - outw(0x8000 | (channel << shift_count) | 0x04, base); + outw(0x8000 | (channel << shift_count) |0x04, base); outw(flow_ctrl << 8 | 0x05, base); outw((STOP_CHAR(tty)) << 8 | (START_CHAR(tty)), base); InterruptTheCard(base); @@ -809,17 +805,20 @@ static int isicom_setup_port(struct isi_port *port) struct isi_board *card = port->card; unsigned long flags; - if (port->flags & ASYNC_INITIALIZED) + if (port->flags & ASYNC_INITIALIZED) { return 0; + } if (!port->xmit_buf) { - /* Relies on BKL */ - unsigned long page = get_zeroed_page(GFP_KERNEL); - if (page == 0) + unsigned long page; + + if (!(page = get_zeroed_page(GFP_KERNEL))) return -ENOMEM; - if (port->xmit_buf) + + if (port->xmit_buf) { free_page(page); - else - port->xmit_buf = (unsigned char *) page; + return -ERESTARTSYS; + } + port->xmit_buf = (unsigned char *) page; } spin_lock_irqsave(&card->card_lock, flags); @@ -950,18 +949,21 @@ static int isicom_open(struct tty_struct *tty, struct file *filp) port->count++; tty->driver_data = port; port->tty = tty; - error = isicom_setup_port(port); - if (error == 0) - error = block_til_ready(tty, filp, port); - return error; + if ((error = isicom_setup_port(port))!=0) + return error; + if ((error = block_til_ready(tty, filp, port))!=0) + return error; + + return 0; } /* close et all */ static inline void isicom_shutdown_board(struct isi_board *bp) { - if (bp->status & BOARD_ACTIVE) + if (bp->status & BOARD_ACTIVE) { bp->status &= ~BOARD_ACTIVE; + } } /* card->lock HAS to be held */ @@ -1010,22 +1012,6 @@ static void isicom_shutdown_port(struct isi_port *port) } } -static void isicom_flush_buffer(struct tty_struct *tty) -{ - struct isi_port *port = tty->driver_data; - struct isi_board *card = port->card; - unsigned long flags; - - if (isicom_paranoia_check(port, tty->name, "isicom_flush_buffer")) - return; - - spin_lock_irqsave(&card->card_lock, flags); - port->xmit_cnt = port->xmit_head = port->xmit_tail = 0; - spin_unlock_irqrestore(&card->card_lock, flags); - - tty_wakeup(tty); -} - static void isicom_close(struct tty_struct *tty, struct file *filp) { struct isi_port *port = tty->driver_data; @@ -1079,7 +1065,8 @@ static void isicom_close(struct tty_struct *tty, struct file *filp) isicom_shutdown_port(port); spin_unlock_irqrestore(&card->card_lock, flags); - isicom_flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); tty_ldisc_flush(tty); spin_lock_irqsave(&card->card_lock, flags); @@ -1117,7 +1104,7 @@ static int isicom_write(struct tty_struct *tty, const unsigned char *buf, spin_lock_irqsave(&card->card_lock, flags); - while (1) { + while(1) { cnt = min_t(int, count, min(SERIAL_XMIT_SIZE - port->xmit_cnt - 1, SERIAL_XMIT_SIZE - port->xmit_head)); if (cnt <= 0) @@ -1138,29 +1125,28 @@ static int isicom_write(struct tty_struct *tty, const unsigned char *buf, } /* put_char et all */ -static int isicom_put_char(struct tty_struct *tty, unsigned char ch) +static void isicom_put_char(struct tty_struct *tty, unsigned char ch) { struct isi_port *port = tty->driver_data; struct isi_board *card = port->card; unsigned long flags; if (isicom_paranoia_check(port, tty->name, "isicom_put_char")) - return 0; + return; if (!port->xmit_buf) - return 0; + return; spin_lock_irqsave(&card->card_lock, flags); if (port->xmit_cnt >= SERIAL_XMIT_SIZE - 1) { spin_unlock_irqrestore(&card->card_lock, flags); - return 0; + return; } port->xmit_buf[port->xmit_head++] = ch; port->xmit_head &= (SERIAL_XMIT_SIZE - 1); port->xmit_cnt++; spin_unlock_irqrestore(&card->card_lock, flags); - return 1; } /* flush_chars et all */ @@ -1272,8 +1258,6 @@ static int isicom_set_serial_info(struct isi_port *port, if (copy_from_user(&newinfo, info, sizeof(newinfo))) return -EFAULT; - lock_kernel(); - reconfig_port = ((port->flags & ASYNC_SPD_MASK) != (newinfo.flags & ASYNC_SPD_MASK)); @@ -1281,13 +1265,12 @@ static int isicom_set_serial_info(struct isi_port *port, if ((newinfo.close_delay != port->close_delay) || (newinfo.closing_wait != port->closing_wait) || ((newinfo.flags & ~ASYNC_USR_MASK) != - (port->flags & ~ASYNC_USR_MASK))) { - unlock_kernel(); + (port->flags & ~ASYNC_USR_MASK))) return -EPERM; - } - port->flags = ((port->flags & ~ASYNC_USR_MASK) | + port->flags = ((port->flags & ~ ASYNC_USR_MASK) | (newinfo.flags & ASYNC_USR_MASK)); - } else { + } + else { port->close_delay = newinfo.close_delay; port->closing_wait = newinfo.closing_wait; port->flags = ((port->flags & ~ASYNC_FLAGS) | @@ -1299,7 +1282,6 @@ static int isicom_set_serial_info(struct isi_port *port, isicom_config_port(port); spin_unlock_irqrestore(&port->card->card_lock, flags); } - unlock_kernel(); return 0; } @@ -1308,7 +1290,6 @@ static int isicom_get_serial_info(struct isi_port *port, { struct serial_struct out_info; - lock_kernel(); memset(&out_info, 0, sizeof(out_info)); /* out_info.type = ? */ out_info.line = port - isi_ports; @@ -1318,7 +1299,6 @@ static int isicom_get_serial_info(struct isi_port *port, /* out_info.baud_base = ? */ out_info.close_delay = port->close_delay; out_info.closing_wait = port->closing_wait; - unlock_kernel(); if (copy_to_user(info, &out_info, sizeof(out_info))) return -EFAULT; return 0; @@ -1334,7 +1314,7 @@ static int isicom_ioctl(struct tty_struct *tty, struct file *filp, if (isicom_paranoia_check(port, tty->name, "isicom_ioctl")) return -ENODEV; - switch (cmd) { + switch(cmd) { case TCSBRK: retval = tty_check_change(tty); if (retval) @@ -1351,6 +1331,19 @@ static int isicom_ioctl(struct tty_struct *tty, struct file *filp, tty_wait_until_sent(tty, 0); isicom_send_break(port, arg ? arg * (HZ/10) : HZ/4); return 0; + + case TIOCGSOFTCAR: + return put_user(C_CLOCAL(tty) ? 1 : 0, + (unsigned long __user *)argp); + + case TIOCSSOFTCAR: + if (get_user(arg, (unsigned long __user *) argp)) + return -EFAULT; + tty->termios->c_cflag = + ((tty->termios->c_cflag & ~CLOCAL) | + (arg ? CLOCAL : 0)); + return 0; + case TIOCGSERIAL: return isicom_get_serial_info(port, argp); @@ -1460,6 +1453,22 @@ static void isicom_hangup(struct tty_struct *tty) wake_up_interruptible(&port->open_wait); } +/* flush_buffer et all */ +static void isicom_flush_buffer(struct tty_struct *tty) +{ + struct isi_port *port = tty->driver_data; + struct isi_board *card = port->card; + unsigned long flags; + + if (isicom_paranoia_check(port, tty->name, "isicom_flush_buffer")) + return; + + spin_lock_irqsave(&card->card_lock, flags); + port->xmit_cnt = port->xmit_head = port->xmit_tail = 0; + spin_unlock_irqrestore(&card->card_lock, flags); + + tty_wakeup(tty); +} /* * Driver init and deinit functions @@ -1583,7 +1592,7 @@ static int __devinit load_firmware(struct pci_dev *pdev, default: dev_err(&pdev->dev, "Unknown signature.\n"); goto end; - } + } retval = request_firmware(&fw, name, &pdev->dev); if (retval) @@ -1611,8 +1620,7 @@ static int __devinit load_firmware(struct pci_dev *pdev, if (WaitTillCardIsFree(base)) goto errrelfw; - status = inw(base + 0x4); - if (status != 0) { + if ((status = inw(base + 0x4)) != 0) { dev_warn(&pdev->dev, "Card%d rejected load header:\n" KERN_WARNING "Address:0x%x\n" KERN_WARNING "Count:0x%x\n" @@ -1629,13 +1637,12 @@ static int __devinit load_firmware(struct pci_dev *pdev, if (WaitTillCardIsFree(base)) goto errrelfw; - status = inw(base + 0x4); - if (status != 0) { + if ((status = inw(base + 0x4)) != 0) { dev_err(&pdev->dev, "Card%d got out of sync.Card " "Status:0x%x\n", index + 1, status); goto errrelfw; } - } + } /* XXX: should we test it by reading it back and comparing with original like * in load firmware package? */ @@ -1659,8 +1666,7 @@ static int __devinit load_firmware(struct pci_dev *pdev, if (WaitTillCardIsFree(base)) goto errrelfw; - status = inw(base + 0x4); - if (status != 0) { + if ((status = inw(base + 0x4)) != 0) { dev_warn(&pdev->dev, "Card%d rejected verify header:\n" KERN_WARNING "Address:0x%x\n" KERN_WARNING "Count:0x%x\n" @@ -1693,8 +1699,7 @@ static int __devinit load_firmware(struct pci_dev *pdev, if (WaitTillCardIsFree(base)) goto errrelfw; - status = inw(base + 0x4); - if (status != 0) { + if ((status = inw(base + 0x4)) != 0) { dev_err(&pdev->dev, "Card%d verify got out of sync. " "Card Status:0x%x\n", index + 1, status); goto errrelfw; @@ -1759,7 +1764,7 @@ static int __devinit isicom_probe(struct pci_dev *pdev, index + 1); retval = -EBUSY; goto errdec; - } + } retval = request_irq(board->irq, isicom_interrupt, IRQF_SHARED | IRQF_DISABLED, ISICOM_NAME, board); @@ -1813,7 +1818,7 @@ static int __init isicom_init(void) int retval, idx, channel; struct isi_port *port; - for (idx = 0; idx < BOARD_COUNT; idx++) { + for(idx = 0; idx < BOARD_COUNT; idx++) { port = &isi_ports[idx * 16]; isi_card[idx].ports = port; spin_lock_init(&isi_card[idx].card_lock); @@ -1827,7 +1832,7 @@ static int __init isicom_init(void) init_waitqueue_head(&port->open_wait); init_waitqueue_head(&port->close_wait); /* . . . */ - } + } isi_card[idx].base = 0; isi_card[idx].irq = 0; } diff --git a/trunk/drivers/char/istallion.c b/trunk/drivers/char/istallion.c index 7c8b62f162bf..c645455c3fd1 100644 --- a/trunk/drivers/char/istallion.c +++ b/trunk/drivers/char/istallion.c @@ -1682,6 +1682,16 @@ static int stli_ioctl(struct tty_struct *tty, struct file *file, unsigned int cm rc = 0; switch (cmd) { + case TIOCGSOFTCAR: + rc = put_user(((tty->termios->c_cflag & CLOCAL) ? 1 : 0), + (unsigned __user *) arg); + break; + case TIOCSSOFTCAR: + if ((rc = get_user(ival, (unsigned __user *) arg)) == 0) + tty->termios->c_cflag = + (tty->termios->c_cflag & ~CLOCAL) | + (ival ? CLOCAL : 0); + break; case TIOCGSERIAL: rc = stli_getserial(portp, argp); break; @@ -3257,7 +3267,7 @@ static int stli_initecp(struct stlibrd *brdp) */ EBRDINIT(brdp); - brdp->membase = ioremap_nocache(brdp->memaddr, brdp->memsize); + brdp->membase = ioremap(brdp->memaddr, brdp->memsize); if (brdp->membase == NULL) { retval = -ENOMEM; goto err_reg; @@ -3414,7 +3424,7 @@ static int stli_initonb(struct stlibrd *brdp) */ EBRDINIT(brdp); - brdp->membase = ioremap_nocache(brdp->memaddr, brdp->memsize); + brdp->membase = ioremap(brdp->memaddr, brdp->memsize); if (brdp->membase == NULL) { retval = -ENOMEM; goto err_reg; @@ -3665,7 +3675,7 @@ static int stli_eisamemprobe(struct stlibrd *brdp) */ for (i = 0; (i < stli_eisamempsize); i++) { brdp->memaddr = stli_eisamemprobeaddrs[i]; - brdp->membase = ioremap_nocache(brdp->memaddr, brdp->memsize); + brdp->membase = ioremap(brdp->memaddr, brdp->memsize); if (brdp->membase == NULL) continue; @@ -4423,8 +4433,6 @@ static int stli_memioctl(struct inode *ip, struct file *fp, unsigned int cmd, un done = 0; rc = 0; - lock_kernel(); - switch (cmd) { case COM_GETPORTSTATS: rc = stli_getportstats(NULL, argp); @@ -4447,7 +4455,6 @@ static int stli_memioctl(struct inode *ip, struct file *fp, unsigned int cmd, un done++; break; } - unlock_kernel(); if (done) return rc; @@ -4465,8 +4472,6 @@ static int stli_memioctl(struct inode *ip, struct file *fp, unsigned int cmd, un if (brdp->state == 0) return -ENODEV; - lock_kernel(); - switch (cmd) { case STL_BINTR: EBRDINTR(brdp); @@ -4489,7 +4494,6 @@ static int stli_memioctl(struct inode *ip, struct file *fp, unsigned int cmd, un rc = -ENOIOCTLCMD; break; } - unlock_kernel(); return rc; } diff --git a/trunk/drivers/char/keyboard.c b/trunk/drivers/char/keyboard.c index 7f7e798c1384..60b934adea65 100644 --- a/trunk/drivers/char/keyboard.c +++ b/trunk/drivers/char/keyboard.c @@ -110,7 +110,6 @@ const int max_vals[] = { const int NR_TYPES = ARRAY_SIZE(max_vals); struct kbd_struct kbd_table[MAX_NR_CONSOLES]; -EXPORT_SYMBOL_GPL(kbd_table); static struct kbd_struct *kbd = kbd_table; struct vt_spawn_console vt_spawn_con = { @@ -261,7 +260,6 @@ void kd_mksound(unsigned int hz, unsigned int ticks) } else kd_nosound(0); } -EXPORT_SYMBOL(kd_mksound); /* * Setting the keyboard rate. @@ -1232,7 +1230,7 @@ static void kbd_keycode(unsigned int keycode, int down, int hw_raw) if (rep && (!vc_kbd_mode(kbd, VC_REPEAT) || - (tty && !L_ECHO(tty) && tty_chars_in_buffer(tty)))) { + (tty && !L_ECHO(tty) && tty->driver->chars_in_buffer(tty)))) { /* * Don't repeat a key if the input buffers are not empty and the * characters get aren't echoed locally. This makes key repeat diff --git a/trunk/drivers/char/mmtimer.c b/trunk/drivers/char/mmtimer.c index d83db5d880e0..e60a74c66e3d 100644 --- a/trunk/drivers/char/mmtimer.c +++ b/trunk/drivers/char/mmtimer.c @@ -74,8 +74,9 @@ static const struct file_operations mmtimer_fops = { * We only have comparison registers RTC1-4 currently available per * node. RTC0 is used by SAL. */ +#define NUM_COMPARATORS 3 /* Check for an RTC interrupt pending */ -static int mmtimer_int_pending(int comparator) +static int inline mmtimer_int_pending(int comparator) { if (HUB_L((unsigned long *)LOCAL_MMR_ADDR(SH_EVENT_OCCURRED)) & SH_EVENT_OCCURRED_RTC1_INT_MASK << comparator) @@ -83,16 +84,15 @@ static int mmtimer_int_pending(int comparator) else return 0; } - /* Clear the RTC interrupt pending bit */ -static void mmtimer_clr_int_pending(int comparator) +static void inline mmtimer_clr_int_pending(int comparator) { HUB_S((u64 *)LOCAL_MMR_ADDR(SH_EVENT_OCCURRED_ALIAS), SH_EVENT_OCCURRED_RTC1_INT_MASK << comparator); } /* Setup timer on comparator RTC1 */ -static void mmtimer_setup_int_0(int cpu, u64 expires) +static void inline mmtimer_setup_int_0(u64 expires) { u64 val; @@ -106,7 +106,7 @@ static void mmtimer_setup_int_0(int cpu, u64 expires) mmtimer_clr_int_pending(0); val = ((u64)SGI_MMTIMER_VECTOR << SH_RTC1_INT_CONFIG_IDX_SHFT) | - ((u64)cpu_physical_id(cpu) << + ((u64)cpu_physical_id(smp_processor_id()) << SH_RTC1_INT_CONFIG_PID_SHFT); /* Set configuration */ @@ -122,7 +122,7 @@ static void mmtimer_setup_int_0(int cpu, u64 expires) } /* Setup timer on comparator RTC2 */ -static void mmtimer_setup_int_1(int cpu, u64 expires) +static void inline mmtimer_setup_int_1(u64 expires) { u64 val; @@ -133,7 +133,7 @@ static void mmtimer_setup_int_1(int cpu, u64 expires) mmtimer_clr_int_pending(1); val = ((u64)SGI_MMTIMER_VECTOR << SH_RTC2_INT_CONFIG_IDX_SHFT) | - ((u64)cpu_physical_id(cpu) << + ((u64)cpu_physical_id(smp_processor_id()) << SH_RTC2_INT_CONFIG_PID_SHFT); HUB_S((u64 *)LOCAL_MMR_ADDR(SH_RTC2_INT_CONFIG), val); @@ -144,7 +144,7 @@ static void mmtimer_setup_int_1(int cpu, u64 expires) } /* Setup timer on comparator RTC3 */ -static void mmtimer_setup_int_2(int cpu, u64 expires) +static void inline mmtimer_setup_int_2(u64 expires) { u64 val; @@ -155,7 +155,7 @@ static void mmtimer_setup_int_2(int cpu, u64 expires) mmtimer_clr_int_pending(2); val = ((u64)SGI_MMTIMER_VECTOR << SH_RTC3_INT_CONFIG_IDX_SHFT) | - ((u64)cpu_physical_id(cpu) << + ((u64)cpu_physical_id(smp_processor_id()) << SH_RTC3_INT_CONFIG_PID_SHFT); HUB_S((u64 *)LOCAL_MMR_ADDR(SH_RTC3_INT_CONFIG), val); @@ -170,22 +170,22 @@ static void mmtimer_setup_int_2(int cpu, u64 expires) * in order to insure that the setup succeeds in a deterministic time frame. * It will check if the interrupt setup succeeded. */ -static int mmtimer_setup(int cpu, int comparator, unsigned long expires) +static int inline mmtimer_setup(int comparator, unsigned long expires) { switch (comparator) { case 0: - mmtimer_setup_int_0(cpu, expires); + mmtimer_setup_int_0(expires); break; case 1: - mmtimer_setup_int_1(cpu, expires); + mmtimer_setup_int_1(expires); break; case 2: - mmtimer_setup_int_2(cpu, expires); + mmtimer_setup_int_2(expires); break; } /* We might've missed our expiration time */ - if (rtc_time() <= expires) + if (rtc_time() < expires) return 1; /* @@ -195,7 +195,7 @@ static int mmtimer_setup(int cpu, int comparator, unsigned long expires) return mmtimer_int_pending(comparator); } -static int mmtimer_disable_int(long nasid, int comparator) +static int inline mmtimer_disable_int(long nasid, int comparator) { switch (comparator) { case 0: @@ -216,124 +216,18 @@ static int mmtimer_disable_int(long nasid, int comparator) return 0; } -#define COMPARATOR 1 /* The comparator to use */ - -#define TIMER_OFF 0xbadcabLL /* Timer is not setup */ -#define TIMER_SET 0 /* Comparator is set for this timer */ +#define TIMER_OFF 0xbadcabLL -/* There is one of these for each timer */ -struct mmtimer { - struct rb_node list; +/* There is one of these for each comparator */ +typedef struct mmtimer { + spinlock_t lock ____cacheline_aligned; struct k_itimer *timer; + int i; int cpu; -}; - -struct mmtimer_node { - spinlock_t lock ____cacheline_aligned; - struct rb_root timer_head; - struct rb_node *next; struct tasklet_struct tasklet; -}; -static struct mmtimer_node *timers; - - -/* - * Add a new mmtimer struct to the node's mmtimer list. - * This function assumes the struct mmtimer_node is locked. - */ -static void mmtimer_add_list(struct mmtimer *n) -{ - int nodeid = n->timer->it.mmtimer.node; - unsigned long expires = n->timer->it.mmtimer.expires; - struct rb_node **link = &timers[nodeid].timer_head.rb_node; - struct rb_node *parent = NULL; - struct mmtimer *x; - - /* - * Find the right place in the rbtree: - */ - while (*link) { - parent = *link; - x = rb_entry(parent, struct mmtimer, list); - - if (expires < x->timer->it.mmtimer.expires) - link = &(*link)->rb_left; - else - link = &(*link)->rb_right; - } - - /* - * Insert the timer to the rbtree and check whether it - * replaces the first pending timer - */ - rb_link_node(&n->list, parent, link); - rb_insert_color(&n->list, &timers[nodeid].timer_head); - - if (!timers[nodeid].next || expires < rb_entry(timers[nodeid].next, - struct mmtimer, list)->timer->it.mmtimer.expires) - timers[nodeid].next = &n->list; -} - -/* - * Set the comparator for the next timer. - * This function assumes the struct mmtimer_node is locked. - */ -static void mmtimer_set_next_timer(int nodeid) -{ - struct mmtimer_node *n = &timers[nodeid]; - struct mmtimer *x; - struct k_itimer *t; - int o; - -restart: - if (n->next == NULL) - return; +} mmtimer_t; - x = rb_entry(n->next, struct mmtimer, list); - t = x->timer; - if (!t->it.mmtimer.incr) { - /* Not an interval timer */ - if (!mmtimer_setup(x->cpu, COMPARATOR, - t->it.mmtimer.expires)) { - /* Late setup, fire now */ - tasklet_schedule(&n->tasklet); - } - return; - } - - /* Interval timer */ - o = 0; - while (!mmtimer_setup(x->cpu, COMPARATOR, t->it.mmtimer.expires)) { - unsigned long e, e1; - struct rb_node *next; - t->it.mmtimer.expires += t->it.mmtimer.incr << o; - t->it_overrun += 1 << o; - o++; - if (o > 20) { - printk(KERN_ALERT "mmtimer: cannot reschedule timer\n"); - t->it.mmtimer.clock = TIMER_OFF; - n->next = rb_next(&x->list); - rb_erase(&x->list, &n->timer_head); - kfree(x); - goto restart; - } - - e = t->it.mmtimer.expires; - next = rb_next(&x->list); - - if (next == NULL) - continue; - - e1 = rb_entry(next, struct mmtimer, list)-> - timer->it.mmtimer.expires; - if (e > e1) { - n->next = next; - rb_erase(&x->list, &n->timer_head); - mmtimer_add_list(x); - goto restart; - } - } -} +static mmtimer_t ** timers; /** * mmtimer_ioctl - ioctl interface for /dev/mmtimer @@ -496,6 +390,35 @@ static int sgi_clock_set(clockid_t clockid, struct timespec *tp) return 0; } +/* + * Schedule the next periodic interrupt. This function will attempt + * to schedule a periodic interrupt later if necessary. If the scheduling + * of an interrupt fails then the time to skip is lengthened + * exponentially in order to ensure that the next interrupt + * can be properly scheduled.. + */ +static int inline reschedule_periodic_timer(mmtimer_t *x) +{ + int n; + struct k_itimer *t = x->timer; + + t->it.mmtimer.clock = x->i; + t->it_overrun--; + + n = 0; + do { + + t->it.mmtimer.expires += t->it.mmtimer.incr << n; + t->it_overrun += 1 << n; + n++; + if (n > 20) + return 1; + + } while (!mmtimer_setup(x->i, t->it.mmtimer.expires)); + + return 0; +} + /** * mmtimer_interrupt - timer interrupt handler * @irq: irq received @@ -512,75 +435,71 @@ static int sgi_clock_set(clockid_t clockid, struct timespec *tp) static irqreturn_t mmtimer_interrupt(int irq, void *dev_id) { + int i; unsigned long expires = 0; int result = IRQ_NONE; unsigned indx = cpu_to_node(smp_processor_id()); - struct mmtimer *base; - - spin_lock(&timers[indx].lock); - base = rb_entry(timers[indx].next, struct mmtimer, list); - if (base == NULL) { - spin_unlock(&timers[indx].lock); - return result; - } - if (base->cpu == smp_processor_id()) { - if (base->timer) - expires = base->timer->it.mmtimer.expires; - /* expires test won't work with shared irqs */ - if ((mmtimer_int_pending(COMPARATOR) > 0) || - (expires && (expires <= rtc_time()))) { - mmtimer_clr_int_pending(COMPARATOR); - tasklet_schedule(&timers[indx].tasklet); - result = IRQ_HANDLED; + /* + * Do this once for each comparison register + */ + for (i = 0; i < NUM_COMPARATORS; i++) { + mmtimer_t *base = timers[indx] + i; + /* Make sure this doesn't get reused before tasklet_sched */ + spin_lock(&base->lock); + if (base->cpu == smp_processor_id()) { + if (base->timer) + expires = base->timer->it.mmtimer.expires; + /* expires test won't work with shared irqs */ + if ((mmtimer_int_pending(i) > 0) || + (expires && (expires < rtc_time()))) { + mmtimer_clr_int_pending(i); + tasklet_schedule(&base->tasklet); + result = IRQ_HANDLED; + } } + spin_unlock(&base->lock); + expires = 0; } - spin_unlock(&timers[indx].lock); return result; } -static void mmtimer_tasklet(unsigned long data) -{ - int nodeid = data; - struct mmtimer_node *mn = &timers[nodeid]; - struct mmtimer *x = rb_entry(mn->next, struct mmtimer, list); - struct k_itimer *t; +void mmtimer_tasklet(unsigned long data) { + mmtimer_t *x = (mmtimer_t *)data; + struct k_itimer *t = x->timer; unsigned long flags; - /* Send signal and deal with periodic signals */ - spin_lock_irqsave(&mn->lock, flags); - if (!mn->next) - goto out; - - x = rb_entry(mn->next, struct mmtimer, list); - t = x->timer; + if (t == NULL) + return; - if (t->it.mmtimer.clock == TIMER_OFF) + /* Send signal and deal with periodic signals */ + spin_lock_irqsave(&t->it_lock, flags); + spin_lock(&x->lock); + /* If timer was deleted between interrupt and here, leave */ + if (t != x->timer) goto out; - t->it_overrun = 0; - mn->next = rb_next(&x->list); - rb_erase(&x->list, &mn->timer_head); + if (posix_timer_event(t, 0) != 0) { - if (posix_timer_event(t, 0) != 0) - t->it_overrun++; + // printk(KERN_WARNING "mmtimer: cannot deliver signal.\n"); + t->it_overrun++; + } if(t->it.mmtimer.incr) { - t->it.mmtimer.expires += t->it.mmtimer.incr; - mmtimer_add_list(x); + /* Periodic timer */ + if (reschedule_periodic_timer(x)) { + printk(KERN_WARNING "mmtimer: unable to reschedule\n"); + x->timer = NULL; + } } else { /* Ensure we don't false trigger in mmtimer_interrupt */ - t->it.mmtimer.clock = TIMER_OFF; t->it.mmtimer.expires = 0; - kfree(x); } - /* Set comparator for next timer, if there is one */ - mmtimer_set_next_timer(nodeid); - t->it_overrun_last = t->it_overrun; out: - spin_unlock_irqrestore(&mn->lock, flags); + spin_unlock(&x->lock); + spin_unlock_irqrestore(&t->it_lock, flags); } static int sgi_timer_create(struct k_itimer *timer) @@ -597,50 +516,19 @@ static int sgi_timer_create(struct k_itimer *timer) */ static int sgi_timer_del(struct k_itimer *timr) { + int i = timr->it.mmtimer.clock; cnodeid_t nodeid = timr->it.mmtimer.node; + mmtimer_t *t = timers[nodeid] + i; unsigned long irqflags; - spin_lock_irqsave(&timers[nodeid].lock, irqflags); - if (timr->it.mmtimer.clock != TIMER_OFF) { - unsigned long expires = timr->it.mmtimer.expires; - struct rb_node *n = timers[nodeid].timer_head.rb_node; - struct mmtimer *uninitialized_var(t); - int r = 0; - + if (i != TIMER_OFF) { + spin_lock_irqsave(&t->lock, irqflags); + mmtimer_disable_int(cnodeid_to_nasid(nodeid),i); + t->timer = NULL; timr->it.mmtimer.clock = TIMER_OFF; timr->it.mmtimer.expires = 0; - - while (n) { - t = rb_entry(n, struct mmtimer, list); - if (t->timer == timr) - break; - - if (expires < t->timer->it.mmtimer.expires) - n = n->rb_left; - else - n = n->rb_right; - } - - if (!n) { - spin_unlock_irqrestore(&timers[nodeid].lock, irqflags); - return 0; - } - - if (timers[nodeid].next == n) { - timers[nodeid].next = rb_next(n); - r = 1; - } - - rb_erase(n, &timers[nodeid].timer_head); - kfree(t); - - if (r) { - mmtimer_disable_int(cnodeid_to_nasid(nodeid), - COMPARATOR); - mmtimer_set_next_timer(nodeid); - } + spin_unlock_irqrestore(&t->lock, irqflags); } - spin_unlock_irqrestore(&timers[nodeid].lock, irqflags); return 0; } @@ -669,11 +557,12 @@ static int sgi_timer_set(struct k_itimer *timr, int flags, struct itimerspec * new_setting, struct itimerspec * old_setting) { + + int i; unsigned long when, period, irqflags; int err = 0; cnodeid_t nodeid; - struct mmtimer *base; - struct rb_node *n; + mmtimer_t *base; if (old_setting) sgi_timer_get(timr, old_setting); @@ -686,10 +575,6 @@ static int sgi_timer_set(struct k_itimer *timr, int flags, /* Clear timer */ return 0; - base = kmalloc(sizeof(struct mmtimer), GFP_KERNEL); - if (base == NULL) - return -ENOMEM; - if (flags & TIMER_ABSTIME) { struct timespec n; unsigned long now; @@ -719,38 +604,47 @@ static int sgi_timer_set(struct k_itimer *timr, int flags, preempt_disable(); nodeid = cpu_to_node(smp_processor_id()); +retry: + /* Don't use an allocated timer, or a deleted one that's pending */ + for(i = 0; i< NUM_COMPARATORS; i++) { + base = timers[nodeid] + i; + if (!base->timer && !base->tasklet.state) { + break; + } + } + + if (i == NUM_COMPARATORS) { + preempt_enable(); + return -EBUSY; + } - /* Lock the node timer structure */ - spin_lock_irqsave(&timers[nodeid].lock, irqflags); + spin_lock_irqsave(&base->lock, irqflags); + if (base->timer || base->tasklet.state != 0) { + spin_unlock_irqrestore(&base->lock, irqflags); + goto retry; + } base->timer = timr; base->cpu = smp_processor_id(); - timr->it.mmtimer.clock = TIMER_SET; + timr->it.mmtimer.clock = i; timr->it.mmtimer.node = nodeid; timr->it.mmtimer.incr = period; timr->it.mmtimer.expires = when; - n = timers[nodeid].next; - - /* Add the new struct mmtimer to node's timer list */ - mmtimer_add_list(base); - - if (timers[nodeid].next == n) { - /* No need to reprogram comparator for now */ - spin_unlock_irqrestore(&timers[nodeid].lock, irqflags); - preempt_enable(); - return err; + if (period == 0) { + if (!mmtimer_setup(i, when)) { + mmtimer_disable_int(-1, i); + posix_timer_event(timr, 0); + timr->it.mmtimer.expires = 0; + } + } else { + timr->it.mmtimer.expires -= period; + if (reschedule_periodic_timer(base)) + err = -EINVAL; } - /* We need to reprogram the comparator */ - if (n) - mmtimer_disable_int(cnodeid_to_nasid(nodeid), COMPARATOR); - - mmtimer_set_next_timer(nodeid); - - /* Unlock the node timer structure */ - spin_unlock_irqrestore(&timers[nodeid].lock, irqflags); + spin_unlock_irqrestore(&base->lock, irqflags); preempt_enable(); @@ -775,6 +669,7 @@ static struct k_clock sgi_clock = { */ static int __init mmtimer_init(void) { + unsigned i; cnodeid_t node, maxn = -1; if (!ia64_platform_is("sn2")) @@ -811,18 +706,31 @@ static int __init mmtimer_init(void) maxn++; /* Allocate list of node ptrs to mmtimer_t's */ - timers = kzalloc(sizeof(struct mmtimer_node)*maxn, GFP_KERNEL); + timers = kzalloc(sizeof(mmtimer_t *)*maxn, GFP_KERNEL); if (timers == NULL) { printk(KERN_ERR "%s: failed to allocate memory for device\n", MMTIMER_NAME); goto out3; } - /* Initialize struct mmtimer's for each online node */ + /* Allocate mmtimer_t's for each online node */ for_each_online_node(node) { - spin_lock_init(&timers[node].lock); - tasklet_init(&timers[node].tasklet, mmtimer_tasklet, - (unsigned long) node); + timers[node] = kmalloc_node(sizeof(mmtimer_t)*NUM_COMPARATORS, GFP_KERNEL, node); + if (timers[node] == NULL) { + printk(KERN_ERR "%s: failed to allocate memory for device\n", + MMTIMER_NAME); + goto out4; + } + for (i=0; i< NUM_COMPARATORS; i++) { + mmtimer_t * base = timers[node] + i; + + spin_lock_init(&base->lock); + base->timer = NULL; + base->cpu = 0; + base->i = i; + tasklet_init(&base->tasklet, mmtimer_tasklet, + (unsigned long) (base)); + } } sgi_clock_period = sgi_clock.res = NSEC_PER_SEC / sn_rtc_cycles_per_second; @@ -833,8 +741,11 @@ static int __init mmtimer_init(void) return 0; +out4: + for_each_online_node(node) { + kfree(timers[node]); + } out3: - kfree(timers); misc_deregister(&mmtimer_miscdev); out2: free_irq(SGI_MMTIMER_VECTOR, NULL); @@ -843,3 +754,4 @@ static int __init mmtimer_init(void) } module_init(mmtimer_init); + diff --git a/trunk/drivers/char/moxa.c b/trunk/drivers/char/moxa.c index d57d3a61919b..64b7b2b18352 100644 --- a/trunk/drivers/char/moxa.c +++ b/trunk/drivers/char/moxa.c @@ -2,8 +2,7 @@ /* * moxa.c -- MOXA Intellio family multiport serial driver. * - * Copyright (C) 1999-2000 Moxa Technologies (support@moxa.com). - * Copyright (c) 2007 Jiri Slaby + * Copyright (C) 1999-2000 Moxa Technologies (support@moxa.com.tw). * * This code is loosely based on the Linux serial driver, written by * Linus Torvalds, Theodore T'so and others. @@ -26,7 +25,6 @@ #include #include #include -#include #include #include #include @@ -43,26 +41,21 @@ #include #include #include +#include #include #include #include -#include "moxa.h" - -#define MOXA_VERSION "6.0k" - -#define MOXA_FW_HDRLEN 32 +#define MOXA_VERSION "5.1k" #define MOXAMAJOR 172 +#define MOXACUMAJOR 173 #define MAX_BOARDS 4 /* Don't change this value */ #define MAX_PORTS_PER_BOARD 32 /* Don't change this value */ #define MAX_PORTS (MAX_BOARDS * MAX_PORTS_PER_BOARD) -#define MOXA_IS_320(brd) ((brd)->boardType == MOXA_BOARD_C320_ISA || \ - (brd)->boardType == MOXA_BOARD_C320_PCI) - /* * Define the Moxa PCI vendor and device IDs. */ @@ -99,16 +92,24 @@ static struct pci_device_id moxa_pcibrds[] = { MODULE_DEVICE_TABLE(pci, moxa_pcibrds); #endif /* CONFIG_PCI */ -struct moxa_port; +struct moxa_isa_board_conf { + int boardType; + int numPorts; + unsigned long baseAddr; +}; + +static struct moxa_isa_board_conf moxa_isa_boards[] = +{ +/* {MOXA_BOARD_C218_ISA,8,0xDC000}, */ +}; static struct moxa_board_conf { int boardType; int numPorts; + unsigned long baseAddr; int busType; - unsigned int ready; - - struct moxa_port *ports; + int loadstat; void __iomem *basemem; void __iomem *intNdx; @@ -130,27 +131,30 @@ struct moxaq_str { }; struct moxa_port { - struct moxa_board_conf *board; - struct tty_struct *tty; - void __iomem *tableAddr; - int type; + int port; int close_delay; - unsigned int count; + unsigned short closing_wait; + int count; + int blocked_open; + long event; /* long req'd for set_bit --RR */ int asyncflags; - int cflag; unsigned long statusflags; + struct tty_struct *tty; + int cflag; wait_queue_head_t open_wait; + struct completion close_wait; - u8 DCDState; - u8 lineCtrl; - u8 lowChkFlag; -}; + struct timer_list emptyTimer; -struct mon_str { - int tick; - int rxcnt[MAX_PORTS]; - int txcnt[MAX_PORTS]; + char chkPort; + char lineCtrl; + void __iomem *tableAddr; + long curBaud; + char DCDState; + char lowChkFlag; + + ushort breakCnt; }; /* statusflags */ @@ -164,27 +168,20 @@ struct mon_str { #define WAKEUP_CHARS 256 static int ttymajor = MOXAMAJOR; -static struct mon_str moxaLog; -static unsigned int moxaFuncTout = HZ / 2; -static unsigned int moxaLowWaterChk; -static DEFINE_MUTEX(moxa_openlock); /* Variables for insmod */ #ifdef MODULE -static unsigned long baseaddr[MAX_BOARDS]; -static unsigned int type[MAX_BOARDS]; -static unsigned int numports[MAX_BOARDS]; +static int baseaddr[4]; +static int type[4]; +static int numports[4]; #endif MODULE_AUTHOR("William Chen"); MODULE_DESCRIPTION("MOXA Intellio Family Multiport Board Device Driver"); MODULE_LICENSE("GPL"); #ifdef MODULE -module_param_array(type, uint, NULL, 0); -MODULE_PARM_DESC(type, "card type: C218=2, C320=4"); -module_param_array(baseaddr, ulong, NULL, 0); -MODULE_PARM_DESC(baseaddr, "base address"); -module_param_array(numports, uint, NULL, 0); -MODULE_PARM_DESC(numports, "numports (ignored for C218)"); +module_param_array(type, int, NULL, 0); +module_param_array(baseaddr, int, NULL, 0); +module_param_array(numports, int, NULL, 0); #endif module_param(ttymajor, int, 0); @@ -197,6 +194,9 @@ static int moxa_write(struct tty_struct *, const unsigned char *, int); static int moxa_write_room(struct tty_struct *); static void moxa_flush_buffer(struct tty_struct *); static int moxa_chars_in_buffer(struct tty_struct *); +static void moxa_flush_chars(struct tty_struct *); +static void moxa_put_char(struct tty_struct *, unsigned char); +static int moxa_ioctl(struct tty_struct *, struct file *, unsigned int, unsigned long); static void moxa_throttle(struct tty_struct *); static void moxa_unthrottle(struct tty_struct *); static void moxa_set_termios(struct tty_struct *, struct ktermios *); @@ -208,183 +208,44 @@ static int moxa_tiocmset(struct tty_struct *tty, struct file *file, unsigned int set, unsigned int clear); static void moxa_poll(unsigned long); static void moxa_set_tty_param(struct tty_struct *, struct ktermios *); +static int moxa_block_till_ready(struct tty_struct *, struct file *, + struct moxa_port *); static void moxa_setup_empty_event(struct tty_struct *); +static void moxa_check_xmit_empty(unsigned long); static void moxa_shut_down(struct moxa_port *); +static void moxa_receive_data(struct moxa_port *); /* * moxa board interface functions: */ -static void MoxaPortEnable(struct moxa_port *); -static void MoxaPortDisable(struct moxa_port *); -static int MoxaPortSetTermio(struct moxa_port *, struct ktermios *, speed_t); -static int MoxaPortGetLineOut(struct moxa_port *, int *, int *); -static void MoxaPortLineCtrl(struct moxa_port *, int, int); -static void MoxaPortFlowCtrl(struct moxa_port *, int, int, int, int, int); -static int MoxaPortLineStatus(struct moxa_port *); -static void MoxaPortFlushData(struct moxa_port *, int); -static int MoxaPortWriteData(struct moxa_port *, const unsigned char *, int); -static int MoxaPortReadData(struct moxa_port *); -static int MoxaPortTxQueue(struct moxa_port *); -static int MoxaPortRxQueue(struct moxa_port *); -static int MoxaPortTxFree(struct moxa_port *); -static void MoxaPortTxDisable(struct moxa_port *); -static void MoxaPortTxEnable(struct moxa_port *); +static void MoxaDriverInit(void); +static int MoxaDriverIoctl(unsigned int, unsigned long, int); +static int MoxaDriverPoll(void); +static int MoxaPortsOfCard(int); +static int MoxaPortIsValid(int); +static void MoxaPortEnable(int); +static void MoxaPortDisable(int); +static long MoxaPortGetMaxBaud(int); +static long MoxaPortSetBaud(int, long); +static int MoxaPortSetTermio(int, struct ktermios *, speed_t); +static int MoxaPortGetLineOut(int, int *, int *); +static void MoxaPortLineCtrl(int, int, int); +static void MoxaPortFlowCtrl(int, int, int, int, int, int); +static int MoxaPortLineStatus(int); +static int MoxaPortDCDChange(int); +static int MoxaPortDCDON(int); +static void MoxaPortFlushData(int, int); +static int MoxaPortWriteData(int, unsigned char *, int); +static int MoxaPortReadData(int, struct tty_struct *tty); +static int MoxaPortTxQueue(int); +static int MoxaPortRxQueue(int); +static int MoxaPortTxFree(int); +static void MoxaPortTxDisable(int); +static void MoxaPortTxEnable(int); +static int MoxaPortResetBrkCnt(int); +static void MoxaPortSendBreak(int, int); static int moxa_get_serial_info(struct moxa_port *, struct serial_struct __user *); static int moxa_set_serial_info(struct moxa_port *, struct serial_struct __user *); -static void MoxaSetFifo(struct moxa_port *port, int enable); - -/* - * I/O functions - */ - -static void moxa_wait_finish(void __iomem *ofsAddr) -{ - unsigned long end = jiffies + moxaFuncTout; - - while (readw(ofsAddr + FuncCode) != 0) - if (time_after(jiffies, end)) - return; - if (readw(ofsAddr + FuncCode) != 0 && printk_ratelimit()) - printk(KERN_WARNING "moxa function expired\n"); -} - -static void moxafunc(void __iomem *ofsAddr, u16 cmd, u16 arg) -{ - writew(arg, ofsAddr + FuncArg); - writew(cmd, ofsAddr + FuncCode); - moxa_wait_finish(ofsAddr); -} - -static void moxa_low_water_check(void __iomem *ofsAddr) -{ - u16 rptr, wptr, mask, len; - - if (readb(ofsAddr + FlagStat) & Xoff_state) { - rptr = readw(ofsAddr + RXrptr); - wptr = readw(ofsAddr + RXwptr); - mask = readw(ofsAddr + RX_mask); - len = (wptr - rptr) & mask; - if (len <= Low_water) - moxafunc(ofsAddr, FC_SendXon, 0); - } -} - -/* - * TTY operations - */ - -static int moxa_ioctl(struct tty_struct *tty, struct file *file, - unsigned int cmd, unsigned long arg) -{ - struct moxa_port *ch = tty->driver_data; - void __user *argp = (void __user *)arg; - int status, ret = 0; - - if (tty->index == MAX_PORTS) { - if (cmd != MOXA_GETDATACOUNT && cmd != MOXA_GET_IOQUEUE && - cmd != MOXA_GETMSTATUS) - return -EINVAL; - } else if (!ch) - return -ENODEV; - - switch (cmd) { - case MOXA_GETDATACOUNT: - moxaLog.tick = jiffies; - if (copy_to_user(argp, &moxaLog, sizeof(moxaLog))) - ret = -EFAULT; - break; - case MOXA_FLUSH_QUEUE: - MoxaPortFlushData(ch, arg); - break; - case MOXA_GET_IOQUEUE: { - struct moxaq_str __user *argm = argp; - struct moxaq_str tmp; - struct moxa_port *p; - unsigned int i, j; - - mutex_lock(&moxa_openlock); - for (i = 0; i < MAX_BOARDS; i++) { - p = moxa_boards[i].ports; - for (j = 0; j < MAX_PORTS_PER_BOARD; j++, p++, argm++) { - memset(&tmp, 0, sizeof(tmp)); - if (moxa_boards[i].ready) { - tmp.inq = MoxaPortRxQueue(p); - tmp.outq = MoxaPortTxQueue(p); - } - if (copy_to_user(argm, &tmp, sizeof(tmp))) { - mutex_unlock(&moxa_openlock); - return -EFAULT; - } - } - } - mutex_unlock(&moxa_openlock); - break; - } case MOXA_GET_OQUEUE: - status = MoxaPortTxQueue(ch); - ret = put_user(status, (unsigned long __user *)argp); - break; - case MOXA_GET_IQUEUE: - status = MoxaPortRxQueue(ch); - ret = put_user(status, (unsigned long __user *)argp); - break; - case MOXA_GETMSTATUS: { - struct mxser_mstatus __user *argm = argp; - struct mxser_mstatus tmp; - struct moxa_port *p; - unsigned int i, j; - - mutex_lock(&moxa_openlock); - for (i = 0; i < MAX_BOARDS; i++) { - p = moxa_boards[i].ports; - for (j = 0; j < MAX_PORTS_PER_BOARD; j++, p++, argm++) { - memset(&tmp, 0, sizeof(tmp)); - if (!moxa_boards[i].ready) - goto copy; - - status = MoxaPortLineStatus(p); - if (status & 1) - tmp.cts = 1; - if (status & 2) - tmp.dsr = 1; - if (status & 4) - tmp.dcd = 1; - - if (!p->tty || !p->tty->termios) - tmp.cflag = p->cflag; - else - tmp.cflag = p->tty->termios->c_cflag; -copy: - if (copy_to_user(argm, &tmp, sizeof(tmp))) { - mutex_unlock(&moxa_openlock); - return -EFAULT; - } - } - } - mutex_unlock(&moxa_openlock); - break; - } - case TIOCGSERIAL: - mutex_lock(&moxa_openlock); - ret = moxa_get_serial_info(ch, argp); - mutex_unlock(&moxa_openlock); - break; - case TIOCSSERIAL: - mutex_lock(&moxa_openlock); - ret = moxa_set_serial_info(ch, argp); - mutex_unlock(&moxa_openlock); - break; - default: - ret = -ENOIOCTLCMD; - } - return ret; -} - -static void moxa_break_ctl(struct tty_struct *tty, int state) -{ - struct moxa_port *port = tty->driver_data; - - moxafunc(port->tableAddr, state ? FC_SendBreak : FC_StopBreak, - Magic_code); -} +static void MoxaSetFifo(int port, int enable); static const struct tty_operations moxa_ops = { .open = moxa_open, @@ -393,6 +254,8 @@ static const struct tty_operations moxa_ops = { .write_room = moxa_write_room, .flush_buffer = moxa_flush_buffer, .chars_in_buffer = moxa_chars_in_buffer, + .flush_chars = moxa_flush_chars, + .put_char = moxa_put_char, .ioctl = moxa_ioctl, .throttle = moxa_throttle, .unthrottle = moxa_unthrottle, @@ -400,795 +263,259 @@ static const struct tty_operations moxa_ops = { .stop = moxa_stop, .start = moxa_start, .hangup = moxa_hangup, - .break_ctl = moxa_break_ctl, .tiocmget = moxa_tiocmget, .tiocmset = moxa_tiocmset, }; static struct tty_driver *moxaDriver; +static struct moxa_port moxa_ports[MAX_PORTS]; static DEFINE_TIMER(moxaTimer, moxa_poll, 0, 0); static DEFINE_SPINLOCK(moxa_lock); -/* - * HW init - */ - -static int moxa_check_fw_model(struct moxa_board_conf *brd, u8 model) +#ifdef CONFIG_PCI +static int __devinit moxa_pci_probe(struct pci_dev *pdev, + const struct pci_device_id *ent) { - switch (brd->boardType) { + struct moxa_board_conf *board; + unsigned int i; + int board_type = ent->driver_data; + int retval; + + retval = pci_enable_device(pdev); + if (retval) { + dev_err(&pdev->dev, "can't enable pci device\n"); + goto err; + } + + for (i = 0; i < MAX_BOARDS; i++) + if (moxa_boards[i].basemem == NULL) + break; + + retval = -ENODEV; + if (i >= MAX_BOARDS) { + dev_warn(&pdev->dev, "more than %u MOXA Intellio family boards " + "found. Board is ignored.\n", MAX_BOARDS); + goto err; + } + + board = &moxa_boards[i]; + board->basemem = pci_iomap(pdev, 2, 0x4000); + if (board->basemem == NULL) { + dev_err(&pdev->dev, "can't remap io space 2\n"); + goto err; + } + + board->boardType = board_type; + switch (board_type) { case MOXA_BOARD_C218_ISA: case MOXA_BOARD_C218_PCI: - if (model != 1) - goto err; + board->numPorts = 8; break; + case MOXA_BOARD_CP204J: - if (model != 3) - goto err; + board->numPorts = 4; break; default: - if (model != 2) - goto err; + board->numPorts = 0; break; } - return 0; + board->busType = MOXA_BUS_TYPE_PCI; + + pci_set_drvdata(pdev, board); + + return (0); err: - return -EINVAL; + return retval; } -static int moxa_check_fw(const void *ptr) +static void __devexit moxa_pci_remove(struct pci_dev *pdev) { - const __le16 *lptr = ptr; - - if (*lptr != cpu_to_le16(0x7980)) - return -EINVAL; + struct moxa_board_conf *brd = pci_get_drvdata(pdev); - return 0; + pci_iounmap(pdev, brd->basemem); + brd->basemem = NULL; } -static int moxa_load_bios(struct moxa_board_conf *brd, const u8 *buf, - size_t len) +static struct pci_driver moxa_pci_driver = { + .name = "moxa", + .id_table = moxa_pcibrds, + .probe = moxa_pci_probe, + .remove = __devexit_p(moxa_pci_remove) +}; +#endif /* CONFIG_PCI */ + +static int __init moxa_init(void) { - void __iomem *baseAddr = brd->basemem; - u16 tmp; + int i, numBoards, retval = 0; + struct moxa_port *ch; - writeb(HW_reset, baseAddr + Control_reg); /* reset */ - msleep(10); - memset_io(baseAddr, 0, 4096); - memcpy_toio(baseAddr, buf, len); /* download BIOS */ - writeb(0, baseAddr + Control_reg); /* restart */ + printk(KERN_INFO "MOXA Intellio family driver version %s\n", + MOXA_VERSION); + moxaDriver = alloc_tty_driver(MAX_PORTS + 1); + if (!moxaDriver) + return -ENOMEM; + + moxaDriver->owner = THIS_MODULE; + moxaDriver->name = "ttyMX"; + moxaDriver->major = ttymajor; + moxaDriver->minor_start = 0; + moxaDriver->type = TTY_DRIVER_TYPE_SERIAL; + moxaDriver->subtype = SERIAL_TYPE_NORMAL; + moxaDriver->init_termios = tty_std_termios; + moxaDriver->init_termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL | HUPCL; + moxaDriver->init_termios.c_ispeed = 9600; + moxaDriver->init_termios.c_ospeed = 9600; + moxaDriver->flags = TTY_DRIVER_REAL_RAW; + tty_set_operations(moxaDriver, &moxa_ops); - msleep(2000); + for (i = 0, ch = moxa_ports; i < MAX_PORTS; i++, ch++) { + ch->type = PORT_16550A; + ch->port = i; + ch->close_delay = 5 * HZ / 10; + ch->closing_wait = 30 * HZ; + ch->cflag = B9600 | CS8 | CREAD | CLOCAL | HUPCL; + init_waitqueue_head(&ch->open_wait); + init_completion(&ch->close_wait); + + setup_timer(&ch->emptyTimer, moxa_check_xmit_empty, + (unsigned long)ch); + } - switch (brd->boardType) { - case MOXA_BOARD_C218_ISA: - case MOXA_BOARD_C218_PCI: - tmp = readw(baseAddr + C218_key); - if (tmp != C218_KeyCode) - goto err; - break; - case MOXA_BOARD_CP204J: - tmp = readw(baseAddr + C218_key); - if (tmp != CP204J_KeyCode) - goto err; - break; - default: - tmp = readw(baseAddr + C320_key); - if (tmp != C320_KeyCode) - goto err; - tmp = readw(baseAddr + C320_status); - if (tmp != STS_init) { - printk(KERN_ERR "MOXA: bios upload failed -- CPU/Basic " - "module not found\n"); - return -EIO; - } - break; + pr_debug("Moxa tty devices major number = %d\n", ttymajor); + + if (tty_register_driver(moxaDriver)) { + printk(KERN_ERR "Couldn't install MOXA Smartio family driver !\n"); + put_tty_driver(moxaDriver); + return -1; } - return 0; -err: - printk(KERN_ERR "MOXA: bios upload failed -- board not found\n"); - return -EIO; -} + mod_timer(&moxaTimer, jiffies + HZ / 50); -static int moxa_load_320b(struct moxa_board_conf *brd, const u8 *ptr, - size_t len) -{ - void __iomem *baseAddr = brd->basemem; + /* Find the boards defined in source code */ + numBoards = 0; + for (i = 0; i < MAX_BOARDS; i++) { + if ((moxa_isa_boards[i].boardType == MOXA_BOARD_C218_ISA) || + (moxa_isa_boards[i].boardType == MOXA_BOARD_C320_ISA)) { + moxa_boards[numBoards].boardType = moxa_isa_boards[i].boardType; + if (moxa_isa_boards[i].boardType == MOXA_BOARD_C218_ISA) + moxa_boards[numBoards].numPorts = 8; + else + moxa_boards[numBoards].numPorts = moxa_isa_boards[i].numPorts; + moxa_boards[numBoards].busType = MOXA_BUS_TYPE_ISA; + moxa_boards[numBoards].baseAddr = moxa_isa_boards[i].baseAddr; + pr_debug("Moxa board %2d: %s board(baseAddr=%lx)\n", + numBoards + 1, + moxa_brdname[moxa_boards[numBoards].boardType-1], + moxa_boards[numBoards].baseAddr); + numBoards++; + } + } + /* Find the boards defined form module args. */ +#ifdef MODULE + for (i = 0; i < MAX_BOARDS; i++) { + if ((type[i] == MOXA_BOARD_C218_ISA) || + (type[i] == MOXA_BOARD_C320_ISA)) { + pr_debug("Moxa board %2d: %s board(baseAddr=%lx)\n", + numBoards + 1, moxa_brdname[type[i] - 1], + (unsigned long)baseaddr[i]); + if (numBoards >= MAX_BOARDS) { + printk(KERN_WARNING "More than %d MOXA " + "Intellio family boards found. Board " + "is ignored.\n", MAX_BOARDS); + continue; + } + moxa_boards[numBoards].boardType = type[i]; + if (moxa_isa_boards[i].boardType == MOXA_BOARD_C218_ISA) + moxa_boards[numBoards].numPorts = 8; + else + moxa_boards[numBoards].numPorts = numports[i]; + moxa_boards[numBoards].busType = MOXA_BUS_TYPE_ISA; + moxa_boards[numBoards].baseAddr = baseaddr[i]; + numBoards++; + } + } +#endif - if (len < 7168) { - printk(KERN_ERR "MOXA: invalid 320 bios -- too short\n"); - return -EINVAL; +#ifdef CONFIG_PCI + retval = pci_register_driver(&moxa_pci_driver); + if (retval) { + printk(KERN_ERR "Can't register moxa pci driver!\n"); + if (numBoards) + retval = 0; } +#endif - writew(len - 7168 - 2, baseAddr + C320bapi_len); - writeb(1, baseAddr + Control_reg); /* Select Page 1 */ - memcpy_toio(baseAddr + DynPage_addr, ptr, 7168); - writeb(2, baseAddr + Control_reg); /* Select Page 2 */ - memcpy_toio(baseAddr + DynPage_addr, ptr + 7168, len - 7168); + for (i = 0; i < numBoards; i++) { + moxa_boards[i].basemem = ioremap(moxa_boards[i].baseAddr, + 0x4000); + } - return 0; + return retval; } -static int moxa_real_load_code(struct moxa_board_conf *brd, const void *ptr, - size_t len) +static void __exit moxa_exit(void) { - void __iomem *baseAddr = brd->basemem; - const u16 *uptr = ptr; - size_t wlen, len2, j; - unsigned long key, loadbuf, loadlen, checksum, checksum_ok; - unsigned int i, retry; - u16 usum, keycode; + int i; - keycode = (brd->boardType == MOXA_BOARD_CP204J) ? CP204J_KeyCode : - C218_KeyCode; + del_timer_sync(&moxaTimer); - switch (brd->boardType) { - case MOXA_BOARD_CP204J: - case MOXA_BOARD_C218_ISA: - case MOXA_BOARD_C218_PCI: - key = C218_key; - loadbuf = C218_LoadBuf; - loadlen = C218DLoad_len; - checksum = C218check_sum; - checksum_ok = C218chksum_ok; - break; - default: - key = C320_key; - keycode = C320_KeyCode; - loadbuf = C320_LoadBuf; - loadlen = C320DLoad_len; - checksum = C320check_sum; - checksum_ok = C320chksum_ok; - break; - } + for (i = 0; i < MAX_PORTS; i++) + del_timer_sync(&moxa_ports[i].emptyTimer); - usum = 0; - wlen = len >> 1; - for (i = 0; i < wlen; i++) - usum += le16_to_cpu(uptr[i]); - retry = 0; - do { - wlen = len >> 1; - j = 0; - while (wlen) { - len2 = (wlen > 2048) ? 2048 : wlen; - wlen -= len2; - memcpy_toio(baseAddr + loadbuf, ptr + j, len2 << 1); - j += len2 << 1; - - writew(len2, baseAddr + loadlen); - writew(0, baseAddr + key); - for (i = 0; i < 100; i++) { - if (readw(baseAddr + key) == keycode) - break; - msleep(10); - } - if (readw(baseAddr + key) != keycode) - return -EIO; - } - writew(0, baseAddr + loadlen); - writew(usum, baseAddr + checksum); - writew(0, baseAddr + key); - for (i = 0; i < 100; i++) { - if (readw(baseAddr + key) == keycode) - break; - msleep(10); - } - retry++; - } while ((readb(baseAddr + checksum_ok) != 1) && (retry < 3)); - if (readb(baseAddr + checksum_ok) != 1) - return -EIO; - - writew(0, baseAddr + key); - for (i = 0; i < 600; i++) { - if (readw(baseAddr + Magic_no) == Magic_code) - break; - msleep(10); - } - if (readw(baseAddr + Magic_no) != Magic_code) - return -EIO; - - if (MOXA_IS_320(brd)) { - if (brd->busType == MOXA_BUS_TYPE_PCI) { /* ASIC board */ - writew(0x3800, baseAddr + TMS320_PORT1); - writew(0x3900, baseAddr + TMS320_PORT2); - writew(28499, baseAddr + TMS320_CLOCK); - } else { - writew(0x3200, baseAddr + TMS320_PORT1); - writew(0x3400, baseAddr + TMS320_PORT2); - writew(19999, baseAddr + TMS320_CLOCK); - } - } - writew(1, baseAddr + Disable_IRQ); - writew(0, baseAddr + Magic_no); - for (i = 0; i < 500; i++) { - if (readw(baseAddr + Magic_no) == Magic_code) - break; - msleep(10); - } - if (readw(baseAddr + Magic_no) != Magic_code) - return -EIO; - - if (MOXA_IS_320(brd)) { - j = readw(baseAddr + Module_cnt); - if (j <= 0) - return -EIO; - brd->numPorts = j * 8; - writew(j, baseAddr + Module_no); - writew(0, baseAddr + Magic_no); - for (i = 0; i < 600; i++) { - if (readw(baseAddr + Magic_no) == Magic_code) - break; - msleep(10); - } - if (readw(baseAddr + Magic_no) != Magic_code) - return -EIO; - } - brd->intNdx = baseAddr + IRQindex; - brd->intPend = baseAddr + IRQpending; - brd->intTable = baseAddr + IRQtable; - - return 0; -} - -static int moxa_load_code(struct moxa_board_conf *brd, const void *ptr, - size_t len) -{ - void __iomem *ofsAddr, *baseAddr = brd->basemem; - struct moxa_port *port; - int retval, i; - - if (len % 2) { - printk(KERN_ERR "MOXA: bios length is not even\n"); - return -EINVAL; - } - - retval = moxa_real_load_code(brd, ptr, len); /* may change numPorts */ - if (retval) - return retval; - - switch (brd->boardType) { - case MOXA_BOARD_C218_ISA: - case MOXA_BOARD_C218_PCI: - case MOXA_BOARD_CP204J: - port = brd->ports; - for (i = 0; i < brd->numPorts; i++, port++) { - port->board = brd; - port->DCDState = 0; - port->tableAddr = baseAddr + Extern_table + - Extern_size * i; - ofsAddr = port->tableAddr; - writew(C218rx_mask, ofsAddr + RX_mask); - writew(C218tx_mask, ofsAddr + TX_mask); - writew(C218rx_spage + i * C218buf_pageno, ofsAddr + Page_rxb); - writew(readw(ofsAddr + Page_rxb) + C218rx_pageno, ofsAddr + EndPage_rxb); - - writew(C218tx_spage + i * C218buf_pageno, ofsAddr + Page_txb); - writew(readw(ofsAddr + Page_txb) + C218tx_pageno, ofsAddr + EndPage_txb); - - } - break; - default: - port = brd->ports; - for (i = 0; i < brd->numPorts; i++, port++) { - port->board = brd; - port->DCDState = 0; - port->tableAddr = baseAddr + Extern_table + - Extern_size * i; - ofsAddr = port->tableAddr; - switch (brd->numPorts) { - case 8: - writew(C320p8rx_mask, ofsAddr + RX_mask); - writew(C320p8tx_mask, ofsAddr + TX_mask); - writew(C320p8rx_spage + i * C320p8buf_pgno, ofsAddr + Page_rxb); - writew(readw(ofsAddr + Page_rxb) + C320p8rx_pgno, ofsAddr + EndPage_rxb); - writew(C320p8tx_spage + i * C320p8buf_pgno, ofsAddr + Page_txb); - writew(readw(ofsAddr + Page_txb) + C320p8tx_pgno, ofsAddr + EndPage_txb); - - break; - case 16: - writew(C320p16rx_mask, ofsAddr + RX_mask); - writew(C320p16tx_mask, ofsAddr + TX_mask); - writew(C320p16rx_spage + i * C320p16buf_pgno, ofsAddr + Page_rxb); - writew(readw(ofsAddr + Page_rxb) + C320p16rx_pgno, ofsAddr + EndPage_rxb); - writew(C320p16tx_spage + i * C320p16buf_pgno, ofsAddr + Page_txb); - writew(readw(ofsAddr + Page_txb) + C320p16tx_pgno, ofsAddr + EndPage_txb); - break; - - case 24: - writew(C320p24rx_mask, ofsAddr + RX_mask); - writew(C320p24tx_mask, ofsAddr + TX_mask); - writew(C320p24rx_spage + i * C320p24buf_pgno, ofsAddr + Page_rxb); - writew(readw(ofsAddr + Page_rxb) + C320p24rx_pgno, ofsAddr + EndPage_rxb); - writew(C320p24tx_spage + i * C320p24buf_pgno, ofsAddr + Page_txb); - writew(readw(ofsAddr + Page_txb), ofsAddr + EndPage_txb); - break; - case 32: - writew(C320p32rx_mask, ofsAddr + RX_mask); - writew(C320p32tx_mask, ofsAddr + TX_mask); - writew(C320p32tx_ofs, ofsAddr + Ofs_txb); - writew(C320p32rx_spage + i * C320p32buf_pgno, ofsAddr + Page_rxb); - writew(readb(ofsAddr + Page_rxb), ofsAddr + EndPage_rxb); - writew(C320p32tx_spage + i * C320p32buf_pgno, ofsAddr + Page_txb); - writew(readw(ofsAddr + Page_txb), ofsAddr + EndPage_txb); - break; - } - } - break; - } - return 0; -} - -static int moxa_load_fw(struct moxa_board_conf *brd, const struct firmware *fw) -{ - void *ptr = fw->data; - char rsn[64]; - u16 lens[5]; - size_t len; - unsigned int a, lenp, lencnt; - int ret = -EINVAL; - struct { - __le32 magic; /* 0x34303430 */ - u8 reserved1[2]; - u8 type; /* UNIX = 3 */ - u8 model; /* C218T=1, C320T=2, CP204=3 */ - u8 reserved2[8]; - __le16 len[5]; - } *hdr = ptr; - - BUILD_BUG_ON(ARRAY_SIZE(hdr->len) != ARRAY_SIZE(lens)); - - if (fw->size < MOXA_FW_HDRLEN) { - strcpy(rsn, "too short (even header won't fit)"); - goto err; - } - if (hdr->magic != cpu_to_le32(0x30343034)) { - sprintf(rsn, "bad magic: %.8x", le32_to_cpu(hdr->magic)); - goto err; - } - if (hdr->type != 3) { - sprintf(rsn, "not for linux, type is %u", hdr->type); - goto err; - } - if (moxa_check_fw_model(brd, hdr->model)) { - sprintf(rsn, "not for this card, model is %u", hdr->model); - goto err; - } - - len = MOXA_FW_HDRLEN; - lencnt = hdr->model == 2 ? 5 : 3; - for (a = 0; a < ARRAY_SIZE(lens); a++) { - lens[a] = le16_to_cpu(hdr->len[a]); - if (lens[a] && len + lens[a] <= fw->size && - moxa_check_fw(&fw->data[len])) - printk(KERN_WARNING "MOXA firmware: unexpected input " - "at offset %u, but going on\n", (u32)len); - if (!lens[a] && a < lencnt) { - sprintf(rsn, "too few entries in fw file"); - goto err; - } - len += lens[a]; - } - - if (len != fw->size) { - sprintf(rsn, "bad length: %u (should be %u)", (u32)fw->size, - (u32)len); - goto err; - } - - ptr += MOXA_FW_HDRLEN; - lenp = 0; /* bios */ - - strcpy(rsn, "read above"); - - ret = moxa_load_bios(brd, ptr, lens[lenp]); - if (ret) - goto err; - - /* we skip the tty section (lens[1]), since we don't need it */ - ptr += lens[lenp] + lens[lenp + 1]; - lenp += 2; /* comm */ - - if (hdr->model == 2) { - ret = moxa_load_320b(brd, ptr, lens[lenp]); - if (ret) - goto err; - /* skip another tty */ - ptr += lens[lenp] + lens[lenp + 1]; - lenp += 2; - } - - ret = moxa_load_code(brd, ptr, lens[lenp]); - if (ret) - goto err; - - return 0; -err: - printk(KERN_ERR "firmware failed to load, reason: %s\n", rsn); - return ret; -} - -static int moxa_init_board(struct moxa_board_conf *brd, struct device *dev) -{ - const struct firmware *fw; - const char *file; - struct moxa_port *p; - unsigned int i; - int ret; - - brd->ports = kcalloc(MAX_PORTS_PER_BOARD, sizeof(*brd->ports), - GFP_KERNEL); - if (brd->ports == NULL) { - printk(KERN_ERR "cannot allocate memory for ports\n"); - ret = -ENOMEM; - goto err; - } - - for (i = 0, p = brd->ports; i < MAX_PORTS_PER_BOARD; i++, p++) { - p->type = PORT_16550A; - p->close_delay = 5 * HZ / 10; - p->cflag = B9600 | CS8 | CREAD | CLOCAL | HUPCL; - init_waitqueue_head(&p->open_wait); - } - - switch (brd->boardType) { - case MOXA_BOARD_C218_ISA: - case MOXA_BOARD_C218_PCI: - file = "c218tunx.cod"; - break; - case MOXA_BOARD_CP204J: - file = "cp204unx.cod"; - break; - default: - file = "c320tunx.cod"; - break; - } - - ret = request_firmware(&fw, file, dev); - if (ret) { - printk(KERN_ERR "MOXA: request_firmware failed. Make sure " - "you've placed '%s' file into your firmware " - "loader directory (e.g. /lib/firmware)\n", - file); - goto err_free; - } - - ret = moxa_load_fw(brd, fw); - - release_firmware(fw); - - if (ret) - goto err_free; - - spin_lock_bh(&moxa_lock); - brd->ready = 1; - if (!timer_pending(&moxaTimer)) - mod_timer(&moxaTimer, jiffies + HZ / 50); - spin_unlock_bh(&moxa_lock); - - return 0; -err_free: - kfree(brd->ports); -err: - return ret; -} - -static void moxa_board_deinit(struct moxa_board_conf *brd) -{ - unsigned int a, opened; - - mutex_lock(&moxa_openlock); - spin_lock_bh(&moxa_lock); - brd->ready = 0; - spin_unlock_bh(&moxa_lock); - - /* pci hot-un-plug support */ - for (a = 0; a < brd->numPorts; a++) - if (brd->ports[a].asyncflags & ASYNC_INITIALIZED) - tty_hangup(brd->ports[a].tty); - while (1) { - opened = 0; - for (a = 0; a < brd->numPorts; a++) - if (brd->ports[a].asyncflags & ASYNC_INITIALIZED) - opened++; - mutex_unlock(&moxa_openlock); - if (!opened) - break; - msleep(50); - mutex_lock(&moxa_openlock); - } - - iounmap(brd->basemem); - brd->basemem = NULL; - kfree(brd->ports); -} - -#ifdef CONFIG_PCI -static int __devinit moxa_pci_probe(struct pci_dev *pdev, - const struct pci_device_id *ent) -{ - struct moxa_board_conf *board; - unsigned int i; - int board_type = ent->driver_data; - int retval; - - retval = pci_enable_device(pdev); - if (retval) { - dev_err(&pdev->dev, "can't enable pci device\n"); - goto err; - } - - for (i = 0; i < MAX_BOARDS; i++) - if (moxa_boards[i].basemem == NULL) - break; - - retval = -ENODEV; - if (i >= MAX_BOARDS) { - dev_warn(&pdev->dev, "more than %u MOXA Intellio family boards " - "found. Board is ignored.\n", MAX_BOARDS); - goto err; - } - - board = &moxa_boards[i]; - - retval = pci_request_region(pdev, 2, "moxa-base"); - if (retval) { - dev_err(&pdev->dev, "can't request pci region 2\n"); - goto err; - } - - board->basemem = ioremap_nocache(pci_resource_start(pdev, 2), 0x4000); - if (board->basemem == NULL) { - dev_err(&pdev->dev, "can't remap io space 2\n"); - goto err_reg; - } - - board->boardType = board_type; - switch (board_type) { - case MOXA_BOARD_C218_ISA: - case MOXA_BOARD_C218_PCI: - board->numPorts = 8; - break; - - case MOXA_BOARD_CP204J: - board->numPorts = 4; - break; - default: - board->numPorts = 0; - break; - } - board->busType = MOXA_BUS_TYPE_PCI; - - retval = moxa_init_board(board, &pdev->dev); - if (retval) - goto err_base; - - pci_set_drvdata(pdev, board); - - dev_info(&pdev->dev, "board '%s' ready (%u ports, firmware loaded)\n", - moxa_brdname[board_type - 1], board->numPorts); - - return 0; -err_base: - iounmap(board->basemem); - board->basemem = NULL; -err_reg: - pci_release_region(pdev, 2); -err: - return retval; -} - -static void __devexit moxa_pci_remove(struct pci_dev *pdev) -{ - struct moxa_board_conf *brd = pci_get_drvdata(pdev); - - moxa_board_deinit(brd); - - pci_release_region(pdev, 2); -} - -static struct pci_driver moxa_pci_driver = { - .name = "moxa", - .id_table = moxa_pcibrds, - .probe = moxa_pci_probe, - .remove = __devexit_p(moxa_pci_remove) -}; -#endif /* CONFIG_PCI */ - -static int __init moxa_init(void) -{ - unsigned int isabrds = 0; - int retval = 0; - - printk(KERN_INFO "MOXA Intellio family driver version %s\n", - MOXA_VERSION); - moxaDriver = alloc_tty_driver(MAX_PORTS + 1); - if (!moxaDriver) - return -ENOMEM; - - moxaDriver->owner = THIS_MODULE; - moxaDriver->name = "ttyMX"; - moxaDriver->major = ttymajor; - moxaDriver->minor_start = 0; - moxaDriver->type = TTY_DRIVER_TYPE_SERIAL; - moxaDriver->subtype = SERIAL_TYPE_NORMAL; - moxaDriver->init_termios = tty_std_termios; - moxaDriver->init_termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL | HUPCL; - moxaDriver->init_termios.c_ispeed = 9600; - moxaDriver->init_termios.c_ospeed = 9600; - moxaDriver->flags = TTY_DRIVER_REAL_RAW; - tty_set_operations(moxaDriver, &moxa_ops); - - if (tty_register_driver(moxaDriver)) { - printk(KERN_ERR "can't register MOXA Smartio tty driver!\n"); - put_tty_driver(moxaDriver); - return -1; - } - - /* Find the boards defined from module args. */ -#ifdef MODULE - { - struct moxa_board_conf *brd = moxa_boards; - unsigned int i; - for (i = 0; i < MAX_BOARDS; i++) { - if (!baseaddr[i]) - break; - if (type[i] == MOXA_BOARD_C218_ISA || - type[i] == MOXA_BOARD_C320_ISA) { - pr_debug("Moxa board %2d: %s board(baseAddr=%lx)\n", - isabrds + 1, moxa_brdname[type[i] - 1], - baseaddr[i]); - brd->boardType = type[i]; - brd->numPorts = type[i] == MOXA_BOARD_C218_ISA ? 8 : - numports[i]; - brd->busType = MOXA_BUS_TYPE_ISA; - brd->basemem = ioremap_nocache(baseaddr[i], 0x4000); - if (!brd->basemem) { - printk(KERN_ERR "MOXA: can't remap %lx\n", - baseaddr[i]); - continue; - } - if (moxa_init_board(brd, NULL)) { - iounmap(brd->basemem); - brd->basemem = NULL; - continue; - } - - printk(KERN_INFO "MOXA isa board found at 0x%.8lu and " - "ready (%u ports, firmware loaded)\n", - baseaddr[i], brd->numPorts); - - brd++; - isabrds++; - } - } - } -#endif - -#ifdef CONFIG_PCI - retval = pci_register_driver(&moxa_pci_driver); - if (retval) { - printk(KERN_ERR "Can't register MOXA pci driver!\n"); - if (isabrds) - retval = 0; - } -#endif - - return retval; -} - -static void __exit moxa_exit(void) -{ - unsigned int i; + if (tty_unregister_driver(moxaDriver)) + printk(KERN_ERR "Couldn't unregister MOXA Intellio family " + "serial driver\n"); + put_tty_driver(moxaDriver); #ifdef CONFIG_PCI pci_unregister_driver(&moxa_pci_driver); #endif - for (i = 0; i < MAX_BOARDS; i++) /* ISA boards */ - if (moxa_boards[i].ready) - moxa_board_deinit(&moxa_boards[i]); - - del_timer_sync(&moxaTimer); - - if (tty_unregister_driver(moxaDriver)) - printk(KERN_ERR "Couldn't unregister MOXA Intellio family " - "serial driver\n"); - put_tty_driver(moxaDriver); + for (i = 0; i < MAX_BOARDS; i++) + if (moxa_boards[i].basemem) + iounmap(moxa_boards[i].basemem); } module_init(moxa_init); module_exit(moxa_exit); -static void moxa_close_port(struct moxa_port *ch) -{ - moxa_shut_down(ch); - MoxaPortFlushData(ch, 2); - ch->asyncflags &= ~ASYNC_NORMAL_ACTIVE; - ch->tty->driver_data = NULL; - ch->tty = NULL; -} - -static int moxa_block_till_ready(struct tty_struct *tty, struct file *filp, - struct moxa_port *ch) -{ - DEFINE_WAIT(wait); - int retval = 0; - u8 dcd; - - while (1) { - prepare_to_wait(&ch->open_wait, &wait, TASK_INTERRUPTIBLE); - if (tty_hung_up_p(filp)) { -#ifdef SERIAL_DO_RESTART - retval = -ERESTARTSYS; -#else - retval = -EAGAIN; -#endif - break; - } - spin_lock_bh(&moxa_lock); - dcd = ch->DCDState; - spin_unlock_bh(&moxa_lock); - if (dcd) - break; - - if (signal_pending(current)) { - retval = -ERESTARTSYS; - break; - } - schedule(); - } - finish_wait(&ch->open_wait, &wait); - - return retval; -} - static int moxa_open(struct tty_struct *tty, struct file *filp) { - struct moxa_board_conf *brd; struct moxa_port *ch; int port; int retval; port = tty->index; if (port == MAX_PORTS) { - return capable(CAP_SYS_ADMIN) ? 0 : -EPERM; + return (0); } - if (mutex_lock_interruptible(&moxa_openlock)) - return -ERESTARTSYS; - brd = &moxa_boards[port / MAX_PORTS_PER_BOARD]; - if (!brd->ready) { - mutex_unlock(&moxa_openlock); - return -ENODEV; + if (!MoxaPortIsValid(port)) { + tty->driver_data = NULL; + return (-ENODEV); } - ch = &brd->ports[port % MAX_PORTS_PER_BOARD]; + ch = &moxa_ports[port]; ch->count++; tty->driver_data = ch; ch->tty = tty; if (!(ch->asyncflags & ASYNC_INITIALIZED)) { ch->statusflags = 0; moxa_set_tty_param(tty, tty->termios); - MoxaPortLineCtrl(ch, 1, 1); - MoxaPortEnable(ch); - MoxaSetFifo(ch, ch->type == PORT_16550A); + MoxaPortLineCtrl(ch->port, 1, 1); + MoxaPortEnable(ch->port); ch->asyncflags |= ASYNC_INITIALIZED; } - mutex_unlock(&moxa_openlock); + retval = moxa_block_till_ready(tty, filp, ch); - retval = 0; - if (!(filp->f_flags & O_NONBLOCK) && !C_CLOCAL(tty)) - retval = moxa_block_till_ready(tty, filp, ch); - mutex_lock(&moxa_openlock); - if (retval) { - if (ch->count) /* 0 means already hung up... */ - if (--ch->count == 0) - moxa_close_port(ch); - } else - ch->asyncflags |= ASYNC_NORMAL_ACTIVE; - mutex_unlock(&moxa_openlock); + moxa_unthrottle(tty); - return retval; + if (ch->type == PORT_16550A) { + MoxaSetFifo(ch->port, 1); + } else { + MoxaSetFifo(ch->port, 0); + } + + return (retval); } static void moxa_close(struct tty_struct *tty, struct file *filp) @@ -1197,14 +524,23 @@ static void moxa_close(struct tty_struct *tty, struct file *filp) int port; port = tty->index; - if (port == MAX_PORTS || tty_hung_up_p(filp)) + if (port == MAX_PORTS) { + return; + } + if (!MoxaPortIsValid(port)) { + pr_debug("Invalid portno in moxa_close\n"); + tty->driver_data = NULL; return; + } + if (tty->driver_data == NULL) { + return; + } + if (tty_hung_up_p(filp)) { + return; + } + ch = (struct moxa_port *) tty->driver_data; - mutex_lock(&moxa_openlock); - ch = tty->driver_data; - if (ch == NULL) - goto unlock; - if (tty->count == 1 && ch->count != 1) { + if ((tty->count == 1) && (ch->count != 1)) { printk(KERN_WARNING "moxa_close: bad serial port count; " "tty->count is 1, ch->count is %d\n", ch->count); ch->count = 1; @@ -1214,35 +550,59 @@ static void moxa_close(struct tty_struct *tty, struct file *filp) "device=%s\n", tty->name); ch->count = 0; } - if (ch->count) - goto unlock; + if (ch->count) { + return; + } + ch->asyncflags |= ASYNC_CLOSING; ch->cflag = tty->termios->c_cflag; if (ch->asyncflags & ASYNC_INITIALIZED) { moxa_setup_empty_event(tty); tty_wait_until_sent(tty, 30 * HZ); /* 30 seconds timeout */ + del_timer_sync(&moxa_ports[ch->port].emptyTimer); } - - moxa_close_port(ch); -unlock: - mutex_unlock(&moxa_openlock); + moxa_shut_down(ch); + MoxaPortFlushData(port, 2); + + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); + tty_ldisc_flush(tty); + + tty->closing = 0; + ch->event = 0; + ch->tty = NULL; + if (ch->blocked_open) { + if (ch->close_delay) { + msleep_interruptible(jiffies_to_msecs(ch->close_delay)); + } + wake_up_interruptible(&ch->open_wait); + } + ch->asyncflags &= ~(ASYNC_NORMAL_ACTIVE | ASYNC_CLOSING); + complete_all(&ch->close_wait); } static int moxa_write(struct tty_struct *tty, const unsigned char *buf, int count) { - struct moxa_port *ch = tty->driver_data; - int len; + struct moxa_port *ch; + int len, port; + unsigned long flags; + ch = (struct moxa_port *) tty->driver_data; if (ch == NULL) - return 0; + return (0); + port = ch->port; - spin_lock_bh(&moxa_lock); - len = MoxaPortWriteData(ch, buf, count); - spin_unlock_bh(&moxa_lock); + spin_lock_irqsave(&moxa_lock, flags); + len = MoxaPortWriteData(port, (unsigned char *) buf, count); + spin_unlock_irqrestore(&moxa_lock, flags); + /********************************************* + if ( !(ch->statusflags & LOWWAIT) && + ((len != count) || (MoxaPortTxFree(port) <= 100)) ) + ************************************************/ ch->statusflags |= LOWWAIT; - return len; + return (len); } static int moxa_write_room(struct tty_struct *tty) @@ -1250,27 +610,27 @@ static int moxa_write_room(struct tty_struct *tty) struct moxa_port *ch; if (tty->stopped) - return 0; - ch = tty->driver_data; + return (0); + ch = (struct moxa_port *) tty->driver_data; if (ch == NULL) - return 0; - return MoxaPortTxFree(ch); + return (0); + return (MoxaPortTxFree(ch->port)); } static void moxa_flush_buffer(struct tty_struct *tty) { - struct moxa_port *ch = tty->driver_data; + struct moxa_port *ch = (struct moxa_port *) tty->driver_data; if (ch == NULL) return; - MoxaPortFlushData(ch, 1); + MoxaPortFlushData(ch->port, 1); tty_wakeup(tty); } static int moxa_chars_in_buffer(struct tty_struct *tty) { - struct moxa_port *ch = tty->driver_data; int chars; + struct moxa_port *ch = (struct moxa_port *) tty->driver_data; /* * Sigh...I have to check if driver_data is NULL here, because @@ -1279,9 +639,8 @@ static int moxa_chars_in_buffer(struct tty_struct *tty) * routine. And since the open() failed, we return 0 here. TDJ */ if (ch == NULL) - return 0; - lock_kernel(); - chars = MoxaPortTxQueue(ch); + return (0); + chars = MoxaPortTxQueue(ch->port); if (chars) { /* * Make it possible to wakeup anything waiting for output @@ -1290,54 +649,73 @@ static int moxa_chars_in_buffer(struct tty_struct *tty) if (!(ch->statusflags & EMPTYWAIT)) moxa_setup_empty_event(tty); } - unlock_kernel(); - return chars; + return (chars); } -static int moxa_tiocmget(struct tty_struct *tty, struct file *file) +static void moxa_flush_chars(struct tty_struct *tty) +{ + /* + * Don't think I need this, because this is called to empty the TX + * buffer for the 16450, 16550, etc. + */ +} + +static void moxa_put_char(struct tty_struct *tty, unsigned char c) { struct moxa_port *ch; + int port; + unsigned long flags; + + ch = (struct moxa_port *) tty->driver_data; + if (ch == NULL) + return; + port = ch->port; + spin_lock_irqsave(&moxa_lock, flags); + MoxaPortWriteData(port, &c, 1); + spin_unlock_irqrestore(&moxa_lock, flags); + /************************************************ + if ( !(ch->statusflags & LOWWAIT) && (MoxaPortTxFree(port) <= 100) ) + *************************************************/ + ch->statusflags |= LOWWAIT; +} + +static int moxa_tiocmget(struct tty_struct *tty, struct file *file) +{ + struct moxa_port *ch = (struct moxa_port *) tty->driver_data; + int port; int flag = 0, dtr, rts; - mutex_lock(&moxa_openlock); - ch = tty->driver_data; - if (!ch) { - mutex_unlock(&moxa_openlock); - return -EINVAL; - } + port = tty->index; + if ((port != MAX_PORTS) && (!ch)) + return (-EINVAL); - MoxaPortGetLineOut(ch, &dtr, &rts); + MoxaPortGetLineOut(ch->port, &dtr, &rts); if (dtr) flag |= TIOCM_DTR; if (rts) flag |= TIOCM_RTS; - dtr = MoxaPortLineStatus(ch); + dtr = MoxaPortLineStatus(ch->port); if (dtr & 1) flag |= TIOCM_CTS; if (dtr & 2) flag |= TIOCM_DSR; if (dtr & 4) flag |= TIOCM_CD; - mutex_unlock(&moxa_openlock); return flag; } static int moxa_tiocmset(struct tty_struct *tty, struct file *file, unsigned int set, unsigned int clear) { - struct moxa_port *ch; + struct moxa_port *ch = (struct moxa_port *) tty->driver_data; int port; int dtr, rts; port = tty->index; - mutex_lock(&moxa_openlock); - ch = tty->driver_data; - if (!ch) { - mutex_unlock(&moxa_openlock); - return -EINVAL; - } + if ((port != MAX_PORTS) && (!ch)) + return (-EINVAL); - MoxaPortGetLineOut(ch, &dtr, &rts); + MoxaPortGetLineOut(ch->port, &dtr, &rts); if (set & TIOCM_RTS) rts = 1; if (set & TIOCM_DTR) @@ -1346,51 +724,105 @@ static int moxa_tiocmset(struct tty_struct *tty, struct file *file, rts = 0; if (clear & TIOCM_DTR) dtr = 0; - MoxaPortLineCtrl(ch, dtr, rts); - mutex_unlock(&moxa_openlock); + MoxaPortLineCtrl(ch->port, dtr, rts); return 0; } +static int moxa_ioctl(struct tty_struct *tty, struct file *file, + unsigned int cmd, unsigned long arg) +{ + struct moxa_port *ch = (struct moxa_port *) tty->driver_data; + register int port; + void __user *argp = (void __user *)arg; + int retval; + + port = tty->index; + if ((port != MAX_PORTS) && (!ch)) + return (-EINVAL); + + switch (cmd) { + case TCSBRK: /* SVID version: non-zero arg --> no break */ + retval = tty_check_change(tty); + if (retval) + return (retval); + moxa_setup_empty_event(tty); + tty_wait_until_sent(tty, 0); + if (!arg) + MoxaPortSendBreak(ch->port, 0); + return (0); + case TCSBRKP: /* support for POSIX tcsendbreak() */ + retval = tty_check_change(tty); + if (retval) + return (retval); + moxa_setup_empty_event(tty); + tty_wait_until_sent(tty, 0); + MoxaPortSendBreak(ch->port, arg); + return (0); + case TIOCGSOFTCAR: + return put_user(C_CLOCAL(tty) ? 1 : 0, (unsigned long __user *) argp); + case TIOCSSOFTCAR: + if(get_user(retval, (unsigned long __user *) argp)) + return -EFAULT; + arg = retval; + tty->termios->c_cflag = ((tty->termios->c_cflag & ~CLOCAL) | + (arg ? CLOCAL : 0)); + if (C_CLOCAL(tty)) + ch->asyncflags &= ~ASYNC_CHECK_CD; + else + ch->asyncflags |= ASYNC_CHECK_CD; + return (0); + case TIOCGSERIAL: + return moxa_get_serial_info(ch, argp); + + case TIOCSSERIAL: + return moxa_set_serial_info(ch, argp); + default: + retval = MoxaDriverIoctl(cmd, arg, port); + } + return (retval); +} + static void moxa_throttle(struct tty_struct *tty) { - struct moxa_port *ch = tty->driver_data; + struct moxa_port *ch = (struct moxa_port *) tty->driver_data; ch->statusflags |= THROTTLE; } static void moxa_unthrottle(struct tty_struct *tty) { - struct moxa_port *ch = tty->driver_data; + struct moxa_port *ch = (struct moxa_port *) tty->driver_data; ch->statusflags &= ~THROTTLE; } static void moxa_set_termios(struct tty_struct *tty, - struct ktermios *old_termios) + struct ktermios *old_termios) { - struct moxa_port *ch = tty->driver_data; + struct moxa_port *ch = (struct moxa_port *) tty->driver_data; if (ch == NULL) return; moxa_set_tty_param(tty, old_termios); - if (!(old_termios->c_cflag & CLOCAL) && C_CLOCAL(tty)) + if (!(old_termios->c_cflag & CLOCAL) && + (tty->termios->c_cflag & CLOCAL)) wake_up_interruptible(&ch->open_wait); } static void moxa_stop(struct tty_struct *tty) { - struct moxa_port *ch = tty->driver_data; + struct moxa_port *ch = (struct moxa_port *) tty->driver_data; if (ch == NULL) return; - MoxaPortTxDisable(ch); + MoxaPortTxDisable(ch->port); ch->statusflags |= TXSTOPPED; } static void moxa_start(struct tty_struct *tty) { - struct moxa_port *ch = tty->driver_data; + struct moxa_port *ch = (struct moxa_port *) tty->driver_data; if (ch == NULL) return; @@ -1398,143 +830,91 @@ static void moxa_start(struct tty_struct *tty) if (!(ch->statusflags & TXSTOPPED)) return; - MoxaPortTxEnable(ch); + MoxaPortTxEnable(ch->port); ch->statusflags &= ~TXSTOPPED; } static void moxa_hangup(struct tty_struct *tty) { - struct moxa_port *ch; + struct moxa_port *ch = (struct moxa_port *) tty->driver_data; - mutex_lock(&moxa_openlock); - ch = tty->driver_data; - if (ch == NULL) { - mutex_unlock(&moxa_openlock); - return; - } + moxa_flush_buffer(tty); + moxa_shut_down(ch); + ch->event = 0; ch->count = 0; - moxa_close_port(ch); - mutex_unlock(&moxa_openlock); - - wake_up_interruptible(&ch->open_wait); -} - -static void moxa_new_dcdstate(struct moxa_port *p, u8 dcd) -{ - dcd = !!dcd; - - if (dcd != p->DCDState && p->tty && C_CLOCAL(p->tty)) { - if (!dcd) - tty_hangup(p->tty); - } - p->DCDState = dcd; -} - -static int moxa_poll_port(struct moxa_port *p, unsigned int handle, - u16 __iomem *ip) -{ - struct tty_struct *tty = p->tty; - void __iomem *ofsAddr; - unsigned int inited = p->asyncflags & ASYNC_INITIALIZED; - u16 intr; - - if (tty) { - if ((p->statusflags & EMPTYWAIT) && - MoxaPortTxQueue(p) == 0) { - p->statusflags &= ~EMPTYWAIT; - tty_wakeup(tty); - } - if ((p->statusflags & LOWWAIT) && !tty->stopped && - MoxaPortTxQueue(p) <= WAKEUP_CHARS) { - p->statusflags &= ~LOWWAIT; - tty_wakeup(tty); - } - - if (inited && !(p->statusflags & THROTTLE) && - MoxaPortRxQueue(p) > 0) { /* RX */ - MoxaPortReadData(p); - tty_schedule_flip(tty); - } - } else { - p->statusflags &= ~EMPTYWAIT; - MoxaPortFlushData(p, 0); /* flush RX */ - } - - if (!handle) /* nothing else to do */ - return 0; - - intr = readw(ip); /* port irq status */ - if (intr == 0) - return 0; - - writew(0, ip); /* ACK port */ - ofsAddr = p->tableAddr; - if (intr & IntrTx) /* disable tx intr */ - writew(readw(ofsAddr + HostStat) & ~WakeupTx, - ofsAddr + HostStat); - - if (!inited) - return 0; - - if (tty && (intr & IntrBreak) && !I_IGNBRK(tty)) { /* BREAK */ - tty_insert_flip_char(tty, 0, TTY_BREAK); - tty_schedule_flip(tty); - } - - if (intr & IntrLine) - moxa_new_dcdstate(p, readb(ofsAddr + FlagStat) & DCD_state); - - return 0; + ch->asyncflags &= ~ASYNC_NORMAL_ACTIVE; + ch->tty = NULL; + wake_up_interruptible(&ch->open_wait); } static void moxa_poll(unsigned long ignored) { - struct moxa_board_conf *brd; - u16 __iomem *ip; - unsigned int card, port, served = 0; + register int card; + struct moxa_port *ch; + struct tty_struct *tp; + int i, ports; + + del_timer(&moxaTimer); - spin_lock(&moxa_lock); + if (MoxaDriverPoll() < 0) { + mod_timer(&moxaTimer, jiffies + HZ / 50); + return; + } for (card = 0; card < MAX_BOARDS; card++) { - brd = &moxa_boards[card]; - if (!brd->ready) + if ((ports = MoxaPortsOfCard(card)) <= 0) continue; - - served++; - - ip = NULL; - if (readb(brd->intPend) == 0xff) - ip = brd->intTable + readb(brd->intNdx); - - for (port = 0; port < brd->numPorts; port++) - moxa_poll_port(&brd->ports[port], !!ip, ip + port); - - if (ip) - writeb(0, brd->intPend); /* ACK */ - - if (moxaLowWaterChk) { - struct moxa_port *p = brd->ports; - for (port = 0; port < brd->numPorts; port++, p++) - if (p->lowChkFlag) { - p->lowChkFlag = 0; - moxa_low_water_check(p->tableAddr); + ch = &moxa_ports[card * MAX_PORTS_PER_BOARD]; + for (i = 0; i < ports; i++, ch++) { + if ((ch->asyncflags & ASYNC_INITIALIZED) == 0) + continue; + if (!(ch->statusflags & THROTTLE) && + (MoxaPortRxQueue(ch->port) > 0)) + moxa_receive_data(ch); + if ((tp = ch->tty) == 0) + continue; + if (ch->statusflags & LOWWAIT) { + if (MoxaPortTxQueue(ch->port) <= WAKEUP_CHARS) { + if (!tp->stopped) { + ch->statusflags &= ~LOWWAIT; + tty_wakeup(tp); + } + } + } + if (!I_IGNBRK(tp) && (MoxaPortResetBrkCnt(ch->port) > 0)) { + tty_insert_flip_char(tp, 0, TTY_BREAK); + tty_schedule_flip(tp); + } + if (MoxaPortDCDChange(ch->port)) { + if (ch->asyncflags & ASYNC_CHECK_CD) { + if (MoxaPortDCDON(ch->port)) + wake_up_interruptible(&ch->open_wait); + else { + tty_hangup(tp); + wake_up_interruptible(&ch->open_wait); + ch->asyncflags &= ~ASYNC_NORMAL_ACTIVE; + } } + } } } - moxaLowWaterChk = 0; - if (served) - mod_timer(&moxaTimer, jiffies + HZ / 50); - spin_unlock(&moxa_lock); + mod_timer(&moxaTimer, jiffies + HZ / 50); } /******************************************************************************/ static void moxa_set_tty_param(struct tty_struct *tty, struct ktermios *old_termios) { - register struct ktermios *ts = tty->termios; - struct moxa_port *ch = tty->driver_data; + register struct ktermios *ts; + struct moxa_port *ch; int rts, cts, txflow, rxflow, xany, baud; + ch = (struct moxa_port *) tty->driver_data; + ts = tty->termios; + if (ts->c_cflag & CLOCAL) + ch->asyncflags &= ~ASYNC_CHECK_CD; + else + ch->asyncflags |= ASYNC_CHECK_CD; rts = cts = txflow = rxflow = xany = 0; if (ts->c_cflag & CRTSCTS) rts = cts = 1; @@ -1547,60 +927,776 @@ static void moxa_set_tty_param(struct tty_struct *tty, struct ktermios *old_term /* Clear the features we don't support */ ts->c_cflag &= ~CMSPAR; - MoxaPortFlowCtrl(ch, rts, cts, txflow, rxflow, xany); - baud = MoxaPortSetTermio(ch, ts, tty_get_baud_rate(tty)); + MoxaPortFlowCtrl(ch->port, rts, cts, txflow, rxflow, xany); + baud = MoxaPortSetTermio(ch->port, ts, tty_get_baud_rate(tty)); if (baud == -1) baud = tty_termios_baud_rate(old_termios); /* Not put the baud rate into the termios data */ tty_encode_baud_rate(tty, baud, baud); } +static int moxa_block_till_ready(struct tty_struct *tty, struct file *filp, + struct moxa_port *ch) +{ + DECLARE_WAITQUEUE(wait,current); + unsigned long flags; + int retval; + int do_clocal = C_CLOCAL(tty); + + /* + * If the device is in the middle of being closed, then block + * until it's done, and then try again. + */ + if (tty_hung_up_p(filp) || (ch->asyncflags & ASYNC_CLOSING)) { + if (ch->asyncflags & ASYNC_CLOSING) + wait_for_completion_interruptible(&ch->close_wait); +#ifdef SERIAL_DO_RESTART + if (ch->asyncflags & ASYNC_HUP_NOTIFY) + return (-EAGAIN); + else + return (-ERESTARTSYS); +#else + return (-EAGAIN); +#endif + } + /* + * If non-blocking mode is set, then make the check up front + * and then exit. + */ + if (filp->f_flags & O_NONBLOCK) { + ch->asyncflags |= ASYNC_NORMAL_ACTIVE; + return (0); + } + /* + * Block waiting for the carrier detect and the line to become free + */ + retval = 0; + add_wait_queue(&ch->open_wait, &wait); + pr_debug("block_til_ready before block: ttys%d, count = %d\n", + ch->port, ch->count); + spin_lock_irqsave(&moxa_lock, flags); + if (!tty_hung_up_p(filp)) + ch->count--; + ch->blocked_open++; + spin_unlock_irqrestore(&moxa_lock, flags); + + while (1) { + set_current_state(TASK_INTERRUPTIBLE); + if (tty_hung_up_p(filp) || + !(ch->asyncflags & ASYNC_INITIALIZED)) { +#ifdef SERIAL_DO_RESTART + if (ch->asyncflags & ASYNC_HUP_NOTIFY) + retval = -EAGAIN; + else + retval = -ERESTARTSYS; +#else + retval = -EAGAIN; +#endif + break; + } + if (!(ch->asyncflags & ASYNC_CLOSING) && (do_clocal || + MoxaPortDCDON(ch->port))) + break; + + if (signal_pending(current)) { + retval = -ERESTARTSYS; + break; + } + schedule(); + } + set_current_state(TASK_RUNNING); + remove_wait_queue(&ch->open_wait, &wait); + + spin_lock_irqsave(&moxa_lock, flags); + if (!tty_hung_up_p(filp)) + ch->count++; + ch->blocked_open--; + spin_unlock_irqrestore(&moxa_lock, flags); + pr_debug("block_til_ready after blocking: ttys%d, count = %d\n", + ch->port, ch->count); + if (retval) + return (retval); + /* FIXME: review to see if we need to use set_bit on these */ + ch->asyncflags |= ASYNC_NORMAL_ACTIVE; + return 0; +} + static void moxa_setup_empty_event(struct tty_struct *tty) { struct moxa_port *ch = tty->driver_data; + unsigned long flags; - spin_lock_bh(&moxa_lock); + spin_lock_irqsave(&moxa_lock, flags); ch->statusflags |= EMPTYWAIT; - spin_unlock_bh(&moxa_lock); + mod_timer(&moxa_ports[ch->port].emptyTimer, jiffies + HZ); + spin_unlock_irqrestore(&moxa_lock, flags); +} + +static void moxa_check_xmit_empty(unsigned long data) +{ + struct moxa_port *ch; + + ch = (struct moxa_port *) data; + if (ch->tty && (ch->statusflags & EMPTYWAIT)) { + if (MoxaPortTxQueue(ch->port) == 0) { + ch->statusflags &= ~EMPTYWAIT; + tty_wakeup(ch->tty); + return; + } + mod_timer(&moxa_ports[ch->port].emptyTimer, + round_jiffies(jiffies + HZ)); + } else + ch->statusflags &= ~EMPTYWAIT; } static void moxa_shut_down(struct moxa_port *ch) { - struct tty_struct *tp = ch->tty; + struct tty_struct *tp; if (!(ch->asyncflags & ASYNC_INITIALIZED)) return; - MoxaPortDisable(ch); + tp = ch->tty; + + MoxaPortDisable(ch->port); /* * If we're a modem control device and HUPCL is on, drop RTS & DTR. */ - if (C_HUPCL(tp)) - MoxaPortLineCtrl(ch, 0, 0); + if (tp->termios->c_cflag & HUPCL) + MoxaPortLineCtrl(ch->port, 0, 0); - spin_lock_bh(&moxa_lock); ch->asyncflags &= ~ASYNC_INITIALIZED; - spin_unlock_bh(&moxa_lock); } +static void moxa_receive_data(struct moxa_port *ch) +{ + struct tty_struct *tp; + struct ktermios *ts; + unsigned long flags; + + ts = NULL; + tp = ch->tty; + if (tp) + ts = tp->termios; + /************************************************** + if ( !tp || !ts || !(ts->c_cflag & CREAD) ) { + *****************************************************/ + if (!tp || !ts) { + MoxaPortFlushData(ch->port, 0); + return; + } + spin_lock_irqsave(&moxa_lock, flags); + MoxaPortReadData(ch->port, tp); + spin_unlock_irqrestore(&moxa_lock, flags); + tty_schedule_flip(tp); +} + +#define Magic_code 0x404 + +/* + * System Configuration + */ +/* + * for C218 BIOS initialization + */ +#define C218_ConfBase 0x800 +#define C218_status (C218_ConfBase + 0) /* BIOS running status */ +#define C218_diag (C218_ConfBase + 2) /* diagnostic status */ +#define C218_key (C218_ConfBase + 4) /* WORD (0x218 for C218) */ +#define C218DLoad_len (C218_ConfBase + 6) /* WORD */ +#define C218check_sum (C218_ConfBase + 8) /* BYTE */ +#define C218chksum_ok (C218_ConfBase + 0x0a) /* BYTE (1:ok) */ +#define C218_TestRx (C218_ConfBase + 0x10) /* 8 bytes for 8 ports */ +#define C218_TestTx (C218_ConfBase + 0x18) /* 8 bytes for 8 ports */ +#define C218_RXerr (C218_ConfBase + 0x20) /* 8 bytes for 8 ports */ +#define C218_ErrFlag (C218_ConfBase + 0x28) /* 8 bytes for 8 ports */ + +#define C218_LoadBuf 0x0F00 +#define C218_KeyCode 0x218 +#define CP204J_KeyCode 0x204 + +/* + * for C320 BIOS initialization + */ +#define C320_ConfBase 0x800 +#define C320_LoadBuf 0x0f00 +#define STS_init 0x05 /* for C320_status */ + +#define C320_status C320_ConfBase + 0 /* BIOS running status */ +#define C320_diag C320_ConfBase + 2 /* diagnostic status */ +#define C320_key C320_ConfBase + 4 /* WORD (0320H for C320) */ +#define C320DLoad_len C320_ConfBase + 6 /* WORD */ +#define C320check_sum C320_ConfBase + 8 /* WORD */ +#define C320chksum_ok C320_ConfBase + 0x0a /* WORD (1:ok) */ +#define C320bapi_len C320_ConfBase + 0x0c /* WORD */ +#define C320UART_no C320_ConfBase + 0x0e /* WORD */ + +#define C320_KeyCode 0x320 + +#define FixPage_addr 0x0000 /* starting addr of static page */ +#define DynPage_addr 0x2000 /* starting addr of dynamic page */ +#define C218_start 0x3000 /* starting addr of C218 BIOS prg */ +#define Control_reg 0x1ff0 /* select page and reset control */ +#define HW_reset 0x80 + +/* + * Function Codes + */ +#define FC_CardReset 0x80 +#define FC_ChannelReset 1 /* C320 firmware not supported */ +#define FC_EnableCH 2 +#define FC_DisableCH 3 +#define FC_SetParam 4 +#define FC_SetMode 5 +#define FC_SetRate 6 +#define FC_LineControl 7 +#define FC_LineStatus 8 +#define FC_XmitControl 9 +#define FC_FlushQueue 10 +#define FC_SendBreak 11 +#define FC_StopBreak 12 +#define FC_LoopbackON 13 +#define FC_LoopbackOFF 14 +#define FC_ClrIrqTable 15 +#define FC_SendXon 16 +#define FC_SetTermIrq 17 /* C320 firmware not supported */ +#define FC_SetCntIrq 18 /* C320 firmware not supported */ +#define FC_SetBreakIrq 19 +#define FC_SetLineIrq 20 +#define FC_SetFlowCtl 21 +#define FC_GenIrq 22 +#define FC_InCD180 23 +#define FC_OutCD180 24 +#define FC_InUARTreg 23 +#define FC_OutUARTreg 24 +#define FC_SetXonXoff 25 +#define FC_OutCD180CCR 26 +#define FC_ExtIQueue 27 +#define FC_ExtOQueue 28 +#define FC_ClrLineIrq 29 +#define FC_HWFlowCtl 30 +#define FC_GetClockRate 35 +#define FC_SetBaud 36 +#define FC_SetDataMode 41 +#define FC_GetCCSR 43 +#define FC_GetDataError 45 +#define FC_RxControl 50 +#define FC_ImmSend 51 +#define FC_SetXonState 52 +#define FC_SetXoffState 53 +#define FC_SetRxFIFOTrig 54 +#define FC_SetTxFIFOCnt 55 +#define FC_UnixRate 56 +#define FC_UnixResetTimer 57 + +#define RxFIFOTrig1 0 +#define RxFIFOTrig4 1 +#define RxFIFOTrig8 2 +#define RxFIFOTrig14 3 + +/* + * Dual-Ported RAM + */ +#define DRAM_global 0 +#define INT_data (DRAM_global + 0) +#define Config_base (DRAM_global + 0x108) + +#define IRQindex (INT_data + 0) +#define IRQpending (INT_data + 4) +#define IRQtable (INT_data + 8) + +/* + * Interrupt Status + */ +#define IntrRx 0x01 /* receiver data O.K. */ +#define IntrTx 0x02 /* transmit buffer empty */ +#define IntrFunc 0x04 /* function complete */ +#define IntrBreak 0x08 /* received break */ +#define IntrLine 0x10 /* line status change + for transmitter */ +#define IntrIntr 0x20 /* received INTR code */ +#define IntrQuit 0x40 /* received QUIT code */ +#define IntrEOF 0x80 /* received EOF code */ + +#define IntrRxTrigger 0x100 /* rx data count reach tigger value */ +#define IntrTxTrigger 0x200 /* tx data count below trigger value */ + +#define Magic_no (Config_base + 0) +#define Card_model_no (Config_base + 2) +#define Total_ports (Config_base + 4) +#define Module_cnt (Config_base + 8) +#define Module_no (Config_base + 10) +#define Timer_10ms (Config_base + 14) +#define Disable_IRQ (Config_base + 20) +#define TMS320_PORT1 (Config_base + 22) +#define TMS320_PORT2 (Config_base + 24) +#define TMS320_CLOCK (Config_base + 26) + +/* + * DATA BUFFER in DRAM + */ +#define Extern_table 0x400 /* Base address of the external table + (24 words * 64) total 3K bytes + (24 words * 128) total 6K bytes */ +#define Extern_size 0x60 /* 96 bytes */ +#define RXrptr 0x00 /* read pointer for RX buffer */ +#define RXwptr 0x02 /* write pointer for RX buffer */ +#define TXrptr 0x04 /* read pointer for TX buffer */ +#define TXwptr 0x06 /* write pointer for TX buffer */ +#define HostStat 0x08 /* IRQ flag and general flag */ +#define FlagStat 0x0A +#define FlowControl 0x0C /* B7 B6 B5 B4 B3 B2 B1 B0 */ + /* x x x x | | | | */ + /* | | | + CTS flow */ + /* | | +--- RTS flow */ + /* | +------ TX Xon/Xoff */ + /* +--------- RX Xon/Xoff */ +#define Break_cnt 0x0E /* received break count */ +#define CD180TXirq 0x10 /* if non-0: enable TX irq */ +#define RX_mask 0x12 +#define TX_mask 0x14 +#define Ofs_rxb 0x16 +#define Ofs_txb 0x18 +#define Page_rxb 0x1A +#define Page_txb 0x1C +#define EndPage_rxb 0x1E +#define EndPage_txb 0x20 +#define Data_error 0x22 +#define RxTrigger 0x28 +#define TxTrigger 0x2a + +#define rRXwptr 0x34 +#define Low_water 0x36 + +#define FuncCode 0x40 +#define FuncArg 0x42 +#define FuncArg1 0x44 + +#define C218rx_size 0x2000 /* 8K bytes */ +#define C218tx_size 0x8000 /* 32K bytes */ + +#define C218rx_mask (C218rx_size - 1) +#define C218tx_mask (C218tx_size - 1) + +#define C320p8rx_size 0x2000 +#define C320p8tx_size 0x8000 +#define C320p8rx_mask (C320p8rx_size - 1) +#define C320p8tx_mask (C320p8tx_size - 1) + +#define C320p16rx_size 0x2000 +#define C320p16tx_size 0x4000 +#define C320p16rx_mask (C320p16rx_size - 1) +#define C320p16tx_mask (C320p16tx_size - 1) + +#define C320p24rx_size 0x2000 +#define C320p24tx_size 0x2000 +#define C320p24rx_mask (C320p24rx_size - 1) +#define C320p24tx_mask (C320p24tx_size - 1) + +#define C320p32rx_size 0x1000 +#define C320p32tx_size 0x1000 +#define C320p32rx_mask (C320p32rx_size - 1) +#define C320p32tx_mask (C320p32tx_size - 1) + +#define Page_size 0x2000 +#define Page_mask (Page_size - 1) +#define C218rx_spage 3 +#define C218tx_spage 4 +#define C218rx_pageno 1 +#define C218tx_pageno 4 +#define C218buf_pageno 5 + +#define C320p8rx_spage 3 +#define C320p8tx_spage 4 +#define C320p8rx_pgno 1 +#define C320p8tx_pgno 4 +#define C320p8buf_pgno 5 + +#define C320p16rx_spage 3 +#define C320p16tx_spage 4 +#define C320p16rx_pgno 1 +#define C320p16tx_pgno 2 +#define C320p16buf_pgno 3 + +#define C320p24rx_spage 3 +#define C320p24tx_spage 4 +#define C320p24rx_pgno 1 +#define C320p24tx_pgno 1 +#define C320p24buf_pgno 2 + +#define C320p32rx_spage 3 +#define C320p32tx_ofs C320p32rx_size +#define C320p32tx_spage 3 +#define C320p32buf_pgno 1 + +/* + * Host Status + */ +#define WakeupRx 0x01 +#define WakeupTx 0x02 +#define WakeupBreak 0x08 +#define WakeupLine 0x10 +#define WakeupIntr 0x20 +#define WakeupQuit 0x40 +#define WakeupEOF 0x80 /* used in VTIME control */ +#define WakeupRxTrigger 0x100 +#define WakeupTxTrigger 0x200 +/* + * Flag status + */ +#define Rx_over 0x01 +#define Xoff_state 0x02 +#define Tx_flowOff 0x04 +#define Tx_enable 0x08 +#define CTS_state 0x10 +#define DSR_state 0x20 +#define DCD_state 0x80 +/* + * FlowControl + */ +#define CTS_FlowCtl 1 +#define RTS_FlowCtl 2 +#define Tx_FlowCtl 4 +#define Rx_FlowCtl 8 +#define IXM_IXANY 0x10 + +#define LowWater 128 + +#define DTR_ON 1 +#define RTS_ON 2 +#define CTS_ON 1 +#define DSR_ON 2 +#define DCD_ON 8 + +/* mode definition */ +#define MX_CS8 0x03 +#define MX_CS7 0x02 +#define MX_CS6 0x01 +#define MX_CS5 0x00 + +#define MX_STOP1 0x00 +#define MX_STOP15 0x04 +#define MX_STOP2 0x08 + +#define MX_PARNONE 0x00 +#define MX_PAREVEN 0x40 +#define MX_PARODD 0xC0 + +/* + * Query + */ + +struct mon_str { + int tick; + int rxcnt[MAX_PORTS]; + int txcnt[MAX_PORTS]; +}; + +#define DCD_changed 0x01 +#define DCD_oldstate 0x80 + +static unsigned char moxaBuff[10240]; +static int moxaLowWaterChk; +static int moxaCard; +static struct mon_str moxaLog; +static int moxaFuncTout = HZ / 2; + +static void moxafunc(void __iomem *, int, ushort); +static void moxa_wait_finish(void __iomem *); +static void moxa_low_water_check(void __iomem *); +static int moxaloadbios(int, unsigned char __user *, int); +static int moxafindcard(int); +static int moxaload320b(int, unsigned char __user *, int); +static int moxaloadcode(int, unsigned char __user *, int); +static int moxaloadc218(int, void __iomem *, int); +static int moxaloadc320(int, void __iomem *, int, int *); + /***************************************************************************** * Driver level functions: * + * 1. MoxaDriverInit(void); * + * 2. MoxaDriverIoctl(unsigned int cmd, unsigned long arg, int port); * + * 3. MoxaDriverPoll(void); * *****************************************************************************/ +void MoxaDriverInit(void) +{ + struct moxa_port *p; + unsigned int i; + + moxaFuncTout = HZ / 2; /* 500 mini-seconds */ + moxaCard = 0; + moxaLog.tick = 0; + moxaLowWaterChk = 0; + for (i = 0; i < MAX_PORTS; i++) { + p = &moxa_ports[i]; + p->chkPort = 0; + p->lowChkFlag = 0; + p->lineCtrl = 0; + moxaLog.rxcnt[i] = 0; + moxaLog.txcnt[i] = 0; + } +} + +#define MOXA 0x400 +#define MOXA_GET_IQUEUE (MOXA + 1) /* get input buffered count */ +#define MOXA_GET_OQUEUE (MOXA + 2) /* get output buffered count */ +#define MOXA_INIT_DRIVER (MOXA + 6) /* moxaCard=0 */ +#define MOXA_LOAD_BIOS (MOXA + 9) /* download BIOS */ +#define MOXA_FIND_BOARD (MOXA + 10) /* Check if MOXA card exist? */ +#define MOXA_LOAD_C320B (MOXA + 11) /* download 320B firmware */ +#define MOXA_LOAD_CODE (MOXA + 12) /* download firmware */ +#define MOXA_GETDATACOUNT (MOXA + 23) +#define MOXA_GET_IOQUEUE (MOXA + 27) +#define MOXA_FLUSH_QUEUE (MOXA + 28) +#define MOXA_GET_CONF (MOXA + 35) /* configuration */ +#define MOXA_GET_MAJOR (MOXA + 63) +#define MOXA_GET_CUMAJOR (MOXA + 64) +#define MOXA_GETMSTATUS (MOXA + 65) + +struct dl_str { + char __user *buf; + int len; + int cardno; +}; + +static struct dl_str dltmp; -static void MoxaPortFlushData(struct moxa_port *port, int mode) +void MoxaPortFlushData(int port, int mode) { void __iomem *ofsAddr; - if (mode < 0 || mode > 2) + if ((mode < 0) || (mode > 2)) return; - ofsAddr = port->tableAddr; + ofsAddr = moxa_ports[port].tableAddr; moxafunc(ofsAddr, FC_FlushQueue, mode); if (mode != 1) { - port->lowChkFlag = 0; + moxa_ports[port].lowChkFlag = 0; moxa_low_water_check(ofsAddr); } } +int MoxaDriverIoctl(unsigned int cmd, unsigned long arg, int port) +{ + int i; + int status; + int MoxaPortTxQueue(int), MoxaPortRxQueue(int); + void __user *argp = (void __user *)arg; + + if (port == MAX_PORTS) { + if ((cmd != MOXA_GET_CONF) && (cmd != MOXA_INIT_DRIVER) && + (cmd != MOXA_LOAD_BIOS) && (cmd != MOXA_FIND_BOARD) && (cmd != MOXA_LOAD_C320B) && + (cmd != MOXA_LOAD_CODE) && (cmd != MOXA_GETDATACOUNT) && + (cmd != MOXA_GET_IOQUEUE) && (cmd != MOXA_GET_MAJOR) && + (cmd != MOXA_GET_CUMAJOR) && (cmd != MOXA_GETMSTATUS)) + return (-EINVAL); + } + switch (cmd) { + case MOXA_GET_CONF: + if(copy_to_user(argp, &moxa_boards, MAX_BOARDS * + sizeof(struct moxa_board_conf))) + return -EFAULT; + return (0); + case MOXA_INIT_DRIVER: + if ((int) arg == 0x404) + MoxaDriverInit(); + return (0); + case MOXA_GETDATACOUNT: + moxaLog.tick = jiffies; + if(copy_to_user(argp, &moxaLog, sizeof(struct mon_str))) + return -EFAULT; + return (0); + case MOXA_FLUSH_QUEUE: + MoxaPortFlushData(port, arg); + return (0); + case MOXA_GET_IOQUEUE: { + struct moxaq_str __user *argm = argp; + struct moxaq_str tmp; + + for (i = 0; i < MAX_PORTS; i++, argm++) { + memset(&tmp, 0, sizeof(tmp)); + if (moxa_ports[i].chkPort) { + tmp.inq = MoxaPortRxQueue(i); + tmp.outq = MoxaPortTxQueue(i); + } + if (copy_to_user(argm, &tmp, sizeof(tmp))) + return -EFAULT; + } + return (0); + } case MOXA_GET_OQUEUE: + i = MoxaPortTxQueue(port); + return put_user(i, (unsigned long __user *)argp); + case MOXA_GET_IQUEUE: + i = MoxaPortRxQueue(port); + return put_user(i, (unsigned long __user *)argp); + case MOXA_GET_MAJOR: + if(copy_to_user(argp, &ttymajor, sizeof(int))) + return -EFAULT; + return 0; + case MOXA_GET_CUMAJOR: + i = 0; + if(copy_to_user(argp, &i, sizeof(int))) + return -EFAULT; + return 0; + case MOXA_GETMSTATUS: { + struct mxser_mstatus __user *argm = argp; + struct mxser_mstatus tmp; + struct moxa_port *p; + + for (i = 0; i < MAX_PORTS; i++, argm++) { + p = &moxa_ports[i]; + memset(&tmp, 0, sizeof(tmp)); + if (!p->chkPort) { + goto copy; + } else { + status = MoxaPortLineStatus(p->port); + if (status & 1) + tmp.cts = 1; + if (status & 2) + tmp.dsr = 1; + if (status & 4) + tmp.dcd = 1; + } + + if (!p->tty || !p->tty->termios) + tmp.cflag = p->cflag; + else + tmp.cflag = p->tty->termios->c_cflag; +copy: + if (copy_to_user(argm, &tmp, sizeof(tmp))) + return -EFAULT; + } + return 0; + } default: + return (-ENOIOCTLCMD); + case MOXA_LOAD_BIOS: + case MOXA_FIND_BOARD: + case MOXA_LOAD_C320B: + case MOXA_LOAD_CODE: + if (!capable(CAP_SYS_RAWIO)) + return -EPERM; + break; + } + + if(copy_from_user(&dltmp, argp, sizeof(struct dl_str))) + return -EFAULT; + if(dltmp.cardno < 0 || dltmp.cardno >= MAX_BOARDS || dltmp.len < 0) + return -EINVAL; + + switch(cmd) + { + case MOXA_LOAD_BIOS: + i = moxaloadbios(dltmp.cardno, dltmp.buf, dltmp.len); + return (i); + case MOXA_FIND_BOARD: + return moxafindcard(dltmp.cardno); + case MOXA_LOAD_C320B: + moxaload320b(dltmp.cardno, dltmp.buf, dltmp.len); + default: /* to keep gcc happy */ + return (0); + case MOXA_LOAD_CODE: + i = moxaloadcode(dltmp.cardno, dltmp.buf, dltmp.len); + if (i == -1) + return (-EFAULT); + return (i); + + } +} + +int MoxaDriverPoll(void) +{ + struct moxa_board_conf *brd; + register ushort temp; + register int card; + void __iomem *ofsAddr; + void __iomem *ip; + int port, p, ports; + + if (moxaCard == 0) + return (-1); + for (card = 0; card < MAX_BOARDS; card++) { + brd = &moxa_boards[card]; + if (brd->loadstat == 0) + continue; + if ((ports = brd->numPorts) == 0) + continue; + if (readb(brd->intPend) == 0xff) { + ip = brd->intTable + readb(brd->intNdx); + p = card * MAX_PORTS_PER_BOARD; + ports <<= 1; + for (port = 0; port < ports; port += 2, p++) { + if ((temp = readw(ip + port)) != 0) { + writew(0, ip + port); + ofsAddr = moxa_ports[p].tableAddr; + if (temp & IntrTx) + writew(readw(ofsAddr + HostStat) & ~WakeupTx, ofsAddr + HostStat); + if (temp & IntrBreak) { + moxa_ports[p].breakCnt++; + } + if (temp & IntrLine) { + if (readb(ofsAddr + FlagStat) & DCD_state) { + if ((moxa_ports[p].DCDState & DCD_oldstate) == 0) + moxa_ports[p].DCDState = (DCD_oldstate | + DCD_changed); + } else { + if (moxa_ports[p].DCDState & DCD_oldstate) + moxa_ports[p].DCDState = DCD_changed; + } + } + } + } + writeb(0, brd->intPend); + } + if (moxaLowWaterChk) { + p = card * MAX_PORTS_PER_BOARD; + for (port = 0; port < ports; port++, p++) { + if (moxa_ports[p].lowChkFlag) { + moxa_ports[p].lowChkFlag = 0; + ofsAddr = moxa_ports[p].tableAddr; + moxa_low_water_check(ofsAddr); + } + } + } + } + moxaLowWaterChk = 0; + return (0); +} + +/***************************************************************************** + * Card level function: * + * 1. MoxaPortsOfCard(int cardno); * + *****************************************************************************/ +int MoxaPortsOfCard(int cardno) +{ + + if (moxa_boards[cardno].boardType == 0) + return (0); + return (moxa_boards[cardno].numPorts); +} + +/***************************************************************************** + * Port level functions: * + * 1. MoxaPortIsValid(int port); * + * 2. MoxaPortEnable(int port); * + * 3. MoxaPortDisable(int port); * + * 4. MoxaPortGetMaxBaud(int port); * + * 6. MoxaPortSetBaud(int port, long baud); * + * 8. MoxaPortSetTermio(int port, unsigned char *termio); * + * 9. MoxaPortGetLineOut(int port, int *dtrState, int *rtsState); * + * 10. MoxaPortLineCtrl(int port, int dtrState, int rtsState); * + * 11. MoxaPortFlowCtrl(int port, int rts, int cts, int rx, int tx,int xany); * + * 12. MoxaPortLineStatus(int port); * + * 13. MoxaPortDCDChange(int port); * + * 14. MoxaPortDCDON(int port); * + * 15. MoxaPortFlushData(int port, int mode); * + * 16. MoxaPortWriteData(int port, unsigned char * buffer, int length); * + * 17. MoxaPortReadData(int port, struct tty_struct *tty); * + * 20. MoxaPortTxQueue(int port); * + * 21. MoxaPortTxFree(int port); * + * 22. MoxaPortRxQueue(int port); * + * 24. MoxaPortTxDisable(int port); * + * 25. MoxaPortTxEnable(int port); * + * 27. MoxaPortResetBrkCnt(int port); * + * 30. MoxaPortSendBreak(int port, int ticks); * + *****************************************************************************/ /* * Moxa Port Number Description: * @@ -1637,6 +1733,33 @@ static void MoxaPortFlushData(struct moxa_port *port, int mode) * -ENOIOCTLCMD * * + * Function 3: Moxa driver polling process routine. + * Syntax: + * int MoxaDriverPoll(void); + * + * return: 0 ; polling O.K. + * -1 : no any Moxa card. + * + * + * Function 4: Get the ports of this card. + * Syntax: + * int MoxaPortsOfCard(int cardno); + * + * int cardno : card number (0 - 3) + * + * return: 0 : this card is invalid + * 8/16/24/32 + * + * + * Function 5: Check this port is valid or invalid + * Syntax: + * int MoxaPortIsValid(int port); + * int port : port number (0 - 127, ref port description) + * + * return: 0 : this port is invalid + * 1 : this port is valid + * + * * Function 6: Enable this port to start Tx/Rx data. * Syntax: * void MoxaPortEnable(int port); @@ -1649,9 +1772,18 @@ static void MoxaPortFlushData(struct moxa_port *port, int mode) * int port : port number (0 - 127) * * + * Function 8: Get the maximun available baud rate of this port. + * Syntax: + * long MoxaPortGetMaxBaud(int port); + * int port : port number (0 - 127) + * + * return: 0 : this port is invalid + * 38400/57600/115200 bps + * + * * Function 10: Setting baud rate of this port. * Syntax: - * speed_t MoxaPortSetBaud(int port, speed_t baud); + * long MoxaPortSetBaud(int port, long baud); * int port : port number (0 - 127) * long baud : baud rate (50 - 115200) * @@ -1718,6 +1850,25 @@ static void MoxaPortFlushData(struct moxa_port *port, int mode) * Bit 2 - DCD state (0: off, 1: on) * * + * Function 17: Check the DCD state has changed since the last read + * of this function. + * Syntax: + * int MoxaPortDCDChange(int port); + * int port : port number (0 - 127) + * + * return: 0 : no changed + * 1 : DCD has changed + * + * + * Function 18: Check ths current DCD state is ON or not. + * Syntax: + * int MoxaPortDCDON(int port); + * int port : port number (0 - 127) + * + * return: 0 : DCD off + * 1 : DCD on + * + * * Function 19: Flush the Rx/Tx buffer data of this port. * Syntax: * void MoxaPortFlushData(int port, int mode); @@ -1791,20 +1942,40 @@ static void MoxaPortFlushData(struct moxa_port *port, int mode) * return: 0 - .. : BREAK signal count * * + * Function 34: Send out a BREAK signal. + * Syntax: + * void MoxaPortSendBreak(int port, int ms100); + * int port : port number (0 - 127) + * int ms100 : break signal time interval. + * unit: 100 mini-second. if ms100 == 0, it will + * send out a about 250 ms BREAK signal. + * */ +int MoxaPortIsValid(int port) +{ + + if (moxaCard == 0) + return (0); + if (moxa_ports[port].chkPort == 0) + return (0); + return (1); +} -static void MoxaPortEnable(struct moxa_port *port) +void MoxaPortEnable(int port) { void __iomem *ofsAddr; - u16 lowwater = 512; + int MoxaPortLineStatus(int); + short lowwater = 512; - ofsAddr = port->tableAddr; + ofsAddr = moxa_ports[port].tableAddr; writew(lowwater, ofsAddr + Low_water); - if (MOXA_IS_320(port->board)) + moxa_ports[port].breakCnt = 0; + if ((moxa_boards[port / MAX_PORTS_PER_BOARD].boardType == MOXA_BOARD_C320_ISA) || + (moxa_boards[port / MAX_PORTS_PER_BOARD].boardType == MOXA_BOARD_C320_PCI)) { moxafunc(ofsAddr, FC_SetBreakIrq, 0); - else - writew(readw(ofsAddr + HostStat) | WakeupBreak, - ofsAddr + HostStat); + } else { + writew(readw(ofsAddr + HostStat) | WakeupBreak, ofsAddr + HostStat); + } moxafunc(ofsAddr, FC_SetLineIrq, Magic_code); moxafunc(ofsAddr, FC_FlushQueue, 2); @@ -1813,9 +1984,9 @@ static void MoxaPortEnable(struct moxa_port *port) MoxaPortLineStatus(port); } -static void MoxaPortDisable(struct moxa_port *port) +void MoxaPortDisable(int port) { - void __iomem *ofsAddr = port->tableAddr; + void __iomem *ofsAddr = moxa_ports[port].tableAddr; moxafunc(ofsAddr, FC_SetFlowCtl, 0); /* disable flow control */ moxafunc(ofsAddr, FC_ClrLineIrq, Magic_code); @@ -1823,32 +1994,49 @@ static void MoxaPortDisable(struct moxa_port *port) moxafunc(ofsAddr, FC_DisableCH, Magic_code); } -static speed_t MoxaPortSetBaud(struct moxa_port *port, speed_t baud) +long MoxaPortGetMaxBaud(int port) +{ + if ((moxa_boards[port / MAX_PORTS_PER_BOARD].boardType == MOXA_BOARD_C320_ISA) || + (moxa_boards[port / MAX_PORTS_PER_BOARD].boardType == MOXA_BOARD_C320_PCI)) + return (460800L); + else + return (921600L); +} + + +long MoxaPortSetBaud(int port, long baud) { - void __iomem *ofsAddr = port->tableAddr; - unsigned int clock, val; - speed_t max; + void __iomem *ofsAddr; + long max, clock; + unsigned int val; - max = MOXA_IS_320(port->board) ? 460800 : 921600; - if (baud < 50) - return 0; + if ((baud < 50L) || ((max = MoxaPortGetMaxBaud(port)) == 0)) + return (0); + ofsAddr = moxa_ports[port].tableAddr; if (baud > max) baud = max; - clock = 921600; + if (max == 38400L) + clock = 614400L; /* for 9.8304 Mhz : max. 38400 bps */ + else if (max == 57600L) + clock = 691200L; /* for 11.0592 Mhz : max. 57600 bps */ + else + clock = 921600L; /* for 14.7456 Mhz : max. 115200 bps */ val = clock / baud; moxafunc(ofsAddr, FC_SetBaud, val); baud = clock / val; - return baud; + moxa_ports[port].curBaud = baud; + return (baud); } -static int MoxaPortSetTermio(struct moxa_port *port, struct ktermios *termio, - speed_t baud) +int MoxaPortSetTermio(int port, struct ktermios *termio, speed_t baud) { void __iomem *ofsAddr; tcflag_t cflag; tcflag_t mode = 0; - ofsAddr = port->tableAddr; + if (moxa_ports[port].chkPort == 0 || termio == 0) + return (-1); + ofsAddr = moxa_ports[port].tableAddr; cflag = termio->c_cflag; /* termio->c_cflag */ mode = termio->c_cflag & CSIZE; @@ -1877,11 +2065,13 @@ static int MoxaPortSetTermio(struct moxa_port *port, struct ktermios *termio, } else mode |= MX_PARNONE; - moxafunc(ofsAddr, FC_SetDataMode, (u16)mode); - - if (MOXA_IS_320(port->board) && baud >= 921600) - return -1; + moxafunc(ofsAddr, FC_SetDataMode, (ushort) mode); + if ((moxa_boards[port / MAX_PORTS_PER_BOARD].boardType == MOXA_BOARD_C320_ISA) || + (moxa_boards[port / MAX_PORTS_PER_BOARD].boardType == MOXA_BOARD_C320_PCI)) { + if (baud >= 921600L) + return (-1); + } baud = MoxaPortSetBaud(port, baud); if (termio->c_iflag & (IXON | IXOFF | IXANY)) { @@ -1891,37 +2081,51 @@ static int MoxaPortSetTermio(struct moxa_port *port, struct ktermios *termio, moxa_wait_finish(ofsAddr); } - return baud; + return (baud); } -static int MoxaPortGetLineOut(struct moxa_port *port, int *dtrState, - int *rtsState) +int MoxaPortGetLineOut(int port, int *dtrState, int *rtsState) { - if (dtrState) - *dtrState = !!(port->lineCtrl & DTR_ON); - if (rtsState) - *rtsState = !!(port->lineCtrl & RTS_ON); - return 0; + if (!MoxaPortIsValid(port)) + return (-1); + if (dtrState) { + if (moxa_ports[port].lineCtrl & DTR_ON) + *dtrState = 1; + else + *dtrState = 0; + } + if (rtsState) { + if (moxa_ports[port].lineCtrl & RTS_ON) + *rtsState = 1; + else + *rtsState = 0; + } + return (0); } -static void MoxaPortLineCtrl(struct moxa_port *port, int dtr, int rts) +void MoxaPortLineCtrl(int port, int dtr, int rts) { - u8 mode = 0; + void __iomem *ofsAddr; + int mode; + ofsAddr = moxa_ports[port].tableAddr; + mode = 0; if (dtr) mode |= DTR_ON; if (rts) mode |= RTS_ON; - port->lineCtrl = mode; - moxafunc(port->tableAddr, FC_LineControl, mode); + moxa_ports[port].lineCtrl = mode; + moxafunc(ofsAddr, FC_LineControl, mode); } -static void MoxaPortFlowCtrl(struct moxa_port *port, int rts, int cts, - int txflow, int rxflow, int txany) +void MoxaPortFlowCtrl(int port, int rts, int cts, int txflow, int rxflow, int txany) { - int mode = 0; + void __iomem *ofsAddr; + int mode; + ofsAddr = moxa_ports[port].tableAddr; + mode = 0; if (rts) mode |= RTS_FlowCtl; if (cts) @@ -1932,50 +2136,81 @@ static void MoxaPortFlowCtrl(struct moxa_port *port, int rts, int cts, mode |= Rx_FlowCtl; if (txany) mode |= IXM_IXANY; - moxafunc(port->tableAddr, FC_SetFlowCtl, mode); + moxafunc(ofsAddr, FC_SetFlowCtl, mode); } -static int MoxaPortLineStatus(struct moxa_port *port) +int MoxaPortLineStatus(int port) { void __iomem *ofsAddr; int val; - ofsAddr = port->tableAddr; - if (MOXA_IS_320(port->board)) { + ofsAddr = moxa_ports[port].tableAddr; + if ((moxa_boards[port / MAX_PORTS_PER_BOARD].boardType == MOXA_BOARD_C320_ISA) || + (moxa_boards[port / MAX_PORTS_PER_BOARD].boardType == MOXA_BOARD_C320_PCI)) { moxafunc(ofsAddr, FC_LineStatus, 0); val = readw(ofsAddr + FuncArg); } else { val = readw(ofsAddr + FlagStat) >> 4; } val &= 0x0B; - if (val & 8) + if (val & 8) { val |= 4; - spin_lock_bh(&moxa_lock); - moxa_new_dcdstate(port, val & 8); - spin_unlock_bh(&moxa_lock); + if ((moxa_ports[port].DCDState & DCD_oldstate) == 0) + moxa_ports[port].DCDState = (DCD_oldstate | DCD_changed); + } else { + if (moxa_ports[port].DCDState & DCD_oldstate) + moxa_ports[port].DCDState = DCD_changed; + } val &= 7; - return val; + return (val); +} + +int MoxaPortDCDChange(int port) +{ + int n; + + if (moxa_ports[port].chkPort == 0) + return (0); + n = moxa_ports[port].DCDState; + moxa_ports[port].DCDState &= ~DCD_changed; + n &= DCD_changed; + return (n); +} + +int MoxaPortDCDON(int port) +{ + int n; + + if (moxa_ports[port].chkPort == 0) + return (0); + if (moxa_ports[port].DCDState & DCD_oldstate) + n = 1; + else + n = 0; + return (n); } -static int MoxaPortWriteData(struct moxa_port *port, - const unsigned char *buffer, int len) +int MoxaPortWriteData(int port, unsigned char * buffer, int len) { + int c, total, i; + ushort tail; + int cnt; + ushort head, tx_mask, spage, epage; + ushort pageno, pageofs, bufhead; void __iomem *baseAddr, *ofsAddr, *ofs; - unsigned int c, total; - u16 head, tail, tx_mask, spage, epage; - u16 pageno, pageofs, bufhead; - ofsAddr = port->tableAddr; - baseAddr = port->board->basemem; + ofsAddr = moxa_ports[port].tableAddr; + baseAddr = moxa_boards[port / MAX_PORTS_PER_BOARD].basemem; tx_mask = readw(ofsAddr + TX_mask); spage = readw(ofsAddr + Page_txb); epage = readw(ofsAddr + EndPage_txb); tail = readw(ofsAddr + TXwptr); head = readw(ofsAddr + TXrptr); - c = (head > tail) ? (head - tail - 1) : (head - tail + tx_mask); + c = (head > tail) ? (head - tail - 1) + : (head - tail + tx_mask); if (c > len) c = len; - moxaLog.txcnt[port->tty->index] += c; + moxaLog.txcnt[port] += c; total = c; if (spage == epage) { bufhead = readw(ofsAddr + Ofs_txb); @@ -1987,179 +2222,249 @@ static int MoxaPortWriteData(struct moxa_port *port, len = tx_mask + 1 - tail; len = (c > len) ? len : c; ofs = baseAddr + DynPage_addr + bufhead + tail; - memcpy_toio(ofs, buffer, len); - buffer += len; + for (i = 0; i < len; i++) + writeb(*buffer++, ofs + i); tail = (tail + len) & tx_mask; c -= len; } + writew(tail, ofsAddr + TXwptr); } else { + len = c; pageno = spage + (tail >> 13); pageofs = tail & Page_mask; - while (c > 0) { - len = Page_size - pageofs; - if (len > c) - len = c; + do { + cnt = Page_size - pageofs; + if (cnt > c) + cnt = c; + c -= cnt; writeb(pageno, baseAddr + Control_reg); ofs = baseAddr + DynPage_addr + pageofs; - memcpy_toio(ofs, buffer, len); - buffer += len; + for (i = 0; i < cnt; i++) + writeb(*buffer++, ofs + i); + if (c == 0) { + writew((tail + len) & tx_mask, ofsAddr + TXwptr); + break; + } if (++pageno == epage) pageno = spage; pageofs = 0; - c -= len; - } - tail = (tail + total) & tx_mask; + } while (1); } - writew(tail, ofsAddr + TXwptr); writeb(1, ofsAddr + CD180TXirq); /* start to send */ - return total; + return (total); } -static int MoxaPortReadData(struct moxa_port *port) +int MoxaPortReadData(int port, struct tty_struct *tty) { - struct tty_struct *tty = port->tty; - unsigned char *dst; + register ushort head, pageofs; + int i, count, cnt, len, total, remain; + ushort tail, rx_mask, spage, epage; + ushort pageno, bufhead; void __iomem *baseAddr, *ofsAddr, *ofs; - unsigned int count, len, total; - u16 tail, rx_mask, spage, epage; - u16 pageno, pageofs, bufhead, head; - ofsAddr = port->tableAddr; - baseAddr = port->board->basemem; + ofsAddr = moxa_ports[port].tableAddr; + baseAddr = moxa_boards[port / MAX_PORTS_PER_BOARD].basemem; head = readw(ofsAddr + RXrptr); tail = readw(ofsAddr + RXwptr); rx_mask = readw(ofsAddr + RX_mask); spage = readw(ofsAddr + Page_rxb); epage = readw(ofsAddr + EndPage_rxb); - count = (tail >= head) ? (tail - head) : (tail - head + rx_mask + 1); + count = (tail >= head) ? (tail - head) + : (tail - head + rx_mask + 1); if (count == 0) return 0; total = count; - moxaLog.rxcnt[tty->index] += total; + remain = count - total; + moxaLog.rxcnt[port] += total; + count = total; if (spage == epage) { bufhead = readw(ofsAddr + Ofs_rxb); writew(spage, baseAddr + Control_reg); while (count > 0) { + if (tail >= head) + len = tail - head; + else + len = rx_mask + 1 - head; + len = (count > len) ? len : count; ofs = baseAddr + DynPage_addr + bufhead + head; - len = (tail >= head) ? (tail - head) : - (rx_mask + 1 - head); - len = tty_prepare_flip_string(tty, &dst, - min(len, count)); - memcpy_fromio(dst, ofs, len); + for (i = 0; i < len; i++) + tty_insert_flip_char(tty, readb(ofs + i), TTY_NORMAL); head = (head + len) & rx_mask; count -= len; } + writew(head, ofsAddr + RXrptr); } else { + len = count; pageno = spage + (head >> 13); pageofs = head & Page_mask; - while (count > 0) { + do { + cnt = Page_size - pageofs; + if (cnt > count) + cnt = count; + count -= cnt; writew(pageno, baseAddr + Control_reg); ofs = baseAddr + DynPage_addr + pageofs; - len = tty_prepare_flip_string(tty, &dst, - min(Page_size - pageofs, count)); - memcpy_fromio(dst, ofs, len); - - count -= len; - pageofs = (pageofs + len) & Page_mask; - if (pageofs == 0 && ++pageno == epage) + for (i = 0; i < cnt; i++) + tty_insert_flip_char(tty, readb(ofs + i), TTY_NORMAL); + if (count == 0) { + writew((head + len) & rx_mask, ofsAddr + RXrptr); + break; + } + if (++pageno == epage) pageno = spage; - } - head = (head + total) & rx_mask; + pageofs = 0; + } while (1); } - writew(head, ofsAddr + RXrptr); - if (readb(ofsAddr + FlagStat) & Xoff_state) { + if ((readb(ofsAddr + FlagStat) & Xoff_state) && (remain < LowWater)) { moxaLowWaterChk = 1; - port->lowChkFlag = 1; + moxa_ports[port].lowChkFlag = 1; } - return total; + return (total); } -static int MoxaPortTxQueue(struct moxa_port *port) +int MoxaPortTxQueue(int port) { - void __iomem *ofsAddr = port->tableAddr; - u16 rptr, wptr, mask; + void __iomem *ofsAddr; + ushort rptr, wptr, mask; + int len; + ofsAddr = moxa_ports[port].tableAddr; rptr = readw(ofsAddr + TXrptr); wptr = readw(ofsAddr + TXwptr); mask = readw(ofsAddr + TX_mask); - return (wptr - rptr) & mask; + len = (wptr - rptr) & mask; + return (len); } -static int MoxaPortTxFree(struct moxa_port *port) +int MoxaPortTxFree(int port) { - void __iomem *ofsAddr = port->tableAddr; - u16 rptr, wptr, mask; + void __iomem *ofsAddr; + ushort rptr, wptr, mask; + int len; + ofsAddr = moxa_ports[port].tableAddr; rptr = readw(ofsAddr + TXrptr); wptr = readw(ofsAddr + TXwptr); mask = readw(ofsAddr + TX_mask); - return mask - ((wptr - rptr) & mask); + len = mask - ((wptr - rptr) & mask); + return (len); } -static int MoxaPortRxQueue(struct moxa_port *port) +int MoxaPortRxQueue(int port) { - void __iomem *ofsAddr = port->tableAddr; - u16 rptr, wptr, mask; + void __iomem *ofsAddr; + ushort rptr, wptr, mask; + int len; + ofsAddr = moxa_ports[port].tableAddr; rptr = readw(ofsAddr + RXrptr); wptr = readw(ofsAddr + RXwptr); mask = readw(ofsAddr + RX_mask); - return (wptr - rptr) & mask; + len = (wptr - rptr) & mask; + return (len); +} + + +void MoxaPortTxDisable(int port) +{ + void __iomem *ofsAddr; + + ofsAddr = moxa_ports[port].tableAddr; + moxafunc(ofsAddr, FC_SetXoffState, Magic_code); +} + +void MoxaPortTxEnable(int port) +{ + void __iomem *ofsAddr; + + ofsAddr = moxa_ports[port].tableAddr; + moxafunc(ofsAddr, FC_SetXonState, Magic_code); } -static void MoxaPortTxDisable(struct moxa_port *port) + +int MoxaPortResetBrkCnt(int port) { - moxafunc(port->tableAddr, FC_SetXoffState, Magic_code); + ushort cnt; + cnt = moxa_ports[port].breakCnt; + moxa_ports[port].breakCnt = 0; + return (cnt); } -static void MoxaPortTxEnable(struct moxa_port *port) + +void MoxaPortSendBreak(int port, int ms100) { - moxafunc(port->tableAddr, FC_SetXonState, Magic_code); + void __iomem *ofsAddr; + + ofsAddr = moxa_ports[port].tableAddr; + if (ms100) { + moxafunc(ofsAddr, FC_SendBreak, Magic_code); + msleep(ms100 * 10); + } else { + moxafunc(ofsAddr, FC_SendBreak, Magic_code); + msleep(250); + } + moxafunc(ofsAddr, FC_StopBreak, Magic_code); } static int moxa_get_serial_info(struct moxa_port *info, - struct serial_struct __user *retinfo) + struct serial_struct __user *retinfo) { - struct serial_struct tmp = { - .type = info->type, - .line = info->tty->index, - .flags = info->asyncflags, - .baud_base = 921600, - .close_delay = info->close_delay - }; - return copy_to_user(retinfo, &tmp, sizeof(*retinfo)) ? -EFAULT : 0; + struct serial_struct tmp; + + memset(&tmp, 0, sizeof(tmp)); + tmp.type = info->type; + tmp.line = info->port; + tmp.port = 0; + tmp.irq = 0; + tmp.flags = info->asyncflags; + tmp.baud_base = 921600; + tmp.close_delay = info->close_delay; + tmp.closing_wait = info->closing_wait; + tmp.custom_divisor = 0; + tmp.hub6 = 0; + if(copy_to_user(retinfo, &tmp, sizeof(*retinfo))) + return -EFAULT; + return (0); } static int moxa_set_serial_info(struct moxa_port *info, - struct serial_struct __user *new_info) + struct serial_struct __user *new_info) { struct serial_struct new_serial; - if (copy_from_user(&new_serial, new_info, sizeof(new_serial))) + if(copy_from_user(&new_serial, new_info, sizeof(new_serial))) return -EFAULT; - if (new_serial.irq != 0 || new_serial.port != 0 || - new_serial.custom_divisor != 0 || - new_serial.baud_base != 921600) - return -EPERM; + if ((new_serial.irq != 0) || + (new_serial.port != 0) || +// (new_serial.type != info->type) || + (new_serial.custom_divisor != 0) || + (new_serial.baud_base != 921600)) + return (-EPERM); if (!capable(CAP_SYS_ADMIN)) { if (((new_serial.flags & ~ASYNC_USR_MASK) != (info->asyncflags & ~ASYNC_USR_MASK))) - return -EPERM; - } else + return (-EPERM); + } else { info->close_delay = new_serial.close_delay * HZ / 100; + info->closing_wait = new_serial.closing_wait * HZ / 100; + } new_serial.flags = (new_serial.flags & ~ASYNC_FLAGS); new_serial.flags |= (info->asyncflags & ASYNC_FLAGS); - MoxaSetFifo(info, new_serial.type == PORT_16550A); + if (new_serial.type == PORT_16550A) { + MoxaSetFifo(info->port, 1); + } else { + MoxaSetFifo(info->port, 0); + } info->type = new_serial.type; - return 0; + return (0); } @@ -2167,10 +2472,374 @@ static int moxa_set_serial_info(struct moxa_port *info, /***************************************************************************** * Static local functions: * *****************************************************************************/ +static void moxafunc(void __iomem *ofsAddr, int cmd, ushort arg) +{ + + writew(arg, ofsAddr + FuncArg); + writew(cmd, ofsAddr + FuncCode); + moxa_wait_finish(ofsAddr); +} + +static void moxa_wait_finish(void __iomem *ofsAddr) +{ + unsigned long i, j; + + i = jiffies; + while (readw(ofsAddr + FuncCode) != 0) { + j = jiffies; + if ((j - i) > moxaFuncTout) { + return; + } + } +} + +static void moxa_low_water_check(void __iomem *ofsAddr) +{ + int len; + ushort rptr, wptr, mask; + + if (readb(ofsAddr + FlagStat) & Xoff_state) { + rptr = readw(ofsAddr + RXrptr); + wptr = readw(ofsAddr + RXwptr); + mask = readw(ofsAddr + RX_mask); + len = (wptr - rptr) & mask; + if (len <= Low_water) + moxafunc(ofsAddr, FC_SendXon, 0); + } +} + +static int moxaloadbios(int cardno, unsigned char __user *tmp, int len) +{ + void __iomem *baseAddr; + int i; + + if(len < 0 || len > sizeof(moxaBuff)) + return -EINVAL; + if(copy_from_user(moxaBuff, tmp, len)) + return -EFAULT; + baseAddr = moxa_boards[cardno].basemem; + writeb(HW_reset, baseAddr + Control_reg); /* reset */ + msleep(10); + for (i = 0; i < 4096; i++) + writeb(0, baseAddr + i); /* clear fix page */ + for (i = 0; i < len; i++) + writeb(moxaBuff[i], baseAddr + i); /* download BIOS */ + writeb(0, baseAddr + Control_reg); /* restart */ + return (0); +} + +static int moxafindcard(int cardno) +{ + void __iomem *baseAddr; + ushort tmp; + + baseAddr = moxa_boards[cardno].basemem; + switch (moxa_boards[cardno].boardType) { + case MOXA_BOARD_C218_ISA: + case MOXA_BOARD_C218_PCI: + if ((tmp = readw(baseAddr + C218_key)) != C218_KeyCode) { + return (-1); + } + break; + case MOXA_BOARD_CP204J: + if ((tmp = readw(baseAddr + C218_key)) != CP204J_KeyCode) { + return (-1); + } + break; + default: + if ((tmp = readw(baseAddr + C320_key)) != C320_KeyCode) { + return (-1); + } + if ((tmp = readw(baseAddr + C320_status)) != STS_init) { + return (-2); + } + } + return (0); +} + +static int moxaload320b(int cardno, unsigned char __user *tmp, int len) +{ + void __iomem *baseAddr; + int i; + + if(len < 0 || len > sizeof(moxaBuff)) + return -EINVAL; + if(copy_from_user(moxaBuff, tmp, len)) + return -EFAULT; + baseAddr = moxa_boards[cardno].basemem; + writew(len - 7168 - 2, baseAddr + C320bapi_len); + writeb(1, baseAddr + Control_reg); /* Select Page 1 */ + for (i = 0; i < 7168; i++) + writeb(moxaBuff[i], baseAddr + DynPage_addr + i); + writeb(2, baseAddr + Control_reg); /* Select Page 2 */ + for (i = 0; i < (len - 7168); i++) + writeb(moxaBuff[i + 7168], baseAddr + DynPage_addr + i); + return (0); +} + +static int moxaloadcode(int cardno, unsigned char __user *tmp, int len) +{ + void __iomem *baseAddr, *ofsAddr; + int retval, port, i; + + if(len < 0 || len > sizeof(moxaBuff)) + return -EINVAL; + if(copy_from_user(moxaBuff, tmp, len)) + return -EFAULT; + baseAddr = moxa_boards[cardno].basemem; + switch (moxa_boards[cardno].boardType) { + case MOXA_BOARD_C218_ISA: + case MOXA_BOARD_C218_PCI: + case MOXA_BOARD_CP204J: + retval = moxaloadc218(cardno, baseAddr, len); + if (retval) + return (retval); + port = cardno * MAX_PORTS_PER_BOARD; + for (i = 0; i < moxa_boards[cardno].numPorts; i++, port++) { + struct moxa_port *p = &moxa_ports[port]; + + p->chkPort = 1; + p->curBaud = 9600L; + p->DCDState = 0; + p->tableAddr = baseAddr + Extern_table + Extern_size * i; + ofsAddr = p->tableAddr; + writew(C218rx_mask, ofsAddr + RX_mask); + writew(C218tx_mask, ofsAddr + TX_mask); + writew(C218rx_spage + i * C218buf_pageno, ofsAddr + Page_rxb); + writew(readw(ofsAddr + Page_rxb) + C218rx_pageno, ofsAddr + EndPage_rxb); + + writew(C218tx_spage + i * C218buf_pageno, ofsAddr + Page_txb); + writew(readw(ofsAddr + Page_txb) + C218tx_pageno, ofsAddr + EndPage_txb); + + } + break; + default: + retval = moxaloadc320(cardno, baseAddr, len, + &moxa_boards[cardno].numPorts); + if (retval) + return (retval); + port = cardno * MAX_PORTS_PER_BOARD; + for (i = 0; i < moxa_boards[cardno].numPorts; i++, port++) { + struct moxa_port *p = &moxa_ports[port]; + + p->chkPort = 1; + p->curBaud = 9600L; + p->DCDState = 0; + p->tableAddr = baseAddr + Extern_table + Extern_size * i; + ofsAddr = p->tableAddr; + if (moxa_boards[cardno].numPorts == 8) { + writew(C320p8rx_mask, ofsAddr + RX_mask); + writew(C320p8tx_mask, ofsAddr + TX_mask); + writew(C320p8rx_spage + i * C320p8buf_pgno, ofsAddr + Page_rxb); + writew(readw(ofsAddr + Page_rxb) + C320p8rx_pgno, ofsAddr + EndPage_rxb); + writew(C320p8tx_spage + i * C320p8buf_pgno, ofsAddr + Page_txb); + writew(readw(ofsAddr + Page_txb) + C320p8tx_pgno, ofsAddr + EndPage_txb); + + } else if (moxa_boards[cardno].numPorts == 16) { + writew(C320p16rx_mask, ofsAddr + RX_mask); + writew(C320p16tx_mask, ofsAddr + TX_mask); + writew(C320p16rx_spage + i * C320p16buf_pgno, ofsAddr + Page_rxb); + writew(readw(ofsAddr + Page_rxb) + C320p16rx_pgno, ofsAddr + EndPage_rxb); + writew(C320p16tx_spage + i * C320p16buf_pgno, ofsAddr + Page_txb); + writew(readw(ofsAddr + Page_txb) + C320p16tx_pgno, ofsAddr + EndPage_txb); + + } else if (moxa_boards[cardno].numPorts == 24) { + writew(C320p24rx_mask, ofsAddr + RX_mask); + writew(C320p24tx_mask, ofsAddr + TX_mask); + writew(C320p24rx_spage + i * C320p24buf_pgno, ofsAddr + Page_rxb); + writew(readw(ofsAddr + Page_rxb) + C320p24rx_pgno, ofsAddr + EndPage_rxb); + writew(C320p24tx_spage + i * C320p24buf_pgno, ofsAddr + Page_txb); + writew(readw(ofsAddr + Page_txb), ofsAddr + EndPage_txb); + } else if (moxa_boards[cardno].numPorts == 32) { + writew(C320p32rx_mask, ofsAddr + RX_mask); + writew(C320p32tx_mask, ofsAddr + TX_mask); + writew(C320p32tx_ofs, ofsAddr + Ofs_txb); + writew(C320p32rx_spage + i * C320p32buf_pgno, ofsAddr + Page_rxb); + writew(readb(ofsAddr + Page_rxb), ofsAddr + EndPage_rxb); + writew(C320p32tx_spage + i * C320p32buf_pgno, ofsAddr + Page_txb); + writew(readw(ofsAddr + Page_txb), ofsAddr + EndPage_txb); + } + } + break; + } + moxa_boards[cardno].loadstat = 1; + return (0); +} + +static int moxaloadc218(int cardno, void __iomem *baseAddr, int len) +{ + char retry; + int i, j, len1, len2; + ushort usum, *ptr, keycode; + + if (moxa_boards[cardno].boardType == MOXA_BOARD_CP204J) + keycode = CP204J_KeyCode; + else + keycode = C218_KeyCode; + usum = 0; + len1 = len >> 1; + ptr = (ushort *) moxaBuff; + for (i = 0; i < len1; i++) + usum += le16_to_cpu(*(ptr + i)); + retry = 0; + do { + len1 = len >> 1; + j = 0; + while (len1) { + len2 = (len1 > 2048) ? 2048 : len1; + len1 -= len2; + for (i = 0; i < len2 << 1; i++) + writeb(moxaBuff[i + j], baseAddr + C218_LoadBuf + i); + j += i; + + writew(len2, baseAddr + C218DLoad_len); + writew(0, baseAddr + C218_key); + for (i = 0; i < 100; i++) { + if (readw(baseAddr + C218_key) == keycode) + break; + msleep(10); + } + if (readw(baseAddr + C218_key) != keycode) { + return (-1); + } + } + writew(0, baseAddr + C218DLoad_len); + writew(usum, baseAddr + C218check_sum); + writew(0, baseAddr + C218_key); + for (i = 0; i < 100; i++) { + if (readw(baseAddr + C218_key) == keycode) + break; + msleep(10); + } + retry++; + } while ((readb(baseAddr + C218chksum_ok) != 1) && (retry < 3)); + if (readb(baseAddr + C218chksum_ok) != 1) { + return (-1); + } + writew(0, baseAddr + C218_key); + for (i = 0; i < 100; i++) { + if (readw(baseAddr + Magic_no) == Magic_code) + break; + msleep(10); + } + if (readw(baseAddr + Magic_no) != Magic_code) { + return (-1); + } + writew(1, baseAddr + Disable_IRQ); + writew(0, baseAddr + Magic_no); + for (i = 0; i < 100; i++) { + if (readw(baseAddr + Magic_no) == Magic_code) + break; + msleep(10); + } + if (readw(baseAddr + Magic_no) != Magic_code) { + return (-1); + } + moxaCard = 1; + moxa_boards[cardno].intNdx = baseAddr + IRQindex; + moxa_boards[cardno].intPend = baseAddr + IRQpending; + moxa_boards[cardno].intTable = baseAddr + IRQtable; + return (0); +} + +static int moxaloadc320(int cardno, void __iomem *baseAddr, int len, int *numPorts) +{ + ushort usum; + int i, j, wlen, len2, retry; + ushort *uptr; + + usum = 0; + wlen = len >> 1; + uptr = (ushort *) moxaBuff; + for (i = 0; i < wlen; i++) + usum += le16_to_cpu(uptr[i]); + retry = 0; + j = 0; + do { + while (wlen) { + if (wlen > 2048) + len2 = 2048; + else + len2 = wlen; + wlen -= len2; + len2 <<= 1; + for (i = 0; i < len2; i++) + writeb(moxaBuff[j + i], baseAddr + C320_LoadBuf + i); + len2 >>= 1; + j += i; + writew(len2, baseAddr + C320DLoad_len); + writew(0, baseAddr + C320_key); + for (i = 0; i < 10; i++) { + if (readw(baseAddr + C320_key) == C320_KeyCode) + break; + msleep(10); + } + if (readw(baseAddr + C320_key) != C320_KeyCode) + return (-1); + } + writew(0, baseAddr + C320DLoad_len); + writew(usum, baseAddr + C320check_sum); + writew(0, baseAddr + C320_key); + for (i = 0; i < 10; i++) { + if (readw(baseAddr + C320_key) == C320_KeyCode) + break; + msleep(10); + } + retry++; + } while ((readb(baseAddr + C320chksum_ok) != 1) && (retry < 3)); + if (readb(baseAddr + C320chksum_ok) != 1) + return (-1); + writew(0, baseAddr + C320_key); + for (i = 0; i < 600; i++) { + if (readw(baseAddr + Magic_no) == Magic_code) + break; + msleep(10); + } + if (readw(baseAddr + Magic_no) != Magic_code) + return (-100); + + if (moxa_boards[cardno].busType == MOXA_BUS_TYPE_PCI) { /* ASIC board */ + writew(0x3800, baseAddr + TMS320_PORT1); + writew(0x3900, baseAddr + TMS320_PORT2); + writew(28499, baseAddr + TMS320_CLOCK); + } else { + writew(0x3200, baseAddr + TMS320_PORT1); + writew(0x3400, baseAddr + TMS320_PORT2); + writew(19999, baseAddr + TMS320_CLOCK); + } + writew(1, baseAddr + Disable_IRQ); + writew(0, baseAddr + Magic_no); + for (i = 0; i < 500; i++) { + if (readw(baseAddr + Magic_no) == Magic_code) + break; + msleep(10); + } + if (readw(baseAddr + Magic_no) != Magic_code) + return (-102); + + j = readw(baseAddr + Module_cnt); + if (j <= 0) + return (-101); + *numPorts = j * 8; + writew(j, baseAddr + Module_no); + writew(0, baseAddr + Magic_no); + for (i = 0; i < 600; i++) { + if (readw(baseAddr + Magic_no) == Magic_code) + break; + msleep(10); + } + if (readw(baseAddr + Magic_no) != Magic_code) + return (-102); + moxaCard = 1; + moxa_boards[cardno].intNdx = baseAddr + IRQindex; + moxa_boards[cardno].intPend = baseAddr + IRQpending; + moxa_boards[cardno].intTable = baseAddr + IRQtable; + return (0); +} -static void MoxaSetFifo(struct moxa_port *port, int enable) +static void MoxaSetFifo(int port, int enable) { - void __iomem *ofsAddr = port->tableAddr; + void __iomem *ofsAddr = moxa_ports[port].tableAddr; if (!enable) { moxafunc(ofsAddr, FC_SetRxFIFOTrig, 0); diff --git a/trunk/drivers/char/moxa.h b/trunk/drivers/char/moxa.h deleted file mode 100644 index 87d16ce57be7..000000000000 --- a/trunk/drivers/char/moxa.h +++ /dev/null @@ -1,304 +0,0 @@ -#ifndef MOXA_H_FILE -#define MOXA_H_FILE - -#define MOXA 0x400 -#define MOXA_GET_IQUEUE (MOXA + 1) /* get input buffered count */ -#define MOXA_GET_OQUEUE (MOXA + 2) /* get output buffered count */ -#define MOXA_GETDATACOUNT (MOXA + 23) -#define MOXA_GET_IOQUEUE (MOXA + 27) -#define MOXA_FLUSH_QUEUE (MOXA + 28) -#define MOXA_GETMSTATUS (MOXA + 65) - -/* - * System Configuration - */ - -#define Magic_code 0x404 - -/* - * for C218 BIOS initialization - */ -#define C218_ConfBase 0x800 -#define C218_status (C218_ConfBase + 0) /* BIOS running status */ -#define C218_diag (C218_ConfBase + 2) /* diagnostic status */ -#define C218_key (C218_ConfBase + 4) /* WORD (0x218 for C218) */ -#define C218DLoad_len (C218_ConfBase + 6) /* WORD */ -#define C218check_sum (C218_ConfBase + 8) /* BYTE */ -#define C218chksum_ok (C218_ConfBase + 0x0a) /* BYTE (1:ok) */ -#define C218_TestRx (C218_ConfBase + 0x10) /* 8 bytes for 8 ports */ -#define C218_TestTx (C218_ConfBase + 0x18) /* 8 bytes for 8 ports */ -#define C218_RXerr (C218_ConfBase + 0x20) /* 8 bytes for 8 ports */ -#define C218_ErrFlag (C218_ConfBase + 0x28) /* 8 bytes for 8 ports */ - -#define C218_LoadBuf 0x0F00 -#define C218_KeyCode 0x218 -#define CP204J_KeyCode 0x204 - -/* - * for C320 BIOS initialization - */ -#define C320_ConfBase 0x800 -#define C320_LoadBuf 0x0f00 -#define STS_init 0x05 /* for C320_status */ - -#define C320_status C320_ConfBase + 0 /* BIOS running status */ -#define C320_diag C320_ConfBase + 2 /* diagnostic status */ -#define C320_key C320_ConfBase + 4 /* WORD (0320H for C320) */ -#define C320DLoad_len C320_ConfBase + 6 /* WORD */ -#define C320check_sum C320_ConfBase + 8 /* WORD */ -#define C320chksum_ok C320_ConfBase + 0x0a /* WORD (1:ok) */ -#define C320bapi_len C320_ConfBase + 0x0c /* WORD */ -#define C320UART_no C320_ConfBase + 0x0e /* WORD */ - -#define C320_KeyCode 0x320 - -#define FixPage_addr 0x0000 /* starting addr of static page */ -#define DynPage_addr 0x2000 /* starting addr of dynamic page */ -#define C218_start 0x3000 /* starting addr of C218 BIOS prg */ -#define Control_reg 0x1ff0 /* select page and reset control */ -#define HW_reset 0x80 - -/* - * Function Codes - */ -#define FC_CardReset 0x80 -#define FC_ChannelReset 1 /* C320 firmware not supported */ -#define FC_EnableCH 2 -#define FC_DisableCH 3 -#define FC_SetParam 4 -#define FC_SetMode 5 -#define FC_SetRate 6 -#define FC_LineControl 7 -#define FC_LineStatus 8 -#define FC_XmitControl 9 -#define FC_FlushQueue 10 -#define FC_SendBreak 11 -#define FC_StopBreak 12 -#define FC_LoopbackON 13 -#define FC_LoopbackOFF 14 -#define FC_ClrIrqTable 15 -#define FC_SendXon 16 -#define FC_SetTermIrq 17 /* C320 firmware not supported */ -#define FC_SetCntIrq 18 /* C320 firmware not supported */ -#define FC_SetBreakIrq 19 -#define FC_SetLineIrq 20 -#define FC_SetFlowCtl 21 -#define FC_GenIrq 22 -#define FC_InCD180 23 -#define FC_OutCD180 24 -#define FC_InUARTreg 23 -#define FC_OutUARTreg 24 -#define FC_SetXonXoff 25 -#define FC_OutCD180CCR 26 -#define FC_ExtIQueue 27 -#define FC_ExtOQueue 28 -#define FC_ClrLineIrq 29 -#define FC_HWFlowCtl 30 -#define FC_GetClockRate 35 -#define FC_SetBaud 36 -#define FC_SetDataMode 41 -#define FC_GetCCSR 43 -#define FC_GetDataError 45 -#define FC_RxControl 50 -#define FC_ImmSend 51 -#define FC_SetXonState 52 -#define FC_SetXoffState 53 -#define FC_SetRxFIFOTrig 54 -#define FC_SetTxFIFOCnt 55 -#define FC_UnixRate 56 -#define FC_UnixResetTimer 57 - -#define RxFIFOTrig1 0 -#define RxFIFOTrig4 1 -#define RxFIFOTrig8 2 -#define RxFIFOTrig14 3 - -/* - * Dual-Ported RAM - */ -#define DRAM_global 0 -#define INT_data (DRAM_global + 0) -#define Config_base (DRAM_global + 0x108) - -#define IRQindex (INT_data + 0) -#define IRQpending (INT_data + 4) -#define IRQtable (INT_data + 8) - -/* - * Interrupt Status - */ -#define IntrRx 0x01 /* receiver data O.K. */ -#define IntrTx 0x02 /* transmit buffer empty */ -#define IntrFunc 0x04 /* function complete */ -#define IntrBreak 0x08 /* received break */ -#define IntrLine 0x10 /* line status change - for transmitter */ -#define IntrIntr 0x20 /* received INTR code */ -#define IntrQuit 0x40 /* received QUIT code */ -#define IntrEOF 0x80 /* received EOF code */ - -#define IntrRxTrigger 0x100 /* rx data count reach tigger value */ -#define IntrTxTrigger 0x200 /* tx data count below trigger value */ - -#define Magic_no (Config_base + 0) -#define Card_model_no (Config_base + 2) -#define Total_ports (Config_base + 4) -#define Module_cnt (Config_base + 8) -#define Module_no (Config_base + 10) -#define Timer_10ms (Config_base + 14) -#define Disable_IRQ (Config_base + 20) -#define TMS320_PORT1 (Config_base + 22) -#define TMS320_PORT2 (Config_base + 24) -#define TMS320_CLOCK (Config_base + 26) - -/* - * DATA BUFFER in DRAM - */ -#define Extern_table 0x400 /* Base address of the external table - (24 words * 64) total 3K bytes - (24 words * 128) total 6K bytes */ -#define Extern_size 0x60 /* 96 bytes */ -#define RXrptr 0x00 /* read pointer for RX buffer */ -#define RXwptr 0x02 /* write pointer for RX buffer */ -#define TXrptr 0x04 /* read pointer for TX buffer */ -#define TXwptr 0x06 /* write pointer for TX buffer */ -#define HostStat 0x08 /* IRQ flag and general flag */ -#define FlagStat 0x0A -#define FlowControl 0x0C /* B7 B6 B5 B4 B3 B2 B1 B0 */ - /* x x x x | | | | */ - /* | | | + CTS flow */ - /* | | +--- RTS flow */ - /* | +------ TX Xon/Xoff */ - /* +--------- RX Xon/Xoff */ -#define Break_cnt 0x0E /* received break count */ -#define CD180TXirq 0x10 /* if non-0: enable TX irq */ -#define RX_mask 0x12 -#define TX_mask 0x14 -#define Ofs_rxb 0x16 -#define Ofs_txb 0x18 -#define Page_rxb 0x1A -#define Page_txb 0x1C -#define EndPage_rxb 0x1E -#define EndPage_txb 0x20 -#define Data_error 0x22 -#define RxTrigger 0x28 -#define TxTrigger 0x2a - -#define rRXwptr 0x34 -#define Low_water 0x36 - -#define FuncCode 0x40 -#define FuncArg 0x42 -#define FuncArg1 0x44 - -#define C218rx_size 0x2000 /* 8K bytes */ -#define C218tx_size 0x8000 /* 32K bytes */ - -#define C218rx_mask (C218rx_size - 1) -#define C218tx_mask (C218tx_size - 1) - -#define C320p8rx_size 0x2000 -#define C320p8tx_size 0x8000 -#define C320p8rx_mask (C320p8rx_size - 1) -#define C320p8tx_mask (C320p8tx_size - 1) - -#define C320p16rx_size 0x2000 -#define C320p16tx_size 0x4000 -#define C320p16rx_mask (C320p16rx_size - 1) -#define C320p16tx_mask (C320p16tx_size - 1) - -#define C320p24rx_size 0x2000 -#define C320p24tx_size 0x2000 -#define C320p24rx_mask (C320p24rx_size - 1) -#define C320p24tx_mask (C320p24tx_size - 1) - -#define C320p32rx_size 0x1000 -#define C320p32tx_size 0x1000 -#define C320p32rx_mask (C320p32rx_size - 1) -#define C320p32tx_mask (C320p32tx_size - 1) - -#define Page_size 0x2000U -#define Page_mask (Page_size - 1) -#define C218rx_spage 3 -#define C218tx_spage 4 -#define C218rx_pageno 1 -#define C218tx_pageno 4 -#define C218buf_pageno 5 - -#define C320p8rx_spage 3 -#define C320p8tx_spage 4 -#define C320p8rx_pgno 1 -#define C320p8tx_pgno 4 -#define C320p8buf_pgno 5 - -#define C320p16rx_spage 3 -#define C320p16tx_spage 4 -#define C320p16rx_pgno 1 -#define C320p16tx_pgno 2 -#define C320p16buf_pgno 3 - -#define C320p24rx_spage 3 -#define C320p24tx_spage 4 -#define C320p24rx_pgno 1 -#define C320p24tx_pgno 1 -#define C320p24buf_pgno 2 - -#define C320p32rx_spage 3 -#define C320p32tx_ofs C320p32rx_size -#define C320p32tx_spage 3 -#define C320p32buf_pgno 1 - -/* - * Host Status - */ -#define WakeupRx 0x01 -#define WakeupTx 0x02 -#define WakeupBreak 0x08 -#define WakeupLine 0x10 -#define WakeupIntr 0x20 -#define WakeupQuit 0x40 -#define WakeupEOF 0x80 /* used in VTIME control */ -#define WakeupRxTrigger 0x100 -#define WakeupTxTrigger 0x200 -/* - * Flag status - */ -#define Rx_over 0x01 -#define Xoff_state 0x02 -#define Tx_flowOff 0x04 -#define Tx_enable 0x08 -#define CTS_state 0x10 -#define DSR_state 0x20 -#define DCD_state 0x80 -/* - * FlowControl - */ -#define CTS_FlowCtl 1 -#define RTS_FlowCtl 2 -#define Tx_FlowCtl 4 -#define Rx_FlowCtl 8 -#define IXM_IXANY 0x10 - -#define LowWater 128 - -#define DTR_ON 1 -#define RTS_ON 2 -#define CTS_ON 1 -#define DSR_ON 2 -#define DCD_ON 8 - -/* mode definition */ -#define MX_CS8 0x03 -#define MX_CS7 0x02 -#define MX_CS6 0x01 -#define MX_CS5 0x00 - -#define MX_STOP1 0x00 -#define MX_STOP15 0x04 -#define MX_STOP2 0x08 - -#define MX_PARNONE 0x00 -#define MX_PAREVEN 0x40 -#define MX_PARODD 0xC0 - -#endif diff --git a/trunk/drivers/char/mxser.c b/trunk/drivers/char/mxser.c index 4b81a85c5b53..68c2e9234691 100644 --- a/trunk/drivers/char/mxser.c +++ b/trunk/drivers/char/mxser.c @@ -307,200 +307,6 @@ static unsigned char mxser_msr[MXSER_PORTS + 1]; static struct mxser_mon_ext mon_data_ext; static int mxser_set_baud_method[MXSER_PORTS + 1]; -static void mxser_enable_must_enchance_mode(unsigned long baseio) -{ - u8 oldlcr; - u8 efr; - - oldlcr = inb(baseio + UART_LCR); - outb(MOXA_MUST_ENTER_ENCHANCE, baseio + UART_LCR); - - efr = inb(baseio + MOXA_MUST_EFR_REGISTER); - efr |= MOXA_MUST_EFR_EFRB_ENABLE; - - outb(efr, baseio + MOXA_MUST_EFR_REGISTER); - outb(oldlcr, baseio + UART_LCR); -} - -static void mxser_disable_must_enchance_mode(unsigned long baseio) -{ - u8 oldlcr; - u8 efr; - - oldlcr = inb(baseio + UART_LCR); - outb(MOXA_MUST_ENTER_ENCHANCE, baseio + UART_LCR); - - efr = inb(baseio + MOXA_MUST_EFR_REGISTER); - efr &= ~MOXA_MUST_EFR_EFRB_ENABLE; - - outb(efr, baseio + MOXA_MUST_EFR_REGISTER); - outb(oldlcr, baseio + UART_LCR); -} - -static void mxser_set_must_xon1_value(unsigned long baseio, u8 value) -{ - u8 oldlcr; - u8 efr; - - oldlcr = inb(baseio + UART_LCR); - outb(MOXA_MUST_ENTER_ENCHANCE, baseio + UART_LCR); - - efr = inb(baseio + MOXA_MUST_EFR_REGISTER); - efr &= ~MOXA_MUST_EFR_BANK_MASK; - efr |= MOXA_MUST_EFR_BANK0; - - outb(efr, baseio + MOXA_MUST_EFR_REGISTER); - outb(value, baseio + MOXA_MUST_XON1_REGISTER); - outb(oldlcr, baseio + UART_LCR); -} - -static void mxser_set_must_xoff1_value(unsigned long baseio, u8 value) -{ - u8 oldlcr; - u8 efr; - - oldlcr = inb(baseio + UART_LCR); - outb(MOXA_MUST_ENTER_ENCHANCE, baseio + UART_LCR); - - efr = inb(baseio + MOXA_MUST_EFR_REGISTER); - efr &= ~MOXA_MUST_EFR_BANK_MASK; - efr |= MOXA_MUST_EFR_BANK0; - - outb(efr, baseio + MOXA_MUST_EFR_REGISTER); - outb(value, baseio + MOXA_MUST_XOFF1_REGISTER); - outb(oldlcr, baseio + UART_LCR); -} - -static void mxser_set_must_fifo_value(struct mxser_port *info) -{ - u8 oldlcr; - u8 efr; - - oldlcr = inb(info->ioaddr + UART_LCR); - outb(MOXA_MUST_ENTER_ENCHANCE, info->ioaddr + UART_LCR); - - efr = inb(info->ioaddr + MOXA_MUST_EFR_REGISTER); - efr &= ~MOXA_MUST_EFR_BANK_MASK; - efr |= MOXA_MUST_EFR_BANK1; - - outb(efr, info->ioaddr + MOXA_MUST_EFR_REGISTER); - outb((u8)info->rx_high_water, info->ioaddr + MOXA_MUST_RBRTH_REGISTER); - outb((u8)info->rx_trigger, info->ioaddr + MOXA_MUST_RBRTI_REGISTER); - outb((u8)info->rx_low_water, info->ioaddr + MOXA_MUST_RBRTL_REGISTER); - outb(oldlcr, info->ioaddr + UART_LCR); -} - -static void mxser_set_must_enum_value(unsigned long baseio, u8 value) -{ - u8 oldlcr; - u8 efr; - - oldlcr = inb(baseio + UART_LCR); - outb(MOXA_MUST_ENTER_ENCHANCE, baseio + UART_LCR); - - efr = inb(baseio + MOXA_MUST_EFR_REGISTER); - efr &= ~MOXA_MUST_EFR_BANK_MASK; - efr |= MOXA_MUST_EFR_BANK2; - - outb(efr, baseio + MOXA_MUST_EFR_REGISTER); - outb(value, baseio + MOXA_MUST_ENUM_REGISTER); - outb(oldlcr, baseio + UART_LCR); -} - -static void mxser_get_must_hardware_id(unsigned long baseio, u8 *pId) -{ - u8 oldlcr; - u8 efr; - - oldlcr = inb(baseio + UART_LCR); - outb(MOXA_MUST_ENTER_ENCHANCE, baseio + UART_LCR); - - efr = inb(baseio + MOXA_MUST_EFR_REGISTER); - efr &= ~MOXA_MUST_EFR_BANK_MASK; - efr |= MOXA_MUST_EFR_BANK2; - - outb(efr, baseio + MOXA_MUST_EFR_REGISTER); - *pId = inb(baseio + MOXA_MUST_HWID_REGISTER); - outb(oldlcr, baseio + UART_LCR); -} - -static void SET_MOXA_MUST_NO_SOFTWARE_FLOW_CONTROL(unsigned long baseio) -{ - u8 oldlcr; - u8 efr; - - oldlcr = inb(baseio + UART_LCR); - outb(MOXA_MUST_ENTER_ENCHANCE, baseio + UART_LCR); - - efr = inb(baseio + MOXA_MUST_EFR_REGISTER); - efr &= ~MOXA_MUST_EFR_SF_MASK; - - outb(efr, baseio + MOXA_MUST_EFR_REGISTER); - outb(oldlcr, baseio + UART_LCR); -} - -static void mxser_enable_must_tx_software_flow_control(unsigned long baseio) -{ - u8 oldlcr; - u8 efr; - - oldlcr = inb(baseio + UART_LCR); - outb(MOXA_MUST_ENTER_ENCHANCE, baseio + UART_LCR); - - efr = inb(baseio + MOXA_MUST_EFR_REGISTER); - efr &= ~MOXA_MUST_EFR_SF_TX_MASK; - efr |= MOXA_MUST_EFR_SF_TX1; - - outb(efr, baseio + MOXA_MUST_EFR_REGISTER); - outb(oldlcr, baseio + UART_LCR); -} - -static void mxser_disable_must_tx_software_flow_control(unsigned long baseio) -{ - u8 oldlcr; - u8 efr; - - oldlcr = inb(baseio + UART_LCR); - outb(MOXA_MUST_ENTER_ENCHANCE, baseio + UART_LCR); - - efr = inb(baseio + MOXA_MUST_EFR_REGISTER); - efr &= ~MOXA_MUST_EFR_SF_TX_MASK; - - outb(efr, baseio + MOXA_MUST_EFR_REGISTER); - outb(oldlcr, baseio + UART_LCR); -} - -static void mxser_enable_must_rx_software_flow_control(unsigned long baseio) -{ - u8 oldlcr; - u8 efr; - - oldlcr = inb(baseio + UART_LCR); - outb(MOXA_MUST_ENTER_ENCHANCE, baseio + UART_LCR); - - efr = inb(baseio + MOXA_MUST_EFR_REGISTER); - efr &= ~MOXA_MUST_EFR_SF_RX_MASK; - efr |= MOXA_MUST_EFR_SF_RX1; - - outb(efr, baseio + MOXA_MUST_EFR_REGISTER); - outb(oldlcr, baseio + UART_LCR); -} - -static void mxser_disable_must_rx_software_flow_control(unsigned long baseio) -{ - u8 oldlcr; - u8 efr; - - oldlcr = inb(baseio + UART_LCR); - outb(MOXA_MUST_ENTER_ENCHANCE, baseio + UART_LCR); - - efr = inb(baseio + MOXA_MUST_EFR_REGISTER); - efr &= ~MOXA_MUST_EFR_SF_RX_MASK; - - outb(efr, baseio + MOXA_MUST_EFR_REGISTER); - outb(oldlcr, baseio + UART_LCR); -} - #ifdef CONFIG_PCI static int __devinit CheckIsMoxaMust(unsigned long io) { @@ -508,16 +314,16 @@ static int __devinit CheckIsMoxaMust(unsigned long io) int i; outb(0, io + UART_LCR); - mxser_disable_must_enchance_mode(io); + DISABLE_MOXA_MUST_ENCHANCE_MODE(io); oldmcr = inb(io + UART_MCR); outb(0, io + UART_MCR); - mxser_set_must_xon1_value(io, 0x11); + SET_MOXA_MUST_XON1_VALUE(io, 0x11); if ((hwid = inb(io + UART_MCR)) != 0) { outb(oldmcr, io + UART_MCR); return MOXA_OTHER_UART; } - mxser_get_must_hardware_id(io, &hwid); + GET_MOXA_MUST_HARDWARE_ID(io, &hwid); for (i = 1; i < UART_INFO_NUM; i++) { /* 0 = OTHER_UART */ if (hwid == Gpci_uart_info[i].type) return (int)hwid; @@ -688,10 +494,10 @@ static int mxser_set_baud(struct mxser_port *info, long newspd) } else quot /= newspd; - mxser_set_must_enum_value(info->ioaddr, quot); + SET_MOXA_MUST_ENUM_VALUE(info->ioaddr, quot); } else #endif - mxser_set_must_enum_value(info->ioaddr, 0); + SET_MOXA_MUST_ENUM_VALUE(info->ioaddr, 0); return 0; } @@ -747,14 +553,14 @@ static int mxser_change_speed(struct mxser_port *info, if (info->board->chip_flag) { fcr = UART_FCR_ENABLE_FIFO; fcr |= MOXA_MUST_FCR_GDA_MODE_ENABLE; - mxser_set_must_fifo_value(info); + SET_MOXA_MUST_FIFO_VALUE(info); } else fcr = 0; } else { fcr = UART_FCR_ENABLE_FIFO; if (info->board->chip_flag) { fcr |= MOXA_MUST_FCR_GDA_MODE_ENABLE; - mxser_set_must_fifo_value(info); + SET_MOXA_MUST_FIFO_VALUE(info); } else { switch (info->rx_trigger) { case 1: @@ -851,21 +657,17 @@ static int mxser_change_speed(struct mxser_port *info, } } if (info->board->chip_flag) { - mxser_set_must_xon1_value(info->ioaddr, START_CHAR(info->tty)); - mxser_set_must_xoff1_value(info->ioaddr, STOP_CHAR(info->tty)); + SET_MOXA_MUST_XON1_VALUE(info->ioaddr, START_CHAR(info->tty)); + SET_MOXA_MUST_XOFF1_VALUE(info->ioaddr, STOP_CHAR(info->tty)); if (I_IXON(info->tty)) { - mxser_enable_must_rx_software_flow_control( - info->ioaddr); + ENABLE_MOXA_MUST_RX_SOFTWARE_FLOW_CONTROL(info->ioaddr); } else { - mxser_disable_must_rx_software_flow_control( - info->ioaddr); + DISABLE_MOXA_MUST_RX_SOFTWARE_FLOW_CONTROL(info->ioaddr); } if (I_IXOFF(info->tty)) { - mxser_enable_must_tx_software_flow_control( - info->ioaddr); + ENABLE_MOXA_MUST_TX_SOFTWARE_FLOW_CONTROL(info->ioaddr); } else { - mxser_disable_must_tx_software_flow_control( - info->ioaddr); + DISABLE_MOXA_MUST_TX_SOFTWARE_FLOW_CONTROL(info->ioaddr); } } @@ -1125,27 +927,6 @@ static int mxser_open(struct tty_struct *tty, struct file *filp) return 0; } -static void mxser_flush_buffer(struct tty_struct *tty) -{ - struct mxser_port *info = tty->driver_data; - char fcr; - unsigned long flags; - - - spin_lock_irqsave(&info->slock, flags); - info->xmit_cnt = info->xmit_head = info->xmit_tail = 0; - - fcr = inb(info->ioaddr + UART_FCR); - outb((fcr | UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT), - info->ioaddr + UART_FCR); - outb(fcr, info->ioaddr + UART_FCR); - - spin_unlock_irqrestore(&info->slock, flags); - - tty_wakeup(tty); -} - - /* * This routine is called when the serial port gets closed. First, we * wait for the last remaining data to be sent. Then, we unlink its @@ -1232,7 +1013,9 @@ static void mxser_close(struct tty_struct *tty, struct file *filp) } mxser_shutdown(info); - mxser_flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); + tty_ldisc_flush(tty); tty->closing = 0; @@ -1289,16 +1072,16 @@ static int mxser_write(struct tty_struct *tty, const unsigned char *buf, int cou return total; } -static int mxser_put_char(struct tty_struct *tty, unsigned char ch) +static void mxser_put_char(struct tty_struct *tty, unsigned char ch) { struct mxser_port *info = tty->driver_data; unsigned long flags; if (!info->xmit_buf) - return 0; + return; if (info->xmit_cnt >= SERIAL_XMIT_SIZE - 1) - return 0; + return; spin_lock_irqsave(&info->slock, flags); info->xmit_buf[info->xmit_head++] = ch; @@ -1316,7 +1099,6 @@ static int mxser_put_char(struct tty_struct *tty, unsigned char ch) spin_unlock_irqrestore(&info->slock, flags); } } - return 1; } @@ -1360,6 +1142,26 @@ static int mxser_chars_in_buffer(struct tty_struct *tty) return info->xmit_cnt; } +static void mxser_flush_buffer(struct tty_struct *tty) +{ + struct mxser_port *info = tty->driver_data; + char fcr; + unsigned long flags; + + + spin_lock_irqsave(&info->slock, flags); + info->xmit_cnt = info->xmit_head = info->xmit_tail = 0; + + fcr = inb(info->ioaddr + UART_FCR); + outb((fcr | UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT), + info->ioaddr + UART_FCR); + outb(fcr, info->ioaddr + UART_FCR); + + spin_unlock_irqrestore(&info->slock, flags); + + tty_wakeup(tty); +} + /* * ------------------------------------------------------------ * friends of mxser_ioctl() @@ -1658,7 +1460,6 @@ static int mxser_ioctl_special(unsigned int cmd, void __user *argp) struct mxser_port *port; int result, status; unsigned int i, j; - int ret = 0; switch (cmd) { case MOXA_GET_MAJOR: @@ -1666,21 +1467,18 @@ static int mxser_ioctl_special(unsigned int cmd, void __user *argp) case MOXA_CHKPORTENABLE: result = 0; - lock_kernel(); + for (i = 0; i < MXSER_BOARDS; i++) for (j = 0; j < MXSER_PORTS_PER_BOARD; j++) if (mxser_boards[i].ports[j].ioaddr) result |= (1 << i); - unlock_kernel(); + return put_user(result, (unsigned long __user *)argp); case MOXA_GETDATACOUNT: - lock_kernel(); if (copy_to_user(argp, &mxvar_log, sizeof(mxvar_log))) - ret = -EFAULT; - unlock_kernel(); - return ret; + return -EFAULT; + return 0; case MOXA_GETMSTATUS: - lock_kernel(); for (i = 0; i < MXSER_BOARDS; i++) for (j = 0; j < MXSER_PORTS_PER_BOARD; j++) { port = &mxser_boards[i].ports[j]; @@ -1717,7 +1515,6 @@ static int mxser_ioctl_special(unsigned int cmd, void __user *argp) else GMStatus[i].cts = 0; } - unlock_kernel(); if (copy_to_user(argp, GMStatus, sizeof(struct mxser_mstatus) * MXSER_PORTS)) return -EFAULT; @@ -1727,8 +1524,7 @@ static int mxser_ioctl_special(unsigned int cmd, void __user *argp) unsigned long opmode; unsigned cflag, iflag; - lock_kernel(); - for (i = 0; i < MXSER_BOARDS; i++) { + for (i = 0; i < MXSER_BOARDS; i++) for (j = 0; j < MXSER_PORTS_PER_BOARD; j++) { port = &mxser_boards[i].ports[j]; if (!port->ioaddr) @@ -1793,14 +1589,13 @@ static int mxser_ioctl_special(unsigned int cmd, void __user *argp) mon_data_ext.iftype[i] = opmode; } - } - unlock_kernel(); - if (copy_to_user(argp, &mon_data_ext, - sizeof(mon_data_ext))) - return -EFAULT; - return 0; - } - default: + if (copy_to_user(argp, &mon_data_ext, + sizeof(mon_data_ext))) + return -EFAULT; + + return 0; + + } default: return -ENOIOCTLCMD; } return 0; @@ -1856,20 +1651,16 @@ static int mxser_ioctl(struct tty_struct *tty, struct file *file, opmode != RS422_MODE && opmode != RS485_4WIRE_MODE) return -EFAULT; - lock_kernel(); mask = ModeMask[p]; shiftbit = p * 2; val = inb(info->opmode_ioaddr); val &= mask; val |= (opmode << shiftbit); outb(val, info->opmode_ioaddr); - unlock_kernel(); } else { - lock_kernel(); shiftbit = p * 2; opmode = inb(info->opmode_ioaddr) >> shiftbit; opmode &= OP_MODE_MASK; - unlock_kernel(); if (put_user(opmode, (int __user *)argp)) return -EFAULT; } @@ -1896,18 +1687,19 @@ static int mxser_ioctl(struct tty_struct *tty, struct file *file, tty_wait_until_sent(tty, 0); mxser_send_break(info, arg ? arg * (HZ / 10) : HZ / 4); return 0; + case TIOCGSOFTCAR: + return put_user(!!C_CLOCAL(tty), (unsigned long __user *)argp); + case TIOCSSOFTCAR: + if (get_user(arg, (unsigned long __user *)argp)) + return -EFAULT; + tty->termios->c_cflag = ((tty->termios->c_cflag & ~CLOCAL) | (arg ? CLOCAL : 0)); + return 0; case TIOCGSERIAL: - lock_kernel(); - retval = mxser_get_serial_info(info, argp); - unlock_kernel(); - return retval; + return mxser_get_serial_info(info, argp); case TIOCSSERIAL: - lock_kernel(); - retval = mxser_set_serial_info(info, argp); - unlock_kernel(); - return retval; + return mxser_set_serial_info(info, argp); case TIOCSERGETLSR: /* Get line status register */ - return mxser_get_lsr_info(info, argp); + return mxser_get_lsr_info(info, argp); /* * Wait for any of the 4 modem inputs (DCD,RI,DSR,CTS) to change * - mask passed in arg for lines of interest @@ -1954,27 +1746,24 @@ static int mxser_ioctl(struct tty_struct *tty, struct file *file, case MOXA_HighSpeedOn: return put_user(info->baud_base != 115200 ? 1 : 0, (int __user *)argp); case MOXA_SDS_RSTICOUNTER: - lock_kernel(); info->mon_data.rxcnt = 0; info->mon_data.txcnt = 0; - unlock_kernel(); return 0; case MOXA_ASPP_OQUEUE:{ int len, lsr; - lock_kernel(); len = mxser_chars_in_buffer(tty); + lsr = inb(info->ioaddr + UART_LSR) & UART_LSR_TEMT; + len += (lsr ? 0 : 1); - unlock_kernel(); return put_user(len, (int __user *)argp); } case MOXA_ASPP_MON: { int mcr, status; - lock_kernel(); status = mxser_get_msr(info->ioaddr, 1, tty->index); mxser_check_modem_status(info, status); @@ -1993,7 +1782,7 @@ static int mxser_ioctl(struct tty_struct *tty, struct file *file, info->mon_data.hold_reason |= NPPI_NOTIFY_CTSHOLD; else info->mon_data.hold_reason &= ~NPPI_NOTIFY_CTSHOLD; - unlock_kernel(); + if (copy_to_user(argp, &info->mon_data, sizeof(struct mxser_mon))) return -EFAULT; @@ -2136,8 +1925,7 @@ static void mxser_set_termios(struct tty_struct *tty, struct ktermios *old_termi if (info->board->chip_flag) { spin_lock_irqsave(&info->slock, flags); - mxser_disable_must_rx_software_flow_control( - info->ioaddr); + DISABLE_MOXA_MUST_RX_SOFTWARE_FLOW_CONTROL(info->ioaddr); spin_unlock_irqrestore(&info->slock, flags); } @@ -2191,7 +1979,6 @@ static void mxser_wait_until_sent(struct tty_struct *tty, int timeout) timeout, char_time); printk("jiff=%lu...", jiffies); #endif - lock_kernel(); while (!((lsr = inb(info->ioaddr + UART_LSR)) & UART_LSR_TEMT)) { #ifdef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT printk("lsr = %d (jiff=%lu)...", lsr, jiffies); @@ -2203,7 +1990,6 @@ static void mxser_wait_until_sent(struct tty_struct *tty, int timeout) break; } set_current_state(TASK_RUNNING); - unlock_kernel(); #ifdef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT printk("lsr = %d (jiff=%lu)...done\n", lsr, jiffies); @@ -2556,7 +2342,7 @@ static int __devinit mxser_initbrd(struct mxser_board *brd, /* Enhance mode enabled here */ if (brd->chip_flag != MOXA_OTHER_UART) - mxser_enable_must_enchance_mode(info->ioaddr); + ENABLE_MOXA_MUST_ENCHANCE_MODE(info->ioaddr); info->flags = ASYNC_SHARE_IRQ; info->type = brd->uart_type; diff --git a/trunk/drivers/char/mxser.h b/trunk/drivers/char/mxser.h index 41878a69203d..844171115954 100644 --- a/trunk/drivers/char/mxser.h +++ b/trunk/drivers/char/mxser.h @@ -147,4 +147,141 @@ /* Rx software flow control mask */ #define MOXA_MUST_EFR_SF_RX_MASK 0x03 +#define ENABLE_MOXA_MUST_ENCHANCE_MODE(baseio) do { \ + u8 __oldlcr, __efr; \ + __oldlcr = inb((baseio)+UART_LCR); \ + outb(MOXA_MUST_ENTER_ENCHANCE, (baseio)+UART_LCR); \ + __efr = inb((baseio)+MOXA_MUST_EFR_REGISTER); \ + __efr |= MOXA_MUST_EFR_EFRB_ENABLE; \ + outb(__efr, (baseio)+MOXA_MUST_EFR_REGISTER); \ + outb(__oldlcr, (baseio)+UART_LCR); \ +} while (0) + +#define DISABLE_MOXA_MUST_ENCHANCE_MODE(baseio) do { \ + u8 __oldlcr, __efr; \ + __oldlcr = inb((baseio)+UART_LCR); \ + outb(MOXA_MUST_ENTER_ENCHANCE, (baseio)+UART_LCR); \ + __efr = inb((baseio)+MOXA_MUST_EFR_REGISTER); \ + __efr &= ~MOXA_MUST_EFR_EFRB_ENABLE; \ + outb(__efr, (baseio)+MOXA_MUST_EFR_REGISTER); \ + outb(__oldlcr, (baseio)+UART_LCR); \ +} while (0) + +#define SET_MOXA_MUST_XON1_VALUE(baseio, Value) do { \ + u8 __oldlcr, __efr; \ + __oldlcr = inb((baseio)+UART_LCR); \ + outb(MOXA_MUST_ENTER_ENCHANCE, (baseio)+UART_LCR); \ + __efr = inb((baseio)+MOXA_MUST_EFR_REGISTER); \ + __efr &= ~MOXA_MUST_EFR_BANK_MASK; \ + __efr |= MOXA_MUST_EFR_BANK0; \ + outb(__efr, (baseio)+MOXA_MUST_EFR_REGISTER); \ + outb((u8)(Value), (baseio)+MOXA_MUST_XON1_REGISTER); \ + outb(__oldlcr, (baseio)+UART_LCR); \ +} while (0) + +#define SET_MOXA_MUST_XOFF1_VALUE(baseio, Value) do { \ + u8 __oldlcr, __efr; \ + __oldlcr = inb((baseio)+UART_LCR); \ + outb(MOXA_MUST_ENTER_ENCHANCE, (baseio)+UART_LCR); \ + __efr = inb((baseio)+MOXA_MUST_EFR_REGISTER); \ + __efr &= ~MOXA_MUST_EFR_BANK_MASK; \ + __efr |= MOXA_MUST_EFR_BANK0; \ + outb(__efr, (baseio)+MOXA_MUST_EFR_REGISTER); \ + outb((u8)(Value), (baseio)+MOXA_MUST_XOFF1_REGISTER); \ + outb(__oldlcr, (baseio)+UART_LCR); \ +} while (0) + +#define SET_MOXA_MUST_FIFO_VALUE(info) do { \ + u8 __oldlcr, __efr; \ + __oldlcr = inb((info)->ioaddr+UART_LCR); \ + outb(MOXA_MUST_ENTER_ENCHANCE, (info)->ioaddr+UART_LCR);\ + __efr = inb((info)->ioaddr+MOXA_MUST_EFR_REGISTER); \ + __efr &= ~MOXA_MUST_EFR_BANK_MASK; \ + __efr |= MOXA_MUST_EFR_BANK1; \ + outb(__efr, (info)->ioaddr+MOXA_MUST_EFR_REGISTER); \ + outb((u8)((info)->rx_high_water), (info)->ioaddr+ \ + MOXA_MUST_RBRTH_REGISTER); \ + outb((u8)((info)->rx_trigger), (info)->ioaddr+ \ + MOXA_MUST_RBRTI_REGISTER); \ + outb((u8)((info)->rx_low_water), (info)->ioaddr+ \ + MOXA_MUST_RBRTL_REGISTER); \ + outb(__oldlcr, (info)->ioaddr+UART_LCR); \ +} while (0) + +#define SET_MOXA_MUST_ENUM_VALUE(baseio, Value) do { \ + u8 __oldlcr, __efr; \ + __oldlcr = inb((baseio)+UART_LCR); \ + outb(MOXA_MUST_ENTER_ENCHANCE, (baseio)+UART_LCR); \ + __efr = inb((baseio)+MOXA_MUST_EFR_REGISTER); \ + __efr &= ~MOXA_MUST_EFR_BANK_MASK; \ + __efr |= MOXA_MUST_EFR_BANK2; \ + outb(__efr, (baseio)+MOXA_MUST_EFR_REGISTER); \ + outb((u8)(Value), (baseio)+MOXA_MUST_ENUM_REGISTER); \ + outb(__oldlcr, (baseio)+UART_LCR); \ +} while (0) + +#define GET_MOXA_MUST_HARDWARE_ID(baseio, pId) do { \ + u8 __oldlcr, __efr; \ + __oldlcr = inb((baseio)+UART_LCR); \ + outb(MOXA_MUST_ENTER_ENCHANCE, (baseio)+UART_LCR); \ + __efr = inb((baseio)+MOXA_MUST_EFR_REGISTER); \ + __efr &= ~MOXA_MUST_EFR_BANK_MASK; \ + __efr |= MOXA_MUST_EFR_BANK2; \ + outb(__efr, (baseio)+MOXA_MUST_EFR_REGISTER); \ + *pId = inb((baseio)+MOXA_MUST_HWID_REGISTER); \ + outb(__oldlcr, (baseio)+UART_LCR); \ +} while (0) + +#define SET_MOXA_MUST_NO_SOFTWARE_FLOW_CONTROL(baseio) do { \ + u8 __oldlcr, __efr; \ + __oldlcr = inb((baseio)+UART_LCR); \ + outb(MOXA_MUST_ENTER_ENCHANCE, (baseio)+UART_LCR); \ + __efr = inb((baseio)+MOXA_MUST_EFR_REGISTER); \ + __efr &= ~MOXA_MUST_EFR_SF_MASK; \ + outb(__efr, (baseio)+MOXA_MUST_EFR_REGISTER); \ + outb(__oldlcr, (baseio)+UART_LCR); \ +} while (0) + +#define ENABLE_MOXA_MUST_TX_SOFTWARE_FLOW_CONTROL(baseio) do { \ + u8 __oldlcr, __efr; \ + __oldlcr = inb((baseio)+UART_LCR); \ + outb(MOXA_MUST_ENTER_ENCHANCE, (baseio)+UART_LCR); \ + __efr = inb((baseio)+MOXA_MUST_EFR_REGISTER); \ + __efr &= ~MOXA_MUST_EFR_SF_TX_MASK; \ + __efr |= MOXA_MUST_EFR_SF_TX1; \ + outb(__efr, (baseio)+MOXA_MUST_EFR_REGISTER); \ + outb(__oldlcr, (baseio)+UART_LCR); \ +} while (0) + +#define DISABLE_MOXA_MUST_TX_SOFTWARE_FLOW_CONTROL(baseio) do { \ + u8 __oldlcr, __efr; \ + __oldlcr = inb((baseio)+UART_LCR); \ + outb(MOXA_MUST_ENTER_ENCHANCE, (baseio)+UART_LCR); \ + __efr = inb((baseio)+MOXA_MUST_EFR_REGISTER); \ + __efr &= ~MOXA_MUST_EFR_SF_TX_MASK; \ + outb(__efr, (baseio)+MOXA_MUST_EFR_REGISTER); \ + outb(__oldlcr, (baseio)+UART_LCR); \ +} while (0) + +#define ENABLE_MOXA_MUST_RX_SOFTWARE_FLOW_CONTROL(baseio) do { \ + u8 __oldlcr, __efr; \ + __oldlcr = inb((baseio)+UART_LCR); \ + outb(MOXA_MUST_ENTER_ENCHANCE, (baseio)+UART_LCR); \ + __efr = inb((baseio)+MOXA_MUST_EFR_REGISTER); \ + __efr &= ~MOXA_MUST_EFR_SF_RX_MASK; \ + __efr |= MOXA_MUST_EFR_SF_RX1; \ + outb(__efr, (baseio)+MOXA_MUST_EFR_REGISTER); \ + outb(__oldlcr, (baseio)+UART_LCR); \ +} while (0) + +#define DISABLE_MOXA_MUST_RX_SOFTWARE_FLOW_CONTROL(baseio) do { \ + u8 __oldlcr, __efr; \ + __oldlcr = inb((baseio)+UART_LCR); \ + outb(MOXA_MUST_ENTER_ENCHANCE, (baseio)+UART_LCR); \ + __efr = inb((baseio)+MOXA_MUST_EFR_REGISTER); \ + __efr &= ~MOXA_MUST_EFR_SF_RX_MASK; \ + outb(__efr, (baseio)+MOXA_MUST_EFR_REGISTER); \ + outb(__oldlcr, (baseio)+UART_LCR); \ +} while (0) + #endif diff --git a/trunk/drivers/char/n_hdlc.c b/trunk/drivers/char/n_hdlc.c index a35bfd7ee80e..06803ed5568c 100644 --- a/trunk/drivers/char/n_hdlc.c +++ b/trunk/drivers/char/n_hdlc.c @@ -342,10 +342,12 @@ static int n_hdlc_tty_open (struct tty_struct *tty) #endif /* Flush any pending characters in the driver and discipline. */ + if (tty->ldisc.flush_buffer) - tty->ldisc.flush_buffer(tty); + tty->ldisc.flush_buffer (tty); - tty_driver_flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer (tty); if (debuglevel >= DEBUG_LEVEL_INFO) printk("%s(%d)n_hdlc_tty_open() success\n",__FILE__,__LINE__); @@ -397,7 +399,7 @@ static void n_hdlc_send_frames(struct n_hdlc *n_hdlc, struct tty_struct *tty) /* Send the next block of data to device */ tty->flags |= (1 << TTY_DO_WRITE_WAKEUP); - actual = tty->ops->write(tty, tbuf->buf, tbuf->count); + actual = tty->driver->write(tty, tbuf->buf, tbuf->count); /* rollback was possible and has been done */ if (actual == -ERESTARTSYS) { @@ -576,36 +578,26 @@ static ssize_t n_hdlc_tty_read(struct tty_struct *tty, struct file *file, return -EFAULT; } - lock_kernel(); - for (;;) { - if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) { - unlock_kernel(); + if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) return -EIO; - } n_hdlc = tty2n_hdlc (tty); if (!n_hdlc || n_hdlc->magic != HDLC_MAGIC || - tty != n_hdlc->tty) { - unlock_kernel(); + tty != n_hdlc->tty) return 0; - } rbuf = n_hdlc_buf_get(&n_hdlc->rx_buf_list); if (rbuf) break; /* no data */ - if (file->f_flags & O_NONBLOCK) { - unlock_kernel(); + if (file->f_flags & O_NONBLOCK) return -EAGAIN; - } interruptible_sleep_on (&tty->read_wait); - if (signal_pending(current)) { - unlock_kernel(); + if (signal_pending(current)) return -EINTR; - } } if (rbuf->count > nr) @@ -626,7 +618,7 @@ static ssize_t n_hdlc_tty_read(struct tty_struct *tty, struct file *file, kfree(rbuf); else n_hdlc_buf_put(&n_hdlc->rx_free_buf_list,rbuf); - unlock_kernel(); + return ret; } /* end of n_hdlc_tty_read() */ @@ -669,8 +661,6 @@ static ssize_t n_hdlc_tty_write(struct tty_struct *tty, struct file *file, count = maxframe; } - lock_kernel(); - add_wait_queue(&tty->write_wait, &wait); set_current_state(TASK_INTERRUPTIBLE); @@ -705,7 +695,7 @@ static ssize_t n_hdlc_tty_write(struct tty_struct *tty, struct file *file, n_hdlc_buf_put(&n_hdlc->tx_buf_list,tbuf); n_hdlc_send_frames(n_hdlc,tty); } - unlock_kernel(); + return error; } /* end of n_hdlc_tty_write() */ @@ -750,7 +740,8 @@ static int n_hdlc_tty_ioctl(struct tty_struct *tty, struct file *file, case TIOCOUTQ: /* get the pending tx byte count in the driver */ - count = tty_chars_in_buffer(tty); + count = tty->driver->chars_in_buffer ? + tty->driver->chars_in_buffer(tty) : 0; /* add size of next output frame in queue */ spin_lock_irqsave(&n_hdlc->tx_buf_list.spinlock,flags); if (n_hdlc->tx_buf_list.head) diff --git a/trunk/drivers/char/n_r3964.c b/trunk/drivers/char/n_r3964.c index 902169062332..6b918b80f73e 100644 --- a/trunk/drivers/char/n_r3964.c +++ b/trunk/drivers/char/n_r3964.c @@ -376,9 +376,8 @@ static void put_char(struct r3964_info *pInfo, unsigned char ch) if (tty == NULL) return; - /* FIXME: put_char should not be called from an IRQ */ - if (tty->ops->put_char) { - tty->ops->put_char(tty, ch); + if (tty->driver->put_char) { + tty->driver->put_char(tty, ch); } pInfo->bcc ^= ch; } @@ -387,9 +386,12 @@ static void flush(struct r3964_info *pInfo) { struct tty_struct *tty = pInfo->tty; - if (tty == NULL || tty->ops->flush_chars == NULL) + if (tty == NULL) return; - tty->ops->flush_chars(tty); + + if (tty->driver->flush_chars) { + tty->driver->flush_chars(tty); + } } static void trigger_transmit(struct r3964_info *pInfo) @@ -447,11 +449,12 @@ static void transmit_block(struct r3964_info *pInfo) struct r3964_block_header *pBlock = pInfo->tx_first; int room = 0; - if (tty == NULL || pBlock == NULL) { + if ((tty == NULL) || (pBlock == NULL)) { return; } - room = tty_write_room(tty); + if (tty->driver->write_room) + room = tty->driver->write_room(tty); TRACE_PS("transmit_block %p, room %d, length %d", pBlock, room, pBlock->length); @@ -1072,15 +1075,12 @@ static ssize_t r3964_read(struct tty_struct *tty, struct file *file, TRACE_L("read()"); - lock_kernel(); - pClient = findClient(pInfo, task_pid(current)); if (pClient) { pMsg = remove_msg(pInfo, pClient); if (pMsg == NULL) { /* no messages available. */ if (file->f_flags & O_NONBLOCK) { - unlock_kernel(); return -EAGAIN; } /* block until there is a message: */ @@ -1090,10 +1090,8 @@ static ssize_t r3964_read(struct tty_struct *tty, struct file *file, /* If we still haven't got a message, we must have been signalled */ - if (!pMsg) { - unlock_kernel(); + if (!pMsg) return -EINTR; - } /* deliver msg to client process: */ theMsg.msg_id = pMsg->msg_id; @@ -1104,15 +1102,12 @@ static ssize_t r3964_read(struct tty_struct *tty, struct file *file, kfree(pMsg); TRACE_M("r3964_read - msg kfree %p", pMsg); - if (copy_to_user(buf, &theMsg, count)) { - unlock_kernel(); + if (copy_to_user(buf, &theMsg, count)) return -EFAULT; - } TRACE_PS("read - return %d", count); return count; } - unlock_kernel(); return -EPERM; } @@ -1161,8 +1156,6 @@ static ssize_t r3964_write(struct tty_struct *tty, struct file *file, pHeader->locks = 0; pHeader->owner = NULL; - lock_kernel(); - pClient = findClient(pInfo, task_pid(current)); if (pClient) { pHeader->owner = pClient; @@ -1180,8 +1173,6 @@ static ssize_t r3964_write(struct tty_struct *tty, struct file *file, add_tx_queue(pInfo, pHeader); trigger_transmit(pInfo); - unlock_kernel(); - return 0; } diff --git a/trunk/drivers/char/n_tty.c b/trunk/drivers/char/n_tty.c index 19105ec203f7..0c09409fa45d 100644 --- a/trunk/drivers/char/n_tty.c +++ b/trunk/drivers/char/n_tty.c @@ -147,8 +147,10 @@ static void put_tty_queue(unsigned char c, struct tty_struct *tty) static void check_unthrottle(struct tty_struct *tty) { - if (tty->count) - tty_unthrottle(tty); + if (tty->count && + test_and_clear_bit(TTY_THROTTLED, &tty->flags) && + tty->driver->unthrottle) + tty->driver->unthrottle(tty); } /** @@ -181,24 +183,22 @@ static void reset_buffer_flags(struct tty_struct *tty) * at hangup) or when the N_TTY line discipline internally has to * clean the pending queue (for example some signals). * - * Locking: ctrl_lock + * FIXME: tty->ctrl_status is not spinlocked and relies on + * lock_kernel() still. */ static void n_tty_flush_buffer(struct tty_struct *tty) { - unsigned long flags; /* clear everything and unthrottle the driver */ reset_buffer_flags(tty); if (!tty->link) return; - spin_lock_irqsave(&tty->ctrl_lock, flags); if (tty->link->packet) { tty->ctrl_status |= TIOCPKT_FLUSHREAD; wake_up_interruptible(&tty->link->read_wait); } - spin_unlock_irqrestore(&tty->ctrl_lock, flags); } /** @@ -264,18 +264,17 @@ static inline int is_continuation(unsigned char c, struct tty_struct *tty) * relevant in the world today. If you ever need them, add them here. * * Called from both the receive and transmit sides and can be called - * re-entrantly. Relies on lock_kernel() for tty->column state. + * re-entrantly. Relies on lock_kernel() still. */ static int opost(unsigned char c, struct tty_struct *tty) { int space, spaces; - space = tty_write_room(tty); + space = tty->driver->write_room(tty); if (!space) return -1; - lock_kernel(); if (O_OPOST(tty)) { switch (c) { case '\n': @@ -284,7 +283,7 @@ static int opost(unsigned char c, struct tty_struct *tty) if (O_ONLCR(tty)) { if (space < 2) return -1; - tty_put_char(tty, '\r'); + tty->driver->put_char(tty, '\r'); tty->column = 0; } tty->canon_column = tty->column; @@ -306,7 +305,7 @@ static int opost(unsigned char c, struct tty_struct *tty) if (space < spaces) return -1; tty->column += spaces; - tty->ops->write(tty, " ", spaces); + tty->driver->write(tty, " ", spaces); return 0; } tty->column += spaces; @@ -323,8 +322,7 @@ static int opost(unsigned char c, struct tty_struct *tty) break; } } - tty_put_char(tty, c); - unlock_kernel(); + tty->driver->put_char(tty, c); return 0; } @@ -339,8 +337,7 @@ static int opost(unsigned char c, struct tty_struct *tty) * the simple cases normally found and helps to generate blocks of * symbols for the console driver and thus improve performance. * - * Called from write_chan under the tty layer write lock. Relies - * on lock_kernel for the tty->column state. + * Called from write_chan under the tty layer write lock. */ static ssize_t opost_block(struct tty_struct *tty, @@ -350,13 +347,12 @@ static ssize_t opost_block(struct tty_struct *tty, int i; const unsigned char *cp; - space = tty_write_room(tty); + space = tty->driver->write_room(tty); if (!space) return 0; if (nr > space) nr = space; - lock_kernel(); for (i = 0, cp = buf; i < nr; i++, cp++) { switch (*cp) { case '\n': @@ -388,14 +384,26 @@ static ssize_t opost_block(struct tty_struct *tty, } } break_out: - if (tty->ops->flush_chars) - tty->ops->flush_chars(tty); - i = tty->ops->write(tty, buf, i); - unlock_kernel(); + if (tty->driver->flush_chars) + tty->driver->flush_chars(tty); + i = tty->driver->write(tty, buf, i); return i; } +/** + * put_char - write character to driver + * @c: character (or part of unicode symbol) + * @tty: terminal device + * + * Queue a byte to the driver layer for output + */ + +static inline void put_char(unsigned char c, struct tty_struct *tty) +{ + tty->driver->put_char(tty, c); +} + /** * echo_char - echo characters * @c: unicode byte to echo @@ -408,8 +416,8 @@ static ssize_t opost_block(struct tty_struct *tty, static void echo_char(unsigned char c, struct tty_struct *tty) { if (L_ECHOCTL(tty) && iscntrl(c) && c != '\t') { - tty_put_char(tty, '^'); - tty_put_char(tty, c ^ 0100); + put_char('^', tty); + put_char(c ^ 0100, tty); tty->column += 2; } else opost(c, tty); @@ -418,7 +426,7 @@ static void echo_char(unsigned char c, struct tty_struct *tty) static inline void finish_erasing(struct tty_struct *tty) { if (tty->erasing) { - tty_put_char(tty, '/'); + put_char('/', tty); tty->column++; tty->erasing = 0; } @@ -502,7 +510,7 @@ static void eraser(unsigned char c, struct tty_struct *tty) if (L_ECHO(tty)) { if (L_ECHOPRT(tty)) { if (!tty->erasing) { - tty_put_char(tty, '\\'); + put_char('\\', tty); tty->column++; tty->erasing = 1; } @@ -510,7 +518,7 @@ static void eraser(unsigned char c, struct tty_struct *tty) echo_char(c, tty); while (--cnt > 0) { head = (head+1) & (N_TTY_BUF_SIZE-1); - tty_put_char(tty, tty->read_buf[head]); + put_char(tty->read_buf[head], tty); } } else if (kill_type == ERASE && !L_ECHOE(tty)) { echo_char(ERASE_CHAR(tty), tty); @@ -538,22 +546,22 @@ static void eraser(unsigned char c, struct tty_struct *tty) /* Now backup to that column. */ while (tty->column > col) { /* Can't use opost here. */ - tty_put_char(tty, '\b'); + put_char('\b', tty); if (tty->column > 0) tty->column--; } } else { if (iscntrl(c) && L_ECHOCTL(tty)) { - tty_put_char(tty, '\b'); - tty_put_char(tty, ' '); - tty_put_char(tty, '\b'); + put_char('\b', tty); + put_char(' ', tty); + put_char('\b', tty); if (tty->column > 0) tty->column--; } if (!iscntrl(c) || L_ECHOCTL(tty)) { - tty_put_char(tty, '\b'); - tty_put_char(tty, ' '); - tty_put_char(tty, '\b'); + put_char('\b', tty); + put_char(' ', tty); + put_char('\b', tty); if (tty->column > 0) tty->column--; } @@ -584,7 +592,8 @@ static inline void isig(int sig, struct tty_struct *tty, int flush) kill_pgrp(tty->pgrp, sig, 1); if (flush || !L_NOFLSH(tty)) { n_tty_flush_buffer(tty); - tty_driver_flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); } } @@ -692,7 +701,7 @@ static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c) if (tty->stopped && !tty->flow_stopped && I_IXON(tty) && ((I_IXANY(tty) && c != START_CHAR(tty) && c != STOP_CHAR(tty)) || - c == INTR_CHAR(tty) || c == QUIT_CHAR(tty) || c == SUSP_CHAR(tty))) + c == INTR_CHAR(tty) || c == QUIT_CHAR(tty))) start_tty(tty); if (tty->closing) { @@ -716,7 +725,7 @@ static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c) tty->lnext = 0; if (L_ECHO(tty)) { if (tty->read_cnt >= N_TTY_BUF_SIZE-1) { - tty_put_char(tty, '\a'); /* beep if no space */ + put_char('\a', tty); /* beep if no space */ return; } /* Record the column of first canon char. */ @@ -730,6 +739,13 @@ static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c) return; } + if (c == '\r') { + if (I_IGNCR(tty)) + return; + if (I_ICRNL(tty)) + c = '\n'; + } else if (c == '\n' && I_INLCR(tty)) + c = '\r'; if (I_IXON(tty)) { if (c == START_CHAR(tty)) { start_tty(tty); @@ -740,7 +756,6 @@ static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c) return; } } - if (L_ISIG(tty)) { int signal; signal = SIGINT; @@ -760,7 +775,8 @@ static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c) */ if (!L_NOFLSH(tty)) { n_tty_flush_buffer(tty); - tty_driver_flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); } if (L_ECHO(tty)) echo_char(c, tty); @@ -769,15 +785,6 @@ static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c) return; } } - - if (c == '\r') { - if (I_IGNCR(tty)) - return; - if (I_ICRNL(tty)) - c = '\n'; - } else if (c == '\n' && I_INLCR(tty)) - c = '\r'; - if (tty->icanon) { if (c == ERASE_CHAR(tty) || c == KILL_CHAR(tty) || (c == WERASE_CHAR(tty) && L_IEXTEN(tty))) { @@ -789,8 +796,8 @@ static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c) if (L_ECHO(tty)) { finish_erasing(tty); if (L_ECHOCTL(tty)) { - tty_put_char(tty, '^'); - tty_put_char(tty, '\b'); + put_char('^', tty); + put_char('\b', tty); } } return; @@ -811,7 +818,7 @@ static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c) if (c == '\n') { if (L_ECHO(tty) || L_ECHONL(tty)) { if (tty->read_cnt >= N_TTY_BUF_SIZE-1) - tty_put_char(tty, '\a'); + put_char('\a', tty); opost('\n', tty); } goto handle_newline; @@ -829,7 +836,7 @@ static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c) */ if (L_ECHO(tty)) { if (tty->read_cnt >= N_TTY_BUF_SIZE-1) - tty_put_char(tty, '\a'); + put_char('\a', tty); /* Record the column of first canon char. */ if (tty->canon_head == tty->read_head) tty->canon_column = tty->column; @@ -859,7 +866,7 @@ static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c) finish_erasing(tty); if (L_ECHO(tty)) { if (tty->read_cnt >= N_TTY_BUF_SIZE-1) { - tty_put_char(tty, '\a'); /* beep if no space */ + put_char('\a', tty); /* beep if no space */ return; } if (c == '\n') @@ -963,8 +970,8 @@ static void n_tty_receive_buf(struct tty_struct *tty, const unsigned char *cp, break; } } - if (tty->ops->flush_chars) - tty->ops->flush_chars(tty); + if (tty->driver->flush_chars) + tty->driver->flush_chars(tty); } n_tty_set_room(tty); @@ -980,8 +987,12 @@ static void n_tty_receive_buf(struct tty_struct *tty, const unsigned char *cp, * mode. We don't want to throttle the driver if we're in * canonical mode and don't have a newline yet! */ - if (tty->receive_room < TTY_THRESHOLD_THROTTLE) - tty_throttle(tty); + if (tty->receive_room < TTY_THRESHOLD_THROTTLE) { + /* check TTY_THROTTLED first so it indicates our state */ + if (!test_and_set_bit(TTY_THROTTLED, &tty->flags) && + tty->driver->throttle) + tty->driver->throttle(tty); + } } int is_ignored(int sig) @@ -1065,9 +1076,6 @@ static void n_tty_set_termios(struct tty_struct *tty, struct ktermios *old) tty->real_raw = 0; } n_tty_set_room(tty); - /* The termios change make the tty ready for I/O */ - wake_up_interruptible(&tty->write_wait); - wake_up_interruptible(&tty->read_wait); } /** @@ -1186,11 +1194,6 @@ extern ssize_t redirected_tty_write(struct file *, const char __user *, * Perform job control management checks on this file/tty descriptor * and if appropriate send any needed signals and return a negative * error code if action should be taken. - * - * FIXME: - * Locking: None - redirected write test is safe, testing - * current->signal should possibly lock current->sighand - * pgrp locking ? */ static int job_control(struct tty_struct *tty, struct file *file) @@ -1243,7 +1246,6 @@ static ssize_t read_chan(struct tty_struct *tty, struct file *file, ssize_t size; long timeout; unsigned long flags; - int packet; do_it_again: @@ -1287,19 +1289,16 @@ static ssize_t read_chan(struct tty_struct *tty, struct file *file, if (mutex_lock_interruptible(&tty->atomic_read_lock)) return -ERESTARTSYS; } - packet = tty->packet; add_wait_queue(&tty->read_wait, &wait); while (nr) { /* First test for status change. */ - if (packet && tty->link->ctrl_status) { + if (tty->packet && tty->link->ctrl_status) { unsigned char cs; if (b != buf) break; - spin_lock_irqsave(&tty->link->ctrl_lock, flags); cs = tty->link->ctrl_status; tty->link->ctrl_status = 0; - spin_unlock_irqrestore(&tty->link->ctrl_lock, flags); if (tty_put_user(tty, cs, b++)) { retval = -EFAULT; b--; @@ -1334,7 +1333,6 @@ static ssize_t read_chan(struct tty_struct *tty, struct file *file, retval = -ERESTARTSYS; break; } - /* FIXME: does n_tty_set_room need locking ? */ n_tty_set_room(tty); timeout = schedule_timeout(timeout); continue; @@ -1342,7 +1340,7 @@ static ssize_t read_chan(struct tty_struct *tty, struct file *file, __set_current_state(TASK_RUNNING); /* Deal with packet mode. */ - if (packet && b == buf) { + if (tty->packet && b == buf) { if (tty_put_user(tty, TIOCPKT_DATA, b++)) { retval = -EFAULT; b--; @@ -1390,8 +1388,6 @@ static ssize_t read_chan(struct tty_struct *tty, struct file *file, break; } else { int uncopied; - /* The copy function takes the read lock and handles - locking internally for this case */ uncopied = copy_from_read_buf(tty, &b, &nr); uncopied += copy_from_read_buf(tty, &b, &nr); if (uncopied) { @@ -1433,6 +1429,7 @@ static ssize_t read_chan(struct tty_struct *tty, struct file *file, goto do_it_again; n_tty_set_room(tty); + return retval; } @@ -1495,11 +1492,11 @@ static ssize_t write_chan(struct tty_struct *tty, struct file *file, break; b++; nr--; } - if (tty->ops->flush_chars) - tty->ops->flush_chars(tty); + if (tty->driver->flush_chars) + tty->driver->flush_chars(tty); } else { while (nr > 0) { - c = tty->ops->write(tty, b, nr); + c = tty->driver->write(tty, b, nr); if (c < 0) { retval = c; goto break_out; @@ -1536,6 +1533,11 @@ static ssize_t write_chan(struct tty_struct *tty, struct file *file, * * This code must be sure never to sleep through a hangup. * Called without the kernel lock held - fine + * + * FIXME: if someone changes the VMIN or discipline settings for the + * terminal while another process is in poll() the poll does not + * recompute the new limits. Possibly set_termios should issue + * a read wakeup to fix this bug. */ static unsigned int normal_poll(struct tty_struct *tty, struct file *file, @@ -1559,9 +1561,9 @@ static unsigned int normal_poll(struct tty_struct *tty, struct file *file, else tty->minimum_to_wake = 1; } - if (tty->ops->write && !tty_is_writelocked(tty) && - tty_chars_in_buffer(tty) < WAKEUP_CHARS && - tty_write_room(tty) > 0) + if (!tty_is_writelocked(tty) && + tty->driver->chars_in_buffer(tty) < WAKEUP_CHARS && + tty->driver->write_room(tty) > 0) mask |= POLLOUT | POLLWRNORM; return mask; } diff --git a/trunk/drivers/char/nozomi.c b/trunk/drivers/char/nozomi.c index 66a0f931c66c..6a6843a0a674 100644 --- a/trunk/drivers/char/nozomi.c +++ b/trunk/drivers/char/nozomi.c @@ -73,7 +73,7 @@ do { \ char tmp[P_BUF_SIZE]; \ snprintf(tmp, sizeof(tmp), ##args); \ printk(_err_flag_ "[%d] %s(): %s\n", __LINE__, \ - __func__, tmp); \ + __FUNCTION__, tmp); \ } while (0) #define DBG1(args...) D_(0x01, ##args) @@ -1407,7 +1407,7 @@ static int __devinit nozomi_card_init(struct pci_dev *pdev, /* Find out what card type it is */ nozomi_get_card_type(dc); - dc->base_addr = ioremap_nocache(start, dc->card_type); + dc->base_addr = ioremap(start, dc->card_type); if (!dc->base_addr) { dev_err(&pdev->dev, "Unable to map card MMIO\n"); ret = -ENODEV; @@ -1724,8 +1724,6 @@ static int ntty_tiocmget(struct tty_struct *tty, struct file *file) const struct ctrl_dl *ctrl_dl = &port->ctrl_dl; const struct ctrl_ul *ctrl_ul = &port->ctrl_ul; - /* Note: these could change under us but it is not clear this - matters if so */ return (ctrl_ul->RTS ? TIOCM_RTS : 0) | (ctrl_ul->DTR ? TIOCM_DTR : 0) | (ctrl_dl->DCD ? TIOCM_CAR : 0) | @@ -1851,6 +1849,16 @@ static void ntty_throttle(struct tty_struct *tty) spin_unlock_irqrestore(&dc->spin_mutex, flags); } +/* just to discard single character writes */ +static void ntty_put_char(struct tty_struct *tty, unsigned char c) +{ + /* + * card does not react correct when we write single chars + * to the card, so we discard them + */ + DBG2("PUT CHAR Function: %c", c); +} + /* Returns number of chars in buffer, called by tty layer */ static s32 ntty_chars_in_buffer(struct tty_struct *tty) { @@ -1884,6 +1892,7 @@ static const struct tty_operations tty_ops = { .unthrottle = ntty_unthrottle, .throttle = ntty_throttle, .chars_in_buffer = ntty_chars_in_buffer, + .put_char = ntty_put_char, .tiocmget = ntty_tiocmget, .tiocmset = ntty_tiocmset, }; diff --git a/trunk/drivers/char/pcmcia/cm4000_cs.c b/trunk/drivers/char/pcmcia/cm4000_cs.c index 4a933d413423..454d7324ba40 100644 --- a/trunk/drivers/char/pcmcia/cm4000_cs.c +++ b/trunk/drivers/char/pcmcia/cm4000_cs.c @@ -53,7 +53,7 @@ module_param(pc_debug, int, 0600); #define DEBUGP(n, rdr, x, args...) do { \ if (pc_debug >= (n)) \ dev_printk(KERN_DEBUG, reader_to_dev(rdr), "%s:" x, \ - __func__ , ## args); \ + __FUNCTION__ , ## args); \ } while (0) #else #define DEBUGP(n, rdr, x, args...) diff --git a/trunk/drivers/char/pcmcia/cm4040_cs.c b/trunk/drivers/char/pcmcia/cm4040_cs.c index 035084c07329..5f291bf739a6 100644 --- a/trunk/drivers/char/pcmcia/cm4040_cs.c +++ b/trunk/drivers/char/pcmcia/cm4040_cs.c @@ -47,7 +47,7 @@ module_param(pc_debug, int, 0600); #define DEBUGP(n, rdr, x, args...) do { \ if (pc_debug >= (n)) \ dev_printk(KERN_DEBUG, reader_to_dev(rdr), "%s:" x, \ - __func__ , ##args); \ + __FUNCTION__ , ##args); \ } while (0) #else #define DEBUGP(n, rdr, x, args...) diff --git a/trunk/drivers/char/pcmcia/synclink_cs.c b/trunk/drivers/char/pcmcia/synclink_cs.c index 1dd0e992c83d..583356426dfb 100644 --- a/trunk/drivers/char/pcmcia/synclink_cs.c +++ b/trunk/drivers/char/pcmcia/synclink_cs.c @@ -503,9 +503,20 @@ static void* mgslpc_get_text_ptr(void) * The wrappers maintain line discipline references * while calling into the line discipline. * + * ldisc_flush_buffer - flush line discipline receive buffers * ldisc_receive_buf - pass receive data to line discipline */ +static void ldisc_flush_buffer(struct tty_struct *tty) +{ + struct tty_ldisc *ld = tty_ldisc_ref(tty); + if (ld) { + if (ld->flush_buffer) + ld->flush_buffer(tty); + tty_ldisc_deref(ld); + } +} + static void ldisc_receive_buf(struct tty_struct *tty, const __u8 *data, char *flags, int count) { @@ -1545,7 +1556,7 @@ static void mgslpc_change_params(MGSLPC_INFO *info) /* Add a character to the transmit buffer */ -static int mgslpc_put_char(struct tty_struct *tty, unsigned char ch) +static void mgslpc_put_char(struct tty_struct *tty, unsigned char ch) { MGSLPC_INFO *info = (MGSLPC_INFO *)tty->driver_data; unsigned long flags; @@ -1556,10 +1567,10 @@ static int mgslpc_put_char(struct tty_struct *tty, unsigned char ch) } if (mgslpc_paranoia_check(info, tty->name, "mgslpc_put_char")) - return 0; + return; if (!info->tx_buf) - return 0; + return; spin_lock_irqsave(&info->lock,flags); @@ -1572,7 +1583,6 @@ static int mgslpc_put_char(struct tty_struct *tty, unsigned char ch) } spin_unlock_irqrestore(&info->lock,flags); - return 1; } /* Enable transmitter so remaining characters in the @@ -2457,9 +2467,10 @@ static void mgslpc_close(struct tty_struct *tty, struct file * filp) if (info->flags & ASYNC_INITIALIZED) mgslpc_wait_until_sent(tty, info->timeout); - mgslpc_flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); - tty_ldisc_flush(tty); + ldisc_flush_buffer(tty); shutdown(info); diff --git a/trunk/drivers/char/pty.c b/trunk/drivers/char/pty.c index 0a05c038ae6f..706ff34728f1 100644 --- a/trunk/drivers/char/pty.c +++ b/trunk/drivers/char/pty.c @@ -181,7 +181,6 @@ static int pty_set_lock(struct tty_struct *tty, int __user * arg) static void pty_flush_buffer(struct tty_struct *tty) { struct tty_struct *to = tty->link; - unsigned long flags; if (!to) return; @@ -190,10 +189,8 @@ static void pty_flush_buffer(struct tty_struct *tty) to->ldisc.flush_buffer(to); if (to->packet) { - spin_lock_irqsave(&tty->ctrl_lock, flags); tty->ctrl_status |= TIOCPKT_FLUSHWRITE; wake_up_interruptible(&to->read_wait); - spin_unlock_irqrestore(&tty->ctrl_lock, flags); } } @@ -254,18 +251,6 @@ static int pty_bsd_ioctl(struct tty_struct *tty, struct file *file, static int legacy_count = CONFIG_LEGACY_PTY_COUNT; module_param(legacy_count, int, 0); -static const struct tty_operations pty_ops_bsd = { - .open = pty_open, - .close = pty_close, - .write = pty_write, - .write_room = pty_write_room, - .flush_buffer = pty_flush_buffer, - .chars_in_buffer = pty_chars_in_buffer, - .unthrottle = pty_unthrottle, - .set_termios = pty_set_termios, - .ioctl = pty_bsd_ioctl, -}; - static void __init legacy_pty_init(void) { if (legacy_count <= 0) @@ -296,6 +281,7 @@ static void __init legacy_pty_init(void) pty_driver->flags = TTY_DRIVER_RESET_TERMIOS | TTY_DRIVER_REAL_RAW; pty_driver->other = pty_slave_driver; tty_set_operations(pty_driver, &pty_ops); + pty_driver->ioctl = pty_bsd_ioctl; pty_slave_driver->owner = THIS_MODULE; pty_slave_driver->driver_name = "pty_slave"; @@ -388,19 +374,6 @@ static int pty_unix98_ioctl(struct tty_struct *tty, struct file *file, return -ENOIOCTLCMD; } -static const struct tty_operations pty_unix98_ops = { - .open = pty_open, - .close = pty_close, - .write = pty_write, - .write_room = pty_write_room, - .flush_buffer = pty_flush_buffer, - .chars_in_buffer = pty_chars_in_buffer, - .unthrottle = pty_unthrottle, - .set_termios = pty_set_termios, - .ioctl = pty_unix98_ioctl -}; - - static void __init unix98_pty_init(void) { ptm_driver = alloc_tty_driver(NR_UNIX98_PTY_MAX); @@ -427,7 +400,8 @@ static void __init unix98_pty_init(void) ptm_driver->flags = TTY_DRIVER_RESET_TERMIOS | TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV | TTY_DRIVER_DEVPTS_MEM; ptm_driver->other = pts_driver; - tty_set_operations(ptm_driver, &pty_unix98_ops); + tty_set_operations(ptm_driver, &pty_ops); + ptm_driver->ioctl = pty_unix98_ioctl; pts_driver->owner = THIS_MODULE; pts_driver->driver_name = "pty_slave"; diff --git a/trunk/drivers/char/rio/cirrus.h b/trunk/drivers/char/rio/cirrus.h index a03a538a3efb..f4f837f86829 100644 --- a/trunk/drivers/char/rio/cirrus.h +++ b/trunk/drivers/char/rio/cirrus.h @@ -43,83 +43,83 @@ /* Bit fields for particular registers shared with driver */ /* COR1 - driver and RTA */ -#define RIOC_COR1_ODD 0x80 /* Odd parity */ -#define RIOC_COR1_EVEN 0x00 /* Even parity */ -#define RIOC_COR1_NOP 0x00 /* No parity */ -#define RIOC_COR1_FORCE 0x20 /* Force parity */ -#define RIOC_COR1_NORMAL 0x40 /* With parity */ -#define RIOC_COR1_1STOP 0x00 /* 1 stop bit */ -#define RIOC_COR1_15STOP 0x04 /* 1.5 stop bits */ -#define RIOC_COR1_2STOP 0x08 /* 2 stop bits */ -#define RIOC_COR1_5BITS 0x00 /* 5 data bits */ -#define RIOC_COR1_6BITS 0x01 /* 6 data bits */ -#define RIOC_COR1_7BITS 0x02 /* 7 data bits */ -#define RIOC_COR1_8BITS 0x03 /* 8 data bits */ - -#define RIOC_COR1_HOST 0xef /* Safe host bits */ +#define COR1_ODD 0x80 /* Odd parity */ +#define COR1_EVEN 0x00 /* Even parity */ +#define COR1_NOP 0x00 /* No parity */ +#define COR1_FORCE 0x20 /* Force parity */ +#define COR1_NORMAL 0x40 /* With parity */ +#define COR1_1STOP 0x00 /* 1 stop bit */ +#define COR1_15STOP 0x04 /* 1.5 stop bits */ +#define COR1_2STOP 0x08 /* 2 stop bits */ +#define COR1_5BITS 0x00 /* 5 data bits */ +#define COR1_6BITS 0x01 /* 6 data bits */ +#define COR1_7BITS 0x02 /* 7 data bits */ +#define COR1_8BITS 0x03 /* 8 data bits */ + +#define COR1_HOST 0xef /* Safe host bits */ /* RTA only */ -#define RIOC_COR1_CINPCK 0x00 /* Check parity of received characters */ -#define RIOC_COR1_CNINPCK 0x10 /* Don't check parity */ +#define COR1_CINPCK 0x00 /* Check parity of received characters */ +#define COR1_CNINPCK 0x10 /* Don't check parity */ /* COR2 bits for both RTA and driver use */ -#define RIOC_COR2_IXANY 0x80 /* IXANY - any character is XON */ -#define RIOC_COR2_IXON 0x40 /* IXON - enable tx soft flowcontrol */ -#define RIOC_COR2_RTSFLOW 0x02 /* Enable tx hardware flow control */ +#define COR2_IXANY 0x80 /* IXANY - any character is XON */ +#define COR2_IXON 0x40 /* IXON - enable tx soft flowcontrol */ +#define COR2_RTSFLOW 0x02 /* Enable tx hardware flow control */ /* Additional driver bits */ -#define RIOC_COR2_HUPCL 0x20 /* Hang up on close */ -#define RIOC_COR2_CTSFLOW 0x04 /* Enable rx hardware flow control */ -#define RIOC_COR2_IXOFF 0x01 /* Enable rx software flow control */ -#define RIOC_COR2_DTRFLOW 0x08 /* Enable tx hardware flow control */ +#define COR2_HUPCL 0x20 /* Hang up on close */ +#define COR2_CTSFLOW 0x04 /* Enable rx hardware flow control */ +#define COR2_IXOFF 0x01 /* Enable rx software flow control */ +#define COR2_DTRFLOW 0x08 /* Enable tx hardware flow control */ /* RTA use only */ -#define RIOC_COR2_ETC 0x20 /* Embedded transmit options */ -#define RIOC_COR2_LOCAL 0x10 /* Local loopback mode */ -#define RIOC_COR2_REMOTE 0x08 /* Remote loopback mode */ -#define RIOC_COR2_HOST 0xc2 /* Safe host bits */ +#define COR2_ETC 0x20 /* Embedded transmit options */ +#define COR2_LOCAL 0x10 /* Local loopback mode */ +#define COR2_REMOTE 0x08 /* Remote loopback mode */ +#define COR2_HOST 0xc2 /* Safe host bits */ /* COR3 - RTA use only */ -#define RIOC_COR3_SCDRNG 0x80 /* Enable special char detect for range */ -#define RIOC_COR3_SCD34 0x40 /* Special character detect for SCHR's 3 + 4 */ -#define RIOC_COR3_FCT 0x20 /* Flow control transparency */ -#define RIOC_COR3_SCD12 0x10 /* Special character detect for SCHR's 1 + 2 */ -#define RIOC_COR3_FIFO12 0x0c /* 12 chars for receive FIFO threshold */ -#define RIOC_COR3_FIFO10 0x0a /* 10 chars for receive FIFO threshold */ -#define RIOC_COR3_FIFO8 0x08 /* 8 chars for receive FIFO threshold */ -#define RIOC_COR3_FIFO6 0x06 /* 6 chars for receive FIFO threshold */ - -#define RIOC_COR3_THRESHOLD RIOC_COR3_FIFO8 /* MUST BE LESS THAN MCOR_THRESHOLD */ - -#define RIOC_COR3_DEFAULT (RIOC_COR3_FCT | RIOC_COR3_THRESHOLD) +#define COR3_SCDRNG 0x80 /* Enable special char detect for range */ +#define COR3_SCD34 0x40 /* Special character detect for SCHR's 3 + 4 */ +#define COR3_FCT 0x20 /* Flow control transparency */ +#define COR3_SCD12 0x10 /* Special character detect for SCHR's 1 + 2 */ +#define COR3_FIFO12 0x0c /* 12 chars for receive FIFO threshold */ +#define COR3_FIFO10 0x0a /* 10 chars for receive FIFO threshold */ +#define COR3_FIFO8 0x08 /* 8 chars for receive FIFO threshold */ +#define COR3_FIFO6 0x06 /* 6 chars for receive FIFO threshold */ + +#define COR3_THRESHOLD COR3_FIFO8 /* MUST BE LESS THAN MCOR_THRESHOLD */ + +#define COR3_DEFAULT (COR3_FCT | COR3_THRESHOLD) /* Default bits for COR3 */ /* COR4 driver and RTA use */ -#define RIOC_COR4_IGNCR 0x80 /* Throw away CR's on input */ -#define RIOC_COR4_ICRNL 0x40 /* Map CR -> NL on input */ -#define RIOC_COR4_INLCR 0x20 /* Map NL -> CR on input */ -#define RIOC_COR4_IGNBRK 0x10 /* Ignore Break */ -#define RIOC_COR4_NBRKINT 0x08 /* No interrupt on break (-BRKINT) */ -#define RIOC_COR4_RAISEMOD 0x01 /* Raise modem output lines on non-zero baud */ +#define COR4_IGNCR 0x80 /* Throw away CR's on input */ +#define COR4_ICRNL 0x40 /* Map CR -> NL on input */ +#define COR4_INLCR 0x20 /* Map NL -> CR on input */ +#define COR4_IGNBRK 0x10 /* Ignore Break */ +#define COR4_NBRKINT 0x08 /* No interrupt on break (-BRKINT) */ +#define COR4_RAISEMOD 0x01 /* Raise modem output lines on non-zero baud */ /* COR4 driver only */ -#define RIOC_COR4_IGNPAR 0x04 /* IGNPAR (ignore characters with errors) */ -#define RIOC_COR4_PARMRK 0x02 /* PARMRK */ +#define COR4_IGNPAR 0x04 /* IGNPAR (ignore characters with errors) */ +#define COR4_PARMRK 0x02 /* PARMRK */ -#define RIOC_COR4_HOST 0xf8 /* Safe host bits */ +#define COR4_HOST 0xf8 /* Safe host bits */ /* COR4 RTA only */ -#define RIOC_COR4_CIGNPAR 0x02 /* Thrown away bad characters */ -#define RIOC_COR4_CPARMRK 0x04 /* PARMRK characters */ -#define RIOC_COR4_CNPARMRK 0x03 /* Don't PARMRK */ +#define COR4_CIGNPAR 0x02 /* Thrown away bad characters */ +#define COR4_CPARMRK 0x04 /* PARMRK characters */ +#define COR4_CNPARMRK 0x03 /* Don't PARMRK */ /* COR5 driver and RTA use */ -#define RIOC_COR5_ISTRIP 0x80 /* Strip input chars to 7 bits */ -#define RIOC_COR5_LNE 0x40 /* Enable LNEXT processing */ -#define RIOC_COR5_CMOE 0x20 /* Match good and errored characters */ -#define RIOC_COR5_ONLCR 0x02 /* NL -> CR NL on output */ -#define RIOC_COR5_OCRNL 0x01 /* CR -> NL on output */ +#define COR5_ISTRIP 0x80 /* Strip input chars to 7 bits */ +#define COR5_LNE 0x40 /* Enable LNEXT processing */ +#define COR5_CMOE 0x20 /* Match good and errored characters */ +#define COR5_ONLCR 0x02 /* NL -> CR NL on output */ +#define COR5_OCRNL 0x01 /* CR -> NL on output */ /* ** Spare bits - these are not used in the CIRRUS registers, so we use @@ -128,86 +128,86 @@ /* ** tstop and tbusy indication */ -#define RIOC_COR5_TSTATE_ON 0x08 /* Turn on monitoring of tbusy and tstop */ -#define RIOC_COR5_TSTATE_OFF 0x04 /* Turn off monitoring of tbusy and tstop */ +#define COR5_TSTATE_ON 0x08 /* Turn on monitoring of tbusy and tstop */ +#define COR5_TSTATE_OFF 0x04 /* Turn off monitoring of tbusy and tstop */ /* ** TAB3 */ -#define RIOC_COR5_TAB3 0x10 /* TAB3 mode */ +#define COR5_TAB3 0x10 /* TAB3 mode */ -#define RIOC_COR5_HOST 0xc3 /* Safe host bits */ +#define COR5_HOST 0xc3 /* Safe host bits */ /* CCSR */ -#define RIOC_CCSR_TXFLOFF 0x04 /* Tx is xoffed */ +#define CCSR_TXFLOFF 0x04 /* Tx is xoffed */ /* MSVR1 */ /* NB. DTR / CD swapped from Cirrus spec as the pins are also reversed on the RTA. This is because otherwise DCD would get lost on the 1 parallel / 3 serial option. */ -#define RIOC_MSVR1_CD 0x80 /* CD (DSR on Cirrus) */ -#define RIOC_MSVR1_RTS 0x40 /* RTS (CTS on Cirrus) */ -#define RIOC_MSVR1_RI 0x20 /* RI */ -#define RIOC_MSVR1_DTR 0x10 /* DTR (CD on Cirrus) */ -#define RIOC_MSVR1_CTS 0x01 /* CTS output pin (RTS on Cirrus) */ +#define MSVR1_CD 0x80 /* CD (DSR on Cirrus) */ +#define MSVR1_RTS 0x40 /* RTS (CTS on Cirrus) */ +#define MSVR1_RI 0x20 /* RI */ +#define MSVR1_DTR 0x10 /* DTR (CD on Cirrus) */ +#define MSVR1_CTS 0x01 /* CTS output pin (RTS on Cirrus) */ /* Next two used to indicate state of tbusy and tstop to driver */ -#define RIOC_MSVR1_TSTOP 0x08 /* Set if port flow controlled */ -#define RIOC_MSVR1_TEMPTY 0x04 /* Set if port tx buffer empty */ +#define MSVR1_TSTOP 0x08 /* Set if port flow controlled */ +#define MSVR1_TEMPTY 0x04 /* Set if port tx buffer empty */ -#define RIOC_MSVR1_HOST 0xf3 /* The bits the host wants */ +#define MSVR1_HOST 0xf3 /* The bits the host wants */ /* Defines for the subscripts of a CONFIG packet */ -#define RIOC_CONFIG_COR1 1 /* Option register 1 */ -#define RIOC_CONFIG_COR2 2 /* Option register 2 */ -#define RIOC_CONFIG_COR4 3 /* Option register 4 */ -#define RIOC_CONFIG_COR5 4 /* Option register 5 */ -#define RIOC_CONFIG_TXXON 5 /* Tx XON character */ -#define RIOC_CONFIG_TXXOFF 6 /* Tx XOFF character */ -#define RIOC_CONFIG_RXXON 7 /* Rx XON character */ -#define RIOC_CONFIG_RXXOFF 8 /* Rx XOFF character */ -#define RIOC_CONFIG_LNEXT 9 /* LNEXT character */ -#define RIOC_CONFIG_TXBAUD 10 /* Tx baud rate */ -#define RIOC_CONFIG_RXBAUD 11 /* Rx baud rate */ - -#define RIOC_PRE_EMPTIVE 0x80 /* Pre-emptive bit in command field */ +#define CONFIG_COR1 1 /* Option register 1 */ +#define CONFIG_COR2 2 /* Option register 2 */ +#define CONFIG_COR4 3 /* Option register 4 */ +#define CONFIG_COR5 4 /* Option register 5 */ +#define CONFIG_TXXON 5 /* Tx XON character */ +#define CONFIG_TXXOFF 6 /* Tx XOFF character */ +#define CONFIG_RXXON 7 /* Rx XON character */ +#define CONFIG_RXXOFF 8 /* Rx XOFF character */ +#define CONFIG_LNEXT 9 /* LNEXT character */ +#define CONFIG_TXBAUD 10 /* Tx baud rate */ +#define CONFIG_RXBAUD 11 /* Rx baud rate */ + +#define PRE_EMPTIVE 0x80 /* Pre-emptive bit in command field */ /* Packet types going from Host to remote - with the exception of OPEN, MOPEN, CONFIG, SBREAK and MEMDUMP the remaining bytes of the data array will not be used */ -#define RIOC_OPEN 0x00 /* Open a port */ -#define RIOC_CONFIG 0x01 /* Configure a port */ -#define RIOC_MOPEN 0x02 /* Modem open (block for DCD) */ -#define RIOC_CLOSE 0x03 /* Close a port */ -#define RIOC_WFLUSH (0x04 | RIOC_PRE_EMPTIVE) /* Write flush */ -#define RIOC_RFLUSH (0x05 | RIOC_PRE_EMPTIVE) /* Read flush */ -#define RIOC_RESUME (0x06 | RIOC_PRE_EMPTIVE) /* Resume if xoffed */ -#define RIOC_SBREAK 0x07 /* Start break */ -#define RIOC_EBREAK 0x08 /* End break */ -#define RIOC_SUSPEND (0x09 | RIOC_PRE_EMPTIVE) /* Susp op (behave as tho xoffed) */ -#define RIOC_FCLOSE (0x0a | RIOC_PRE_EMPTIVE) /* Force close */ -#define RIOC_XPRINT 0x0b /* Xprint packet */ -#define RIOC_MBIS (0x0c | RIOC_PRE_EMPTIVE) /* Set modem lines */ -#define RIOC_MBIC (0x0d | RIOC_PRE_EMPTIVE) /* Clear modem lines */ -#define RIOC_MSET (0x0e | RIOC_PRE_EMPTIVE) /* Set modem lines */ -#define RIOC_PCLOSE 0x0f /* Pseudo close - Leaves rx/tx enabled */ -#define RIOC_MGET (0x10 | RIOC_PRE_EMPTIVE) /* Force update of modem status */ -#define RIOC_MEMDUMP (0x11 | RIOC_PRE_EMPTIVE) /* Send back mem from addr supplied */ -#define RIOC_READ_REGISTER (0x12 | RIOC_PRE_EMPTIVE) /* Read CD1400 register (debug) */ +#define OPEN 0x00 /* Open a port */ +#define CONFIG 0x01 /* Configure a port */ +#define MOPEN 0x02 /* Modem open (block for DCD) */ +#define CLOSE 0x03 /* Close a port */ +#define WFLUSH (0x04 | PRE_EMPTIVE) /* Write flush */ +#define RFLUSH (0x05 | PRE_EMPTIVE) /* Read flush */ +#define RESUME (0x06 | PRE_EMPTIVE) /* Resume if xoffed */ +#define SBREAK 0x07 /* Start break */ +#define EBREAK 0x08 /* End break */ +#define SUSPEND (0x09 | PRE_EMPTIVE) /* Susp op (behave as tho xoffed) */ +#define FCLOSE (0x0a | PRE_EMPTIVE) /* Force close */ +#define XPRINT 0x0b /* Xprint packet */ +#define MBIS (0x0c | PRE_EMPTIVE) /* Set modem lines */ +#define MBIC (0x0d | PRE_EMPTIVE) /* Clear modem lines */ +#define MSET (0x0e | PRE_EMPTIVE) /* Set modem lines */ +#define PCLOSE 0x0f /* Pseudo close - Leaves rx/tx enabled */ +#define MGET (0x10 | PRE_EMPTIVE) /* Force update of modem status */ +#define MEMDUMP (0x11 | PRE_EMPTIVE) /* Send back mem from addr supplied */ +#define READ_REGISTER (0x12 | PRE_EMPTIVE) /* Read CD1400 register (debug) */ /* "Command" packets going from remote to host COMPLETE and MODEM_STATUS use data[4] / data[3] to indicate current state and modem status respectively */ -#define RIOC_COMPLETE (0x20 | RIOC_PRE_EMPTIVE) +#define COMPLETE (0x20 | PRE_EMPTIVE) /* Command complete */ -#define RIOC_BREAK_RECEIVED (0x21 | RIOC_PRE_EMPTIVE) +#define BREAK_RECEIVED (0x21 | PRE_EMPTIVE) /* Break received */ -#define RIOC_MODEM_STATUS (0x22 | RIOC_PRE_EMPTIVE) +#define MODEM_STATUS (0x22 | PRE_EMPTIVE) /* Change in modem status */ /* "Command" packet that could go either way - handshake wake-up */ -#define RIOC_HANDSHAKE (0x23 | RIOC_PRE_EMPTIVE) +#define HANDSHAKE (0x23 | PRE_EMPTIVE) /* Wake-up to HOST / RTA */ #endif diff --git a/trunk/drivers/char/rio/rio_linux.c b/trunk/drivers/char/rio/rio_linux.c index 412777cd1e68..0ce96670f979 100644 --- a/trunk/drivers/char/rio/rio_linux.c +++ b/trunk/drivers/char/rio/rio_linux.c @@ -344,7 +344,7 @@ int rio_minor(struct tty_struct *tty) static int rio_set_real_termios(void *ptr) { - return RIOParam((struct Port *) ptr, RIOC_CONFIG, 1, 1); + return RIOParam((struct Port *) ptr, CONFIG, 1, 1); } @@ -487,7 +487,7 @@ static int rio_get_CD(void *ptr) int rv; func_enter(); - rv = (PortP->ModemState & RIOC_MSVR1_CD) != 0; + rv = (PortP->ModemState & MSVR1_CD) != 0; rio_dprintk(RIO_DEBUG_INIT, "Getting CD status: %d\n", rv); @@ -607,8 +607,7 @@ static int rio_ioctl(struct tty_struct *tty, struct file *filp, unsigned int cmd rio_dprintk(RIO_DEBUG_TTY, "BREAK on deleted RTA\n"); rc = -EIO; } else { - if (RIOShortCommand(p, PortP, RIOC_SBREAK, 2, 250) == - RIO_FAIL) { + if (RIOShortCommand(p, PortP, SBREAK, 2, 250) == RIO_FAIL) { rio_dprintk(RIO_DEBUG_INTR, "SBREAK RIOShortCommand failed\n"); rc = -EIO; } @@ -623,8 +622,7 @@ static int rio_ioctl(struct tty_struct *tty, struct file *filp, unsigned int cmd l = arg ? arg * 100 : 250; if (l > 255) l = 255; - if (RIOShortCommand(p, PortP, RIOC_SBREAK, 2, - arg ? arg * 100 : 250) == RIO_FAIL) { + if (RIOShortCommand(p, PortP, SBREAK, 2, arg ? arg * 100 : 250) == RIO_FAIL) { rio_dprintk(RIO_DEBUG_INTR, "SBREAK RIOShortCommand failed\n"); rc = -EIO; } diff --git a/trunk/drivers/char/rio/rio_linux.h b/trunk/drivers/char/rio/rio_linux.h index 7f26cd7c815e..dc3f005614a3 100644 --- a/trunk/drivers/char/rio/rio_linux.h +++ b/trunk/drivers/char/rio/rio_linux.h @@ -186,9 +186,9 @@ static inline void *rio_memcpy_fromio(void *dest, void __iomem *source, int n) #ifdef DEBUG #define rio_dprintk(f, str...) do { if (rio_debug & f) printk (str);} while (0) -#define func_enter() rio_dprintk (RIO_DEBUG_FLOW, "rio: enter %s\n", __func__) -#define func_exit() rio_dprintk (RIO_DEBUG_FLOW, "rio: exit %s\n", __func__) -#define func_enter2() rio_dprintk (RIO_DEBUG_FLOW, "rio: enter %s (port %d)\n",__func__, port->line) +#define func_enter() rio_dprintk (RIO_DEBUG_FLOW, "rio: enter %s\n", __FUNCTION__) +#define func_exit() rio_dprintk (RIO_DEBUG_FLOW, "rio: exit %s\n", __FUNCTION__) +#define func_enter2() rio_dprintk (RIO_DEBUG_FLOW, "rio: enter %s (port %d)\n",__FUNCTION__, port->line) #else #define rio_dprintk(f, str...) /* nothing */ #define func_enter() diff --git a/trunk/drivers/char/rio/riocmd.c b/trunk/drivers/char/rio/riocmd.c index 7b96e0814887..bf36959fc121 100644 --- a/trunk/drivers/char/rio/riocmd.c +++ b/trunk/drivers/char/rio/riocmd.c @@ -417,7 +417,7 @@ static int RIOCommandRup(struct rio_info *p, uint Rup, struct Host *HostP, struc PortP = p->RIOPortp[SysPort]; rio_spin_lock_irqsave(&PortP->portSem, flags); switch (readb(&PktCmdP->Command)) { - case RIOC_BREAK_RECEIVED: + case BREAK_RECEIVED: rio_dprintk(RIO_DEBUG_CMD, "Received a break!\n"); /* If the current line disc. is not multi-threading and the current processor is not the default, reset rup_intr @@ -428,16 +428,16 @@ static int RIOCommandRup(struct rio_info *p, uint Rup, struct Host *HostP, struc gs_got_break(&PortP->gs); break; - case RIOC_COMPLETE: + case COMPLETE: rio_dprintk(RIO_DEBUG_CMD, "Command complete on phb %d host %Zd\n", readb(&PktCmdP->PhbNum), HostP - p->RIOHosts); subCommand = 1; switch (readb(&PktCmdP->SubCommand)) { - case RIOC_MEMDUMP: + case MEMDUMP: rio_dprintk(RIO_DEBUG_CMD, "Memory dump cmd (0x%x) from addr 0x%x\n", readb(&PktCmdP->SubCommand), readw(&PktCmdP->SubAddr)); break; - case RIOC_READ_REGISTER: + case READ_REGISTER: rio_dprintk(RIO_DEBUG_CMD, "Read register (0x%x)\n", readw(&PktCmdP->SubAddr)); - p->CdRegister = (readb(&PktCmdP->ModemStatus) & RIOC_MSVR1_HOST); + p->CdRegister = (readb(&PktCmdP->ModemStatus) & MSVR1_HOST); break; default: subCommand = 0; @@ -456,15 +456,14 @@ static int RIOCommandRup(struct rio_info *p, uint Rup, struct Host *HostP, struc rio_dprintk(RIO_DEBUG_CMD, "No change\n"); /* FALLTHROUGH */ - case RIOC_MODEM_STATUS: + case MODEM_STATUS: /* ** Knock out the tbusy and tstop bits, as these are not relevant ** to the check for modem status change (they're just there because ** it's a convenient place to put them!). */ ReportedModemStatus = readb(&PktCmdP->ModemStatus); - if ((PortP->ModemState & RIOC_MSVR1_HOST) == - (ReportedModemStatus & RIOC_MSVR1_HOST)) { + if ((PortP->ModemState & MSVR1_HOST) == (ReportedModemStatus & MSVR1_HOST)) { rio_dprintk(RIO_DEBUG_CMD, "Modem status unchanged 0x%x\n", PortP->ModemState); /* ** Update ModemState just in case tbusy or tstop states have @@ -498,7 +497,7 @@ static int RIOCommandRup(struct rio_info *p, uint Rup, struct Host *HostP, struc /* ** Is there a carrier? */ - if (PortP->ModemState & RIOC_MSVR1_CD) { + if (PortP->ModemState & MSVR1_CD) { /* ** Has carrier just appeared? */ @@ -692,7 +691,7 @@ void RIOPollHostCommands(struct rio_info *p, struct Host *HostP) */ rio_spin_unlock_irqrestore(&UnixRupP->RupLock, flags); FreeMe = RIOCommandRup(p, Rup, HostP, PacketP); - if (readb(&PacketP->data[5]) == RIOC_MEMDUMP) { + if (readb(&PacketP->data[5]) == MEMDUMP) { rio_dprintk(RIO_DEBUG_CMD, "Memdump from 0x%x complete\n", readw(&(PacketP->data[6]))); rio_memcpy_fromio(p->RIOMemDump, &(PacketP->data[8]), 32); } diff --git a/trunk/drivers/char/rio/rioctrl.c b/trunk/drivers/char/rio/rioctrl.c index d65ceb9a434a..d8eb2bcbe015 100644 --- a/trunk/drivers/char/rio/rioctrl.c +++ b/trunk/drivers/char/rio/rioctrl.c @@ -422,8 +422,7 @@ int riocontrol(struct rio_info *p, dev_t dev, int cmd, unsigned long arg, int su } rio_spin_lock_irqsave(&PortP->portSem, flags); - if (RIOPreemptiveCmd(p, (p->RIOPortp[port]), RIOC_RESUME) == - RIO_FAIL) { + if (RIOPreemptiveCmd(p, (p->RIOPortp[port]), RESUME) == RIO_FAIL) { rio_dprintk(RIO_DEBUG_CTRL, "RIO_RESUME failed\n"); rio_spin_unlock_irqrestore(&PortP->portSem, flags); return -EBUSY; @@ -637,8 +636,7 @@ int riocontrol(struct rio_info *p, dev_t dev, int cmd, unsigned long arg, int su return -ENXIO; } PortP = (p->RIOPortp[PortTty.port]); - RIOParam(PortP, RIOC_CONFIG, PortP->State & RIO_MODEM, - OK_TO_SLEEP); + RIOParam(PortP, CONFIG, PortP->State & RIO_MODEM, OK_TO_SLEEP); return retval; case RIO_SET_PORT_PARAMS: @@ -1249,7 +1247,7 @@ int riocontrol(struct rio_info *p, dev_t dev, int cmd, unsigned long arg, int su rio_spin_lock_irqsave(&PortP->portSem, flags); - if (RIOPreemptiveCmd(p, PortP, RIOC_MEMDUMP) == RIO_FAIL) { + if (RIOPreemptiveCmd(p, PortP, MEMDUMP) == RIO_FAIL) { rio_dprintk(RIO_DEBUG_CTRL, "RIO_MEM_DUMP failed\n"); rio_spin_unlock_irqrestore(&PortP->portSem, flags); return -EBUSY; @@ -1315,8 +1313,7 @@ int riocontrol(struct rio_info *p, dev_t dev, int cmd, unsigned long arg, int su rio_spin_lock_irqsave(&PortP->portSem, flags); - if (RIOPreemptiveCmd(p, PortP, RIOC_READ_REGISTER) == - RIO_FAIL) { + if (RIOPreemptiveCmd(p, PortP, READ_REGISTER) == RIO_FAIL) { rio_dprintk(RIO_DEBUG_CTRL, "RIO_READ_REGISTER failed\n"); rio_spin_unlock_irqrestore(&PortP->portSem, flags); return -EBUSY; @@ -1437,50 +1434,50 @@ int RIOPreemptiveCmd(struct rio_info *p, struct Port *PortP, u8 Cmd) PktCmdP->PhbNum = port; switch (Cmd) { - case RIOC_MEMDUMP: + case MEMDUMP: rio_dprintk(RIO_DEBUG_CTRL, "Queue MEMDUMP command blk %p " "(addr 0x%x)\n", CmdBlkP, (int) SubCmd.Addr); - PktCmdP->SubCommand = RIOC_MEMDUMP; + PktCmdP->SubCommand = MEMDUMP; PktCmdP->SubAddr = SubCmd.Addr; break; - case RIOC_FCLOSE: + case FCLOSE: rio_dprintk(RIO_DEBUG_CTRL, "Queue FCLOSE command blk %p\n", CmdBlkP); break; - case RIOC_READ_REGISTER: + case READ_REGISTER: rio_dprintk(RIO_DEBUG_CTRL, "Queue READ_REGISTER (0x%x) " "command blk %p\n", (int) SubCmd.Addr, CmdBlkP); - PktCmdP->SubCommand = RIOC_READ_REGISTER; + PktCmdP->SubCommand = READ_REGISTER; PktCmdP->SubAddr = SubCmd.Addr; break; - case RIOC_RESUME: + case RESUME: rio_dprintk(RIO_DEBUG_CTRL, "Queue RESUME command blk %p\n", CmdBlkP); break; - case RIOC_RFLUSH: + case RFLUSH: rio_dprintk(RIO_DEBUG_CTRL, "Queue RFLUSH command blk %p\n", CmdBlkP); CmdBlkP->PostFuncP = RIORFlushEnable; break; - case RIOC_SUSPEND: + case SUSPEND: rio_dprintk(RIO_DEBUG_CTRL, "Queue SUSPEND command blk %p\n", CmdBlkP); break; - case RIOC_MGET: + case MGET: rio_dprintk(RIO_DEBUG_CTRL, "Queue MGET command blk %p\n", CmdBlkP); break; - case RIOC_MSET: - case RIOC_MBIC: - case RIOC_MBIS: + case MSET: + case MBIC: + case MBIS: CmdBlkP->Packet.data[4] = (char) PortP->ModemLines; rio_dprintk(RIO_DEBUG_CTRL, "Queue MSET/MBIC/MBIS command " "blk %p\n", CmdBlkP); break; - case RIOC_WFLUSH: + case WFLUSH: /* ** If we have queued up the maximum number of Write flushes ** allowed then we should not bother sending any more to the diff --git a/trunk/drivers/char/rio/riointr.c b/trunk/drivers/char/rio/riointr.c index ea21686c69a4..4734e26e1ccd 100644 --- a/trunk/drivers/char/rio/riointr.c +++ b/trunk/drivers/char/rio/riointr.c @@ -401,8 +401,9 @@ void RIOServiceHost(struct rio_info *p, struct Host *HostP) PortP->InUse = NOT_INUSE; rio_spin_unlock(&PortP->portSem); - if (RIOParam(PortP, RIOC_OPEN, ((PortP->Cor2Copy & (RIOC_COR2_RTSFLOW | RIOC_COR2_CTSFLOW)) == (RIOC_COR2_RTSFLOW | RIOC_COR2_CTSFLOW)) ? 1 : 0, DONT_SLEEP) == RIO_FAIL) + if (RIOParam(PortP, OPEN, ((PortP->Cor2Copy & (COR2_RTSFLOW | COR2_CTSFLOW)) == (COR2_RTSFLOW | COR2_CTSFLOW)) ? 1 : 0, DONT_SLEEP) == RIO_FAIL) { continue; /* with next port */ + } rio_spin_lock(&PortP->portSem); PortP->MagicFlags &= ~MAGIC_REBOOT; } @@ -428,7 +429,7 @@ void RIOServiceHost(struct rio_info *p, struct Host *HostP) */ PktCmdP = (struct PktCmd __iomem *) &PacketP->data[0]; - writeb(RIOC_WFLUSH, &PktCmdP->Command); + writeb(WFLUSH, &PktCmdP->Command); p = PortP->HostPort % (u16) PORTS_PER_RTA; diff --git a/trunk/drivers/char/rio/rioparam.c b/trunk/drivers/char/rio/rioparam.c index 4810b845cc21..da276ed57b3f 100644 --- a/trunk/drivers/char/rio/rioparam.c +++ b/trunk/drivers/char/rio/rioparam.c @@ -177,7 +177,7 @@ int RIOParam(struct Port *PortP, int cmd, int Modem, int SleepFlag) } rio_spin_lock_irqsave(&PortP->portSem, flags); - if (cmd == RIOC_OPEN) { + if (cmd == OPEN) { /* ** If the port is set to store or lock the parameters, and it is ** paramed with OPEN, we want to restore the saved port termio, but @@ -241,50 +241,50 @@ int RIOParam(struct Port *PortP, int cmd, int Modem, int SleepFlag) case CS5: { rio_dprintk(RIO_DEBUG_PARAM, "5 bit data\n"); - Cor1 |= RIOC_COR1_5BITS; + Cor1 |= COR1_5BITS; break; } case CS6: { rio_dprintk(RIO_DEBUG_PARAM, "6 bit data\n"); - Cor1 |= RIOC_COR1_6BITS; + Cor1 |= COR1_6BITS; break; } case CS7: { rio_dprintk(RIO_DEBUG_PARAM, "7 bit data\n"); - Cor1 |= RIOC_COR1_7BITS; + Cor1 |= COR1_7BITS; break; } case CS8: { rio_dprintk(RIO_DEBUG_PARAM, "8 bit data\n"); - Cor1 |= RIOC_COR1_8BITS; + Cor1 |= COR1_8BITS; break; } } if (TtyP->termios->c_cflag & CSTOPB) { rio_dprintk(RIO_DEBUG_PARAM, "2 stop bits\n"); - Cor1 |= RIOC_COR1_2STOP; + Cor1 |= COR1_2STOP; } else { rio_dprintk(RIO_DEBUG_PARAM, "1 stop bit\n"); - Cor1 |= RIOC_COR1_1STOP; + Cor1 |= COR1_1STOP; } if (TtyP->termios->c_cflag & PARENB) { rio_dprintk(RIO_DEBUG_PARAM, "Enable parity\n"); - Cor1 |= RIOC_COR1_NORMAL; + Cor1 |= COR1_NORMAL; } else { rio_dprintk(RIO_DEBUG_PARAM, "Disable parity\n"); - Cor1 |= RIOC_COR1_NOP; + Cor1 |= COR1_NOP; } if (TtyP->termios->c_cflag & PARODD) { rio_dprintk(RIO_DEBUG_PARAM, "Odd parity\n"); - Cor1 |= RIOC_COR1_ODD; + Cor1 |= COR1_ODD; } else { rio_dprintk(RIO_DEBUG_PARAM, "Even parity\n"); - Cor1 |= RIOC_COR1_EVEN; + Cor1 |= COR1_EVEN; } /* @@ -292,11 +292,11 @@ int RIOParam(struct Port *PortP, int cmd, int Modem, int SleepFlag) */ if (TtyP->termios->c_iflag & IXON) { rio_dprintk(RIO_DEBUG_PARAM, "Enable start/stop output control\n"); - Cor2 |= RIOC_COR2_IXON; + Cor2 |= COR2_IXON; } else { if (PortP->Config & RIO_IXON) { rio_dprintk(RIO_DEBUG_PARAM, "Force enable start/stop output control\n"); - Cor2 |= RIOC_COR2_IXON; + Cor2 |= COR2_IXON; } else rio_dprintk(RIO_DEBUG_PARAM, "IXON has been disabled.\n"); } @@ -304,29 +304,29 @@ int RIOParam(struct Port *PortP, int cmd, int Modem, int SleepFlag) if (TtyP->termios->c_iflag & IXANY) { if (PortP->Config & RIO_IXANY) { rio_dprintk(RIO_DEBUG_PARAM, "Enable any key to restart output\n"); - Cor2 |= RIOC_COR2_IXANY; + Cor2 |= COR2_IXANY; } else rio_dprintk(RIO_DEBUG_PARAM, "IXANY has been disabled due to sanity reasons.\n"); } if (TtyP->termios->c_iflag & IXOFF) { rio_dprintk(RIO_DEBUG_PARAM, "Enable start/stop input control 2\n"); - Cor2 |= RIOC_COR2_IXOFF; + Cor2 |= COR2_IXOFF; } if (TtyP->termios->c_cflag & HUPCL) { rio_dprintk(RIO_DEBUG_PARAM, "Hangup on last close\n"); - Cor2 |= RIOC_COR2_HUPCL; + Cor2 |= COR2_HUPCL; } if (C_CRTSCTS(TtyP)) { rio_dprintk(RIO_DEBUG_PARAM, "Rx hardware flow control enabled\n"); - Cor2 |= RIOC_COR2_CTSFLOW; - Cor2 |= RIOC_COR2_RTSFLOW; + Cor2 |= COR2_CTSFLOW; + Cor2 |= COR2_RTSFLOW; } else { rio_dprintk(RIO_DEBUG_PARAM, "Rx hardware flow control disabled\n"); - Cor2 &= ~RIOC_COR2_CTSFLOW; - Cor2 &= ~RIOC_COR2_RTSFLOW; + Cor2 &= ~COR2_CTSFLOW; + Cor2 &= ~COR2_RTSFLOW; } @@ -341,36 +341,36 @@ int RIOParam(struct Port *PortP, int cmd, int Modem, int SleepFlag) */ if (TtyP->termios->c_iflag & IGNBRK) { rio_dprintk(RIO_DEBUG_PARAM, "Ignore break condition\n"); - Cor4 |= RIOC_COR4_IGNBRK; + Cor4 |= COR4_IGNBRK; } if (!(TtyP->termios->c_iflag & BRKINT)) { rio_dprintk(RIO_DEBUG_PARAM, "Break generates NULL condition\n"); - Cor4 |= RIOC_COR4_NBRKINT; + Cor4 |= COR4_NBRKINT; } else { rio_dprintk(RIO_DEBUG_PARAM, "Interrupt on break condition\n"); } if (TtyP->termios->c_iflag & INLCR) { rio_dprintk(RIO_DEBUG_PARAM, "Map newline to carriage return on input\n"); - Cor4 |= RIOC_COR4_INLCR; + Cor4 |= COR4_INLCR; } if (TtyP->termios->c_iflag & IGNCR) { rio_dprintk(RIO_DEBUG_PARAM, "Ignore carriage return on input\n"); - Cor4 |= RIOC_COR4_IGNCR; + Cor4 |= COR4_IGNCR; } if (TtyP->termios->c_iflag & ICRNL) { rio_dprintk(RIO_DEBUG_PARAM, "Map carriage return to newline on input\n"); - Cor4 |= RIOC_COR4_ICRNL; + Cor4 |= COR4_ICRNL; } if (TtyP->termios->c_iflag & IGNPAR) { rio_dprintk(RIO_DEBUG_PARAM, "Ignore characters with parity errors\n"); - Cor4 |= RIOC_COR4_IGNPAR; + Cor4 |= COR4_IGNPAR; } if (TtyP->termios->c_iflag & PARMRK) { rio_dprintk(RIO_DEBUG_PARAM, "Mark parity errors\n"); - Cor4 |= RIOC_COR4_PARMRK; + Cor4 |= COR4_PARMRK; } /* @@ -378,22 +378,22 @@ int RIOParam(struct Port *PortP, int cmd, int Modem, int SleepFlag) ** on reception of a config packet. ** The download code handles the zero baud condition. */ - Cor4 |= RIOC_COR4_RAISEMOD; + Cor4 |= COR4_RAISEMOD; /* ** COR 5 */ - Cor5 = RIOC_COR5_CMOE; + Cor5 = COR5_CMOE; /* ** Set to monitor tbusy/tstop (or not). */ if (PortP->MonitorTstate) - Cor5 |= RIOC_COR5_TSTATE_ON; + Cor5 |= COR5_TSTATE_ON; else - Cor5 |= RIOC_COR5_TSTATE_OFF; + Cor5 |= COR5_TSTATE_OFF; /* ** Could set LNE here if you wanted LNext processing. SVR4 will use it. @@ -401,24 +401,24 @@ int RIOParam(struct Port *PortP, int cmd, int Modem, int SleepFlag) if (TtyP->termios->c_iflag & ISTRIP) { rio_dprintk(RIO_DEBUG_PARAM, "Strip input characters\n"); if (!(PortP->State & RIO_TRIAD_MODE)) { - Cor5 |= RIOC_COR5_ISTRIP; + Cor5 |= COR5_ISTRIP; } } if (TtyP->termios->c_oflag & ONLCR) { rio_dprintk(RIO_DEBUG_PARAM, "Map newline to carriage-return, newline on output\n"); if (PortP->CookMode == COOK_MEDIUM) - Cor5 |= RIOC_COR5_ONLCR; + Cor5 |= COR5_ONLCR; } if (TtyP->termios->c_oflag & OCRNL) { rio_dprintk(RIO_DEBUG_PARAM, "Map carriage return to newline on output\n"); if (PortP->CookMode == COOK_MEDIUM) - Cor5 |= RIOC_COR5_OCRNL; + Cor5 |= COR5_OCRNL; } if ((TtyP->termios->c_oflag & TABDLY) == TAB3) { rio_dprintk(RIO_DEBUG_PARAM, "Tab delay 3 set\n"); if (PortP->CookMode == COOK_MEDIUM) - Cor5 |= RIOC_COR5_TAB3; + Cor5 |= COR5_TAB3; } /* diff --git a/trunk/drivers/char/rio/riotty.c b/trunk/drivers/char/rio/riotty.c index c99354843be1..1cb8580a161d 100644 --- a/trunk/drivers/char/rio/riotty.c +++ b/trunk/drivers/char/rio/riotty.c @@ -211,7 +211,7 @@ int riotopen(struct tty_struct *tty, struct file *filp) rio_dprintk(RIO_DEBUG_TTY, "Waiting for RIO_CLOSING to go away\n"); if (repeat_this-- <= 0) { rio_dprintk(RIO_DEBUG_TTY, "Waiting for not idle closed broken by signal\n"); - RIOPreemptiveCmd(p, PortP, RIOC_FCLOSE); + RIOPreemptiveCmd(p, PortP, FCLOSE); retval = -EINTR; goto bombout; } @@ -264,7 +264,7 @@ int riotopen(struct tty_struct *tty, struct file *filp) here. If I read the docs correctly the "open" command piggybacks the parameters immediately. -- REW */ - RIOParam(PortP, RIOC_OPEN, 1, OK_TO_SLEEP); /* Open the port */ + RIOParam(PortP, OPEN, 1, OK_TO_SLEEP); /* Open the port */ rio_spin_lock_irqsave(&PortP->portSem, flags); /* @@ -275,7 +275,7 @@ int riotopen(struct tty_struct *tty, struct file *filp) rio_spin_unlock_irqrestore(&PortP->portSem, flags); if (RIODelay(PortP, HUNDRED_MS) == RIO_FAIL) { rio_dprintk(RIO_DEBUG_TTY, "Waiting for open to finish broken by signal\n"); - RIOPreemptiveCmd(p, PortP, RIOC_FCLOSE); + RIOPreemptiveCmd(p, PortP, FCLOSE); func_exit(); return -EINTR; } @@ -297,8 +297,7 @@ int riotopen(struct tty_struct *tty, struct file *filp) ** insert test for carrier here. -- ??? ** I already see that test here. What's the deal? -- REW */ - if ((PortP->gs.tty->termios->c_cflag & CLOCAL) || - (PortP->ModemState & RIOC_MSVR1_CD)) { + if ((PortP->gs.tty->termios->c_cflag & CLOCAL) || (PortP->ModemState & MSVR1_CD)) { rio_dprintk(RIO_DEBUG_TTY, "open(%d) Modem carr on\n", SysPort); /* tp->tm.c_state |= CARR_ON; @@ -326,7 +325,7 @@ int riotopen(struct tty_struct *tty, struct file *filp) ** I think it's OK. -- REW */ rio_dprintk(RIO_DEBUG_TTY, "open(%d) sleeping for carr broken by signal\n", SysPort); - RIOPreemptiveCmd(p, PortP, RIOC_FCLOSE); + RIOPreemptiveCmd(p, PortP, FCLOSE); /* tp->tm.c_state &= ~WOPEN; */ @@ -417,7 +416,7 @@ int riotclose(void *ptr) */ PortP->State &= ~RIO_MOPEN; PortP->State &= ~RIO_CARR_ON; - PortP->ModemState &= ~RIOC_MSVR1_CD; + PortP->ModemState &= ~MSVR1_CD; /* ** If the device was open as both a Modem and a tty line ** then we need to wimp out here, as the port has not really @@ -454,7 +453,7 @@ int riotclose(void *ptr) if (repeat_this-- <= 0) { rv = -EINTR; rio_dprintk(RIO_DEBUG_TTY, "Waiting for not idle closed broken by signal\n"); - RIOPreemptiveCmd(p, PortP, RIOC_FCLOSE); + RIOPreemptiveCmd(p, PortP, FCLOSE); goto close_end; } rio_dprintk(RIO_DEBUG_TTY, "Calling timeout to flush in closing\n"); @@ -493,8 +492,8 @@ int riotclose(void *ptr) /* Can't call RIOShortCommand with the port locked. */ rio_spin_unlock_irqrestore(&PortP->portSem, flags); - if (RIOShortCommand(p, PortP, RIOC_CLOSE, 1, 0) == RIO_FAIL) { - RIOPreemptiveCmd(p, PortP, RIOC_FCLOSE); + if (RIOShortCommand(p, PortP, CLOSE, 1, 0) == RIO_FAIL) { + RIOPreemptiveCmd(p, PortP, FCLOSE); rio_spin_lock_irqsave(&PortP->portSem, flags); goto close_end; } @@ -504,7 +503,7 @@ int riotclose(void *ptr) try--; if (time_after(jiffies, end_time)) { rio_dprintk(RIO_DEBUG_TTY, "Run out of tries - force the bugger shut!\n"); - RIOPreemptiveCmd(p, PortP, RIOC_FCLOSE); + RIOPreemptiveCmd(p, PortP, FCLOSE); break; } rio_dprintk(RIO_DEBUG_TTY, "Close: PortState:ISOPEN is %d\n", PortP->PortState & PORT_ISOPEN); @@ -516,14 +515,14 @@ int riotclose(void *ptr) } if (RIODelay(PortP, HUNDRED_MS) == RIO_FAIL) { rio_dprintk(RIO_DEBUG_TTY, "RTA EINTR in delay \n"); - RIOPreemptiveCmd(p, PortP, RIOC_FCLOSE); + RIOPreemptiveCmd(p, PortP, FCLOSE); break; } } rio_spin_lock_irqsave(&PortP->portSem, flags); rio_dprintk(RIO_DEBUG_TTY, "Close: try was %d on completion\n", try); - /* RIOPreemptiveCmd(p, PortP, RIOC_FCLOSE); */ + /* RIOPreemptiveCmd(p, PortP, FCLOSE); */ /* ** 15.10.1998 ARG - ESIL 0761 part fix diff --git a/trunk/drivers/char/riscom8.c b/trunk/drivers/char/riscom8.c index f073c710ab8d..3f9d0a9ac36d 100644 --- a/trunk/drivers/char/riscom8.c +++ b/trunk/drivers/char/riscom8.c @@ -4,9 +4,9 @@ * Copyright (C) 1994-1996 Dmitry Gorodchanin (pgmdsg@ibi.com) * * This code is loosely based on the Linux serial driver, written by - * Linus Torvalds, Theodore T'so and others. The RISCom/8 card - * programming info was obtained from various drivers for other OSes - * (FreeBSD, ISC, etc), but no source code from those drivers were + * Linus Torvalds, Theodore T'so and others. The RISCom/8 card + * programming info was obtained from various drivers for other OSes + * (FreeBSD, ISC, etc), but no source code from those drivers were * directly included in this driver. * * @@ -33,7 +33,7 @@ #include -#include +#include #include #include #include @@ -49,7 +49,7 @@ #include #include -#include +#include #include "riscom8.h" #include "riscom8_reg.h" @@ -57,15 +57,15 @@ /* Am I paranoid or not ? ;-) */ #define RISCOM_PARANOIA_CHECK -/* - * Crazy InteliCom/8 boards sometimes have swapped CTS & DSR signals. +/* + * Crazy InteliCom/8 boards sometimes has swapped CTS & DSR signals. * You can slightly speed up things by #undefing the following option, - * if you are REALLY sure that your board is correct one. + * if you are REALLY sure that your board is correct one. */ #define RISCOM_BRAIN_DAMAGED_CTS -/* +/* * The following defines are mostly for testing purposes. But if you need * some nice reporting in your syslog, you can define them also. */ @@ -112,7 +112,7 @@ static unsigned short rc_ioport[] = { #define RC_NIOPORT ARRAY_SIZE(rc_ioport) -static int rc_paranoia_check(struct riscom_port const *port, +static inline int rc_paranoia_check(struct riscom_port const * port, char *name, const char *routine) { #ifdef RISCOM_PARANOIA_CHECK @@ -134,53 +134,52 @@ static int rc_paranoia_check(struct riscom_port const *port, } /* - * + * * Service functions for RISCom/8 driver. - * + * */ /* Get board number from pointer */ -static inline int board_No(struct riscom_board const *bp) +static inline int board_No (struct riscom_board const * bp) { return bp - rc_board; } /* Get port number from pointer */ -static inline int port_No(struct riscom_port const *port) +static inline int port_No (struct riscom_port const * port) { - return RC_PORT(port - rc_port); + return RC_PORT(port - rc_port); } /* Get pointer to board from pointer to port */ -static inline struct riscom_board *port_Board(struct riscom_port const *port) +static inline struct riscom_board * port_Board(struct riscom_port const * port) { return &rc_board[RC_BOARD(port - rc_port)]; } /* Input Byte from CL CD180 register */ -static inline unsigned char rc_in(struct riscom_board const *bp, - unsigned short reg) +static inline unsigned char rc_in(struct riscom_board const * bp, unsigned short reg) { return inb(bp->base + RC_TO_ISA(reg)); } /* Output Byte to CL CD180 register */ -static inline void rc_out(struct riscom_board const *bp, unsigned short reg, +static inline void rc_out(struct riscom_board const * bp, unsigned short reg, unsigned char val) { outb(val, bp->base + RC_TO_ISA(reg)); } /* Wait for Channel Command Register ready */ -static void rc_wait_CCR(struct riscom_board const *bp) +static inline void rc_wait_CCR(struct riscom_board const * bp) { unsigned long delay; /* FIXME: need something more descriptive then 100000 :) */ - for (delay = 100000; delay; delay--) + for (delay = 100000; delay; delay--) if (!rc_in(bp, CD180_CCR)) return; - + printk(KERN_INFO "rc%d: Timeout waiting for CCR.\n", board_No(bp)); } @@ -188,11 +187,11 @@ static void rc_wait_CCR(struct riscom_board const *bp) * RISCom/8 probe functions. */ -static int rc_request_io_range(struct riscom_board * const bp) +static inline int rc_request_io_range(struct riscom_board * const bp) { int i; - - for (i = 0; i < RC_NIOPORT; i++) + + for (i = 0; i < RC_NIOPORT; i++) if (!request_region(RC_TO_ISA(rc_ioport[i]) + bp->base, 1, "RISCom/8")) { goto out_release; @@ -201,42 +200,42 @@ static int rc_request_io_range(struct riscom_board * const bp) out_release: printk(KERN_INFO "rc%d: Skipping probe at 0x%03x. IO address in use.\n", board_No(bp), bp->base); - while (--i >= 0) + while(--i >= 0) release_region(RC_TO_ISA(rc_ioport[i]) + bp->base, 1); return 1; } -static void rc_release_io_range(struct riscom_board * const bp) +static inline void rc_release_io_range(struct riscom_board * const bp) { int i; - - for (i = 0; i < RC_NIOPORT; i++) + + for (i = 0; i < RC_NIOPORT; i++) release_region(RC_TO_ISA(rc_ioport[i]) + bp->base, 1); } - + /* Reset and setup CD180 chip */ -static void __init rc_init_CD180(struct riscom_board const *bp) +static void __init rc_init_CD180(struct riscom_board const * bp) { unsigned long flags; - + spin_lock_irqsave(&riscom_lock, flags); - rc_out(bp, RC_CTOUT, 0); /* Clear timeout */ - rc_wait_CCR(bp); /* Wait for CCR ready */ - rc_out(bp, CD180_CCR, CCR_HARDRESET); /* Reset CD180 chip */ + rc_out(bp, RC_CTOUT, 0); /* Clear timeout */ + rc_wait_CCR(bp); /* Wait for CCR ready */ + rc_out(bp, CD180_CCR, CCR_HARDRESET); /* Reset CD180 chip */ spin_unlock_irqrestore(&riscom_lock, flags); - msleep(50); /* Delay 0.05 sec */ + msleep(50); /* Delay 0.05 sec */ spin_lock_irqsave(&riscom_lock, flags); - rc_out(bp, CD180_GIVR, RC_ID); /* Set ID for this chip */ - rc_out(bp, CD180_GICR, 0); /* Clear all bits */ - rc_out(bp, CD180_PILR1, RC_ACK_MINT); /* Prio for modem intr */ - rc_out(bp, CD180_PILR2, RC_ACK_TINT); /* Prio for tx intr */ - rc_out(bp, CD180_PILR3, RC_ACK_RINT); /* Prio for rx intr */ - + rc_out(bp, CD180_GIVR, RC_ID); /* Set ID for this chip */ + rc_out(bp, CD180_GICR, 0); /* Clear all bits */ + rc_out(bp, CD180_PILR1, RC_ACK_MINT); /* Prio for modem intr */ + rc_out(bp, CD180_PILR2, RC_ACK_TINT); /* Prio for transmitter intr */ + rc_out(bp, CD180_PILR3, RC_ACK_RINT); /* Prio for receiver intr */ + /* Setting up prescaler. We need 4 ticks per 1 ms */ rc_out(bp, CD180_PPRH, (RC_OSCFREQ/(1000000/RISCOM_TPS)) >> 8); rc_out(bp, CD180_PPRL, (RC_OSCFREQ/(1000000/RISCOM_TPS)) & 0xff); - + spin_unlock_irqrestore(&riscom_lock, flags); } @@ -246,12 +245,12 @@ static int __init rc_probe(struct riscom_board *bp) unsigned char val1, val2; int irqs = 0; int retries; - + bp->irq = 0; if (rc_request_io_range(bp)) return 1; - + /* Are the I/O ports here ? */ rc_out(bp, CD180_PPRL, 0x5a); outb(0xff, 0x80); @@ -259,34 +258,34 @@ static int __init rc_probe(struct riscom_board *bp) rc_out(bp, CD180_PPRL, 0xa5); outb(0x00, 0x80); val2 = rc_in(bp, CD180_PPRL); - + if ((val1 != 0x5a) || (val2 != 0xa5)) { printk(KERN_ERR "rc%d: RISCom/8 Board at 0x%03x not found.\n", board_No(bp), bp->base); goto out_release; } - + /* It's time to find IRQ for this board */ - for (retries = 0; retries < 5 && irqs <= 0; retries++) { + for (retries = 0; retries < 5 && irqs <= 0; retries++) { irqs = probe_irq_on(); - rc_init_CD180(bp); /* Reset CD180 chip */ - rc_out(bp, CD180_CAR, 2); /* Select port 2 */ + rc_init_CD180(bp); /* Reset CD180 chip */ + rc_out(bp, CD180_CAR, 2); /* Select port 2 */ rc_wait_CCR(bp); - rc_out(bp, CD180_CCR, CCR_TXEN); /* Enable transmitter */ - rc_out(bp, CD180_IER, IER_TXRDY);/* Enable tx empty intr */ + rc_out(bp, CD180_CCR, CCR_TXEN); /* Enable transmitter */ + rc_out(bp, CD180_IER, IER_TXRDY); /* Enable tx empty intr */ msleep(50); irqs = probe_irq_off(irqs); - val1 = rc_in(bp, RC_BSR); /* Get Board Status reg */ - val2 = rc_in(bp, RC_ACK_TINT); /* ACK interrupt */ - rc_init_CD180(bp); /* Reset CD180 again */ - + val1 = rc_in(bp, RC_BSR); /* Get Board Status reg */ + val2 = rc_in(bp, RC_ACK_TINT); /* ACK interrupt */ + rc_init_CD180(bp); /* Reset CD180 again */ + if ((val1 & RC_BSR_TINT) || (val2 != (RC_ID | GIVR_IT_TX))) { printk(KERN_ERR "rc%d: RISCom/8 Board at 0x%03x not " "found.\n", board_No(bp), bp->base); goto out_release; } } - + if (irqs <= 0) { printk(KERN_ERR "rc%d: Can't find IRQ for RISCom/8 board " "at 0x%03x.\n", board_No(bp), bp->base); @@ -294,112 +293,113 @@ static int __init rc_probe(struct riscom_board *bp) } bp->irq = irqs; bp->flags |= RC_BOARD_PRESENT; - + printk(KERN_INFO "rc%d: RISCom/8 Rev. %c board detected at " "0x%03x, IRQ %d.\n", board_No(bp), (rc_in(bp, CD180_GFRCR) & 0x0f) + 'A', /* Board revision */ bp->base, bp->irq); - + return 0; out_release: rc_release_io_range(bp); return 1; } -/* - * +/* + * * Interrupt processing routines. - * + * */ -static struct riscom_port *rc_get_port(struct riscom_board const *bp, - unsigned char const *what) +static inline struct riscom_port * rc_get_port(struct riscom_board const * bp, + unsigned char const * what) { unsigned char channel; - struct riscom_port *port; - + struct riscom_port * port; + channel = rc_in(bp, CD180_GICR) >> GICR_CHAN_OFF; if (channel < CD180_NCH) { port = &rc_port[board_No(bp) * RC_NPORT + channel]; - if (port->flags & ASYNC_INITIALIZED) + if (port->flags & ASYNC_INITIALIZED) { return port; + } } - printk(KERN_ERR "rc%d: %s interrupt from invalid port %d\n", + printk(KERN_ERR "rc%d: %s interrupt from invalid port %d\n", board_No(bp), what, channel); return NULL; } -static void rc_receive_exc(struct riscom_board const *bp) +static inline void rc_receive_exc(struct riscom_board const * bp) { struct riscom_port *port; struct tty_struct *tty; unsigned char status; unsigned char ch, flag; - - port = rc_get_port(bp, "Receive"); - if (port == NULL) + + if (!(port = rc_get_port(bp, "Receive"))) return; tty = port->tty; - -#ifdef RC_REPORT_OVERRUN + +#ifdef RC_REPORT_OVERRUN status = rc_in(bp, CD180_RCSR); if (status & RCSR_OE) port->overrun++; status &= port->mark_mask; -#else +#else status = rc_in(bp, CD180_RCSR) & port->mark_mask; -#endif +#endif ch = rc_in(bp, CD180_RDR); - if (!status) + if (!status) { return; + } if (status & RCSR_TOUT) { printk(KERN_WARNING "rc%d: port %d: Receiver timeout. " - "Hardware problems ?\n", + "Hardware problems ?\n", board_No(bp), port_No(port)); return; - + } else if (status & RCSR_BREAK) { printk(KERN_INFO "rc%d: port %d: Handling break...\n", board_No(bp), port_No(port)); flag = TTY_BREAK; if (port->flags & ASYNC_SAK) do_SAK(tty); - - } else if (status & RCSR_PE) + + } else if (status & RCSR_PE) flag = TTY_PARITY; - - else if (status & RCSR_FE) + + else if (status & RCSR_FE) flag = TTY_FRAME; - - else if (status & RCSR_OE) + + else if (status & RCSR_OE) flag = TTY_OVERRUN; + else flag = TTY_NORMAL; - + tty_insert_flip_char(tty, ch, flag); tty_flip_buffer_push(tty); } -static void rc_receive(struct riscom_board const *bp) +static inline void rc_receive(struct riscom_board const * bp) { struct riscom_port *port; struct tty_struct *tty; unsigned char count; - - port = rc_get_port(bp, "Receive"); - if (port == NULL) + + if (!(port = rc_get_port(bp, "Receive"))) return; - + tty = port->tty; - + count = rc_in(bp, CD180_RDCR); - + #ifdef RC_REPORT_FIFO port->hits[count > 8 ? 9 : count]++; -#endif - +#endif + while (count--) { if (tty_buffer_request_room(tty, 1) == 0) { printk(KERN_WARNING "rc%d: port %d: Working around " @@ -412,26 +412,26 @@ static void rc_receive(struct riscom_board const *bp) tty_flip_buffer_push(tty); } -static void rc_transmit(struct riscom_board const *bp) +static inline void rc_transmit(struct riscom_board const * bp) { struct riscom_port *port; struct tty_struct *tty; unsigned char count; - - port = rc_get_port(bp, "Transmit"); - if (port == NULL) + + + if (!(port = rc_get_port(bp, "Transmit"))) return; - + tty = port->tty; - - if (port->IER & IER_TXEMPTY) { + + if (port->IER & IER_TXEMPTY) { /* FIFO drained */ rc_out(bp, CD180_CAR, port_No(port)); port->IER &= ~IER_TXEMPTY; rc_out(bp, CD180_IER, port->IER); return; } - + if ((port->xmit_cnt <= 0 && !port->break_length) || tty->stopped || tty->hw_stopped) { rc_out(bp, CD180_CAR, port_No(port)); @@ -439,7 +439,7 @@ static void rc_transmit(struct riscom_board const *bp) rc_out(bp, CD180_IER, port->IER); return; } - + if (port->break_length) { if (port->break_length > 0) { if (port->COR2 & COR2_ETC) { @@ -451,8 +451,7 @@ static void rc_transmit(struct riscom_board const *bp) rc_out(bp, CD180_TDR, CD180_C_ESC); rc_out(bp, CD180_TDR, CD180_C_DELAY); rc_out(bp, CD180_TDR, count); - port->break_length -= count; - if (port->break_length == 0) + if (!(port->break_length -= count)) port->break_length--; } else { rc_out(bp, CD180_TDR, CD180_C_ESC); @@ -464,7 +463,7 @@ static void rc_transmit(struct riscom_board const *bp) } return; } - + count = CD180_NFIFO; do { rc_out(bp, CD180_TDR, port->xmit_buf[port->xmit_tail++]); @@ -472,7 +471,7 @@ static void rc_transmit(struct riscom_board const *bp) if (--port->xmit_cnt <= 0) break; } while (--count > 0); - + if (port->xmit_cnt <= 0) { rc_out(bp, CD180_CAR, port_No(port)); port->IER &= ~IER_TXRDY; @@ -482,26 +481,25 @@ static void rc_transmit(struct riscom_board const *bp) tty_wakeup(tty); } -static void rc_check_modem(struct riscom_board const *bp) +static inline void rc_check_modem(struct riscom_board const * bp) { struct riscom_port *port; struct tty_struct *tty; unsigned char mcr; - - port = rc_get_port(bp, "Modem"); - if (port == NULL) + + if (!(port = rc_get_port(bp, "Modem"))) return; - + tty = port->tty; - + mcr = rc_in(bp, CD180_MCR); - if (mcr & MCR_CDCHG) { - if (rc_in(bp, CD180_MSVR) & MSVR_CD) + if (mcr & MCR_CDCHG) { + if (rc_in(bp, CD180_MSVR) & MSVR_CD) wake_up_interruptible(&port->open_wait); else tty_hangup(tty); } - + #ifdef RISCOM_BRAIN_DAMAGED_CTS if (mcr & MCR_CTSCHG) { if (rc_in(bp, CD180_MSVR) & MSVR_CTS) { @@ -528,13 +526,13 @@ static void rc_check_modem(struct riscom_board const *bp) rc_out(bp, CD180_IER, port->IER); } #endif /* RISCOM_BRAIN_DAMAGED_CTS */ - + /* Clear change bits */ rc_out(bp, CD180_MCR, 0); } /* The main interrupt processing routine */ -static irqreturn_t rc_interrupt(int dummy, void *dev_id) +static irqreturn_t rc_interrupt(int dummy, void * dev_id) { unsigned char status; unsigned char ack; @@ -549,11 +547,13 @@ static irqreturn_t rc_interrupt(int dummy, void *dev_id) (RC_BSR_TOUT | RC_BSR_TINT | RC_BSR_MINT | RC_BSR_RINT))) { handled = 1; - if (status & RC_BSR_TOUT) + if (status & RC_BSR_TOUT) printk(KERN_WARNING "rc%d: Got timeout. Hardware " "error?\n", board_No(bp)); + else if (status & RC_BSR_RINT) { ack = rc_in(bp, RC_ACK_RINT); + if (ack == (RC_ID | GIVR_IT_RCV)) rc_receive(bp); else if (ack == (RC_ID | GIVR_IT_REXC)) @@ -562,23 +562,29 @@ static irqreturn_t rc_interrupt(int dummy, void *dev_id) printk(KERN_WARNING "rc%d: Bad receive ack " "0x%02x.\n", board_No(bp), ack); + } else if (status & RC_BSR_TINT) { ack = rc_in(bp, RC_ACK_TINT); + if (ack == (RC_ID | GIVR_IT_TX)) rc_transmit(bp); else printk(KERN_WARNING "rc%d: Bad transmit ack " "0x%02x.\n", board_No(bp), ack); + } else /* if (status & RC_BSR_MINT) */ { ack = rc_in(bp, RC_ACK_MINT); - if (ack == (RC_ID | GIVR_IT_MODEM)) + + if (ack == (RC_ID | GIVR_IT_MODEM)) rc_check_modem(bp); else printk(KERN_WARNING "rc%d: Bad modem ack " "0x%02x.\n", board_No(bp), ack); - } + + } + rc_out(bp, CD180_EOIR, 0); /* Mark end of interrupt */ rc_out(bp, RC_CTOUT, 0); /* Clear timeout flag */ } @@ -590,24 +596,24 @@ static irqreturn_t rc_interrupt(int dummy, void *dev_id) */ /* Called with disabled interrupts */ -static int rc_setup_board(struct riscom_board *bp) +static int rc_setup_board(struct riscom_board * bp) { int error; - if (bp->flags & RC_BOARD_ACTIVE) + if (bp->flags & RC_BOARD_ACTIVE) return 0; - + error = request_irq(bp->irq, rc_interrupt, IRQF_DISABLED, "RISCom/8", bp); - if (error) + if (error) return error; - + rc_out(bp, RC_CTOUT, 0); /* Just in case */ bp->DTR = ~0; rc_out(bp, RC_DTR, bp->DTR); /* Drop DTR on all ports */ - + bp->flags |= RC_BOARD_ACTIVE; - + return 0; } @@ -616,40 +622,40 @@ static void rc_shutdown_board(struct riscom_board *bp) { if (!(bp->flags & RC_BOARD_ACTIVE)) return; - + bp->flags &= ~RC_BOARD_ACTIVE; - + free_irq(bp->irq, NULL); - + bp->DTR = ~0; rc_out(bp, RC_DTR, bp->DTR); /* Drop DTR on all ports */ - + } /* - * Setting up port characteristics. + * Setting up port characteristics. * Must be called with disabled interrupts */ static void rc_change_speed(struct riscom_board *bp, struct riscom_port *port) { - struct tty_struct *tty = port->tty; + struct tty_struct *tty; unsigned long baud; long tmp; unsigned char cor1 = 0, cor3 = 0; unsigned char mcor1 = 0, mcor2 = 0; - - if (tty == NULL || tty->termios == NULL) + + if (!(tty = port->tty) || !tty->termios) return; port->IER = 0; port->COR2 = 0; port->MSVR = MSVR_RTS; - + baud = tty_get_baud_rate(tty); - + /* Select port on the board */ rc_out(bp, CD180_CAR, port_No(port)); - + if (!baud) { /* Drop DTR & exit */ bp->DTR |= (1u << port_No(port)); @@ -660,68 +666,69 @@ static void rc_change_speed(struct riscom_board *bp, struct riscom_port *port) bp->DTR &= ~(1u << port_No(port)); rc_out(bp, RC_DTR, bp->DTR); } - + /* - * Now we must calculate some speed depended things + * Now we must calculate some speed depended things */ - + /* Set baud rate for port */ tmp = (((RC_OSCFREQ + baud/2) / baud + CD180_TPC/2) / CD180_TPC); - rc_out(bp, CD180_RBPRH, (tmp >> 8) & 0xff); - rc_out(bp, CD180_TBPRH, (tmp >> 8) & 0xff); - rc_out(bp, CD180_RBPRL, tmp & 0xff); + rc_out(bp, CD180_RBPRH, (tmp >> 8) & 0xff); + rc_out(bp, CD180_TBPRH, (tmp >> 8) & 0xff); + rc_out(bp, CD180_RBPRL, tmp & 0xff); rc_out(bp, CD180_TBPRL, tmp & 0xff); - + baud = (baud + 5) / 10; /* Estimated CPS */ - + /* Two timer ticks seems enough to wakeup something like SLIP driver */ - tmp = ((baud + HZ/2) / HZ) * 2 - CD180_NFIFO; + tmp = ((baud + HZ/2) / HZ) * 2 - CD180_NFIFO; port->wakeup_chars = (tmp < 0) ? 0 : ((tmp >= SERIAL_XMIT_SIZE) ? SERIAL_XMIT_SIZE - 1 : tmp); - + /* Receiver timeout will be transmission time for 1.5 chars */ tmp = (RISCOM_TPS + RISCOM_TPS/2 + baud/2) / baud; tmp = (tmp > 0xff) ? 0xff : tmp; rc_out(bp, CD180_RTPR, tmp); - - switch (C_CSIZE(tty)) { - case CS5: + + switch (C_CSIZE(tty)) { + case CS5: cor1 |= COR1_5BITS; break; - case CS6: + case CS6: cor1 |= COR1_6BITS; break; - case CS7: + case CS7: cor1 |= COR1_7BITS; break; - case CS8: + case CS8: cor1 |= COR1_8BITS; break; } - if (C_CSTOPB(tty)) + + if (C_CSTOPB(tty)) cor1 |= COR1_2SB; - + cor1 |= COR1_IGNORE; - if (C_PARENB(tty)) { + if (C_PARENB(tty)) { cor1 |= COR1_NORMPAR; - if (C_PARODD(tty)) + if (C_PARODD(tty)) cor1 |= COR1_ODDP; - if (I_INPCK(tty)) + if (I_INPCK(tty)) cor1 &= ~COR1_IGNORE; } /* Set marking of some errors */ port->mark_mask = RCSR_OE | RCSR_TOUT; - if (I_INPCK(tty)) + if (I_INPCK(tty)) port->mark_mask |= RCSR_FE | RCSR_PE; - if (I_BRKINT(tty) || I_PARMRK(tty)) + if (I_BRKINT(tty) || I_PARMRK(tty)) port->mark_mask |= RCSR_BREAK; - if (I_IGNPAR(tty)) + if (I_IGNPAR(tty)) port->mark_mask &= ~(RCSR_FE | RCSR_PE); - if (I_IGNBRK(tty)) { + if (I_IGNBRK(tty)) { port->mark_mask &= ~RCSR_BREAK; - if (I_IGNPAR(tty)) + if (I_IGNPAR(tty)) /* Real raw mode. Ignore all */ port->mark_mask &= ~RCSR_OE; } @@ -731,8 +738,7 @@ static void rc_change_speed(struct riscom_board *bp, struct riscom_port *port) port->IER |= IER_DSR | IER_CTS; mcor1 |= MCOR1_DSRZD | MCOR1_CTSZD; mcor2 |= MCOR2_DSROD | MCOR2_CTSOD; - tty->hw_stopped = !(rc_in(bp, CD180_MSVR) & - (MSVR_CTS|MSVR_DSR)); + tty->hw_stopped = !(rc_in(bp, CD180_MSVR) & (MSVR_CTS|MSVR_DSR)); #else port->COR2 |= COR2_CTSAE; #endif @@ -755,13 +761,13 @@ static void rc_change_speed(struct riscom_board *bp, struct riscom_port *port) mcor1 |= MCOR1_CDZD; mcor2 |= MCOR2_CDOD; } - - if (C_CREAD(tty)) + + if (C_CREAD(tty)) /* Enable receiver */ port->IER |= IER_RXD; - + /* Set input FIFO size (1-8 bytes) */ - cor3 |= RISCOM_RXFIFO; + cor3 |= RISCOM_RXFIFO; /* Setting up CD180 channel registers */ rc_out(bp, CD180_COR1, cor1); rc_out(bp, CD180_COR2, port->COR2); @@ -785,30 +791,36 @@ static void rc_change_speed(struct riscom_board *bp, struct riscom_port *port) static int rc_setup_port(struct riscom_board *bp, struct riscom_port *port) { unsigned long flags; - + if (port->flags & ASYNC_INITIALIZED) return 0; - + if (!port->xmit_buf) { /* We may sleep in get_zeroed_page() */ - unsigned long tmp = get_zeroed_page(GFP_KERNEL); - if (tmp == 0) + unsigned long tmp; + + if (!(tmp = get_zeroed_page(GFP_KERNEL))) return -ENOMEM; - if (port->xmit_buf) + + if (port->xmit_buf) { free_page(tmp); - else - port->xmit_buf = (unsigned char *) tmp; + return -ERESTARTSYS; + } + port->xmit_buf = (unsigned char *) tmp; } + spin_lock_irqsave(&riscom_lock, flags); - if (port->tty) + if (port->tty) clear_bit(TTY_IO_ERROR, &port->tty->flags); - if (port->count == 1) + + if (port->count == 1) bp->count++; + port->xmit_cnt = port->xmit_head = port->xmit_tail = 0; rc_change_speed(bp, port); port->flags |= ASYNC_INITIALIZED; - + spin_unlock_irqrestore(&riscom_lock, flags); return 0; } @@ -817,39 +829,38 @@ static int rc_setup_port(struct riscom_board *bp, struct riscom_port *port) static void rc_shutdown_port(struct riscom_board *bp, struct riscom_port *port) { struct tty_struct *tty; - - if (!(port->flags & ASYNC_INITIALIZED)) + + if (!(port->flags & ASYNC_INITIALIZED)) return; - + #ifdef RC_REPORT_OVERRUN printk(KERN_INFO "rc%d: port %d: Total %ld overruns were detected.\n", board_No(bp), port_No(port), port->overrun); -#endif +#endif #ifdef RC_REPORT_FIFO { int i; - + printk(KERN_INFO "rc%d: port %d: FIFO hits [ ", board_No(bp), port_No(port)); - for (i = 0; i < 10; i++) + for (i = 0; i < 10; i++) { printk("%ld ", port->hits[i]); + } printk("].\n"); } -#endif +#endif if (port->xmit_buf) { free_page((unsigned long) port->xmit_buf); port->xmit_buf = NULL; } - tty = port->tty; - - if (tty == NULL || C_HUPCL(tty)) { + if (!(tty = port->tty) || C_HUPCL(tty)) { /* Drop DTR */ bp->DTR |= (1u << port_No(port)); rc_out(bp, RC_DTR, bp->DTR); } - - /* Select port */ + + /* Select port */ rc_out(bp, CD180_CAR, port_No(port)); /* Reset port */ rc_wait_CCR(bp); @@ -857,26 +868,28 @@ static void rc_shutdown_port(struct riscom_board *bp, struct riscom_port *port) /* Disable all interrupts from this port */ port->IER = 0; rc_out(bp, CD180_IER, port->IER); - - if (tty) + + if (tty) set_bit(TTY_IO_ERROR, &tty->flags); port->flags &= ~ASYNC_INITIALIZED; - + if (--bp->count < 0) { printk(KERN_INFO "rc%d: rc_shutdown_port: " "bad board count: %d\n", board_No(bp), bp->count); bp->count = 0; } + /* * If this is the last opened port on the board * shutdown whole board */ - if (!bp->count) + if (!bp->count) rc_shutdown_board(bp); } -static int block_til_ready(struct tty_struct *tty, struct file *filp, + +static int block_til_ready(struct tty_struct *tty, struct file * filp, struct riscom_port *port) { DECLARE_WAITQUEUE(wait, current); @@ -908,7 +921,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, return 0; } - if (C_CLOCAL(tty)) + if (C_CLOCAL(tty)) do_clocal = 1; /* @@ -946,7 +959,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, if (port->flags & ASYNC_HUP_NOTIFY) retval = -EAGAIN; else - retval = -ERESTARTSYS; + retval = -ERESTARTSYS; break; } if (!(port->flags & ASYNC_CLOSING) && @@ -965,63 +978,50 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, port->blocked_open--; if (retval) return retval; - + port->flags |= ASYNC_NORMAL_ACTIVE; return 0; -} +} -static int rc_open(struct tty_struct *tty, struct file *filp) +static int rc_open(struct tty_struct * tty, struct file * filp) { int board; int error; - struct riscom_port *port; - struct riscom_board *bp; - + struct riscom_port * port; + struct riscom_board * bp; + board = RC_BOARD(tty->index); if (board >= RC_NBOARD || !(rc_board[board].flags & RC_BOARD_PRESENT)) return -ENODEV; - + bp = &rc_board[board]; port = rc_port + board * RC_NPORT + RC_PORT(tty->index); if (rc_paranoia_check(port, tty->name, "rc_open")) return -ENODEV; - - error = rc_setup_board(bp); - if (error) + + if ((error = rc_setup_board(bp))) return error; - + port->count++; tty->driver_data = port; port->tty = tty; - - error = rc_setup_port(bp, port); - if (error == 0) - error = block_til_ready(tty, filp, port); - return error; -} - -static void rc_flush_buffer(struct tty_struct *tty) -{ - struct riscom_port *port = (struct riscom_port *)tty->driver_data; - unsigned long flags; - - if (rc_paranoia_check(port, tty->name, "rc_flush_buffer")) - return; - - spin_lock_irqsave(&riscom_lock, flags); - port->xmit_cnt = port->xmit_head = port->xmit_tail = 0; - spin_unlock_irqrestore(&riscom_lock, flags); - - tty_wakeup(tty); + + if ((error = rc_setup_port(bp, port))) + return error; + + if ((error = block_til_ready(tty, filp, port))) + return error; + + return 0; } -static void rc_close(struct tty_struct *tty, struct file *filp) +static void rc_close(struct tty_struct * tty, struct file * filp) { struct riscom_port *port = (struct riscom_port *) tty->driver_data; struct riscom_board *bp; unsigned long flags; unsigned long timeout; - + if (!port || rc_paranoia_check(port, tty->name, "close")) return; @@ -1029,7 +1029,7 @@ static void rc_close(struct tty_struct *tty, struct file *filp) if (tty_hung_up_p(filp)) goto out; - + bp = port_Board(port); if ((tty->count == 1) && (port->count != 1)) { printk(KERN_INFO "rc%d: rc_close: bad port count;" @@ -1047,7 +1047,7 @@ static void rc_close(struct tty_struct *tty, struct file *filp) goto out; port->flags |= ASYNC_CLOSING; /* - * Now we wait for the transmit buffer to clear; and we notify + * Now we wait for the transmit buffer to clear; and we notify * the line discipline to only process XON/XOFF characters. */ tty->closing = 1; @@ -1070,22 +1070,24 @@ static void rc_close(struct tty_struct *tty, struct file *filp) * has completely drained; this is especially * important if there is a transmit FIFO! */ - timeout = jiffies + HZ; - while (port->IER & IER_TXEMPTY) { + timeout = jiffies+HZ; + while(port->IER & IER_TXEMPTY) { msleep_interruptible(jiffies_to_msecs(port->timeout)); if (time_after(jiffies, timeout)) break; } } rc_shutdown_port(bp, port); - rc_flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); tty_ldisc_flush(tty); tty->closing = 0; port->tty = NULL; if (port->blocked_open) { - if (port->close_delay) + if (port->close_delay) { msleep_interruptible(jiffies_to_msecs(port->close_delay)); + } wake_up_interruptible(&port->open_wait); } port->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING); @@ -1095,17 +1097,17 @@ static void rc_close(struct tty_struct *tty, struct file *filp) spin_unlock_irqrestore(&riscom_lock, flags); } -static int rc_write(struct tty_struct *tty, +static int rc_write(struct tty_struct * tty, const unsigned char *buf, int count) { struct riscom_port *port = (struct riscom_port *)tty->driver_data; struct riscom_board *bp; int c, total = 0; unsigned long flags; - + if (rc_paranoia_check(port, tty->name, "rc_write")) return 0; - + bp = port_Board(port); if (!tty || !port->xmit_buf) @@ -1142,41 +1144,38 @@ static int rc_write(struct tty_struct *tty, return total; } -static int rc_put_char(struct tty_struct *tty, unsigned char ch) +static void rc_put_char(struct tty_struct * tty, unsigned char ch) { struct riscom_port *port = (struct riscom_port *)tty->driver_data; unsigned long flags; - int ret = 0; if (rc_paranoia_check(port, tty->name, "rc_put_char")) - return 0; + return; if (!tty || !port->xmit_buf) - return 0; + return; spin_lock_irqsave(&riscom_lock, flags); - + if (port->xmit_cnt >= SERIAL_XMIT_SIZE - 1) goto out; port->xmit_buf[port->xmit_head++] = ch; port->xmit_head &= SERIAL_XMIT_SIZE - 1; port->xmit_cnt++; - ret = 1; out: spin_unlock_irqrestore(&riscom_lock, flags); - return ret; } -static void rc_flush_chars(struct tty_struct *tty) +static void rc_flush_chars(struct tty_struct * tty) { struct riscom_port *port = (struct riscom_port *)tty->driver_data; unsigned long flags; - + if (rc_paranoia_check(port, tty->name, "rc_flush_chars")) return; - + if (port->xmit_cnt <= 0 || tty->stopped || tty->hw_stopped || !port->xmit_buf) return; @@ -1190,11 +1189,11 @@ static void rc_flush_chars(struct tty_struct *tty) spin_unlock_irqrestore(&riscom_lock, flags); } -static int rc_write_room(struct tty_struct *tty) +static int rc_write_room(struct tty_struct * tty) { struct riscom_port *port = (struct riscom_port *)tty->driver_data; int ret; - + if (rc_paranoia_check(port, tty->name, "rc_write_room")) return 0; @@ -1207,22 +1206,39 @@ static int rc_write_room(struct tty_struct *tty) static int rc_chars_in_buffer(struct tty_struct *tty) { struct riscom_port *port = (struct riscom_port *)tty->driver_data; - + if (rc_paranoia_check(port, tty->name, "rc_chars_in_buffer")) return 0; - + return port->xmit_cnt; } +static void rc_flush_buffer(struct tty_struct *tty) +{ + struct riscom_port *port = (struct riscom_port *)tty->driver_data; + unsigned long flags; + + if (rc_paranoia_check(port, tty->name, "rc_flush_buffer")) + return; + + spin_lock_irqsave(&riscom_lock, flags); + + port->xmit_cnt = port->xmit_head = port->xmit_tail = 0; + + spin_unlock_irqrestore(&riscom_lock, flags); + + tty_wakeup(tty); +} + static int rc_tiocmget(struct tty_struct *tty, struct file *file) { struct riscom_port *port = (struct riscom_port *)tty->driver_data; - struct riscom_board *bp; + struct riscom_board * bp; unsigned char status; unsigned int result; unsigned long flags; - if (rc_paranoia_check(port, tty->name, __func__)) + if (rc_paranoia_check(port, tty->name, __FUNCTION__)) return -ENODEV; bp = port_Board(port); @@ -1250,7 +1266,7 @@ static int rc_tiocmset(struct tty_struct *tty, struct file *file, unsigned long flags; struct riscom_board *bp; - if (rc_paranoia_check(port, tty->name, __func__)) + if (rc_paranoia_check(port, tty->name, __FUNCTION__)) return -ENODEV; bp = port_Board(port); @@ -1276,11 +1292,11 @@ static int rc_tiocmset(struct tty_struct *tty, struct file *file, return 0; } -static void rc_send_break(struct riscom_port *port, unsigned long length) +static inline void rc_send_break(struct riscom_port * port, unsigned long length) { struct riscom_board *bp = port_Board(port); unsigned long flags; - + spin_lock_irqsave(&riscom_lock, flags); port->break_length = RISCOM_TPS / HZ * length; @@ -1296,17 +1312,17 @@ static void rc_send_break(struct riscom_port *port, unsigned long length) spin_unlock_irqrestore(&riscom_lock, flags); } -static int rc_set_serial_info(struct riscom_port *port, - struct serial_struct __user *newinfo) +static inline int rc_set_serial_info(struct riscom_port * port, + struct serial_struct __user * newinfo) { struct serial_struct tmp; struct riscom_board *bp = port_Board(port); int change_speed; - + if (copy_from_user(&tmp, newinfo, sizeof(tmp))) return -EFAULT; - -#if 0 + +#if 0 if ((tmp.irq != bp->irq) || (tmp.port != bp->base) || (tmp.type != PORT_CIRRUS) || @@ -1315,16 +1331,16 @@ static int rc_set_serial_info(struct riscom_port *port, (tmp.xmit_fifo_size != CD180_NFIFO) || (tmp.flags & ~RISCOM_LEGAL_FLAGS)) return -EINVAL; -#endif - +#endif + change_speed = ((port->flags & ASYNC_SPD_MASK) != (tmp.flags & ASYNC_SPD_MASK)); - + if (!capable(CAP_SYS_ADMIN)) { if ((tmp.close_delay != port->close_delay) || (tmp.closing_wait != port->closing_wait) || ((tmp.flags & ~ASYNC_USR_MASK) != - (port->flags & ~ASYNC_USR_MASK))) + (port->flags & ~ASYNC_USR_MASK))) return -EPERM; port->flags = ((port->flags & ~ASYNC_USR_MASK) | (tmp.flags & ASYNC_USR_MASK)); @@ -1344,12 +1360,12 @@ static int rc_set_serial_info(struct riscom_port *port, return 0; } -static int rc_get_serial_info(struct riscom_port *port, +static inline int rc_get_serial_info(struct riscom_port * port, struct serial_struct __user *retinfo) { struct serial_struct tmp; struct riscom_board *bp = port_Board(port); - + memset(&tmp, 0, sizeof(tmp)); tmp.type = PORT_CIRRUS; tmp.line = port - rc_port; @@ -1363,18 +1379,19 @@ static int rc_get_serial_info(struct riscom_port *port, return copy_to_user(retinfo, &tmp, sizeof(tmp)) ? -EFAULT : 0; } -static int rc_ioctl(struct tty_struct *tty, struct file *filp, +static int rc_ioctl(struct tty_struct * tty, struct file * filp, unsigned int cmd, unsigned long arg) + { struct riscom_port *port = (struct riscom_port *)tty->driver_data; void __user *argp = (void __user *)arg; - int retval = 0; - + int retval; + if (rc_paranoia_check(port, tty->name, "rc_ioctl")) return -ENODEV; - + switch (cmd) { - case TCSBRK: /* SVID version: non-zero arg --> no break */ + case TCSBRK: /* SVID version: non-zero arg --> no break */ retval = tty_check_change(tty); if (retval) return retval; @@ -1382,40 +1399,45 @@ static int rc_ioctl(struct tty_struct *tty, struct file *filp, if (!arg) rc_send_break(port, HZ/4); /* 1/4 second */ break; - case TCSBRKP: /* support for POSIX tcsendbreak() */ + case TCSBRKP: /* support for POSIX tcsendbreak() */ retval = tty_check_change(tty); if (retval) return retval; tty_wait_until_sent(tty, 0); rc_send_break(port, arg ? arg*(HZ/10) : HZ/4); break; - case TIOCGSERIAL: - lock_kernel(); - retval = rc_get_serial_info(port, argp); - unlock_kernel(); + case TIOCGSOFTCAR: + return put_user(C_CLOCAL(tty) ? 1 : 0, (unsigned __user *)argp); + case TIOCSSOFTCAR: + if (get_user(arg,(unsigned __user *) argp)) + return -EFAULT; + tty->termios->c_cflag = + ((tty->termios->c_cflag & ~CLOCAL) | + (arg ? CLOCAL : 0)); break; - case TIOCSSERIAL: - lock_kernel(); - retval = rc_set_serial_info(port, argp); - unlock_kernel(); - break; - default: - retval = -ENOIOCTLCMD; + case TIOCGSERIAL: + return rc_get_serial_info(port, argp); + case TIOCSSERIAL: + return rc_set_serial_info(port, argp); + default: + return -ENOIOCTLCMD; } - return retval; + return 0; } -static void rc_throttle(struct tty_struct *tty) +static void rc_throttle(struct tty_struct * tty) { struct riscom_port *port = (struct riscom_port *)tty->driver_data; struct riscom_board *bp; unsigned long flags; - + if (rc_paranoia_check(port, tty->name, "rc_throttle")) return; + bp = port_Board(port); spin_lock_irqsave(&riscom_lock, flags); + port->MSVR &= ~MSVR_RTS; rc_out(bp, CD180_CAR, port_No(port)); if (I_IXOFF(tty)) { @@ -1424,20 +1446,23 @@ static void rc_throttle(struct tty_struct *tty) rc_wait_CCR(bp); } rc_out(bp, CD180_MSVR, port->MSVR); + spin_unlock_irqrestore(&riscom_lock, flags); } -static void rc_unthrottle(struct tty_struct *tty) +static void rc_unthrottle(struct tty_struct * tty) { struct riscom_port *port = (struct riscom_port *)tty->driver_data; struct riscom_board *bp; unsigned long flags; - + if (rc_paranoia_check(port, tty->name, "rc_unthrottle")) return; + bp = port_Board(port); - + spin_lock_irqsave(&riscom_lock, flags); + port->MSVR |= MSVR_RTS; rc_out(bp, CD180_CAR, port_No(port)); if (I_IXOFF(tty)) { @@ -1446,58 +1471,62 @@ static void rc_unthrottle(struct tty_struct *tty) rc_wait_CCR(bp); } rc_out(bp, CD180_MSVR, port->MSVR); + spin_unlock_irqrestore(&riscom_lock, flags); } -static void rc_stop(struct tty_struct *tty) +static void rc_stop(struct tty_struct * tty) { struct riscom_port *port = (struct riscom_port *)tty->driver_data; struct riscom_board *bp; unsigned long flags; - + if (rc_paranoia_check(port, tty->name, "rc_stop")) return; - + bp = port_Board(port); - + spin_lock_irqsave(&riscom_lock, flags); + port->IER &= ~IER_TXRDY; rc_out(bp, CD180_CAR, port_No(port)); rc_out(bp, CD180_IER, port->IER); + spin_unlock_irqrestore(&riscom_lock, flags); } -static void rc_start(struct tty_struct *tty) +static void rc_start(struct tty_struct * tty) { struct riscom_port *port = (struct riscom_port *)tty->driver_data; struct riscom_board *bp; unsigned long flags; - + if (rc_paranoia_check(port, tty->name, "rc_start")) return; - + bp = port_Board(port); - + spin_lock_irqsave(&riscom_lock, flags); - if (port->xmit_cnt && port->xmit_buf && !(port->IER & IER_TXRDY)) { + if (port->xmit_cnt && port->xmit_buf && !(port->IER & IER_TXRDY)) { port->IER |= IER_TXRDY; rc_out(bp, CD180_CAR, port_No(port)); rc_out(bp, CD180_IER, port->IER); } + spin_unlock_irqrestore(&riscom_lock, flags); } -static void rc_hangup(struct tty_struct *tty) +static void rc_hangup(struct tty_struct * tty) { struct riscom_port *port = (struct riscom_port *)tty->driver_data; struct riscom_board *bp; - + if (rc_paranoia_check(port, tty->name, "rc_hangup")) return; - + bp = port_Board(port); - + rc_shutdown_port(bp, port); port->count = 0; port->flags &= ~ASYNC_NORMAL_ACTIVE; @@ -1505,14 +1534,17 @@ static void rc_hangup(struct tty_struct *tty) wake_up_interruptible(&port->open_wait); } -static void rc_set_termios(struct tty_struct *tty, - struct ktermios *old_termios) +static void rc_set_termios(struct tty_struct * tty, struct ktermios * old_termios) { struct riscom_port *port = (struct riscom_port *)tty->driver_data; unsigned long flags; - + if (rc_paranoia_check(port, tty->name, "rc_set_termios")) return; + + if (tty->termios->c_cflag == old_termios->c_cflag && + tty->termios->c_iflag == old_termios->c_iflag) + return; spin_lock_irqsave(&riscom_lock, flags); rc_change_speed(port_Board(port), port); @@ -1551,9 +1583,9 @@ static int __init rc_init_drivers(void) int i; riscom_driver = alloc_tty_driver(RC_NBOARD * RC_NPORT); - if (!riscom_driver) + if (!riscom_driver) return -ENOMEM; - + riscom_driver->owner = THIS_MODULE; riscom_driver->name = "ttyL"; riscom_driver->major = RISCOM8_NORMAL_MAJOR; @@ -1566,21 +1598,23 @@ static int __init rc_init_drivers(void) riscom_driver->init_termios.c_ospeed = 9600; riscom_driver->flags = TTY_DRIVER_REAL_RAW; tty_set_operations(riscom_driver, &riscom_ops); - error = tty_register_driver(riscom_driver); - if (error != 0) { + if ((error = tty_register_driver(riscom_driver))) { put_tty_driver(riscom_driver); printk(KERN_ERR "rc: Couldn't register RISCom/8 driver, " - "error = %d\n", error); + "error = %d\n", + error); return 1; } + memset(rc_port, 0, sizeof(rc_port)); for (i = 0; i < RC_NPORT * RC_NBOARD; i++) { rc_port[i].magic = RISCOM8_MAGIC; - rc_port[i].close_delay = 50 * HZ / 100; - rc_port[i].closing_wait = 3000 * HZ / 100; + rc_port[i].close_delay = 50 * HZ/100; + rc_port[i].closing_wait = 3000 * HZ/100; init_waitqueue_head(&rc_port[i].open_wait); init_waitqueue_head(&rc_port[i].close_wait); } + return 0; } @@ -1593,13 +1627,13 @@ static void rc_release_drivers(void) #ifndef MODULE /* * Called at boot time. - * + * * You can specify IO base for up to RC_NBOARD cards, * using line "riscom8=0xiobase1,0xiobase2,.." at LILO prompt. * Note that there will be no probing at default * addresses in this case. * - */ + */ static int __init riscom8_setup(char *str) { int ints[RC_NBOARD]; @@ -1610,7 +1644,7 @@ static int __init riscom8_setup(char *str) for (i = 0; i < RC_NBOARD; i++) { if (i < ints[0]) rc_board[i].base = ints[i+1]; - else + else rc_board[i].base = 0; } return 1; @@ -1625,8 +1659,8 @@ static char banner[] __initdata = static char no_boards_msg[] __initdata = KERN_INFO "rc: No RISCom/8 boards detected.\n"; -/* - * This routine must be called by kernel at boot time +/* + * This routine must be called by kernel at boot time */ static int __init riscom8_init(void) { @@ -1635,12 +1669,13 @@ static int __init riscom8_init(void) printk(banner); - if (rc_init_drivers()) + if (rc_init_drivers()) return -EIO; - for (i = 0; i < RC_NBOARD; i++) - if (rc_board[i].base && !rc_probe(&rc_board[i])) + for (i = 0; i < RC_NBOARD; i++) + if (rc_board[i].base && !rc_probe(&rc_board[i])) found++; + if (!found) { rc_release_drivers(); printk(no_boards_msg); @@ -1667,13 +1702,13 @@ MODULE_LICENSE("GPL"); * by specifying "iobase=0xXXX iobase1=0xXXX ..." as insmod parameter. * */ -static int __init riscom8_init_module(void) +static int __init riscom8_init_module (void) { #ifdef MODULE int i; if (iobase || iobase1 || iobase2 || iobase3) { - for (i = 0; i < RC_NBOARD; i++) + for(i = 0; i < RC_NBOARD; i++) rc_board[i].base = 0; } @@ -1689,17 +1724,18 @@ static int __init riscom8_init_module(void) return riscom8_init(); } - -static void __exit riscom8_exit_module(void) + +static void __exit riscom8_exit_module (void) { int i; - + rc_release_drivers(); - for (i = 0; i < RC_NBOARD; i++) - if (rc_board[i].flags & RC_BOARD_PRESENT) + for (i = 0; i < RC_NBOARD; i++) + if (rc_board[i].flags & RC_BOARD_PRESENT) rc_release_io_range(&rc_board[i]); - + } module_init(riscom8_init_module); module_exit(riscom8_exit_module); + diff --git a/trunk/drivers/char/rocket.c b/trunk/drivers/char/rocket.c index 743dc80a9325..f585bc8579e9 100644 --- a/trunk/drivers/char/rocket.c +++ b/trunk/drivers/char/rocket.c @@ -449,8 +449,7 @@ static void rp_do_transmit(struct r_port *info) while (1) { if (tty->stopped || tty->hw_stopped) break; - c = min(info->xmit_fifo_room, info->xmit_cnt); - c = min(c, XMIT_BUF_SIZE - info->xmit_tail); + c = min(info->xmit_fifo_room, min(info->xmit_cnt, XMIT_BUF_SIZE - info->xmit_tail)); if (c <= 0 || info->xmit_fifo_room <= 0) break; sOutStrW(sGetTxRxDataIO(cp), (unsigned short *) (info->xmit_buf + info->xmit_tail), c / 2); @@ -1434,38 +1433,29 @@ static int rp_ioctl(struct tty_struct *tty, struct file *file, { struct r_port *info = (struct r_port *) tty->driver_data; void __user *argp = (void __user *)arg; - int ret = 0; if (cmd != RCKP_GET_PORTS && rocket_paranoia_check(info, "rp_ioctl")) return -ENXIO; - lock_kernel(); - switch (cmd) { case RCKP_GET_STRUCT: if (copy_to_user(argp, info, sizeof (struct r_port))) - ret = -EFAULT; - break; + return -EFAULT; + return 0; case RCKP_GET_CONFIG: - ret = get_config(info, argp); - break; + return get_config(info, argp); case RCKP_SET_CONFIG: - ret = set_config(info, argp); - break; + return set_config(info, argp); case RCKP_GET_PORTS: - ret = get_ports(info, argp); - break; + return get_ports(info, argp); case RCKP_RESET_RM2: - ret = reset_rm2(info, argp); - break; + return reset_rm2(info, argp); case RCKP_GET_VERSION: - ret = get_version(info, argp); - break; + return get_version(info, argp); default: - ret = -ENOIOCTLCMD; + return -ENOIOCTLCMD; } - unlock_kernel(); - return ret; + return 0; } static void rp_send_xchar(struct tty_struct *tty, char ch) @@ -1585,7 +1575,6 @@ static void rp_wait_until_sent(struct tty_struct *tty, int timeout) jiffies); printk(KERN_INFO "cps=%d...\n", info->cps); #endif - lock_kernel(); while (1) { txcnt = sGetTxCnt(cp); if (!txcnt) { @@ -1613,7 +1602,6 @@ static void rp_wait_until_sent(struct tty_struct *tty, int timeout) break; } __set_current_state(TASK_RUNNING); - unlock_kernel(); #ifdef ROCKET_DEBUG_WAIT_UNTIL_SENT printk(KERN_INFO "txcnt = %d (jiff=%lu)...done\n", txcnt, jiffies); #endif @@ -1663,14 +1651,14 @@ static void rp_hangup(struct tty_struct *tty) * writing routines will write directly to transmit FIFO. * Write buffer and counters protected by spinlocks */ -static int rp_put_char(struct tty_struct *tty, unsigned char ch) +static void rp_put_char(struct tty_struct *tty, unsigned char ch) { struct r_port *info = (struct r_port *) tty->driver_data; CHANNEL_t *cp; unsigned long flags; if (rocket_paranoia_check(info, "rp_put_char")) - return 0; + return; /* * Grab the port write mutex, locking out other processes that try to @@ -1699,7 +1687,6 @@ static int rp_put_char(struct tty_struct *tty, unsigned char ch) } spin_unlock_irqrestore(&info->slock, flags); mutex_unlock(&info->write_mtx); - return 1; } /* @@ -1762,10 +1749,10 @@ static int rp_write(struct tty_struct *tty, /* Write remaining data into the port's xmit_buf */ while (1) { - if (!info->tty) /* Seemingly obligatory check... */ + if (!info->tty) /* Seemingly obligatory check... */ goto end; - c = min(count, XMIT_BUF_SIZE - info->xmit_cnt - 1); - c = min(c, XMIT_BUF_SIZE - info->xmit_head); + + c = min(count, min(XMIT_BUF_SIZE - info->xmit_cnt - 1, XMIT_BUF_SIZE - info->xmit_head)); if (c <= 0) break; diff --git a/trunk/drivers/char/serial167.c b/trunk/drivers/char/serial167.c index fd2db07a50fc..df8cd0ca97eb 100644 --- a/trunk/drivers/char/serial167.c +++ b/trunk/drivers/char/serial167.c @@ -1060,7 +1060,7 @@ static void config_setup(struct cyclades_port *info) } /* config_setup */ -static int cy_put_char(struct tty_struct *tty, unsigned char ch) +static void cy_put_char(struct tty_struct *tty, unsigned char ch) { struct cyclades_port *info = (struct cyclades_port *)tty->driver_data; unsigned long flags; @@ -1070,7 +1070,7 @@ static int cy_put_char(struct tty_struct *tty, unsigned char ch) #endif if (serial_paranoia_check(info, tty->name, "cy_put_char")) - return 0; + return; if (!info->xmit_buf) return; @@ -1078,14 +1078,13 @@ static int cy_put_char(struct tty_struct *tty, unsigned char ch) local_irq_save(flags); if (info->xmit_cnt >= PAGE_SIZE - 1) { local_irq_restore(flags); - return 0; + return; } info->xmit_buf[info->xmit_head++] = ch; info->xmit_head &= PAGE_SIZE - 1; info->xmit_cnt++; local_irq_restore(flags); - return 1; } /* cy_put_char */ static void cy_flush_chars(struct tty_struct *tty) @@ -1540,8 +1539,6 @@ cy_ioctl(struct tty_struct *tty, struct file *file, printk("cy_ioctl %s, cmd = %x arg = %lx\n", tty->name, cmd, arg); /* */ #endif - lock_kernel(); - switch (cmd) { case CYGETMON: ret_val = get_mon_info(info, argp); @@ -1587,6 +1584,18 @@ cy_ioctl(struct tty_struct *tty, struct file *file, break; /* The following commands are incompletely implemented!!! */ + case TIOCGSOFTCAR: + ret_val = + put_user(C_CLOCAL(tty) ? 1 : 0, + (unsigned long __user *)argp); + break; + case TIOCSSOFTCAR: + ret_val = get_user(val, (unsigned long __user *)argp); + if (ret_val) + break; + tty->termios->c_cflag = + ((tty->termios->c_cflag & ~CLOCAL) | (val ? CLOCAL : 0)); + break; case TIOCGSERIAL: ret_val = get_serial_info(info, argp); break; @@ -1596,7 +1605,6 @@ cy_ioctl(struct tty_struct *tty, struct file *file, default: ret_val = -ENOIOCTLCMD; } - unlock_kernel(); #ifdef SERIAL_DEBUG_OTHER printk("cy_ioctl done\n"); @@ -1675,7 +1683,8 @@ static void cy_close(struct tty_struct *tty, struct file *filp) if (info->flags & ASYNC_INITIALIZED) tty_wait_until_sent(tty, 3000); /* 30 seconds timeout */ shutdown(info); - cy_flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); tty_ldisc_flush(tty); info->tty = NULL; if (info->blocked_open) { diff --git a/trunk/drivers/char/snsc.c b/trunk/drivers/char/snsc.c index 8fe099a41065..b9c1dba6bd01 100644 --- a/trunk/drivers/char/snsc.c +++ b/trunk/drivers/char/snsc.c @@ -80,7 +80,7 @@ scdrv_open(struct inode *inode, struct file *file) sd = kzalloc(sizeof (struct subch_data_s), GFP_KERNEL); if (sd == NULL) { printk("%s: couldn't allocate subchannel data\n", - __func__); + __FUNCTION__); return -ENOMEM; } @@ -90,7 +90,7 @@ scdrv_open(struct inode *inode, struct file *file) if (sd->sd_subch < 0) { kfree(sd); - printk("%s: couldn't allocate subchannel\n", __func__); + printk("%s: couldn't allocate subchannel\n", __FUNCTION__); return -EBUSY; } @@ -110,7 +110,7 @@ scdrv_open(struct inode *inode, struct file *file) if (rv) { ia64_sn_irtr_close(sd->sd_nasid, sd->sd_subch); kfree(sd); - printk("%s: irq request failed (%d)\n", __func__, rv); + printk("%s: irq request failed (%d)\n", __FUNCTION__, rv); return -EBUSY; } @@ -215,7 +215,7 @@ scdrv_read(struct file *file, char __user *buf, size_t count, loff_t *f_pos) */ if (count < len) { pr_debug("%s: only accepting %d of %d bytes\n", - __func__, (int) count, len); + __FUNCTION__, (int) count, len); } len = min((int) count, len); if (copy_to_user(buf, sd->sd_rb, len)) @@ -384,7 +384,7 @@ scdrv_init(void) if (alloc_chrdev_region(&first_dev, 0, num_cnodes, SYSCTL_BASENAME) < 0) { printk("%s: failed to register SN system controller device\n", - __func__); + __FUNCTION__); return -ENODEV; } snsc_class = class_create(THIS_MODULE, SYSCTL_BASENAME); @@ -403,7 +403,7 @@ scdrv_init(void) GFP_KERNEL); if (!scd) { printk("%s: failed to allocate device info" - "for %s/%s\n", __func__, + "for %s/%s\n", __FUNCTION__, SYSCTL_BASENAME, devname); continue; } @@ -412,7 +412,7 @@ scdrv_init(void) scd->scd_nasid = cnodeid_to_nasid(cnode); if (!(salbuf = kmalloc(SCDRV_BUFSZ, GFP_KERNEL))) { printk("%s: failed to allocate driver buffer" - "(%s%s)\n", __func__, + "(%s%s)\n", __FUNCTION__, SYSCTL_BASENAME, devname); kfree(scd); continue; @@ -424,7 +424,7 @@ scdrv_init(void) ("%s: failed to initialize SAL for" " system controller communication" " (%s/%s): outdated PROM?\n", - __func__, SYSCTL_BASENAME, devname); + __FUNCTION__, SYSCTL_BASENAME, devname); kfree(scd); kfree(salbuf); continue; @@ -435,7 +435,7 @@ scdrv_init(void) if (cdev_add(&scd->scd_cdev, dev, 1)) { printk("%s: failed to register system" " controller device (%s%s)\n", - __func__, SYSCTL_BASENAME, devname); + __FUNCTION__, SYSCTL_BASENAME, devname); kfree(scd); kfree(salbuf); continue; diff --git a/trunk/drivers/char/snsc_event.c b/trunk/drivers/char/snsc_event.c index 53b3d44f8c06..31a7765eaf73 100644 --- a/trunk/drivers/char/snsc_event.c +++ b/trunk/drivers/char/snsc_event.c @@ -271,7 +271,7 @@ scdrv_event_init(struct sysctl_data_s *scd) event_sd = kzalloc(sizeof (struct subch_data_s), GFP_KERNEL); if (event_sd == NULL) { printk(KERN_WARNING "%s: couldn't allocate subchannel info" - " for event monitoring\n", __func__); + " for event monitoring\n", __FUNCTION__); return; } @@ -285,7 +285,7 @@ scdrv_event_init(struct sysctl_data_s *scd) if (event_sd->sd_subch < 0) { kfree(event_sd); printk(KERN_WARNING "%s: couldn't open event subchannel\n", - __func__); + __FUNCTION__); return; } @@ -295,7 +295,7 @@ scdrv_event_init(struct sysctl_data_s *scd) "system controller events", event_sd); if (rv) { printk(KERN_WARNING "%s: irq request failed (%d)\n", - __func__, rv); + __FUNCTION__, rv); ia64_sn_irtr_close(event_sd->sd_nasid, event_sd->sd_subch); kfree(event_sd); return; diff --git a/trunk/drivers/char/sonypi.c b/trunk/drivers/char/sonypi.c index 58533de59027..c03ad164c39a 100644 --- a/trunk/drivers/char/sonypi.c +++ b/trunk/drivers/char/sonypi.c @@ -506,7 +506,7 @@ static struct sonypi_device { while (--n && (command)) \ udelay(1); \ if (!n && (verbose || !quiet)) \ - printk(KERN_WARNING "sonypi command failed at %s : %s (line %d)\n", __FILE__, __func__, __LINE__); \ + printk(KERN_WARNING "sonypi command failed at %s : %s (line %d)\n", __FILE__, __FUNCTION__, __LINE__); \ } #ifdef CONFIG_ACPI diff --git a/trunk/drivers/char/specialix.c b/trunk/drivers/char/specialix.c index 2ee4d9893757..4b5b5b78acb4 100644 --- a/trunk/drivers/char/specialix.c +++ b/trunk/drivers/char/specialix.c @@ -131,8 +131,8 @@ static int sx_rxfifo = SPECIALIX_RXFIFO; #define SX_DEBUG_FIFO 0x0800 -#define func_enter() dprintk (SX_DEBUG_FLOW, "io8: enter %s\n",__func__) -#define func_exit() dprintk (SX_DEBUG_FLOW, "io8: exit %s\n", __func__) +#define func_enter() dprintk (SX_DEBUG_FLOW, "io8: enter %s\n",__FUNCTION__) +#define func_exit() dprintk (SX_DEBUG_FLOW, "io8: exit %s\n", __FUNCTION__) #define jiffies_from_ms(a) ((((a) * HZ)/1000)+1) @@ -874,7 +874,7 @@ static irqreturn_t sx_interrupt(int dummy, void *dev_id) spin_lock_irqsave(&bp->lock, flags); - dprintk (SX_DEBUG_FLOW, "enter %s port %d room: %ld\n", __func__, port_No(sx_get_port(bp, "INT")), SERIAL_XMIT_SIZE - sx_get_port(bp, "ITN")->xmit_cnt - 1); + dprintk (SX_DEBUG_FLOW, "enter %s port %d room: %ld\n", __FUNCTION__, port_No(sx_get_port(bp, "INT")), SERIAL_XMIT_SIZE - sx_get_port(bp, "ITN")->xmit_cnt - 1); if (!(bp->flags & SX_BOARD_ACTIVE)) { dprintk (SX_DEBUG_IRQ, "sx: False interrupt. irq %d.\n", bp->irq); spin_unlock_irqrestore(&bp->lock, flags); @@ -1504,27 +1504,6 @@ static int sx_open(struct tty_struct * tty, struct file * filp) return 0; } -static void sx_flush_buffer(struct tty_struct *tty) -{ - struct specialix_port *port = (struct specialix_port *)tty->driver_data; - unsigned long flags; - struct specialix_board * bp; - - func_enter(); - - if (sx_paranoia_check(port, tty->name, "sx_flush_buffer")) { - func_exit(); - return; - } - - bp = port_Board(port); - spin_lock_irqsave(&port->lock, flags); - port->xmit_cnt = port->xmit_head = port->xmit_tail = 0; - spin_unlock_irqrestore(&port->lock, flags); - tty_wakeup(tty); - - func_exit(); -} static void sx_close(struct tty_struct * tty, struct file * filp) { @@ -1618,7 +1597,8 @@ static void sx_close(struct tty_struct * tty, struct file * filp) } sx_shutdown_port(bp, port); - sx_flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); tty_ldisc_flush(tty); spin_lock_irqsave(&port->lock, flags); tty->closing = 0; @@ -1690,7 +1670,7 @@ static int sx_write(struct tty_struct * tty, } -static int sx_put_char(struct tty_struct * tty, unsigned char ch) +static void sx_put_char(struct tty_struct * tty, unsigned char ch) { struct specialix_port *port = (struct specialix_port *)tty->driver_data; unsigned long flags; @@ -1700,12 +1680,12 @@ static int sx_put_char(struct tty_struct * tty, unsigned char ch) if (sx_paranoia_check(port, tty->name, "sx_put_char")) { func_exit(); - return 0; + return; } dprintk (SX_DEBUG_TX, "check tty: %p %p\n", tty, port->xmit_buf); if (!port->xmit_buf) { func_exit(); - return 0; + return; } bp = port_Board(port); spin_lock_irqsave(&port->lock, flags); @@ -1715,7 +1695,7 @@ static int sx_put_char(struct tty_struct * tty, unsigned char ch) spin_unlock_irqrestore(&port->lock, flags); dprintk (SX_DEBUG_TX, "Exit size\n"); func_exit(); - return 0; + return; } dprintk (SX_DEBUG_TX, "Handle xmit: %p %p\n", port, port->xmit_buf); port->xmit_buf[port->xmit_head++] = ch; @@ -1724,7 +1704,6 @@ static int sx_put_char(struct tty_struct * tty, unsigned char ch) spin_unlock_irqrestore(&port->lock, flags); func_exit(); - return 1; } @@ -1791,6 +1770,28 @@ static int sx_chars_in_buffer(struct tty_struct *tty) } +static void sx_flush_buffer(struct tty_struct *tty) +{ + struct specialix_port *port = (struct specialix_port *)tty->driver_data; + unsigned long flags; + struct specialix_board * bp; + + func_enter(); + + if (sx_paranoia_check(port, tty->name, "sx_flush_buffer")) { + func_exit(); + return; + } + + bp = port_Board(port); + spin_lock_irqsave(&port->lock, flags); + port->xmit_cnt = port->xmit_head = port->xmit_tail = 0; + spin_unlock_irqrestore(&port->lock, flags); + tty_wakeup(tty); + + func_exit(); +} + static int sx_tiocmget(struct tty_struct *tty, struct file *file) { @@ -1802,7 +1803,7 @@ static int sx_tiocmget(struct tty_struct *tty, struct file *file) func_enter(); - if (sx_paranoia_check(port, tty->name, __func__)) { + if (sx_paranoia_check(port, tty->name, __FUNCTION__)) { func_exit(); return -ENODEV; } @@ -1844,7 +1845,7 @@ static int sx_tiocmset(struct tty_struct *tty, struct file *file, func_enter(); - if (sx_paranoia_check(port, tty->name, __func__)) { + if (sx_paranoia_check(port, tty->name, __FUNCTION__)) { func_exit(); return -ENODEV; } @@ -1921,13 +1922,29 @@ static inline int sx_set_serial_info(struct specialix_port * port, int change_speed; func_enter(); - + /* + if (!access_ok(VERIFY_READ, (void *) newinfo, sizeof(tmp))) { + func_exit(); + return -EFAULT; + } + */ if (copy_from_user(&tmp, newinfo, sizeof(tmp))) { func_enter(); return -EFAULT; } - lock_kernel(); +#if 0 + if ((tmp.irq != bp->irq) || + (tmp.port != bp->base) || + (tmp.type != PORT_CIRRUS) || + (tmp.baud_base != (SX_OSCFREQ + CD186x_TPC/2) / CD186x_TPC) || + (tmp.custom_divisor != 0) || + (tmp.xmit_fifo_size != CD186x_NFIFO) || + (tmp.flags & ~SPECIALIX_LEGAL_FLAGS)) { + func_exit(); + return -EINVAL; + } +#endif change_speed = ((port->flags & ASYNC_SPD_MASK) != (tmp.flags & ASYNC_SPD_MASK)); @@ -1939,7 +1956,6 @@ static inline int sx_set_serial_info(struct specialix_port * port, ((tmp.flags & ~ASYNC_USR_MASK) != (port->flags & ~ASYNC_USR_MASK))) { func_exit(); - unlock_kernel(); return -EPERM; } port->flags = ((port->flags & ~ASYNC_USR_MASK) | @@ -1956,7 +1972,6 @@ static inline int sx_set_serial_info(struct specialix_port * port, sx_change_speed(bp, port); } func_exit(); - unlock_kernel(); return 0; } @@ -1969,8 +1984,12 @@ static inline int sx_get_serial_info(struct specialix_port * port, func_enter(); + /* + if (!access_ok(VERIFY_WRITE, (void *) retinfo, sizeof(tmp))) + return -EFAULT; + */ + memset(&tmp, 0, sizeof(tmp)); - lock_kernel(); tmp.type = PORT_CIRRUS; tmp.line = port - sx_port; tmp.port = bp->base; @@ -1981,7 +2000,6 @@ static inline int sx_get_serial_info(struct specialix_port * port, tmp.closing_wait = port->closing_wait * HZ/100; tmp.custom_divisor = port->custom_divisor; tmp.xmit_fifo_size = CD186x_NFIFO; - unlock_kernel(); if (copy_to_user(retinfo, &tmp, sizeof(tmp))) { func_exit(); return -EFAULT; @@ -2027,6 +2045,23 @@ static int sx_ioctl(struct tty_struct * tty, struct file * filp, sx_send_break(port, arg ? arg*(HZ/10) : HZ/4); func_exit(); return 0; + case TIOCGSOFTCAR: + if (put_user(C_CLOCAL(tty)?1:0, (unsigned long __user *)argp)) { + func_exit(); + return -EFAULT; + } + func_exit(); + return 0; + case TIOCSSOFTCAR: + if (get_user(arg, (unsigned long __user *) argp)) { + func_exit(); + return -EFAULT; + } + tty->termios->c_cflag = + ((tty->termios->c_cflag & ~CLOCAL) | + (arg ? CLOCAL : 0)); + func_exit(); + return 0; case TIOCGSERIAL: func_exit(); return sx_get_serial_info(port, argp); diff --git a/trunk/drivers/char/stallion.c b/trunk/drivers/char/stallion.c index d17be10c5d21..874aaa08e956 100644 --- a/trunk/drivers/char/stallion.c +++ b/trunk/drivers/char/stallion.c @@ -875,7 +875,6 @@ static void stl_waituntilsent(struct tty_struct *tty, int timeout) timeout = HZ; tend = jiffies + timeout; - lock_kernel(); while (stl_datastate(portp)) { if (signal_pending(current)) break; @@ -883,7 +882,6 @@ static void stl_waituntilsent(struct tty_struct *tty, int timeout) if (time_after_eq(jiffies, tend)) break; } - unlock_kernel(); } /*****************************************************************************/ @@ -1275,9 +1273,18 @@ static int stl_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd rc = 0; - lock_kernel(); - switch (cmd) { + case TIOCGSOFTCAR: + rc = put_user(((tty->termios->c_cflag & CLOCAL) ? 1 : 0), + (unsigned __user *) argp); + break; + case TIOCSSOFTCAR: + if (get_user(ival, (unsigned int __user *) arg)) + return -EFAULT; + tty->termios->c_cflag = + (tty->termios->c_cflag & ~CLOCAL) | + (ival ? CLOCAL : 0); + break; case TIOCGSERIAL: rc = stl_getserial(portp, argp); break; @@ -1301,7 +1308,7 @@ static int stl_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd rc = -ENOIOCTLCMD; break; } - unlock_kernel(); + return rc; } diff --git a/trunk/drivers/char/sx.c b/trunk/drivers/char/sx.c index f39f6fd89350..a6e1c9ba1217 100644 --- a/trunk/drivers/char/sx.c +++ b/trunk/drivers/char/sx.c @@ -384,11 +384,11 @@ static struct real_driver sx_real_driver = { #define sx_dprintk(f, str...) /* nothing */ #endif -#define func_enter() sx_dprintk(SX_DEBUG_FLOW, "sx: enter %s\n",__func__) -#define func_exit() sx_dprintk(SX_DEBUG_FLOW, "sx: exit %s\n",__func__) +#define func_enter() sx_dprintk(SX_DEBUG_FLOW, "sx: enter %s\n",__FUNCTION__) +#define func_exit() sx_dprintk(SX_DEBUG_FLOW, "sx: exit %s\n",__FUNCTION__) #define func_enter2() sx_dprintk(SX_DEBUG_FLOW, "sx: enter %s (port %d)\n", \ - __func__, port->line) + __FUNCTION__, port->line) /* * Firmware loader driver specific routines @@ -1574,7 +1574,7 @@ static void sx_close(void *ptr) sx_dprintk(SX_DEBUG_CLOSE, "WARNING port count:%d\n", port->gs.count); /*printk("%s SETTING port count to zero: %p count: %d\n", - __func__, port, port->gs.count); + __FUNCTION__, port, port->gs.count); port->gs.count = 0;*/ } @@ -1844,7 +1844,6 @@ static void sx_break(struct tty_struct *tty, int flag) int rv; func_enter(); - lock_kernel(); if (flag) rv = sx_send_command(port, HS_START, -1, HS_IDLE_BREAK); @@ -1853,7 +1852,7 @@ static void sx_break(struct tty_struct *tty, int flag) if (rv != 1) printk(KERN_ERR "sx: couldn't send break (%x).\n", read_sx_byte(port->board, CHAN_OFFSET(port, hi_hstat))); - unlock_kernel(); + func_exit(); } @@ -1889,12 +1888,23 @@ static int sx_ioctl(struct tty_struct *tty, struct file *filp, int rc; struct sx_port *port = tty->driver_data; void __user *argp = (void __user *)arg; + int ival; /* func_enter2(); */ rc = 0; - lock_kernel(); switch (cmd) { + case TIOCGSOFTCAR: + rc = put_user(((tty->termios->c_cflag & CLOCAL) ? 1 : 0), + (unsigned __user *)argp); + break; + case TIOCSSOFTCAR: + if ((rc = get_user(ival, (unsigned __user *)argp)) == 0) { + tty->termios->c_cflag = + (tty->termios->c_cflag & ~CLOCAL) | + (ival ? CLOCAL : 0); + } + break; case TIOCGSERIAL: rc = gs_getserial(&port->gs, argp); break; @@ -1905,7 +1915,6 @@ static int sx_ioctl(struct tty_struct *tty, struct file *filp, rc = -ENOIOCTLCMD; break; } - unlock_kernel(); /* func_exit(); */ return rc; @@ -2540,7 +2549,7 @@ static int __devinit sx_eisa_probe(struct device *dev) goto err_flag; } board->base2 = - board->base = ioremap_nocache(board->hw_base, SI2_EISA_WINDOW_LEN); + board->base = ioremap(board->hw_base, SI2_EISA_WINDOW_LEN); if (!board->base) { dev_err(dev, "can't remap memory\n"); goto err_reg; @@ -2617,7 +2626,7 @@ static void __devinit fix_sx_pci(struct pci_dev *pdev, struct sx_board *board) pci_read_config_dword(pdev, PCI_BASE_ADDRESS_0, &hwbase); hwbase &= PCI_BASE_ADDRESS_MEM_MASK; - rebase = ioremap_nocache(hwbase, 0x80); + rebase = ioremap(hwbase, 0x80); t = readl(rebase + CNTRL_REG_OFFSET); if (t != CNTRL_REG_GOODVALUE) { printk(KERN_DEBUG "sx: performing cntrl reg fix: %08x -> " @@ -2761,7 +2770,7 @@ static int __init sx_init(void) if (!request_region(board->hw_base, board->hw_len, "sx")) continue; board->base2 = - board->base = ioremap_nocache(board->hw_base, board->hw_len); + board->base = ioremap(board->hw_base, board->hw_len); if (!board->base) goto err_sx_reg; board->flags &= ~SX_BOARD_TYPE; @@ -2785,7 +2794,7 @@ static int __init sx_init(void) if (!request_region(board->hw_base, board->hw_len, "sx")) continue; board->base2 = - board->base = ioremap_nocache(board->hw_base, board->hw_len); + board->base = ioremap(board->hw_base, board->hw_len); if (!board->base) goto err_si_reg; board->flags &= ~SX_BOARD_TYPE; @@ -2808,7 +2817,7 @@ static int __init sx_init(void) if (!request_region(board->hw_base, board->hw_len, "sx")) continue; board->base2 = - board->base = ioremap_nocache(board->hw_base, board->hw_len); + board->base = ioremap(board->hw_base, board->hw_len); if (!board->base) goto err_si1_reg; board->flags &= ~SX_BOARD_TYPE; diff --git a/trunk/drivers/char/synclink.c b/trunk/drivers/char/synclink.c index 513b7c2f3e26..fadab1d9510f 100644 --- a/trunk/drivers/char/synclink.c +++ b/trunk/drivers/char/synclink.c @@ -2026,11 +2026,10 @@ static void mgsl_change_params(struct mgsl_struct *info) * * Return Value: None */ -static int mgsl_put_char(struct tty_struct *tty, unsigned char ch) +static void mgsl_put_char(struct tty_struct *tty, unsigned char ch) { struct mgsl_struct *info = (struct mgsl_struct *)tty->driver_data; unsigned long flags; - int ret; if ( debug_level >= DEBUG_LEVEL_INFO ) { printk( "%s(%d):mgsl_put_char(%d) on %s\n", @@ -2038,23 +2037,23 @@ static int mgsl_put_char(struct tty_struct *tty, unsigned char ch) } if (mgsl_paranoia_check(info, tty->name, "mgsl_put_char")) - return 0; + return; if (!tty || !info->xmit_buf) - return 0; + return; spin_lock_irqsave(&info->irq_spinlock,flags); if ( (info->params.mode == MGSL_MODE_ASYNC ) || !info->tx_active ) { + if (info->xmit_cnt < SERIAL_XMIT_SIZE - 1) { info->xmit_buf[info->xmit_head++] = ch; info->xmit_head &= SERIAL_XMIT_SIZE-1; info->xmit_cnt++; - ret = 1; } } + spin_unlock_irqrestore(&info->irq_spinlock,flags); - return ret; } /* end of mgsl_put_char() */ @@ -2943,7 +2942,6 @@ static int mgsl_ioctl(struct tty_struct *tty, struct file * file, unsigned int cmd, unsigned long arg) { struct mgsl_struct * info = (struct mgsl_struct *)tty->driver_data; - int ret; if (debug_level >= DEBUG_LEVEL_INFO) printk("%s(%d):mgsl_ioctl %s cmd=%08X\n", __FILE__,__LINE__, @@ -2958,10 +2956,7 @@ static int mgsl_ioctl(struct tty_struct *tty, struct file * file, return -EIO; } - lock_kernel(); - ret = mgsl_ioctl_common(info, cmd, arg); - unlock_kernel(); - return ret; + return mgsl_ioctl_common(info, cmd, arg); } static int mgsl_ioctl_common(struct mgsl_struct *info, unsigned int cmd, unsigned long arg) @@ -3158,7 +3153,8 @@ static void mgsl_close(struct tty_struct *tty, struct file * filp) if (info->flags & ASYNC_INITIALIZED) mgsl_wait_until_sent(tty, info->timeout); - mgsl_flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); tty_ldisc_flush(tty); @@ -3221,8 +3217,7 @@ static void mgsl_wait_until_sent(struct tty_struct *tty, int timeout) * interval should also be less than the timeout. * Note: use tight timings here to satisfy the NIST-PCTS. */ - - lock_kernel(); + if ( info->params.data_rate ) { char_time = info->timeout/(32 * 5); if (!char_time) @@ -3252,7 +3247,6 @@ static void mgsl_wait_until_sent(struct tty_struct *tty, int timeout) break; } } - unlock_kernel(); exit: if (debug_level >= DEBUG_LEVEL_INFO) @@ -4150,8 +4144,7 @@ static int mgsl_claim_resources(struct mgsl_struct *info) } info->lcr_mem_requested = true; - info->memory_base = ioremap_nocache(info->phys_memory_base, - 0x40000); + info->memory_base = ioremap(info->phys_memory_base,0x40000); if (!info->memory_base) { printk( "%s(%d):Cant map shared memory on device %s MemAddr=%08X\n", __FILE__,__LINE__,info->device_name, info->phys_memory_base ); @@ -4164,14 +4157,12 @@ static int mgsl_claim_resources(struct mgsl_struct *info) goto errout; } - info->lcr_base = ioremap_nocache(info->phys_lcr_base, - PAGE_SIZE); + info->lcr_base = ioremap(info->phys_lcr_base,PAGE_SIZE) + info->lcr_offset; if (!info->lcr_base) { printk( "%s(%d):Cant map LCR memory on device %s MemAddr=%08X\n", __FILE__,__LINE__,info->device_name, info->phys_lcr_base ); goto errout; } - info->lcr_base += info->lcr_offset; } else { /* claim DMA channel */ diff --git a/trunk/drivers/char/synclink_gt.c b/trunk/drivers/char/synclink_gt.c index 2001b0e52dc6..f3d8d72e5ea4 100644 --- a/trunk/drivers/char/synclink_gt.c +++ b/trunk/drivers/char/synclink_gt.c @@ -151,7 +151,7 @@ static void hangup(struct tty_struct *tty); static void set_termios(struct tty_struct *tty, struct ktermios *old_termios); static int write(struct tty_struct *tty, const unsigned char *buf, int count); -static int put_char(struct tty_struct *tty, unsigned char ch); +static void put_char(struct tty_struct *tty, unsigned char ch); static void send_xchar(struct tty_struct *tty, char ch); static void wait_until_sent(struct tty_struct *tty, int timeout); static int write_room(struct tty_struct *tty); @@ -771,7 +771,8 @@ static void close(struct tty_struct *tty, struct file *filp) if (info->flags & ASYNC_INITIALIZED) wait_until_sent(tty, info->timeout); - flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); tty_ldisc_flush(tty); shutdown(info); @@ -912,24 +913,20 @@ static int write(struct tty_struct *tty, return ret; } -static int put_char(struct tty_struct *tty, unsigned char ch) +static void put_char(struct tty_struct *tty, unsigned char ch) { struct slgt_info *info = tty->driver_data; unsigned long flags; - int ret; if (sanity_check(info, tty->name, "put_char")) - return 0; + return; DBGINFO(("%s put_char(%d)\n", info->device_name, ch)); if (!info->tx_buf) - return 0; + return; spin_lock_irqsave(&info->lock,flags); - if (!info->tx_active && (info->tx_count < info->max_frame_size)) { + if (!info->tx_active && (info->tx_count < info->max_frame_size)) info->tx_buf[info->tx_count++] = ch; - ret = 1; - } spin_unlock_irqrestore(&info->lock,flags); - return ret; } static void send_xchar(struct tty_struct *tty, char ch) @@ -970,8 +967,6 @@ static void wait_until_sent(struct tty_struct *tty, int timeout) * Note: use tight timings here to satisfy the NIST-PCTS. */ - lock_kernel(); - if (info->params.data_rate) { char_time = info->timeout/(32 * 5); if (!char_time) @@ -989,7 +984,6 @@ static void wait_until_sent(struct tty_struct *tty, int timeout) if (timeout && time_after(jiffies, orig_jiffies + timeout)) break; } - unlock_kernel(); exit: DBGINFO(("%s wait_until_sent exit\n", info->device_name)); @@ -1103,7 +1097,6 @@ static int ioctl(struct tty_struct *tty, struct file *file, struct serial_icounter_struct __user *p_cuser; /* user space */ unsigned long flags; void __user *argp = (void __user *)arg; - int ret; if (sanity_check(info, tty->name, "ioctl")) return -ENODEV; @@ -1115,54 +1108,37 @@ static int ioctl(struct tty_struct *tty, struct file *file, return -EIO; } - lock_kernel(); - switch (cmd) { case MGSL_IOCGPARAMS: - ret = get_params(info, argp); - break; + return get_params(info, argp); case MGSL_IOCSPARAMS: - ret = set_params(info, argp); - break; + return set_params(info, argp); case MGSL_IOCGTXIDLE: - ret = get_txidle(info, argp); - break; + return get_txidle(info, argp); case MGSL_IOCSTXIDLE: - ret = set_txidle(info, (int)arg); - break; + return set_txidle(info, (int)arg); case MGSL_IOCTXENABLE: - ret = tx_enable(info, (int)arg); - break; + return tx_enable(info, (int)arg); case MGSL_IOCRXENABLE: - ret = rx_enable(info, (int)arg); - break; + return rx_enable(info, (int)arg); case MGSL_IOCTXABORT: - ret = tx_abort(info); - break; + return tx_abort(info); case MGSL_IOCGSTATS: - ret = get_stats(info, argp); - break; + return get_stats(info, argp); case MGSL_IOCWAITEVENT: - ret = wait_mgsl_event(info, argp); - break; + return wait_mgsl_event(info, argp); case TIOCMIWAIT: - ret = modem_input_wait(info,(int)arg); - break; + return modem_input_wait(info,(int)arg); case MGSL_IOCGIF: - ret = get_interface(info, argp); - break; + return get_interface(info, argp); case MGSL_IOCSIF: - ret = set_interface(info,(int)arg); - break; + return set_interface(info,(int)arg); case MGSL_IOCSGPIO: - ret = set_gpio(info, argp); - break; + return set_gpio(info, argp); case MGSL_IOCGGPIO: - ret = get_gpio(info, argp); - break; + return get_gpio(info, argp); case MGSL_IOCWAITGPIO: - ret = wait_gpio(info, argp); - break; + return wait_gpio(info, argp); case TIOCGICOUNT: spin_lock_irqsave(&info->lock,flags); cnow = info->icount; @@ -1179,14 +1155,12 @@ static int ioctl(struct tty_struct *tty, struct file *file, put_user(cnow.parity, &p_cuser->parity) || put_user(cnow.brk, &p_cuser->brk) || put_user(cnow.buf_overrun, &p_cuser->buf_overrun)) - ret = -EFAULT; - ret = 0; - break; + return -EFAULT; + return 0; default: - ret = -ENOIOCTLCMD; + return -ENOIOCTLCMD; } - unlock_kernel(); - return ret; + return 0; } /* @@ -3350,7 +3324,7 @@ static int claim_resources(struct slgt_info *info) else info->reg_addr_requested = true; - info->reg_addr = ioremap_nocache(info->phys_reg_addr, SLGT_REG_SIZE); + info->reg_addr = ioremap(info->phys_reg_addr, SLGT_REG_SIZE); if (!info->reg_addr) { DBGERR(("%s cant map device registers, addr=%08X\n", info->device_name, info->phys_reg_addr)); diff --git a/trunk/drivers/char/synclinkmp.c b/trunk/drivers/char/synclinkmp.c index bec54866e0bb..e98c3e6f8216 100644 --- a/trunk/drivers/char/synclinkmp.c +++ b/trunk/drivers/char/synclinkmp.c @@ -519,7 +519,7 @@ static void hangup(struct tty_struct *tty); static void set_termios(struct tty_struct *tty, struct ktermios *old_termios); static int write(struct tty_struct *tty, const unsigned char *buf, int count); -static int put_char(struct tty_struct *tty, unsigned char ch); +static void put_char(struct tty_struct *tty, unsigned char ch); static void send_xchar(struct tty_struct *tty, char ch); static void wait_until_sent(struct tty_struct *tty, int timeout); static int write_room(struct tty_struct *tty); @@ -862,7 +862,8 @@ static void close(struct tty_struct *tty, struct file *filp) if (info->flags & ASYNC_INITIALIZED) wait_until_sent(tty, info->timeout); - flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); tty_ldisc_flush(tty); @@ -1045,11 +1046,10 @@ static int write(struct tty_struct *tty, /* Add a character to the transmit buffer. */ -static int put_char(struct tty_struct *tty, unsigned char ch) +static void put_char(struct tty_struct *tty, unsigned char ch) { SLMP_INFO *info = (SLMP_INFO *)tty->driver_data; unsigned long flags; - int ret = 0; if ( debug_level >= DEBUG_LEVEL_INFO ) { printk( "%s(%d):%s put_char(%d)\n", @@ -1057,10 +1057,10 @@ static int put_char(struct tty_struct *tty, unsigned char ch) } if (sanity_check(info, tty->name, "put_char")) - return 0; + return; if (!info->tx_buf) - return 0; + return; spin_lock_irqsave(&info->lock,flags); @@ -1072,12 +1072,10 @@ static int put_char(struct tty_struct *tty, unsigned char ch) if (info->tx_put >= info->max_frame_size) info->tx_put -= info->max_frame_size; info->tx_count++; - ret = 1; } } spin_unlock_irqrestore(&info->lock,flags); - return ret; } /* Send a high-priority XON/XOFF character @@ -1121,8 +1119,6 @@ static void wait_until_sent(struct tty_struct *tty, int timeout) if (sanity_check(info, tty->name, "wait_until_sent")) return; - lock_kernel(); - if (!(info->flags & ASYNC_INITIALIZED)) goto exit; @@ -1165,7 +1161,6 @@ static void wait_until_sent(struct tty_struct *tty, int timeout) } exit: - unlock_kernel(); if (debug_level >= DEBUG_LEVEL_INFO) printk("%s(%d):%s wait_until_sent() exit\n", __FILE__,__LINE__, info->device_name ); @@ -1181,7 +1176,6 @@ static int write_room(struct tty_struct *tty) if (sanity_check(info, tty->name, "write_room")) return 0; - lock_kernel(); if (info->params.mode == MGSL_MODE_HDLC) { ret = (info->tx_active) ? 0 : HDLC_MAX_FRAME_SIZE; } else { @@ -1189,7 +1183,6 @@ static int write_room(struct tty_struct *tty) if (ret < 0) ret = 0; } - unlock_kernel(); if (debug_level >= DEBUG_LEVEL_INFO) printk("%s(%d):%s write_room()=%d\n", @@ -1310,7 +1303,7 @@ static void tx_release(struct tty_struct *tty) * * Return Value: 0 if success, otherwise error code */ -static int do_ioctl(struct tty_struct *tty, struct file *file, +static int ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd, unsigned long arg) { SLMP_INFO *info = (SLMP_INFO *)tty->driver_data; @@ -1400,16 +1393,6 @@ static int do_ioctl(struct tty_struct *tty, struct file *file, return 0; } -static int ioctl(struct tty_struct *tty, struct file *file, - unsigned int cmd, unsigned long arg) -{ - int ret; - lock_kernel(); - ret = do_ioctl(tty, file, cmd, arg); - unlock_kernel(); - return ret; -} - /* * /proc fs routines.... */ @@ -3643,8 +3626,7 @@ static int claim_resources(SLMP_INFO *info) else info->sca_statctrl_requested = true; - info->memory_base = ioremap_nocache(info->phys_memory_base, - SCA_MEM_SIZE); + info->memory_base = ioremap(info->phys_memory_base,SCA_MEM_SIZE); if (!info->memory_base) { printk( "%s(%d):%s Cant map shared memory, MemAddr=%08X\n", __FILE__,__LINE__,info->device_name, info->phys_memory_base ); @@ -3652,7 +3634,7 @@ static int claim_resources(SLMP_INFO *info) goto errout; } - info->lcr_base = ioremap_nocache(info->phys_lcr_base, PAGE_SIZE); + info->lcr_base = ioremap(info->phys_lcr_base,PAGE_SIZE); if (!info->lcr_base) { printk( "%s(%d):%s Cant map LCR memory, MemAddr=%08X\n", __FILE__,__LINE__,info->device_name, info->phys_lcr_base ); @@ -3661,7 +3643,7 @@ static int claim_resources(SLMP_INFO *info) } info->lcr_base += info->lcr_offset; - info->sca_base = ioremap_nocache(info->phys_sca_base, PAGE_SIZE); + info->sca_base = ioremap(info->phys_sca_base,PAGE_SIZE); if (!info->sca_base) { printk( "%s(%d):%s Cant map SCA memory, MemAddr=%08X\n", __FILE__,__LINE__,info->device_name, info->phys_sca_base ); @@ -3670,8 +3652,7 @@ static int claim_resources(SLMP_INFO *info) } info->sca_base += info->sca_offset; - info->statctrl_base = ioremap_nocache(info->phys_statctrl_base, - PAGE_SIZE); + info->statctrl_base = ioremap(info->phys_statctrl_base,PAGE_SIZE); if (!info->statctrl_base) { printk( "%s(%d):%s Cant map SCA Status/Control memory, MemAddr=%08X\n", __FILE__,__LINE__,info->device_name, info->phys_statctrl_base ); diff --git a/trunk/drivers/char/tty_io.c b/trunk/drivers/char/tty_io.c index 1d298c2cf930..2fa6856706ab 100644 --- a/trunk/drivers/char/tty_io.c +++ b/trunk/drivers/char/tty_io.c @@ -91,6 +91,7 @@ #include #include #include +#include #include #include #include @@ -136,6 +137,9 @@ EXPORT_SYMBOL(tty_mutex); #ifdef CONFIG_UNIX98_PTYS extern struct tty_driver *ptm_driver; /* Unix98 pty masters; for /dev/ptmx */ +extern int pty_limit; /* Config limit on Unix98 ptys */ +static DEFINE_IDR(allocated_ptys); +static DEFINE_MUTEX(allocated_ptys_lock); static int ptmx_open(struct inode *, struct file *); #endif @@ -148,7 +152,8 @@ ssize_t redirected_tty_write(struct file *, const char __user *, static unsigned int tty_poll(struct file *, poll_table *); static int tty_open(struct inode *, struct file *); static int tty_release(struct inode *, struct file *); -long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg); +int tty_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg); #ifdef CONFIG_COMPAT static long tty_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg); @@ -1104,8 +1109,8 @@ static int tty_set_ldisc(struct tty_struct *tty, int ldisc) a reference to the old ldisc. If we ended up flipping back to the existing ldisc we have two references to it */ - if (tty->ldisc.num != o_ldisc.num && tty->ops->set_ldisc) - tty->ops->set_ldisc(tty); + if (tty->ldisc.num != o_ldisc.num && tty->driver->set_ldisc) + tty->driver->set_ldisc(tty); tty_ldisc_put(o_ldisc.num); @@ -1177,8 +1182,9 @@ struct tty_driver *tty_find_polling_driver(char *name, int *line) if (*str == '\0') str = NULL; - if (tty_line >= 0 && tty_line <= p->num && p->ops && - p->ops->poll_init && !p->ops->poll_init(p, tty_line, str)) { + if (tty_line >= 0 && tty_line <= p->num && p->poll_init && + !p->poll_init(p, tty_line, str)) { + res = p; *line = tty_line; break; @@ -1199,37 +1205,26 @@ EXPORT_SYMBOL_GPL(tty_find_polling_driver); * not in the foreground, send a SIGTTOU. If the signal is blocked or * ignored, go ahead and perform the operation. (POSIX 7.2) * - * Locking: ctrl_lock + * Locking: none */ int tty_check_change(struct tty_struct *tty) { - unsigned long flags; - int ret = 0; - if (current->signal->tty != tty) return 0; - - spin_lock_irqsave(&tty->ctrl_lock, flags); - if (!tty->pgrp) { printk(KERN_WARNING "tty_check_change: tty->pgrp == NULL!\n"); - goto out; + return 0; } if (task_pgrp(current) == tty->pgrp) - goto out; + return 0; if (is_ignored(SIGTTOU)) - goto out; - if (is_current_pgrp_orphaned()) { - ret = -EIO; - goto out; - } + return 0; + if (is_current_pgrp_orphaned()) + return -EIO; kill_pgrp(task_pgrp(current), SIGTTOU, 1); set_thread_flag(TIF_SIGPENDING); - ret = -ERESTARTSYS; -out: - spin_unlock_irqrestore(&tty->ctrl_lock, flags); - return ret; + return -ERESTARTSYS; } EXPORT_SYMBOL(tty_check_change); @@ -1252,8 +1247,8 @@ static unsigned int hung_up_tty_poll(struct file *filp, poll_table *wait) return POLLIN | POLLOUT | POLLERR | POLLHUP | POLLRDNORM | POLLWRNORM; } -static long hung_up_tty_ioctl(struct file *file, unsigned int cmd, - unsigned long arg) +static int hung_up_tty_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg) { return cmd == TIOCSPGRP ? -ENOTTY : -EIO; } @@ -1269,7 +1264,7 @@ static const struct file_operations tty_fops = { .read = tty_read, .write = tty_write, .poll = tty_poll, - .unlocked_ioctl = tty_ioctl, + .ioctl = tty_ioctl, .compat_ioctl = tty_compat_ioctl, .open = tty_open, .release = tty_release, @@ -1282,7 +1277,7 @@ static const struct file_operations ptmx_fops = { .read = tty_read, .write = tty_write, .poll = tty_poll, - .unlocked_ioctl = tty_ioctl, + .ioctl = tty_ioctl, .compat_ioctl = tty_compat_ioctl, .open = ptmx_open, .release = tty_release, @@ -1295,7 +1290,7 @@ static const struct file_operations console_fops = { .read = tty_read, .write = redirected_tty_write, .poll = tty_poll, - .unlocked_ioctl = tty_ioctl, + .ioctl = tty_ioctl, .compat_ioctl = tty_compat_ioctl, .open = tty_open, .release = tty_release, @@ -1307,7 +1302,7 @@ static const struct file_operations hung_up_tty_fops = { .read = hung_up_tty_read, .write = hung_up_tty_write, .poll = hung_up_tty_poll, - .unlocked_ioctl = hung_up_tty_ioctl, + .ioctl = hung_up_tty_ioctl, .compat_ioctl = hung_up_tty_compat_ioctl, .release = tty_release, }; @@ -1409,7 +1404,6 @@ static void do_tty_hangup(struct work_struct *work) struct task_struct *p; struct tty_ldisc *ld; int closecount = 0, n; - unsigned long flags; if (!tty) return; @@ -1447,7 +1441,8 @@ static void do_tty_hangup(struct work_struct *work) /* We may have no line discipline at this point */ if (ld->flush_buffer) ld->flush_buffer(tty); - tty_driver_flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if ((test_bit(TTY_DO_WRITE_WAKEUP, &tty->flags)) && ld->write_wakeup) ld->write_wakeup(tty); @@ -1485,24 +1480,19 @@ static void do_tty_hangup(struct work_struct *work) __group_send_sig_info(SIGHUP, SEND_SIG_PRIV, p); __group_send_sig_info(SIGCONT, SEND_SIG_PRIV, p); put_pid(p->signal->tty_old_pgrp); /* A noop */ - spin_lock_irqsave(&tty->ctrl_lock, flags); if (tty->pgrp) p->signal->tty_old_pgrp = get_pid(tty->pgrp); - spin_unlock_irqrestore(&tty->ctrl_lock, flags); spin_unlock_irq(&p->sighand->siglock); } while_each_pid_task(tty->session, PIDTYPE_SID, p); } read_unlock(&tasklist_lock); - spin_lock_irqsave(&tty->ctrl_lock, flags); tty->flags = 0; put_pid(tty->session); put_pid(tty->pgrp); tty->session = NULL; tty->pgrp = NULL; tty->ctrl_status = 0; - spin_unlock_irqrestore(&tty->ctrl_lock, flags); - /* * If one of the devices matches a console pointer, we * cannot just call hangup() because that will cause @@ -1510,11 +1500,11 @@ static void do_tty_hangup(struct work_struct *work) * So we just call close() the right number of times. */ if (cons_filp) { - if (tty->ops->close) + if (tty->driver->close) for (n = 0; n < closecount; n++) - tty->ops->close(tty, cons_filp); - } else if (tty->ops->hangup) - (tty->ops->hangup)(tty); + tty->driver->close(tty, cons_filp); + } else if (tty->driver->hangup) + (tty->driver->hangup)(tty); /* * We don't want to have driver/ldisc interactions beyond * the ones we did here. The driver layer expects no @@ -1636,17 +1626,16 @@ void disassociate_ctty(int on_exit) struct tty_struct *tty; struct pid *tty_pgrp = NULL; + lock_kernel(); mutex_lock(&tty_mutex); tty = get_current_tty(); if (tty) { tty_pgrp = get_pid(tty->pgrp); mutex_unlock(&tty_mutex); - lock_kernel(); /* XXX: here we race, there is nothing protecting tty */ if (on_exit && tty->driver->type != TTY_DRIVER_TYPE_PTY) tty_vhangup(tty); - unlock_kernel(); } else if (on_exit) { struct pid *old_pgrp; spin_lock_irq(¤t->sighand->siglock); @@ -1659,6 +1648,7 @@ void disassociate_ctty(int on_exit) put_pid(old_pgrp); } mutex_unlock(&tty_mutex); + unlock_kernel(); return; } if (tty_pgrp) { @@ -1677,13 +1667,10 @@ void disassociate_ctty(int on_exit) /* It is possible that do_tty_hangup has free'd this tty */ tty = get_current_tty(); if (tty) { - unsigned long flags; - spin_lock_irqsave(&tty->ctrl_lock, flags); put_pid(tty->session); put_pid(tty->pgrp); tty->session = NULL; tty->pgrp = NULL; - spin_unlock_irqrestore(&tty->ctrl_lock, flags); } else { #ifdef TTY_DEBUG_HANGUP printk(KERN_DEBUG "error attempted to write to tty [0x%p]" @@ -1696,6 +1683,7 @@ void disassociate_ctty(int on_exit) read_lock(&tasklist_lock); session_clear_tty(task_session(current)); read_unlock(&tasklist_lock); + unlock_kernel(); } /** @@ -1705,10 +1693,8 @@ void disassociate_ctty(int on_exit) void no_tty(void) { struct task_struct *tsk = current; - lock_kernel(); if (tsk->signal->leader) disassociate_ctty(0); - unlock_kernel(); proc_clear_tty(tsk); } @@ -1728,26 +1714,21 @@ void no_tty(void) * but not always. * * Locking: - * Uses the tty control lock internally + * Broken. Relies on BKL which is unsafe here. */ void stop_tty(struct tty_struct *tty) { - unsigned long flags; - spin_lock_irqsave(&tty->ctrl_lock, flags); - if (tty->stopped) { - spin_unlock_irqrestore(&tty->ctrl_lock, flags); + if (tty->stopped) return; - } tty->stopped = 1; if (tty->link && tty->link->packet) { tty->ctrl_status &= ~TIOCPKT_START; tty->ctrl_status |= TIOCPKT_STOP; wake_up_interruptible(&tty->link->read_wait); } - spin_unlock_irqrestore(&tty->ctrl_lock, flags); - if (tty->ops->stop) - (tty->ops->stop)(tty); + if (tty->driver->stop) + (tty->driver->stop)(tty); } EXPORT_SYMBOL(stop_tty); @@ -1762,26 +1743,21 @@ EXPORT_SYMBOL(stop_tty); * driver start method is invoked and the line discipline woken. * * Locking: - * ctrl_lock + * Broken. Relies on BKL which is unsafe here. */ void start_tty(struct tty_struct *tty) { - unsigned long flags; - spin_lock_irqsave(&tty->ctrl_lock, flags); - if (!tty->stopped || tty->flow_stopped) { - spin_unlock_irqrestore(&tty->ctrl_lock, flags); + if (!tty->stopped || tty->flow_stopped) return; - } tty->stopped = 0; if (tty->link && tty->link->packet) { tty->ctrl_status &= ~TIOCPKT_STOP; tty->ctrl_status |= TIOCPKT_START; wake_up_interruptible(&tty->link->read_wait); } - spin_unlock_irqrestore(&tty->ctrl_lock, flags); - if (tty->ops->start) - (tty->ops->start)(tty); + if (tty->driver->start) + (tty->driver->start)(tty); /* If we have a running line discipline it may need kicking */ tty_wakeup(tty); } @@ -1799,8 +1775,10 @@ EXPORT_SYMBOL(start_tty); * for hung up devices before calling the line discipline method. * * Locking: - * Locks the line discipline internally while needed. Multiple - * read calls may be outstanding in parallel. + * Locks the line discipline internally while needed + * For historical reasons the line discipline read method is + * invoked under the BKL. This will go away in time so do not rely on it + * in new code. Multiple read calls may be outstanding in parallel. */ static ssize_t tty_read(struct file *file, char __user *buf, size_t count, @@ -1821,11 +1799,13 @@ static ssize_t tty_read(struct file *file, char __user *buf, size_t count, /* We want to wait for the line discipline to sort out in this situation */ ld = tty_ldisc_ref_wait(tty); + lock_kernel(); if (ld->read) i = (ld->read)(tty, file, buf, count); else i = -EIO; tty_ldisc_deref(ld); + unlock_kernel(); if (i > 0) inode->i_atime = current_fs_time(inode->i_sb); return i; @@ -1913,7 +1893,9 @@ static inline ssize_t do_tty_write( ret = -EFAULT; if (copy_from_user(tty->write_buf, buf, size)) break; + lock_kernel(); ret = write(tty, file, tty->write_buf, size); + unlock_kernel(); if (ret <= 0) break; written += ret; @@ -1966,13 +1948,10 @@ static ssize_t tty_write(struct file *file, const char __user *buf, tty = (struct tty_struct *)file->private_data; if (tty_paranoia_check(tty, inode, "tty_write")) return -EIO; - if (!tty || !tty->ops->write || + if (!tty || !tty->driver->write || (test_bit(TTY_IO_ERROR, &tty->flags))) return -EIO; - /* Short term debug to catch buggy drivers */ - if (tty->ops->write_room == NULL) - printk(KERN_ERR "tty driver %s lacks a write_room method.\n", - tty->driver->name); + ld = tty_ldisc_ref_wait(tty); if (!ld->write) ret = -EIO; @@ -2119,7 +2098,6 @@ static int init_dev(struct tty_driver *driver, int idx, goto fail_no_mem; initialize_tty_struct(tty); tty->driver = driver; - tty->ops = driver->ops; tty->index = idx; tty_line_name(driver, idx, tty->name); @@ -2150,7 +2128,6 @@ static int init_dev(struct tty_driver *driver, int idx, goto free_mem_out; initialize_tty_struct(o_tty); o_tty->driver = driver->other; - o_tty->ops = driver->ops; o_tty->index = idx; tty_line_name(driver->other, idx, o_tty->name); @@ -2455,8 +2432,8 @@ static void release_dev(struct file *filp) } } #endif - if (tty->ops->close) - tty->ops->close(tty, filp); + if (tty->driver->close) + tty->driver->close(tty, filp); /* * Sanity check: if tty->count is going to zero, there shouldn't be @@ -2635,9 +2612,15 @@ static void release_dev(struct file *filp) */ release_tty(tty, idx); +#ifdef CONFIG_UNIX98_PTYS /* Make this pty number available for reallocation */ - if (devpts) - devpts_kill_index(idx); + if (devpts) { + mutex_lock(&allocated_ptys_lock); + idr_remove(&allocated_ptys, idx); + mutex_unlock(&allocated_ptys_lock); + } +#endif + } /** @@ -2733,8 +2716,8 @@ static int tty_open(struct inode *inode, struct file *filp) printk(KERN_DEBUG "opening %s...", tty->name); #endif if (!retval) { - if (tty->ops->open) - retval = tty->ops->open(tty, filp); + if (tty->driver->open) + retval = tty->driver->open(tty, filp); else retval = -ENODEV; } @@ -2793,13 +2776,29 @@ static int ptmx_open(struct inode *inode, struct file *filp) struct tty_struct *tty; int retval; int index; + int idr_ret; nonseekable_open(inode, filp); /* find a device that is not in use. */ - index = devpts_new_index(); - if (index < 0) - return index; + mutex_lock(&allocated_ptys_lock); + if (!idr_pre_get(&allocated_ptys, GFP_KERNEL)) { + mutex_unlock(&allocated_ptys_lock); + return -ENOMEM; + } + idr_ret = idr_get_new(&allocated_ptys, NULL, &index); + if (idr_ret < 0) { + mutex_unlock(&allocated_ptys_lock); + if (idr_ret == -EAGAIN) + return -ENOMEM; + return -EIO; + } + if (index >= pty_limit) { + idr_remove(&allocated_ptys, index); + mutex_unlock(&allocated_ptys_lock); + return -EIO; + } + mutex_unlock(&allocated_ptys_lock); mutex_lock(&tty_mutex); retval = init_dev(ptm_driver, index, &tty); @@ -2812,19 +2811,21 @@ static int ptmx_open(struct inode *inode, struct file *filp) filp->private_data = tty; file_move(filp, &tty->tty_files); - retval = devpts_pty_new(tty->link); - if (retval) + retval = -ENOMEM; + if (devpts_pty_new(tty->link)) goto out1; - check_tty_count(tty, "ptmx_open"); - retval = ptm_driver->ops->open(tty, filp); + check_tty_count(tty, "tty_open"); + retval = ptm_driver->open(tty, filp); if (!retval) return 0; out1: release_dev(filp); return retval; out: - devpts_kill_index(index); + mutex_lock(&allocated_ptys_lock); + idr_remove(&allocated_ptys, index); + mutex_unlock(&allocated_ptys_lock); return retval; } #endif @@ -2881,7 +2882,6 @@ static unsigned int tty_poll(struct file *filp, poll_table *wait) static int tty_fasync(int fd, struct file *filp, int on) { struct tty_struct *tty; - unsigned long flags; int retval; tty = (struct tty_struct *)filp->private_data; @@ -2897,7 +2897,6 @@ static int tty_fasync(int fd, struct file *filp, int on) struct pid *pid; if (!waitqueue_active(&tty->read_wait)) tty->minimum_to_wake = 1; - spin_lock_irqsave(&tty->ctrl_lock, flags); if (tty->pgrp) { pid = tty->pgrp; type = PIDTYPE_PGID; @@ -2905,7 +2904,6 @@ static int tty_fasync(int fd, struct file *filp, int on) pid = task_pid(current); type = PIDTYPE_PID; } - spin_unlock_irqrestore(&tty->ctrl_lock, flags); retval = __f_setown(filp, pid, type, 0); if (retval) return retval; @@ -2991,8 +2989,6 @@ static int tiocswinsz(struct tty_struct *tty, struct tty_struct *real_tty, struct winsize __user *arg) { struct winsize tmp_ws; - struct pid *pgrp, *rpgrp; - unsigned long flags; if (copy_from_user(&tmp_ws, arg, sizeof(*arg))) return -EFAULT; @@ -3010,21 +3006,10 @@ static int tiocswinsz(struct tty_struct *tty, struct tty_struct *real_tty, } } #endif - /* Get the PID values and reference them so we can - avoid holding the tty ctrl lock while sending signals */ - spin_lock_irqsave(&tty->ctrl_lock, flags); - pgrp = get_pid(tty->pgrp); - rpgrp = get_pid(real_tty->pgrp); - spin_unlock_irqrestore(&tty->ctrl_lock, flags); - - if (pgrp) - kill_pgrp(pgrp, SIGWINCH, 1); - if (rpgrp != pgrp && rpgrp) - kill_pgrp(rpgrp, SIGWINCH, 1); - - put_pid(pgrp); - put_pid(rpgrp); - + if (tty->pgrp) + kill_pgrp(tty->pgrp, SIGWINCH, 1); + if ((real_tty->pgrp != tty->pgrp) && real_tty->pgrp) + kill_pgrp(real_tty->pgrp, SIGWINCH, 1); tty->winsize = tmp_ws; real_tty->winsize = tmp_ws; done: @@ -3085,13 +3070,10 @@ static int fionbio(struct file *file, int __user *p) if (get_user(nonblock, p)) return -EFAULT; - /* file->f_flags is still BKL protected in the fs layer - vomit */ - lock_kernel(); if (nonblock) file->f_flags |= O_NONBLOCK; else file->f_flags &= ~O_NONBLOCK; - unlock_kernel(); return 0; } @@ -3148,27 +3130,6 @@ static int tiocsctty(struct tty_struct *tty, int arg) return ret; } -/** - * tty_get_pgrp - return a ref counted pgrp pid - * @tty: tty to read - * - * Returns a refcounted instance of the pid struct for the process - * group controlling the tty. - */ - -struct pid *tty_get_pgrp(struct tty_struct *tty) -{ - unsigned long flags; - struct pid *pgrp; - - spin_lock_irqsave(&tty->ctrl_lock, flags); - pgrp = get_pid(tty->pgrp); - spin_unlock_irqrestore(&tty->ctrl_lock, flags); - - return pgrp; -} -EXPORT_SYMBOL_GPL(tty_get_pgrp); - /** * tiocgpgrp - get process group * @tty: tty passed by user @@ -3183,18 +3144,13 @@ EXPORT_SYMBOL_GPL(tty_get_pgrp); static int tiocgpgrp(struct tty_struct *tty, struct tty_struct *real_tty, pid_t __user *p) { - struct pid *pid; - int ret; /* * (tty == real_tty) is a cheap way of * testing if the tty is NOT a master pty. */ if (tty == real_tty && current->signal->tty != real_tty) return -ENOTTY; - pid = tty_get_pgrp(real_tty); - ret = put_user(pid_vnr(pid), p); - put_pid(pid); - return ret; + return put_user(pid_vnr(real_tty->pgrp), p); } /** @@ -3206,7 +3162,7 @@ static int tiocgpgrp(struct tty_struct *tty, struct tty_struct *real_tty, pid_t * Set the process group of the tty to the session passed. Only * permitted where the tty session is our session. * - * Locking: RCU, ctrl lock + * Locking: None */ static int tiocspgrp(struct tty_struct *tty, struct tty_struct *real_tty, pid_t __user *p) @@ -3214,7 +3170,6 @@ static int tiocspgrp(struct tty_struct *tty, struct tty_struct *real_tty, pid_t struct pid *pgrp; pid_t pgrp_nr; int retval = tty_check_change(real_tty); - unsigned long flags; if (retval == -EIO) return -ENOTTY; @@ -3237,10 +3192,8 @@ static int tiocspgrp(struct tty_struct *tty, struct tty_struct *real_tty, pid_t if (session_of_pgrp(pgrp) != task_session(current)) goto out_unlock; retval = 0; - spin_lock_irqsave(&tty->ctrl_lock, flags); put_pid(real_tty->pgrp); real_tty->pgrp = get_pid(pgrp); - spin_unlock_irqrestore(&tty->ctrl_lock, flags); out_unlock: rcu_read_unlock(); return retval; @@ -3284,16 +3237,10 @@ static int tiocgsid(struct tty_struct *tty, struct tty_struct *real_tty, pid_t _ static int tiocsetd(struct tty_struct *tty, int __user *p) { int ldisc; - int ret; if (get_user(ldisc, p)) return -EFAULT; - - lock_kernel(); - ret = tty_set_ldisc(tty, ldisc); - unlock_kernel(); - - return ret; + return tty_set_ldisc(tty, ldisc); } /** @@ -3313,18 +3260,18 @@ static int send_break(struct tty_struct *tty, unsigned int duration) { if (tty_write_lock(tty, 0) < 0) return -EINTR; - tty->ops->break_ctl(tty, -1); + tty->driver->break_ctl(tty, -1); if (!signal_pending(current)) msleep_interruptible(duration); - tty->ops->break_ctl(tty, 0); + tty->driver->break_ctl(tty, 0); tty_write_unlock(tty); - if (!signal_pending(current)) + if (signal_pending(current)) return -EINTR; return 0; } /** - * tty_tiocmget - get modem status + * tiocmget - get modem status * @tty: tty device * @file: user file pointer * @p: pointer to result @@ -3339,8 +3286,8 @@ static int tty_tiocmget(struct tty_struct *tty, struct file *file, int __user *p { int retval = -EINVAL; - if (tty->ops->tiocmget) { - retval = tty->ops->tiocmget(tty, file); + if (tty->driver->tiocmget) { + retval = tty->driver->tiocmget(tty, file); if (retval >= 0) retval = put_user(retval, p); @@ -3349,7 +3296,7 @@ static int tty_tiocmget(struct tty_struct *tty, struct file *file, int __user *p } /** - * tty_tiocmset - set modem status + * tiocmset - set modem status * @tty: tty device * @file: user file pointer * @cmd: command - clear bits, set bits or set all @@ -3366,7 +3313,7 @@ static int tty_tiocmset(struct tty_struct *tty, struct file *file, unsigned int { int retval = -EINVAL; - if (tty->ops->tiocmset) { + if (tty->driver->tiocmset) { unsigned int set, clear, val; retval = get_user(val, p); @@ -3390,7 +3337,7 @@ static int tty_tiocmset(struct tty_struct *tty, struct file *file, unsigned int set &= TIOCM_DTR|TIOCM_RTS|TIOCM_OUT1|TIOCM_OUT2|TIOCM_LOOP; clear &= TIOCM_DTR|TIOCM_RTS|TIOCM_OUT1|TIOCM_OUT2|TIOCM_LOOP; - retval = tty->ops->tiocmset(tty, file, set, clear); + retval = tty->driver->tiocmset(tty, file, set, clear); } return retval; } @@ -3398,18 +3345,20 @@ static int tty_tiocmset(struct tty_struct *tty, struct file *file, unsigned int /* * Split this up, as gcc can choke on it otherwise.. */ -long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg) +int tty_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg) { struct tty_struct *tty, *real_tty; void __user *p = (void __user *)arg; int retval; struct tty_ldisc *ld; - struct inode *inode = file->f_dentry->d_inode; tty = (struct tty_struct *)file->private_data; if (tty_paranoia_check(tty, inode, "tty_ioctl")) return -EINVAL; + /* CHECKME: is this safe as one end closes ? */ + real_tty = tty; if (tty->driver->type == TTY_DRIVER_TYPE_PTY && tty->driver->subtype == PTY_TYPE_MASTER) @@ -3418,28 +3367,21 @@ long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg) /* * Break handling by driver */ - - retval = -EINVAL; - - if (!tty->ops->break_ctl) { + if (!tty->driver->break_ctl) { switch (cmd) { case TIOCSBRK: case TIOCCBRK: - if (tty->ops->ioctl) - retval = tty->ops->ioctl(tty, file, cmd, arg); - if (retval != -EINVAL && retval != -ENOIOCTLCMD) - printk(KERN_WARNING "tty: driver %s needs updating to use break_ctl\n", tty->driver->name); - return retval; + if (tty->driver->ioctl) + return tty->driver->ioctl(tty, file, cmd, arg); + return -EINVAL; /* These two ioctl's always return success; even if */ /* the driver doesn't support them. */ case TCSBRK: case TCSBRKP: - if (!tty->ops->ioctl) + if (!tty->driver->ioctl) return 0; - retval = tty->ops->ioctl(tty, file, cmd, arg); - if (retval != -EINVAL && retval != -ENOIOCTLCMD) - printk(KERN_WARNING "tty: driver %s needs updating to use break_ctl\n", tty->driver->name); + retval = tty->driver->ioctl(tty, file, cmd, arg); if (retval == -ENOIOCTLCMD) retval = 0; return retval; @@ -3497,6 +3439,7 @@ long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg) case TIOCGSID: return tiocgsid(tty, real_tty, p); case TIOCGETD: + /* FIXME: check this is ok */ return put_user(tty->ldisc.num, (int __user *)p); case TIOCSETD: return tiocsetd(tty, p); @@ -3508,13 +3451,11 @@ long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg) * Break handling */ case TIOCSBRK: /* Turn break on, unconditionally */ - if (tty->ops->break_ctl) - tty->ops->break_ctl(tty, -1); + tty->driver->break_ctl(tty, -1); return 0; case TIOCCBRK: /* Turn break off, unconditionally */ - if (tty->ops->break_ctl) - tty->ops->break_ctl(tty, 0); + tty->driver->break_ctl(tty, 0); return 0; case TCSBRK: /* SVID version: non-zero arg --> no break */ /* non-zero arg means wait for all output data @@ -3543,8 +3484,8 @@ long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg) } break; } - if (tty->ops->ioctl) { - retval = (tty->ops->ioctl)(tty, file, cmd, arg); + if (tty->driver->ioctl) { + retval = (tty->driver->ioctl)(tty, file, cmd, arg); if (retval != -ENOIOCTLCMD) return retval; } @@ -3571,8 +3512,8 @@ static long tty_compat_ioctl(struct file *file, unsigned int cmd, if (tty_paranoia_check(tty, inode, "tty_ioctl")) return -EINVAL; - if (tty->ops->compat_ioctl) { - retval = (tty->ops->compat_ioctl)(tty, file, cmd, arg); + if (tty->driver->compat_ioctl) { + retval = (tty->driver->compat_ioctl)(tty, file, cmd, arg); if (retval != -ENOIOCTLCMD) return retval; } @@ -3622,7 +3563,8 @@ void __do_SAK(struct tty_struct *tty) tty_ldisc_flush(tty); - tty_driver_flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); read_lock(&tasklist_lock); /* Kill the entire session */ @@ -3828,32 +3770,19 @@ static void initialize_tty_struct(struct tty_struct *tty) mutex_init(&tty->atomic_read_lock); mutex_init(&tty->atomic_write_lock); spin_lock_init(&tty->read_lock); - spin_lock_init(&tty->ctrl_lock); INIT_LIST_HEAD(&tty->tty_files); INIT_WORK(&tty->SAK_work, do_SAK_work); } -/** - * tty_put_char - write one character to a tty - * @tty: tty - * @ch: character - * - * Write one byte to the tty using the provided put_char method - * if present. Returns the number of characters successfully output. - * - * Note: the specific put_char operation in the driver layer may go - * away soon. Don't call it directly, use this method +/* + * The default put_char routine if the driver did not define one. */ -int tty_put_char(struct tty_struct *tty, unsigned char ch) +static void tty_default_put_char(struct tty_struct *tty, unsigned char ch) { - if (tty->ops->put_char) - return tty->ops->put_char(tty, ch); - return tty->ops->write(tty, &ch, 1); + tty->driver->write(tty, &ch, 1); } -EXPORT_SYMBOL_GPL(tty_put_char); - static struct class *tty_class; /** @@ -3936,8 +3865,37 @@ void put_tty_driver(struct tty_driver *driver) void tty_set_operations(struct tty_driver *driver, const struct tty_operations *op) { - driver->ops = op; -}; + driver->open = op->open; + driver->close = op->close; + driver->write = op->write; + driver->put_char = op->put_char; + driver->flush_chars = op->flush_chars; + driver->write_room = op->write_room; + driver->chars_in_buffer = op->chars_in_buffer; + driver->ioctl = op->ioctl; + driver->compat_ioctl = op->compat_ioctl; + driver->set_termios = op->set_termios; + driver->throttle = op->throttle; + driver->unthrottle = op->unthrottle; + driver->stop = op->stop; + driver->start = op->start; + driver->hangup = op->hangup; + driver->break_ctl = op->break_ctl; + driver->flush_buffer = op->flush_buffer; + driver->set_ldisc = op->set_ldisc; + driver->wait_until_sent = op->wait_until_sent; + driver->send_xchar = op->send_xchar; + driver->read_proc = op->read_proc; + driver->write_proc = op->write_proc; + driver->tiocmget = op->tiocmget; + driver->tiocmset = op->tiocmset; +#ifdef CONFIG_CONSOLE_POLL + driver->poll_init = op->poll_init; + driver->poll_get_char = op->poll_get_char; + driver->poll_put_char = op->poll_put_char; +#endif +} + EXPORT_SYMBOL(alloc_tty_driver); EXPORT_SYMBOL(put_tty_driver); @@ -4000,6 +3958,9 @@ int tty_register_driver(struct tty_driver *driver) return error; } + if (!driver->put_char) + driver->put_char = tty_default_put_char; + mutex_lock(&tty_mutex); list_add(&driver->tty_drivers, &tty_drivers); mutex_unlock(&tty_mutex); @@ -4075,19 +4036,14 @@ void proc_clear_tty(struct task_struct *p) } EXPORT_SYMBOL(proc_clear_tty); -/* Called under the sighand lock */ - static void __proc_set_tty(struct task_struct *tsk, struct tty_struct *tty) { if (tty) { - unsigned long flags; - /* We should not have a session or pgrp to put here but.... */ - spin_lock_irqsave(&tty->ctrl_lock, flags); + /* We should not have a session or pgrp to here but.... */ put_pid(tty->session); put_pid(tty->pgrp); - tty->pgrp = get_pid(task_pgrp(tsk)); - spin_unlock_irqrestore(&tty->ctrl_lock, flags); tty->session = get_pid(task_session(tsk)); + tty->pgrp = get_pid(task_pgrp(tsk)); } put_pid(tsk->signal->tty_old_pgrp); tsk->signal->tty = tty; diff --git a/trunk/drivers/char/tty_ioctl.c b/trunk/drivers/char/tty_ioctl.c index b1a757a5ee27..f95a80b2265f 100644 --- a/trunk/drivers/char/tty_ioctl.c +++ b/trunk/drivers/char/tty_ioctl.c @@ -21,7 +21,6 @@ #include #include #include -#include #include #include @@ -40,50 +39,6 @@ #define TERMIOS_OLD 8 -int tty_chars_in_buffer(struct tty_struct *tty) -{ - if (tty->ops->chars_in_buffer) - return tty->ops->chars_in_buffer(tty); - else - return 0; -} - -EXPORT_SYMBOL(tty_chars_in_buffer); - -int tty_write_room(struct tty_struct *tty) -{ - if (tty->ops->write_room) - return tty->ops->write_room(tty); - return 2048; -} - -EXPORT_SYMBOL(tty_write_room); - -void tty_driver_flush_buffer(struct tty_struct *tty) -{ - if (tty->ops->flush_buffer) - tty->ops->flush_buffer(tty); -} - -EXPORT_SYMBOL(tty_driver_flush_buffer); - -void tty_throttle(struct tty_struct *tty) -{ - /* check TTY_THROTTLED first so it indicates our state */ - if (!test_and_set_bit(TTY_THROTTLED, &tty->flags) && - tty->ops->throttle) - tty->ops->throttle(tty); -} -EXPORT_SYMBOL(tty_throttle); - -void tty_unthrottle(struct tty_struct *tty) -{ - if (test_and_clear_bit(TTY_THROTTLED, &tty->flags) && - tty->ops->unthrottle) - tty->ops->unthrottle(tty); -} -EXPORT_SYMBOL(tty_unthrottle); - /** * tty_wait_until_sent - wait for I/O to finish * @tty: tty we are waiting for @@ -102,13 +57,15 @@ void tty_wait_until_sent(struct tty_struct *tty, long timeout) printk(KERN_DEBUG "%s wait until sent...\n", tty_name(tty, buf)); #endif + if (!tty->driver->chars_in_buffer) + return; if (!timeout) timeout = MAX_SCHEDULE_TIMEOUT; if (wait_event_interruptible_timeout(tty->write_wait, - !tty_chars_in_buffer(tty), timeout) >= 0) { - if (tty->ops->wait_until_sent) - tty->ops->wait_until_sent(tty, timeout); - } + !tty->driver->chars_in_buffer(tty), timeout) < 0) + return; + if (tty->driver->wait_until_sent) + tty->driver->wait_until_sent(tty, timeout); } EXPORT_SYMBOL(tty_wait_until_sent); @@ -436,9 +393,8 @@ EXPORT_SYMBOL(tty_termios_hw_change); static void change_termios(struct tty_struct *tty, struct ktermios *new_termios) { int canon_change; - struct ktermios old_termios; + struct ktermios old_termios = *tty->termios; struct tty_ldisc *ld; - unsigned long flags; /* * Perform the actual termios internal changes under lock. @@ -448,7 +404,7 @@ static void change_termios(struct tty_struct *tty, struct ktermios *new_termios) /* FIXME: we need to decide on some locking/ordering semantics for the set_termios notification eventually */ mutex_lock(&tty->termios_mutex); - old_termios = *tty->termios; + *tty->termios = *new_termios; unset_locked_termios(tty->termios, &old_termios, tty->termios_locked); canon_change = (old_termios.c_lflag ^ tty->termios->c_lflag) & ICANON; @@ -473,19 +429,17 @@ static void change_termios(struct tty_struct *tty, struct ktermios *new_termios) STOP_CHAR(tty) == '\023' && START_CHAR(tty) == '\021'); if (old_flow != new_flow) { - spin_lock_irqsave(&tty->ctrl_lock, flags); tty->ctrl_status &= ~(TIOCPKT_DOSTOP | TIOCPKT_NOSTOP); if (new_flow) tty->ctrl_status |= TIOCPKT_DOSTOP; else tty->ctrl_status |= TIOCPKT_NOSTOP; - spin_unlock_irqrestore(&tty->ctrl_lock, flags); wake_up_interruptible(&tty->link->read_wait); } } - if (tty->ops->set_termios) - (*tty->ops->set_termios)(tty, &old_termios); + if (tty->driver->set_termios) + (*tty->driver->set_termios)(tty, &old_termios); else tty_termios_copy_hw(tty->termios, &old_termios); @@ -520,9 +474,7 @@ static int set_termios(struct tty_struct *tty, void __user *arg, int opt) if (retval) return retval; - mutex_lock(&tty->termios_mutex); memcpy(&tmp_termios, tty->termios, sizeof(struct ktermios)); - mutex_unlock(&tty->termios_mutex); if (opt & TERMIOS_TERMIO) { if (user_termio_to_kernel_termios(&tmp_termios, @@ -708,14 +660,12 @@ static int get_tchars(struct tty_struct *tty, struct tchars __user *tchars) { struct tchars tmp; - mutex_lock(&tty->termios_mutex); tmp.t_intrc = tty->termios->c_cc[VINTR]; tmp.t_quitc = tty->termios->c_cc[VQUIT]; tmp.t_startc = tty->termios->c_cc[VSTART]; tmp.t_stopc = tty->termios->c_cc[VSTOP]; tmp.t_eofc = tty->termios->c_cc[VEOF]; tmp.t_brkc = tty->termios->c_cc[VEOL2]; /* what is brkc anyway? */ - mutex_unlock(&tty->termios_mutex); return copy_to_user(tchars, &tmp, sizeof(tmp)) ? -EFAULT : 0; } @@ -725,14 +675,12 @@ static int set_tchars(struct tty_struct *tty, struct tchars __user *tchars) if (copy_from_user(&tmp, tchars, sizeof(tmp))) return -EFAULT; - mutex_lock(&tty->termios_mutex); tty->termios->c_cc[VINTR] = tmp.t_intrc; tty->termios->c_cc[VQUIT] = tmp.t_quitc; tty->termios->c_cc[VSTART] = tmp.t_startc; tty->termios->c_cc[VSTOP] = tmp.t_stopc; tty->termios->c_cc[VEOF] = tmp.t_eofc; tty->termios->c_cc[VEOL2] = tmp.t_brkc; /* what is brkc anyway? */ - mutex_unlock(&tty->termios_mutex); return 0; } #endif @@ -742,7 +690,6 @@ static int get_ltchars(struct tty_struct *tty, struct ltchars __user *ltchars) { struct ltchars tmp; - mutex_lock(&tty->termios_mutex); tmp.t_suspc = tty->termios->c_cc[VSUSP]; /* what is dsuspc anyway? */ tmp.t_dsuspc = tty->termios->c_cc[VSUSP]; @@ -751,7 +698,6 @@ static int get_ltchars(struct tty_struct *tty, struct ltchars __user *ltchars) tmp.t_flushc = tty->termios->c_cc[VEOL2]; tmp.t_werasc = tty->termios->c_cc[VWERASE]; tmp.t_lnextc = tty->termios->c_cc[VLNEXT]; - mutex_unlock(&tty->termios_mutex); return copy_to_user(ltchars, &tmp, sizeof(tmp)) ? -EFAULT : 0; } @@ -762,7 +708,6 @@ static int set_ltchars(struct tty_struct *tty, struct ltchars __user *ltchars) if (copy_from_user(&tmp, ltchars, sizeof(tmp))) return -EFAULT; - mutex_lock(&tty->termios_mutex); tty->termios->c_cc[VSUSP] = tmp.t_suspc; /* what is dsuspc anyway? */ tty->termios->c_cc[VEOL2] = tmp.t_dsuspc; @@ -771,7 +716,6 @@ static int set_ltchars(struct tty_struct *tty, struct ltchars __user *ltchars) tty->termios->c_cc[VEOL2] = tmp.t_flushc; tty->termios->c_cc[VWERASE] = tmp.t_werasc; tty->termios->c_cc[VLNEXT] = tmp.t_lnextc; - mutex_unlock(&tty->termios_mutex); return 0; } #endif @@ -788,8 +732,8 @@ static int send_prio_char(struct tty_struct *tty, char ch) { int was_stopped = tty->stopped; - if (tty->ops->send_xchar) { - tty->ops->send_xchar(tty, ch); + if (tty->driver->send_xchar) { + tty->driver->send_xchar(tty, ch); return 0; } @@ -798,40 +742,13 @@ static int send_prio_char(struct tty_struct *tty, char ch) if (was_stopped) start_tty(tty); - tty->ops->write(tty, &ch, 1); + tty->driver->write(tty, &ch, 1); if (was_stopped) stop_tty(tty); tty_write_unlock(tty); return 0; } -/** - * tty_change_softcar - carrier change ioctl helper - * @tty: tty to update - * @arg: enable/disable CLOCAL - * - * Perform a change to the CLOCAL state and call into the driver - * layer to make it visible. All done with the termios mutex - */ - -static int tty_change_softcar(struct tty_struct *tty, int arg) -{ - int ret = 0; - int bit = arg ? CLOCAL : 0; - struct ktermios old; - - mutex_lock(&tty->termios_mutex); - old = *tty->termios; - tty->termios->c_cflag &= ~CLOCAL; - tty->termios->c_cflag |= bit; - if (tty->ops->set_termios) - tty->ops->set_termios(tty, &old); - if ((tty->termios->c_cflag & CLOCAL) != bit) - ret = -EINVAL; - mutex_unlock(&tty->termios_mutex); - return ret; -} - /** * tty_mode_ioctl - mode related ioctls * @tty: tty for the ioctl @@ -942,7 +859,12 @@ int tty_mode_ioctl(struct tty_struct *tty, struct file *file, case TIOCSSOFTCAR: if (get_user(arg, (unsigned int __user *) arg)) return -EFAULT; - return tty_change_softcar(tty, arg); + mutex_lock(&tty->termios_mutex); + tty->termios->c_cflag = + ((tty->termios->c_cflag & ~CLOCAL) | + (arg ? CLOCAL : 0)); + mutex_unlock(&tty->termios_mutex); + return 0; default: return -ENOIOCTLCMD; } @@ -967,7 +889,8 @@ int tty_perform_flush(struct tty_struct *tty, unsigned long arg) ld->flush_buffer(tty); /* fall through */ case TCOFLUSH: - tty_driver_flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); break; default: tty_ldisc_deref(ld); @@ -982,7 +905,6 @@ int n_tty_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd, unsigned long arg) { struct tty_struct *real_tty; - unsigned long flags; int retval; if (tty->driver->type == TTY_DRIVER_TYPE_PTY && @@ -1024,7 +946,9 @@ int n_tty_ioctl(struct tty_struct *tty, struct file *file, case TCFLSH: return tty_perform_flush(tty, arg); case TIOCOUTQ: - return put_user(tty_chars_in_buffer(tty), (int __user *) arg); + return put_user(tty->driver->chars_in_buffer ? + tty->driver->chars_in_buffer(tty) : 0, + (int __user *) arg); case TIOCINQ: retval = tty->read_cnt; if (L_ICANON(tty)) @@ -1039,7 +963,6 @@ int n_tty_ioctl(struct tty_struct *tty, struct file *file, return -ENOTTY; if (get_user(pktmode, (int __user *) arg)) return -EFAULT; - spin_lock_irqsave(&tty->ctrl_lock, flags); if (pktmode) { if (!tty->packet) { tty->packet = 1; @@ -1047,7 +970,6 @@ int n_tty_ioctl(struct tty_struct *tty, struct file *file, } } else tty->packet = 0; - spin_unlock_irqrestore(&tty->ctrl_lock, flags); return 0; } default: diff --git a/trunk/drivers/char/viocons.c b/trunk/drivers/char/viocons.c index 3d3e1c2b310f..8de6b95aeb84 100644 --- a/trunk/drivers/char/viocons.c +++ b/trunk/drivers/char/viocons.c @@ -628,13 +628,13 @@ static int viotty_write(struct tty_struct *tty, const unsigned char *buf, /* * TTY put_char method */ -static int viotty_put_char(struct tty_struct *tty, unsigned char ch) +static void viotty_put_char(struct tty_struct *tty, unsigned char ch) { struct port_info *pi; pi = get_port_data(tty); if (pi == NULL) - return 0; + return; /* This will append '\r' as well if the char is '\n' */ if (viochar_is_console(pi)) @@ -642,7 +642,6 @@ static int viotty_put_char(struct tty_struct *tty, unsigned char ch) if (viopath_isactive(pi->lp)) internal_write(pi, &ch, 1); - return 1; } /* @@ -705,11 +704,8 @@ static int viotty_ioctl(struct tty_struct *tty, struct file *file, case KDSKBLED: return 0; } - /* FIXME: WTF is this being called for ??? */ - lock_kernel(); - ret = n_tty_ioctl(tty, file, cmd, arg); - unlock_kernel(); - return ret; + + return n_tty_ioctl(tty, file, cmd, arg); } /* diff --git a/trunk/drivers/char/vt.c b/trunk/drivers/char/vt.c index e458b08139af..1c2660477135 100644 --- a/trunk/drivers/char/vt.c +++ b/trunk/drivers/char/vt.c @@ -909,21 +909,15 @@ int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines) if (vc->vc_tty) { struct winsize ws, *cws = &vc->vc_tty->winsize; - unsigned long flags; memset(&ws, 0, sizeof(ws)); ws.ws_row = vc->vc_rows; ws.ws_col = vc->vc_cols; ws.ws_ypixel = vc->vc_scan_lines; - - mutex_lock(&vc->vc_tty->termios_mutex); - spin_lock_irqsave(&vc->vc_tty->ctrl_lock, flags); if ((ws.ws_row != cws->ws_row || ws.ws_col != cws->ws_col) && vc->vc_tty->pgrp) kill_pgrp(vc->vc_tty->pgrp, SIGWINCH, 1); - spin_unlock_irqrestore(&vc->vc_tty->ctrl_lock, flags); *cws = ws; - mutex_unlock(&vc->vc_tty->termios_mutex); } if (CON_IS_VISIBLE(vc)) @@ -2547,9 +2541,6 @@ int tioclinux(struct tty_struct *tty, unsigned long arg) if (get_user(type, p)) return -EFAULT; ret = 0; - - lock_kernel(); - switch (type) { case TIOCL_SETSEL: @@ -2569,7 +2560,7 @@ int tioclinux(struct tty_struct *tty, unsigned long arg) ret = sel_loadlut(p); break; case TIOCL_GETSHIFTSTATE: - + /* * Make it possible to react to Shift+Mousebutton. * Note that 'shift_state' is an undocumented @@ -2624,7 +2615,6 @@ int tioclinux(struct tty_struct *tty, unsigned long arg) ret = -EINVAL; break; } - unlock_kernel(); return ret; } @@ -2642,11 +2632,11 @@ static int con_write(struct tty_struct *tty, const unsigned char *buf, int count return retval; } -static int con_put_char(struct tty_struct *tty, unsigned char ch) +static void con_put_char(struct tty_struct *tty, unsigned char ch) { if (in_interrupt()) - return 0; /* n_r3964 calls put_char() from interrupt context */ - return do_con_write(tty, &ch, 1); + return; /* n_r3964 calls put_char() from interrupt context */ + do_con_write(tty, &ch, 1); } static int con_write_room(struct tty_struct *tty) @@ -3839,7 +3829,7 @@ static int con_font_get(struct vc_data *vc, struct console_font_op *op) goto out; c = (font.width+7)/8 * 32 * font.charcount; - + if (op->data && font.charcount > op->charcount) rc = -ENOSPC; if (!(op->flags & KD_FONT_FLAG_OLD)) { @@ -4004,7 +3994,6 @@ u16 screen_glyph(struct vc_data *vc, int offset) c |= 0x100; return c; } -EXPORT_SYMBOL_GPL(screen_glyph); /* used by vcs - note the word offset */ unsigned short *screen_pos(struct vc_data *vc, int w_offset, int viewed) diff --git a/trunk/drivers/char/vt_ioctl.c b/trunk/drivers/char/vt_ioctl.c index 3211afd9d57e..e6f89e8b9258 100644 --- a/trunk/drivers/char/vt_ioctl.c +++ b/trunk/drivers/char/vt_ioctl.c @@ -373,17 +373,11 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, unsigned char ucval; void __user *up = (void __user *)arg; int i, perm; - int ret = 0; - + console = vc->vc_num; - lock_kernel(); - - if (!vc_cons_allocated(console)) { /* impossible? */ - ret = -ENOIOCTLCMD; - goto out; - } - + if (!vc_cons_allocated(console)) /* impossible? */ + return -ENOIOCTLCMD; /* * To have permissions to do most of the vt ioctls, we either have @@ -397,15 +391,15 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, switch (cmd) { case KIOCSOUND: if (!perm) - goto eperm; + return -EPERM; if (arg) arg = CLOCK_TICK_RATE / arg; kd_mksound(arg, 0); - break; + return 0; case KDMKTONE: if (!perm) - goto eperm; + return -EPERM; { unsigned int ticks, count; @@ -418,7 +412,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, if (count) count = CLOCK_TICK_RATE / count; kd_mksound(count, ticks); - break; + return 0; } case KDGKBTYPE: @@ -441,18 +435,14 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, * KDADDIO and KDDELIO may be able to add ports beyond what * we reject here, but to be safe... */ - if (arg < GPFIRST || arg > GPLAST) { - ret = -EINVAL; - break; - } - ret = sys_ioperm(arg, 1, (cmd == KDADDIO)) ? -ENXIO : 0; - break; + if (arg < GPFIRST || arg > GPLAST) + return -EINVAL; + return sys_ioperm(arg, 1, (cmd == KDADDIO)) ? -ENXIO : 0; case KDENABIO: case KDDISABIO: - ret = sys_ioperm(GPFIRST, GPNUM, + return sys_ioperm(GPFIRST, GPNUM, (cmd == KDENABIO)) ? -ENXIO : 0; - break; #endif /* Linux m68k/i386 interface for setting the keyboard delay/repeat rate */ @@ -460,20 +450,19 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, case KDKBDREP: { struct kbd_repeat kbrep; + int err; if (!capable(CAP_SYS_TTY_CONFIG)) - goto eperm; + return -EPERM; - if (copy_from_user(&kbrep, up, sizeof(struct kbd_repeat))) { - ret = -EFAULT; - break; - } - ret = kbd_rate(&kbrep); - if (ret) - break; + if (copy_from_user(&kbrep, up, sizeof(struct kbd_repeat))) + return -EFAULT; + err = kbd_rate(&kbrep); + if (err) + return err; if (copy_to_user(up, &kbrep, sizeof(struct kbd_repeat))) - ret = -EFAULT; - break; + return -EFAULT; + return 0; } case KDSETMODE: @@ -486,7 +475,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, * need to restore their engine state. --BenH */ if (!perm) - goto eperm; + return -EPERM; switch (arg) { case KD_GRAPHICS: break; @@ -496,14 +485,13 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, case KD_TEXT: break; default: - ret = -EINVAL; - goto out; + return -EINVAL; } if (vc->vc_mode == (unsigned char) arg) - break; + return 0; vc->vc_mode = (unsigned char) arg; if (console != fg_console) - break; + return 0; /* * explicitly blank/unblank the screen if switching modes */ @@ -513,7 +501,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, else do_blank_screen(1); release_console_sem(); - break; + return 0; case KDGETMODE: ucval = vc->vc_mode; @@ -525,12 +513,11 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, * these work like a combination of mmap and KDENABIO. * this could be easily finished. */ - ret = -EINVAL; - break; + return -EINVAL; case KDSKBMODE: if (!perm) - goto eperm; + return -EPERM; switch(arg) { case K_RAW: kbd->kbdmode = VC_RAW; @@ -547,11 +534,10 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, compute_shiftstate(); break; default: - ret = -EINVAL; - goto out; + return -EINVAL; } tty_ldisc_flush(tty); - break; + return 0; case KDGKBMODE: ucval = ((kbd->kbdmode == VC_RAW) ? K_RAW : @@ -571,32 +557,28 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, set_vc_kbd_mode(kbd, VC_META); break; default: - ret = -EINVAL; + return -EINVAL; } - break; + return 0; case KDGKBMETA: ucval = (vc_kbd_mode(kbd, VC_META) ? K_ESCPREFIX : K_METABIT); setint: - ret = put_user(ucval, (int __user *)arg); - break; + return put_user(ucval, (int __user *)arg); case KDGETKEYCODE: case KDSETKEYCODE: if(!capable(CAP_SYS_TTY_CONFIG)) - perm = 0; - ret = do_kbkeycode_ioctl(cmd, up, perm); - break; + perm=0; + return do_kbkeycode_ioctl(cmd, up, perm); case KDGKBENT: case KDSKBENT: - ret = do_kdsk_ioctl(cmd, up, perm, kbd); - break; + return do_kdsk_ioctl(cmd, up, perm, kbd); case KDGKBSENT: case KDSKBSENT: - ret = do_kdgkb_ioctl(cmd, up, perm); - break; + return do_kdgkb_ioctl(cmd, up, perm); case KDGKBDIACR: { @@ -604,31 +586,26 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, struct kbdiacr diacr; int i; - if (put_user(accent_table_size, &a->kb_cnt)) { - ret = -EFAULT; - break; - } + if (put_user(accent_table_size, &a->kb_cnt)) + return -EFAULT; for (i = 0; i < accent_table_size; i++) { diacr.diacr = conv_uni_to_8bit(accent_table[i].diacr); diacr.base = conv_uni_to_8bit(accent_table[i].base); diacr.result = conv_uni_to_8bit(accent_table[i].result); - if (copy_to_user(a->kbdiacr + i, &diacr, sizeof(struct kbdiacr))) { - ret = -EFAULT; - break; - } + if (copy_to_user(a->kbdiacr + i, &diacr, sizeof(struct kbdiacr))) + return -EFAULT; } - break; + return 0; } case KDGKBDIACRUC: { struct kbdiacrsuc __user *a = up; if (put_user(accent_table_size, &a->kb_cnt)) - ret = -EFAULT; - else if (copy_to_user(a->kbdiacruc, accent_table, - accent_table_size*sizeof(struct kbdiacruc))) - ret = -EFAULT; - break; + return -EFAULT; + if (copy_to_user(a->kbdiacruc, accent_table, accent_table_size*sizeof(struct kbdiacruc))) + return -EFAULT; + return 0; } case KDSKBDIACR: @@ -639,26 +616,20 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, int i; if (!perm) - goto eperm; - if (get_user(ct,&a->kb_cnt)) { - ret = -EFAULT; - break; - } - if (ct >= MAX_DIACR) { - ret = -EINVAL; - break; - } + return -EPERM; + if (get_user(ct,&a->kb_cnt)) + return -EFAULT; + if (ct >= MAX_DIACR) + return -EINVAL; accent_table_size = ct; for (i = 0; i < ct; i++) { - if (copy_from_user(&diacr, a->kbdiacr + i, sizeof(struct kbdiacr))) { - ret = -EFAULT; - break; - } + if (copy_from_user(&diacr, a->kbdiacr + i, sizeof(struct kbdiacr))) + return -EFAULT; accent_table[i].diacr = conv_8bit_to_uni(diacr.diacr); accent_table[i].base = conv_8bit_to_uni(diacr.base); accent_table[i].result = conv_8bit_to_uni(diacr.result); } - break; + return 0; } case KDSKBDIACRUC: @@ -667,19 +638,15 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, unsigned int ct; if (!perm) - goto eperm; - if (get_user(ct,&a->kb_cnt)) { - ret = -EFAULT; - break; - } - if (ct >= MAX_DIACR) { - ret = -EINVAL; - break; - } + return -EPERM; + if (get_user(ct,&a->kb_cnt)) + return -EFAULT; + if (ct >= MAX_DIACR) + return -EINVAL; accent_table_size = ct; if (copy_from_user(accent_table, a->kbdiacruc, ct*sizeof(struct kbdiacruc))) - ret = -EFAULT; - break; + return -EFAULT; + return 0; } /* the ioctls below read/set the flags usually shown in the leds */ @@ -690,29 +657,26 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, case KDSKBLED: if (!perm) - goto eperm; - if (arg & ~0x77) { - ret = -EINVAL; - break; - } + return -EPERM; + if (arg & ~0x77) + return -EINVAL; kbd->ledflagstate = (arg & 7); kbd->default_ledflagstate = ((arg >> 4) & 7); set_leds(); - break; + return 0; /* the ioctls below only set the lights, not the functions */ /* for those, see KDGKBLED and KDSKBLED above */ case KDGETLED: ucval = getledstate(); setchar: - ret = put_user(ucval, (char __user *)arg); - break; + return put_user(ucval, (char __user *)arg); case KDSETLED: if (!perm) - goto eperm; + return -EPERM; setledstate(kbd, arg); - break; + return 0; /* * A process can indicate its willingness to accept signals @@ -724,17 +688,16 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, case KDSIGACCEPT: { if (!perm || !capable(CAP_KILL)) - goto eperm; + return -EPERM; if (!valid_signal(arg) || arg < 1 || arg == SIGKILL) - ret = -EINVAL; - else { - spin_lock_irq(&vt_spawn_con.lock); - put_pid(vt_spawn_con.pid); - vt_spawn_con.pid = get_pid(task_pid(current)); - vt_spawn_con.sig = arg; - spin_unlock_irq(&vt_spawn_con.lock); - } - break; + return -EINVAL; + + spin_lock_irq(&vt_spawn_con.lock); + put_pid(vt_spawn_con.pid); + vt_spawn_con.pid = get_pid(task_pid(current)); + vt_spawn_con.sig = arg; + spin_unlock_irq(&vt_spawn_con.lock); + return 0; } case VT_SETMODE: @@ -742,15 +705,11 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, struct vt_mode tmp; if (!perm) - goto eperm; - if (copy_from_user(&tmp, up, sizeof(struct vt_mode))) { - ret = -EFAULT; - goto out; - } - if (tmp.mode != VT_AUTO && tmp.mode != VT_PROCESS) { - ret = -EINVAL; - goto out; - } + return -EPERM; + if (copy_from_user(&tmp, up, sizeof(struct vt_mode))) + return -EFAULT; + if (tmp.mode != VT_AUTO && tmp.mode != VT_PROCESS) + return -EINVAL; acquire_console_sem(); vc->vt_mode = tmp; /* the frsig is ignored, so we set it to 0 */ @@ -760,7 +719,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, /* no switch is required -- saw@shade.msu.ru */ vc->vt_newvt = -1; release_console_sem(); - break; + return 0; } case VT_GETMODE: @@ -773,9 +732,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, release_console_sem(); rc = copy_to_user(up, &tmp, sizeof(struct vt_mode)); - if (rc) - ret = -EFAULT; - break; + return rc ? -EFAULT : 0; } /* @@ -789,16 +746,12 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, unsigned short state, mask; if (put_user(fg_console + 1, &vtstat->v_active)) - ret = -EFAULT; - else { - state = 1; /* /dev/tty0 is always open */ - for (i = 0, mask = 2; i < MAX_NR_CONSOLES && mask; - ++i, mask <<= 1) - if (VT_IS_IN_USE(i)) - state |= mask; - ret = put_user(state, &vtstat->v_state); - } - break; + return -EFAULT; + state = 1; /* /dev/tty0 is always open */ + for (i = 0, mask = 2; i < MAX_NR_CONSOLES && mask; ++i, mask <<= 1) + if (VT_IS_IN_USE(i)) + state |= mask; + return put_user(state, &vtstat->v_state); } /* @@ -818,31 +771,27 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, */ case VT_ACTIVATE: if (!perm) - goto eperm; + return -EPERM; if (arg == 0 || arg > MAX_NR_CONSOLES) - ret = -ENXIO; - else { - arg--; - acquire_console_sem(); - ret = vc_allocate(arg); - release_console_sem(); - if (ret) - break; - set_console(arg); - } - break; + return -ENXIO; + arg--; + acquire_console_sem(); + i = vc_allocate(arg); + release_console_sem(); + if (i) + return i; + set_console(arg); + return 0; /* * wait until the specified VT has been activated */ case VT_WAITACTIVE: if (!perm) - goto eperm; + return -EPERM; if (arg == 0 || arg > MAX_NR_CONSOLES) - ret = -ENXIO; - else - ret = vt_waitactive(arg - 1); - break; + return -ENXIO; + return vt_waitactive(arg-1); /* * If a vt is under process control, the kernel will not switch to it @@ -856,12 +805,10 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, */ case VT_RELDISP: if (!perm) - goto eperm; + return -EPERM; + if (vc->vt_mode.mode != VT_PROCESS) + return -EINVAL; - if (vc->vt_mode.mode != VT_PROCESS) { - ret = -EINVAL; - break; - } /* * Switching-from response */ @@ -882,10 +829,10 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, int newvt; newvt = vc->vt_newvt; vc->vt_newvt = -1; - ret = vc_allocate(newvt); - if (ret) { + i = vc_allocate(newvt); + if (i) { release_console_sem(); - break; + return i; } /* * When we actually do the console switch, @@ -894,27 +841,31 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, */ complete_change_console(vc_cons[newvt].d); } - } else { - /* - * Switched-to response - */ + } + + /* + * Switched-to response + */ + else + { /* * If it's just an ACK, ignore it */ - if (arg != VT_ACKACQ) - ret = -EINVAL; + if (arg != VT_ACKACQ) { + release_console_sem(); + return -EINVAL; + } } release_console_sem(); - break; + + return 0; /* * Disallocate memory associated to VT (but leave VT1) */ case VT_DISALLOCATE: - if (arg > MAX_NR_CONSOLES) { - ret = -ENXIO; - break; - } + if (arg > MAX_NR_CONSOLES) + return -ENXIO; if (arg == 0) { /* deallocate all unused consoles, but leave 0 */ acquire_console_sem(); @@ -926,14 +877,14 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, /* deallocate a single console, if possible */ arg--; if (VT_BUSY(arg)) - ret = -EBUSY; - else if (arg) { /* leave 0 */ + return -EBUSY; + if (arg) { /* leave 0 */ acquire_console_sem(); vc_deallocate(arg); release_console_sem(); } } - break; + return 0; case VT_RESIZE: { @@ -942,21 +893,21 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, ushort ll,cc; if (!perm) - goto eperm; + return -EPERM; if (get_user(ll, &vtsizes->v_rows) || get_user(cc, &vtsizes->v_cols)) - ret = -EFAULT; - else { - for (i = 0; i < MAX_NR_CONSOLES; i++) { - vc = vc_cons[i].d; + return -EFAULT; - if (vc) { - vc->vc_resize_user = 1; - vc_lock_resize(vc_cons[i].d, cc, ll); - } + for (i = 0; i < MAX_NR_CONSOLES; i++) { + vc = vc_cons[i].d; + + if (vc) { + vc->vc_resize_user = 1; + vc_lock_resize(vc_cons[i].d, cc, ll); } } - break; + + return 0; } case VT_RESIZEX: @@ -964,13 +915,10 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, struct vt_consize __user *vtconsize = up; ushort ll,cc,vlin,clin,vcol,ccol; if (!perm) - goto eperm; + return -EPERM; if (!access_ok(VERIFY_READ, vtconsize, - sizeof(struct vt_consize))) { - ret = -EFAULT; - break; - } - /* FIXME: Should check the copies properly */ + sizeof(struct vt_consize))) + return -EFAULT; __get_user(ll, &vtconsize->v_rows); __get_user(cc, &vtconsize->v_cols); __get_user(vlin, &vtconsize->v_vlin); @@ -980,28 +928,21 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, vlin = vlin ? vlin : vc->vc_scan_lines; if (clin) { if (ll) { - if (ll != vlin/clin) { - /* Parameters don't add up */ - ret = -EINVAL; - break; - } + if (ll != vlin/clin) + return -EINVAL; /* Parameters don't add up */ } else ll = vlin/clin; } if (vcol && ccol) { if (cc) { - if (cc != vcol/ccol) { - ret = -EINVAL; - break; - } + if (cc != vcol/ccol) + return -EINVAL; } else cc = vcol/ccol; } - if (clin > 32) { - ret = -EINVAL; - break; - } + if (clin > 32) + return -EINVAL; for (i = 0; i < MAX_NR_CONSOLES; i++) { if (!vc_cons[i].d) @@ -1015,20 +956,19 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, vc_resize(vc_cons[i].d, cc, ll); release_console_sem(); } - break; + return 0; } case PIO_FONT: { if (!perm) - goto eperm; + return -EPERM; op.op = KD_FONT_OP_SET; op.flags = KD_FONT_FLAG_OLD | KD_FONT_FLAG_DONT_RECALC; /* Compatibility */ op.width = 8; op.height = 0; op.charcount = 256; op.data = up; - ret = con_font_op(vc_cons[fg_console].d, &op); - break; + return con_font_op(vc_cons[fg_console].d, &op); } case GIO_FONT: { @@ -1038,124 +978,100 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, op.height = 32; op.charcount = 256; op.data = up; - ret = con_font_op(vc_cons[fg_console].d, &op); - break; + return con_font_op(vc_cons[fg_console].d, &op); } case PIO_CMAP: if (!perm) - ret = -EPERM; - else - ret = con_set_cmap(up); - break; + return -EPERM; + return con_set_cmap(up); case GIO_CMAP: - ret = con_get_cmap(up); - break; + return con_get_cmap(up); case PIO_FONTX: case GIO_FONTX: - ret = do_fontx_ioctl(cmd, up, perm, &op); - break; + return do_fontx_ioctl(cmd, up, perm, &op); case PIO_FONTRESET: { if (!perm) - goto eperm; + return -EPERM; #ifdef BROKEN_GRAPHICS_PROGRAMS /* With BROKEN_GRAPHICS_PROGRAMS defined, the default font is not saved. */ - ret = -ENOSYS; - break; + return -ENOSYS; #else { op.op = KD_FONT_OP_SET_DEFAULT; op.data = NULL; - ret = con_font_op(vc_cons[fg_console].d, &op); - if (ret) - break; + i = con_font_op(vc_cons[fg_console].d, &op); + if (i) + return i; con_set_default_unimap(vc_cons[fg_console].d); - break; + return 0; } #endif } case KDFONTOP: { - if (copy_from_user(&op, up, sizeof(op))) { - ret = -EFAULT; - break; - } + if (copy_from_user(&op, up, sizeof(op))) + return -EFAULT; if (!perm && op.op != KD_FONT_OP_GET) - goto eperm; - ret = con_font_op(vc, &op); - if (ret) - break; + return -EPERM; + i = con_font_op(vc, &op); + if (i) return i; if (copy_to_user(up, &op, sizeof(op))) - ret = -EFAULT; - break; + return -EFAULT; + return 0; } case PIO_SCRNMAP: if (!perm) - ret = -EPERM; - else - ret = con_set_trans_old(up); - break; + return -EPERM; + return con_set_trans_old(up); case GIO_SCRNMAP: - ret = con_get_trans_old(up); - break; + return con_get_trans_old(up); case PIO_UNISCRNMAP: if (!perm) - ret = -EPERM; - else - ret = con_set_trans_new(up); - break; + return -EPERM; + return con_set_trans_new(up); case GIO_UNISCRNMAP: - ret = con_get_trans_new(up); - break; + return con_get_trans_new(up); case PIO_UNIMAPCLR: { struct unimapinit ui; if (!perm) - goto eperm; - ret = copy_from_user(&ui, up, sizeof(struct unimapinit)); - if (!ret) - con_clear_unimap(vc, &ui); - break; + return -EPERM; + i = copy_from_user(&ui, up, sizeof(struct unimapinit)); + if (i) return -EFAULT; + con_clear_unimap(vc, &ui); + return 0; } case PIO_UNIMAP: case GIO_UNIMAP: - ret = do_unimap_ioctl(cmd, up, perm, vc); - break; + return do_unimap_ioctl(cmd, up, perm, vc); case VT_LOCKSWITCH: if (!capable(CAP_SYS_TTY_CONFIG)) - goto eperm; + return -EPERM; vt_dont_switch = 1; - break; + return 0; case VT_UNLOCKSWITCH: if (!capable(CAP_SYS_TTY_CONFIG)) - goto eperm; + return -EPERM; vt_dont_switch = 0; - break; + return 0; case VT_GETHIFONTMASK: - ret = put_user(vc->vc_hi_font_mask, - (unsigned short __user *)arg); - break; + return put_user(vc->vc_hi_font_mask, (unsigned short __user *)arg); default: - ret = -ENOIOCTLCMD; + return -ENOIOCTLCMD; } -out: - unlock_kernel(); - return ret; -eperm: - ret = -EPERM; - goto out; } /* diff --git a/trunk/drivers/gpio/gpiolib.c b/trunk/drivers/gpio/gpiolib.c index 7f138c6195ff..24c62b848bf9 100644 --- a/trunk/drivers/gpio/gpiolib.c +++ b/trunk/drivers/gpio/gpiolib.c @@ -382,7 +382,7 @@ int gpio_direction_input(unsigned gpio) spin_unlock_irqrestore(&gpio_lock, flags); if (status) pr_debug("%s: gpio-%d status %d\n", - __func__, gpio, status); + __FUNCTION__, gpio, status); return status; } EXPORT_SYMBOL_GPL(gpio_direction_input); @@ -420,7 +420,7 @@ int gpio_direction_output(unsigned gpio, int value) spin_unlock_irqrestore(&gpio_lock, flags); if (status) pr_debug("%s: gpio-%d status %d\n", - __func__, gpio, status); + __FUNCTION__, gpio, status); return status; } EXPORT_SYMBOL_GPL(gpio_direction_output); diff --git a/trunk/drivers/hwmon/ads7828.c b/trunk/drivers/hwmon/ads7828.c index 5c8b6e0ff47c..ed71a8bc70dc 100644 --- a/trunk/drivers/hwmon/ads7828.c +++ b/trunk/drivers/hwmon/ads7828.c @@ -224,7 +224,7 @@ static int ads7828_detect(struct i2c_adapter *adapter, int address, int kind) if (in_data & 0xF000) { printk(KERN_DEBUG "%s : Doesn't look like an ads7828 device\n", - __func__); + __FUNCTION__); goto exit_free; } } diff --git a/trunk/drivers/input/serio/serport.c b/trunk/drivers/input/serio/serport.c index 7ff71ba7b7c9..e1a3a79ab3f9 100644 --- a/trunk/drivers/input/serio/serport.c +++ b/trunk/drivers/input/serio/serport.c @@ -46,7 +46,7 @@ struct serport { static int serport_serio_write(struct serio *serio, unsigned char data) { struct serport *serport = serio->port_data; - return -(serport->tty->ops->write(serport->tty, &data, 1) != 1); + return -(serport->tty->driver->write(serport->tty, &data, 1) != 1); } static int serport_serio_open(struct serio *serio) diff --git a/trunk/drivers/isdn/capi/capi.c b/trunk/drivers/isdn/capi/capi.c index 6ca0bb949ad3..24c6b7ca62be 100644 --- a/trunk/drivers/isdn/capi/capi.c +++ b/trunk/drivers/isdn/capi/capi.c @@ -1111,12 +1111,11 @@ static int capinc_tty_write(struct tty_struct * tty, return count; } -static int capinc_tty_put_char(struct tty_struct *tty, unsigned char ch) +static void capinc_tty_put_char(struct tty_struct *tty, unsigned char ch) { struct capiminor *mp = (struct capiminor *)tty->driver_data; struct sk_buff *skb; unsigned long flags; - int ret = 1; #ifdef _DEBUG_TTYFUNCS printk(KERN_DEBUG "capinc_put_char(%u)\n", ch); @@ -1126,7 +1125,7 @@ static int capinc_tty_put_char(struct tty_struct *tty, unsigned char ch) #ifdef _DEBUG_TTYFUNCS printk(KERN_DEBUG "capinc_tty_put_char: mp or mp->ncci NULL\n"); #endif - return 0; + return; } spin_lock_irqsave(&workaround_lock, flags); @@ -1135,7 +1134,7 @@ static int capinc_tty_put_char(struct tty_struct *tty, unsigned char ch) if (skb_tailroom(skb) > 0) { *(skb_put(skb, 1)) = ch; spin_unlock_irqrestore(&workaround_lock, flags); - return 1; + return; } mp->ttyskb = NULL; skb_queue_tail(&mp->outqueue, skb); @@ -1149,10 +1148,8 @@ static int capinc_tty_put_char(struct tty_struct *tty, unsigned char ch) mp->ttyskb = skb; } else { printk(KERN_ERR "capinc_put_char: char %u lost\n", ch); - ret = 0; } spin_unlock_irqrestore(&workaround_lock, flags); - return ret; } static void capinc_tty_flush_chars(struct tty_struct *tty) diff --git a/trunk/drivers/isdn/gigaset/ser-gigaset.c b/trunk/drivers/isdn/gigaset/ser-gigaset.c index 45d1ee93cd39..fceeb1d57682 100644 --- a/trunk/drivers/isdn/gigaset/ser-gigaset.c +++ b/trunk/drivers/isdn/gigaset/ser-gigaset.c @@ -68,10 +68,10 @@ static int write_modem(struct cardstate *cs) struct tty_struct *tty = cs->hw.ser->tty; struct bc_state *bcs = &cs->bcs[0]; /* only one channel */ struct sk_buff *skb = bcs->tx_skb; - int sent = -EOPNOTSUPP; + int sent; if (!tty || !tty->driver || !skb) - return -EINVAL; + return -EFAULT; if (!skb->len) { dev_kfree_skb_any(skb); @@ -80,8 +80,7 @@ static int write_modem(struct cardstate *cs) } set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); - if (tty->ops->write) - sent = tty->ops->write(tty, skb->data, skb->len); + sent = tty->driver->write(tty, skb->data, skb->len); gig_dbg(DEBUG_OUTPUT, "write_modem: sent %d", sent); if (sent < 0) { /* error */ @@ -121,7 +120,7 @@ static int send_cb(struct cardstate *cs) if (cb->len) { set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); - sent = tty->ops->write(tty, cb->buf + cb->offset, cb->len); + sent = tty->driver->write(tty, cb->buf + cb->offset, cb->len); if (sent < 0) { /* error */ gig_dbg(DEBUG_OUTPUT, "send_cb: write error %d", sent); @@ -441,14 +440,14 @@ static int gigaset_set_modem_ctrl(struct cardstate *cs, unsigned old_state, unsi struct tty_struct *tty = cs->hw.ser->tty; unsigned int set, clear; - if (!tty || !tty->driver || !tty->ops->tiocmset) - return -EINVAL; + if (!tty || !tty->driver || !tty->driver->tiocmset) + return -EFAULT; set = new_state & ~old_state; clear = old_state & ~new_state; if (!set && !clear) return 0; gig_dbg(DEBUG_IF, "tiocmset set %x clear %x", set, clear); - return tty->ops->tiocmset(tty, NULL, set, clear); + return tty->driver->tiocmset(tty, NULL, set, clear); } static int gigaset_baud_rate(struct cardstate *cs, unsigned cflag) diff --git a/trunk/drivers/isdn/i4l/isdn_tty.c b/trunk/drivers/isdn/i4l/isdn_tty.c index 1a2222cbb805..8af0df1d5b8c 100644 --- a/trunk/drivers/isdn/i4l/isdn_tty.c +++ b/trunk/drivers/isdn/i4l/isdn_tty.c @@ -1352,14 +1352,12 @@ isdn_tty_tiocmget(struct tty_struct *tty, struct file *file) if (tty->flags & (1 << TTY_IO_ERROR)) return -EIO; - lock_kernel(); #ifdef ISDN_DEBUG_MODEM_IOCTL printk(KERN_DEBUG "ttyI%d ioctl TIOCMGET\n", info->line); #endif control = info->mcr; status = info->msr; - unlock_kernel(); return ((control & UART_MCR_RTS) ? TIOCM_RTS : 0) | ((control & UART_MCR_DTR) ? TIOCM_DTR : 0) | ((status & UART_MSR_DCD) ? TIOCM_CAR : 0) @@ -1383,7 +1381,6 @@ isdn_tty_tiocmset(struct tty_struct *tty, struct file *file, printk(KERN_DEBUG "ttyI%d ioctl TIOCMxxx: %x %x\n", info->line, set, clear); #endif - lock_kernel(); if (set & TIOCM_RTS) info->mcr |= UART_MCR_RTS; if (set & TIOCM_DTR) { @@ -1405,7 +1402,6 @@ isdn_tty_tiocmset(struct tty_struct *tty, struct file *file, isdn_tty_modem_hup(info, 1); } } - unlock_kernel(); return 0; } @@ -1439,6 +1435,21 @@ isdn_tty_ioctl(struct tty_struct *tty, struct file *file, return retval; tty_wait_until_sent(tty, 0); return 0; + case TIOCGSOFTCAR: +#ifdef ISDN_DEBUG_MODEM_IOCTL + printk(KERN_DEBUG "ttyI%d ioctl TIOCGSOFTCAR\n", info->line); +#endif + return put_user(C_CLOCAL(tty) ? 1 : 0, (ulong __user *) arg); + case TIOCSSOFTCAR: +#ifdef ISDN_DEBUG_MODEM_IOCTL + printk(KERN_DEBUG "ttyI%d ioctl TIOCSSOFTCAR\n", info->line); +#endif + if (get_user(arg, (ulong __user *) arg)) + return -EFAULT; + tty->termios->c_cflag = + ((tty->termios->c_cflag & ~CLOCAL) | + (arg ? CLOCAL : 0)); + return 0; case TIOCSERGETLSR: /* Get line status register */ #ifdef ISDN_DEBUG_MODEM_IOCTL printk(KERN_DEBUG "ttyI%d ioctl TIOCSERGETLSR\n", info->line); @@ -1461,14 +1472,13 @@ isdn_tty_set_termios(struct tty_struct *tty, struct ktermios *old_termios) if (!old_termios) isdn_tty_change_speed(info); else { - if (tty->termios->c_cflag == old_termios->c_cflag && - tty->termios->c_ispeed == old_termios->c_ispeed && - tty->termios->c_ospeed == old_termios->c_ospeed) + if (tty->termios->c_cflag == old_termios->c_cflag) return; isdn_tty_change_speed(info); if ((old_termios->c_cflag & CRTSCTS) && - !(tty->termios->c_cflag & CRTSCTS)) + !(tty->termios->c_cflag & CRTSCTS)) { tty->hw_stopped = 0; + } } } @@ -1708,7 +1718,9 @@ isdn_tty_close(struct tty_struct *tty, struct file *filp) } dev->modempoll--; isdn_tty_shutdown(info); - isdn_tty_flush_buffer(tty); + + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); tty_ldisc_flush(tty); info->tty = NULL; info->ncarrier = 0; diff --git a/trunk/drivers/md/md.c b/trunk/drivers/md/md.c index 83eb78b00137..bb3e4b1cb773 100644 --- a/trunk/drivers/md/md.c +++ b/trunk/drivers/md/md.c @@ -276,7 +276,6 @@ static mddev_t * mddev_find(dev_t unit) init_waitqueue_head(&new->sb_wait); new->reshape_position = MaxSector; new->resync_max = MaxSector; - new->level = LEVEL_NONE; new->queue = blk_alloc_queue(GFP_KERNEL); if (!new->queue) { @@ -1370,11 +1369,6 @@ static int bind_rdev_to_array(mdk_rdev_t * rdev, mddev_t * mddev) MD_BUG(); return -EINVAL; } - - /* prevent duplicates */ - if (find_rdev(mddev, rdev->bdev->bd_dev)) - return -EEXIST; - /* make sure rdev->size exceeds mddev->size */ if (rdev->size && (mddev->size == 0 || rdev->size < mddev->size)) { if (mddev->pers) { @@ -1658,8 +1652,6 @@ static void md_update_sb(mddev_t * mddev, int force_change) int sync_req; int nospares = 0; - if (mddev->external) - return; repeat: spin_lock_irq(&mddev->write_lock); @@ -1828,10 +1820,6 @@ state_show(mdk_rdev_t *rdev, char *page) len += sprintf(page+len, "%swrite_mostly",sep); sep = ","; } - if (test_bit(Blocked, &rdev->flags)) { - len += sprintf(page+len, "%sblocked", sep); - sep = ","; - } if (!test_bit(Faulty, &rdev->flags) && !test_bit(In_sync, &rdev->flags)) { len += sprintf(page+len, "%sspare", sep); @@ -1848,8 +1836,6 @@ state_store(mdk_rdev_t *rdev, const char *buf, size_t len) * remove - disconnects the device * writemostly - sets write_mostly * -writemostly - clears write_mostly - * blocked - sets the Blocked flag - * -blocked - clears the Blocked flag */ int err = -EINVAL; if (cmd_match(buf, "faulty") && rdev->mddev->pers) { @@ -1871,16 +1857,6 @@ state_store(mdk_rdev_t *rdev, const char *buf, size_t len) err = 0; } else if (cmd_match(buf, "-writemostly")) { clear_bit(WriteMostly, &rdev->flags); - err = 0; - } else if (cmd_match(buf, "blocked")) { - set_bit(Blocked, &rdev->flags); - err = 0; - } else if (cmd_match(buf, "-blocked")) { - clear_bit(Blocked, &rdev->flags); - wake_up(&rdev->blocked_wait); - set_bit(MD_RECOVERY_NEEDED, &rdev->mddev->recovery); - md_wakeup_thread(rdev->mddev->thread); - err = 0; } return err ? err : len; @@ -2121,7 +2097,7 @@ rdev_attr_store(struct kobject *kobj, struct attribute *attr, rv = -EBUSY; else rv = entry->store(rdev, page, length); - mddev_unlock(mddev); + mddev_unlock(rdev->mddev); } return rv; } @@ -2210,9 +2186,7 @@ static mdk_rdev_t *md_import_device(dev_t newdev, int super_format, int super_mi goto abort_free; } } - INIT_LIST_HEAD(&rdev->same_set); - init_waitqueue_head(&rdev->blocked_wait); return rdev; @@ -2483,6 +2457,7 @@ resync_start_show(mddev_t *mddev, char *page) static ssize_t resync_start_store(mddev_t *mddev, const char *buf, size_t len) { + /* can only set chunk_size if array is not yet active */ char *e; unsigned long long n = simple_strtoull(buf, &e, 10); @@ -2616,20 +2591,15 @@ array_state_store(mddev_t *mddev, const char *buf, size_t len) err = do_md_stop(mddev, 1); else { mddev->ro = 1; - set_disk_ro(mddev->gendisk, 1); err = do_md_run(mddev); } break; case read_auto: + /* stopping an active array */ if (mddev->pers) { - if (mddev->ro != 1) - err = do_md_stop(mddev, 1); - else - err = restart_array(mddev); - if (err == 0) { - mddev->ro = 2; - set_disk_ro(mddev->gendisk, 0); - } + err = do_md_stop(mddev, 1); + if (err == 0) + mddev->ro = 2; /* FIXME mark devices writable */ } else { mddev->ro = 2; err = do_md_run(mddev); @@ -2642,8 +2612,6 @@ array_state_store(mddev_t *mddev, const char *buf, size_t len) if (atomic_read(&mddev->writes_pending) == 0) { if (mddev->in_sync == 0) { mddev->in_sync = 1; - if (mddev->safemode == 1) - mddev->safemode = 0; if (mddev->persistent) set_bit(MD_CHANGE_CLEAN, &mddev->flags); @@ -2667,7 +2635,6 @@ array_state_store(mddev_t *mddev, const char *buf, size_t len) err = 0; } else { mddev->ro = 0; - set_disk_ro(mddev->gendisk, 0); err = do_md_run(mddev); } break; @@ -3745,30 +3712,6 @@ static int do_md_stop(mddev_t * mddev, int mode) mddev->reshape_position = MaxSector; mddev->external = 0; mddev->persistent = 0; - mddev->level = LEVEL_NONE; - mddev->clevel[0] = 0; - mddev->flags = 0; - mddev->ro = 0; - mddev->metadata_type[0] = 0; - mddev->chunk_size = 0; - mddev->ctime = mddev->utime = 0; - mddev->layout = 0; - mddev->max_disks = 0; - mddev->events = 0; - mddev->delta_disks = 0; - mddev->new_level = LEVEL_NONE; - mddev->new_layout = 0; - mddev->new_chunk = 0; - mddev->curr_resync = 0; - mddev->resync_mismatches = 0; - mddev->suspend_lo = mddev->suspend_hi = 0; - mddev->sync_speed_min = mddev->sync_speed_max = 0; - mddev->recovery = 0; - mddev->in_sync = 0; - mddev->changed = 0; - mddev->degraded = 0; - mddev->barriers_work = 0; - mddev->safemode = 0; } else if (mddev->pers) printk(KERN_INFO "md: %s switched to read-only mode.\n", @@ -4976,9 +4919,6 @@ void md_error(mddev_t *mddev, mdk_rdev_t *rdev) if (!rdev || test_bit(Faulty, &rdev->flags)) return; - - if (mddev->external) - set_bit(Blocked, &rdev->flags); /* dprintk("md_error dev:%s, rdev:(%d:%d), (caller: %p,%p,%p,%p).\n", mdname(mddev), @@ -5425,8 +5365,6 @@ void md_write_start(mddev_t *mddev, struct bio *bi) md_wakeup_thread(mddev->sync_thread); } atomic_inc(&mddev->writes_pending); - if (mddev->safemode == 1) - mddev->safemode = 0; if (mddev->in_sync) { spin_lock_irq(&mddev->write_lock); if (mddev->in_sync) { @@ -5781,7 +5719,7 @@ static int remove_and_add_spares(mddev_t *mddev) rdev_for_each(rdev, rtmp, mddev) if (rdev->raid_disk >= 0 && - !test_bit(Blocked, &rdev->flags) && + !mddev->external && (test_bit(Faulty, &rdev->flags) || ! test_bit(In_sync, &rdev->flags)) && atomic_read(&rdev->nr_pending)==0) { @@ -5851,7 +5789,7 @@ void md_check_recovery(mddev_t *mddev) return; if (signal_pending(current)) { - if (mddev->pers->sync_request && !mddev->external) { + if (mddev->pers->sync_request) { printk(KERN_INFO "md: %s in immediate safe mode\n", mdname(mddev)); mddev->safemode = 2; @@ -5863,7 +5801,7 @@ void md_check_recovery(mddev_t *mddev) (mddev->flags && !mddev->external) || test_bit(MD_RECOVERY_NEEDED, &mddev->recovery) || test_bit(MD_RECOVERY_DONE, &mddev->recovery) || - (mddev->external == 0 && mddev->safemode == 1) || + (mddev->safemode == 1) || (mddev->safemode == 2 && ! atomic_read(&mddev->writes_pending) && !mddev->in_sync && mddev->recovery_cp == MaxSector) )) @@ -5872,20 +5810,16 @@ void md_check_recovery(mddev_t *mddev) if (mddev_trylock(mddev)) { int spares = 0; - if (!mddev->external) { - spin_lock_irq(&mddev->write_lock); - if (mddev->safemode && - !atomic_read(&mddev->writes_pending) && - !mddev->in_sync && - mddev->recovery_cp == MaxSector) { - mddev->in_sync = 1; - if (mddev->persistent) - set_bit(MD_CHANGE_CLEAN, &mddev->flags); - } - if (mddev->safemode == 1) - mddev->safemode = 0; - spin_unlock_irq(&mddev->write_lock); + spin_lock_irq(&mddev->write_lock); + if (mddev->safemode && !atomic_read(&mddev->writes_pending) && + !mddev->in_sync && mddev->recovery_cp == MaxSector) { + mddev->in_sync = 1; + if (mddev->persistent) + set_bit(MD_CHANGE_CLEAN, &mddev->flags); } + if (mddev->safemode == 1) + mddev->safemode = 0; + spin_unlock_irq(&mddev->write_lock); if (mddev->flags) md_update_sb(mddev, 0); @@ -5980,16 +5914,6 @@ void md_check_recovery(mddev_t *mddev) } } -void md_wait_for_blocked_rdev(mdk_rdev_t *rdev, mddev_t *mddev) -{ - sysfs_notify(&rdev->kobj, NULL, "state"); - wait_event_timeout(rdev->blocked_wait, - !test_bit(Blocked, &rdev->flags), - msecs_to_jiffies(5000)); - rdev_dec_pending(rdev, mddev); -} -EXPORT_SYMBOL(md_wait_for_blocked_rdev); - static int md_notify_reboot(struct notifier_block *this, unsigned long code, void *x) { diff --git a/trunk/drivers/md/raid1.c b/trunk/drivers/md/raid1.c index 6778b7cb39bd..9fd473a6dbf5 100644 --- a/trunk/drivers/md/raid1.c +++ b/trunk/drivers/md/raid1.c @@ -773,6 +773,7 @@ static int make_request(struct request_queue *q, struct bio * bio) r1bio_t *r1_bio; struct bio *read_bio; int i, targets = 0, disks; + mdk_rdev_t *rdev; struct bitmap *bitmap = mddev->bitmap; unsigned long flags; struct bio_list bl; @@ -780,7 +781,6 @@ static int make_request(struct request_queue *q, struct bio * bio) const int rw = bio_data_dir(bio); const int do_sync = bio_sync(bio); int do_barriers; - mdk_rdev_t *blocked_rdev; /* * Register the new request and wait if the reconstruction @@ -862,17 +862,10 @@ static int make_request(struct request_queue *q, struct bio * bio) first = 0; } #endif - retry_write: - blocked_rdev = NULL; rcu_read_lock(); for (i = 0; i < disks; i++) { - mdk_rdev_t *rdev = rcu_dereference(conf->mirrors[i].rdev); - if (rdev && unlikely(test_bit(Blocked, &rdev->flags))) { - atomic_inc(&rdev->nr_pending); - blocked_rdev = rdev; - break; - } - if (rdev && !test_bit(Faulty, &rdev->flags)) { + if ((rdev=rcu_dereference(conf->mirrors[i].rdev)) != NULL && + !test_bit(Faulty, &rdev->flags)) { atomic_inc(&rdev->nr_pending); if (test_bit(Faulty, &rdev->flags)) { rdev_dec_pending(rdev, mddev); @@ -885,20 +878,6 @@ static int make_request(struct request_queue *q, struct bio * bio) } rcu_read_unlock(); - if (unlikely(blocked_rdev)) { - /* Wait for this device to become unblocked */ - int j; - - for (j = 0; j < i; j++) - if (r1_bio->bios[j]) - rdev_dec_pending(conf->mirrors[j].rdev, mddev); - - allow_barrier(conf); - md_wait_for_blocked_rdev(blocked_rdev, mddev); - wait_barrier(conf); - goto retry_write; - } - BUG_ON(targets == 0); /* we never fail the last device */ if (targets < conf->raid_disks) { diff --git a/trunk/drivers/md/raid10.c b/trunk/drivers/md/raid10.c index 5938fa962922..1e96aa3ff513 100644 --- a/trunk/drivers/md/raid10.c +++ b/trunk/drivers/md/raid10.c @@ -790,7 +790,6 @@ static int make_request(struct request_queue *q, struct bio * bio) const int do_sync = bio_sync(bio); struct bio_list bl; unsigned long flags; - mdk_rdev_t *blocked_rdev; if (unlikely(bio_barrier(bio))) { bio_endio(bio, -EOPNOTSUPP); @@ -880,23 +879,17 @@ static int make_request(struct request_queue *q, struct bio * bio) /* * WRITE: */ - /* first select target devices under rcu_lock and + /* first select target devices under spinlock and * inc refcount on their rdev. Record them by setting * bios[x] to bio */ raid10_find_phys(conf, r10_bio); - retry_write: - blocked_rdev = 0; rcu_read_lock(); for (i = 0; i < conf->copies; i++) { int d = r10_bio->devs[i].devnum; mdk_rdev_t *rdev = rcu_dereference(conf->mirrors[d].rdev); - if (rdev && unlikely(test_bit(Blocked, &rdev->flags))) { - atomic_inc(&rdev->nr_pending); - blocked_rdev = rdev; - break; - } - if (rdev && !test_bit(Faulty, &rdev->flags)) { + if (rdev && + !test_bit(Faulty, &rdev->flags)) { atomic_inc(&rdev->nr_pending); r10_bio->devs[i].bio = bio; } else { @@ -906,22 +899,6 @@ static int make_request(struct request_queue *q, struct bio * bio) } rcu_read_unlock(); - if (unlikely(blocked_rdev)) { - /* Have to wait for this device to get unblocked, then retry */ - int j; - int d; - - for (j = 0; j < i; j++) - if (r10_bio->devs[j].bio) { - d = r10_bio->devs[j].devnum; - rdev_dec_pending(conf->mirrors[d].rdev, mddev); - } - allow_barrier(conf); - md_wait_for_blocked_rdev(blocked_rdev, mddev); - wait_barrier(conf); - goto retry_write; - } - atomic_set(&r10_bio->remaining, 0); bio_list_init(&bl); diff --git a/trunk/drivers/md/raid5.c b/trunk/drivers/md/raid5.c index 087eee0cb809..968dacaced6d 100644 --- a/trunk/drivers/md/raid5.c +++ b/trunk/drivers/md/raid5.c @@ -2607,7 +2607,6 @@ static void handle_stripe_expansion(raid5_conf_t *conf, struct stripe_head *sh, } } - /* * handle_stripe - do things to a stripe. * @@ -2633,7 +2632,6 @@ static void handle_stripe5(struct stripe_head *sh) struct stripe_head_state s; struct r5dev *dev; unsigned long pending = 0; - mdk_rdev_t *blocked_rdev = NULL; memset(&s, 0, sizeof(s)); pr_debug("handling stripe %llu, state=%#lx cnt=%d, pd_idx=%d " @@ -2693,11 +2691,6 @@ static void handle_stripe5(struct stripe_head *sh) if (dev->written) s.written++; rdev = rcu_dereference(conf->disks[i].rdev); - if (rdev && unlikely(test_bit(Blocked, &rdev->flags))) { - blocked_rdev = rdev; - atomic_inc(&rdev->nr_pending); - break; - } if (!rdev || !test_bit(In_sync, &rdev->flags)) { /* The ReadError flag will just be confusing now */ clear_bit(R5_ReadError, &dev->flags); @@ -2712,11 +2705,6 @@ static void handle_stripe5(struct stripe_head *sh) } rcu_read_unlock(); - if (unlikely(blocked_rdev)) { - set_bit(STRIPE_HANDLE, &sh->state); - goto unlock; - } - if (s.to_fill && !test_and_set_bit(STRIPE_OP_BIOFILL, &sh->ops.pending)) sh->ops.count++; @@ -2906,13 +2894,8 @@ static void handle_stripe5(struct stripe_head *sh) if (sh->ops.count) pending = get_stripe_work(sh); - unlock: spin_unlock(&sh->lock); - /* wait for this device to become unblocked */ - if (unlikely(blocked_rdev)) - md_wait_for_blocked_rdev(blocked_rdev, conf->mddev); - if (pending) raid5_run_ops(sh, pending); @@ -2929,7 +2912,6 @@ static void handle_stripe6(struct stripe_head *sh, struct page *tmp_page) struct stripe_head_state s; struct r6_state r6s; struct r5dev *dev, *pdev, *qdev; - mdk_rdev_t *blocked_rdev = NULL; r6s.qd_idx = raid6_next_disk(pd_idx, disks); pr_debug("handling stripe %llu, state=%#lx cnt=%d, " @@ -2993,11 +2975,6 @@ static void handle_stripe6(struct stripe_head *sh, struct page *tmp_page) if (dev->written) s.written++; rdev = rcu_dereference(conf->disks[i].rdev); - if (rdev && unlikely(test_bit(Blocked, &rdev->flags))) { - blocked_rdev = rdev; - atomic_inc(&rdev->nr_pending); - break; - } if (!rdev || !test_bit(In_sync, &rdev->flags)) { /* The ReadError flag will just be confusing now */ clear_bit(R5_ReadError, &dev->flags); @@ -3012,11 +2989,6 @@ static void handle_stripe6(struct stripe_head *sh, struct page *tmp_page) set_bit(R5_Insync, &dev->flags); } rcu_read_unlock(); - - if (unlikely(blocked_rdev)) { - set_bit(STRIPE_HANDLE, &sh->state); - goto unlock; - } pr_debug("locked=%d uptodate=%d to_read=%d" " to_write=%d failed=%d failed_num=%d,%d\n", s.locked, s.uptodate, s.to_read, s.to_write, s.failed, @@ -3122,13 +3094,8 @@ static void handle_stripe6(struct stripe_head *sh, struct page *tmp_page) !test_bit(STRIPE_OP_COMPUTE_BLK, &sh->ops.pending)) handle_stripe_expansion(conf, sh, &r6s); - unlock: spin_unlock(&sh->lock); - /* wait for this device to become unblocked */ - if (unlikely(blocked_rdev)) - md_wait_for_blocked_rdev(blocked_rdev, conf->mddev); - return_io(return_bi); for (i=disks; i-- ;) { diff --git a/trunk/drivers/media/common/Makefile b/trunk/drivers/media/common/Makefile index 351b98b9b302..8e7448230643 100644 --- a/trunk/drivers/media/common/Makefile +++ b/trunk/drivers/media/common/Makefile @@ -2,7 +2,6 @@ saa7146-objs := saa7146_i2c.o saa7146_core.o saa7146_vv-objs := saa7146_fops.o saa7146_video.o saa7146_hlp.o saa7146_vbi.o ir-common-objs := ir-functions.o ir-keymaps.o -obj-y += tuners/ obj-$(CONFIG_VIDEO_SAA7146) += saa7146.o obj-$(CONFIG_VIDEO_SAA7146_VV) += saa7146_vv.o obj-$(CONFIG_VIDEO_IR) += ir-common.o diff --git a/trunk/drivers/media/video/bt8xx/bttvp.h b/trunk/drivers/media/video/bt8xx/bttvp.h index 27da7b423275..03816b73f847 100644 --- a/trunk/drivers/media/video/bt8xx/bttvp.h +++ b/trunk/drivers/media/video/bt8xx/bttvp.h @@ -81,6 +81,8 @@ /* Limits scaled width, which must be a multiple of 4. */ #define MAX_HACTIVE (0x3FF & -4) +#define clamp(x, low, high) min (max (low, x), high) + #define BTTV_NORMS (\ V4L2_STD_PAL | V4L2_STD_PAL_N | \ V4L2_STD_PAL_Nc | V4L2_STD_SECAM | \ diff --git a/trunk/drivers/media/video/usbvideo/vicam.c b/trunk/drivers/media/video/usbvideo/vicam.c index 17f542dfb366..64819353276a 100644 --- a/trunk/drivers/media/video/usbvideo/vicam.c +++ b/trunk/drivers/media/video/usbvideo/vicam.c @@ -70,6 +70,12 @@ #define VICAM_HEADER_SIZE 64 +#define clamp( x, l, h ) max_t( __typeof__( x ), \ + ( l ), \ + min_t( __typeof__( x ), \ + ( h ), \ + ( x ) ) ) + /* Not sure what all the bytes in these char * arrays do, but they're necessary to make * the camera work. diff --git a/trunk/drivers/mfd/asic3.c b/trunk/drivers/mfd/asic3.c index ef8a492766a7..f6f2d960cadb 100644 --- a/trunk/drivers/mfd/asic3.c +++ b/trunk/drivers/mfd/asic3.c @@ -132,7 +132,7 @@ static void asic3_irq_demux(unsigned int irq, struct irq_desc *desc) if (iter >= MAX_ASIC_ISR_LOOPS) printk(KERN_ERR "%s: interrupt processing overrun\n", - __func__); + __FUNCTION__); } static inline int asic3_irq_to_bank(struct asic3 *asic, int irq) @@ -409,7 +409,7 @@ int asic3_gpio_get_value(struct asic3 *asic, unsigned gpio) return asic3_get_gpio_d(asic, Status) & mask; default: printk(KERN_ERR "%s: invalid GPIO value 0x%x", - __func__, gpio); + __FUNCTION__, gpio); return -EINVAL; } } @@ -437,7 +437,7 @@ void asic3_gpio_set_value(struct asic3 *asic, unsigned gpio, int val) return; default: printk(KERN_ERR "%s: invalid GPIO value 0x%x", - __func__, gpio); + __FUNCTION__, gpio); return; } } diff --git a/trunk/drivers/mfd/sm501.c b/trunk/drivers/mfd/sm501.c index 2fe64734d8af..6e655b4c6682 100644 --- a/trunk/drivers/mfd/sm501.c +++ b/trunk/drivers/mfd/sm501.c @@ -349,11 +349,11 @@ int sm501_unit_power(struct device *dev, unsigned int unit, unsigned int to) mode &= 3; /* get current power mode */ if (unit >= ARRAY_SIZE(sm->unit_power)) { - dev_err(dev, "%s: bad unit %d\n", __func__, unit); + dev_err(dev, "%s: bad unit %d\n", __FUNCTION__, unit); goto already; } - dev_dbg(sm->dev, "%s: unit %d, cur %d, to %d\n", __func__, unit, + dev_dbg(sm->dev, "%s: unit %d, cur %d, to %d\n", __FUNCTION__, unit, sm->unit_power[unit], to); if (to == 0 && sm->unit_power[unit] == 0) { diff --git a/trunk/drivers/net/fec_mpc52xx.c b/trunk/drivers/net/fec_mpc52xx.c index d21b7ab64bd1..e5e6352556fa 100644 --- a/trunk/drivers/net/fec_mpc52xx.c +++ b/trunk/drivers/net/fec_mpc52xx.c @@ -491,23 +491,20 @@ static irqreturn_t mpc52xx_fec_interrupt(int irq, void *dev_id) out_be32(&fec->ievent, ievent); /* clear pending events */ - /* on fifo error, soft-reset fec */ - if (ievent & (FEC_IEVENT_RFIFO_ERROR | FEC_IEVENT_XFIFO_ERROR)) { - - if (net_ratelimit() && (ievent & FEC_IEVENT_RFIFO_ERROR)) - dev_warn(&dev->dev, "FEC_IEVENT_RFIFO_ERROR\n"); - if (net_ratelimit() && (ievent & FEC_IEVENT_XFIFO_ERROR)) - dev_warn(&dev->dev, "FEC_IEVENT_XFIFO_ERROR\n"); - - mpc52xx_fec_reset(dev); - - netif_wake_queue(dev); + if (ievent & ~(FEC_IEVENT_RFIFO_ERROR | FEC_IEVENT_XFIFO_ERROR)) { + if (ievent & ~FEC_IEVENT_TFINT) + dev_dbg(&dev->dev, "ievent: %08x\n", ievent); return IRQ_HANDLED; } - if (ievent & ~FEC_IEVENT_TFINT) - dev_dbg(&dev->dev, "ievent: %08x\n", ievent); + if (net_ratelimit() && (ievent & FEC_IEVENT_RFIFO_ERROR)) + dev_warn(&dev->dev, "FEC_IEVENT_RFIFO_ERROR\n"); + if (net_ratelimit() && (ievent & FEC_IEVENT_XFIFO_ERROR)) + dev_warn(&dev->dev, "FEC_IEVENT_XFIFO_ERROR\n"); + mpc52xx_fec_reset(dev); + + netif_wake_queue(dev); return IRQ_HANDLED; } diff --git a/trunk/drivers/net/hamradio/6pack.c b/trunk/drivers/net/hamradio/6pack.c index 9d5721287d6f..1da55dd2a5a0 100644 --- a/trunk/drivers/net/hamradio/6pack.c +++ b/trunk/drivers/net/hamradio/6pack.c @@ -148,13 +148,13 @@ static void sp_xmit_on_air(unsigned long channel) if (((sp->status1 & SIXP_DCD_MASK) == 0) && (random < sp->persistence)) { sp->led_state = 0x70; - sp->tty->ops->write(sp->tty, &sp->led_state, 1); + sp->tty->driver->write(sp->tty, &sp->led_state, 1); sp->tx_enable = 1; - actual = sp->tty->ops->write(sp->tty, sp->xbuff, sp->status2); + actual = sp->tty->driver->write(sp->tty, sp->xbuff, sp->status2); sp->xleft -= actual; sp->xhead += actual; sp->led_state = 0x60; - sp->tty->ops->write(sp->tty, &sp->led_state, 1); + sp->tty->driver->write(sp->tty, &sp->led_state, 1); sp->status2 = 0; } else mod_timer(&sp->tx_t, jiffies + ((when + 1) * HZ) / 100); @@ -220,13 +220,13 @@ static void sp_encaps(struct sixpack *sp, unsigned char *icp, int len) */ if (sp->duplex == 1) { sp->led_state = 0x70; - sp->tty->ops->write(sp->tty, &sp->led_state, 1); + sp->tty->driver->write(sp->tty, &sp->led_state, 1); sp->tx_enable = 1; - actual = sp->tty->ops->write(sp->tty, sp->xbuff, count); + actual = sp->tty->driver->write(sp->tty, sp->xbuff, count); sp->xleft = count - actual; sp->xhead = sp->xbuff + actual; sp->led_state = 0x60; - sp->tty->ops->write(sp->tty, &sp->led_state, 1); + sp->tty->driver->write(sp->tty, &sp->led_state, 1); } else { sp->xleft = count; sp->xhead = sp->xbuff; @@ -444,7 +444,7 @@ static void sixpack_write_wakeup(struct tty_struct *tty) } if (sp->tx_enable) { - actual = tty->ops->write(tty, sp->xhead, sp->xleft); + actual = tty->driver->write(tty, sp->xhead, sp->xleft); sp->xleft -= actual; sp->xhead += actual; } @@ -491,7 +491,9 @@ static void sixpack_receive_buf(struct tty_struct *tty, sixpack_decode(sp, buf, count1); sp_put(sp); - tty_unthrottle(tty); + if (test_and_clear_bit(TTY_THROTTLED, &tty->flags) + && tty->driver->unthrottle) + tty->driver->unthrottle(tty); } /* @@ -552,8 +554,8 @@ static void resync_tnc(unsigned long channel) /* resync the TNC */ sp->led_state = 0x60; - sp->tty->ops->write(sp->tty, &sp->led_state, 1); - sp->tty->ops->write(sp->tty, &resync_cmd, 1); + sp->tty->driver->write(sp->tty, &sp->led_state, 1); + sp->tty->driver->write(sp->tty, &resync_cmd, 1); /* Start resync timer again -- the TNC might be still absent */ @@ -571,7 +573,7 @@ static inline int tnc_init(struct sixpack *sp) tnc_set_sync_state(sp, TNC_UNSYNC_STARTUP); - sp->tty->ops->write(sp->tty, &inbyte, 1); + sp->tty->driver->write(sp->tty, &inbyte, 1); del_timer(&sp->resync_t); sp->resync_t.data = (unsigned long) sp; @@ -599,8 +601,6 @@ static int sixpack_open(struct tty_struct *tty) if (!capable(CAP_NET_ADMIN)) return -EPERM; - if (tty->ops->write == NULL) - return -EOPNOTSUPP; dev = alloc_netdev(sizeof(struct sixpack), "sp%d", sp_setup); if (!dev) { @@ -914,9 +914,9 @@ static void decode_prio_command(struct sixpack *sp, unsigned char cmd) } else { /* output watchdog char if idle */ if ((sp->status2 != 0) && (sp->duplex == 1)) { sp->led_state = 0x70; - sp->tty->ops->write(sp->tty, &sp->led_state, 1); + sp->tty->driver->write(sp->tty, &sp->led_state, 1); sp->tx_enable = 1; - actual = sp->tty->ops->write(sp->tty, sp->xbuff, sp->status2); + actual = sp->tty->driver->write(sp->tty, sp->xbuff, sp->status2); sp->xleft -= actual; sp->xhead += actual; sp->led_state = 0x60; @@ -926,7 +926,7 @@ static void decode_prio_command(struct sixpack *sp, unsigned char cmd) } /* needed to trigger the TNC watchdog */ - sp->tty->ops->write(sp->tty, &sp->led_state, 1); + sp->tty->driver->write(sp->tty, &sp->led_state, 1); /* if the state byte has been received, the TNC is present, so the resync timer can be reset. */ @@ -956,12 +956,12 @@ static void decode_std_command(struct sixpack *sp, unsigned char cmd) if ((sp->status & SIXP_RX_DCD_MASK) == SIXP_RX_DCD_MASK) { sp->led_state = 0x68; - sp->tty->ops->write(sp->tty, &sp->led_state, 1); + sp->tty->driver->write(sp->tty, &sp->led_state, 1); } } else { sp->led_state = 0x60; /* fill trailing bytes with zeroes */ - sp->tty->ops->write(sp->tty, &sp->led_state, 1); + sp->tty->driver->write(sp->tty, &sp->led_state, 1); rest = sp->rx_count; if (rest != 0) for (i = rest; i <= 3; i++) diff --git a/trunk/drivers/net/hamradio/mkiss.c b/trunk/drivers/net/hamradio/mkiss.c index 65166035aca0..30c9b3b0d131 100644 --- a/trunk/drivers/net/hamradio/mkiss.c +++ b/trunk/drivers/net/hamradio/mkiss.c @@ -516,7 +516,7 @@ static void ax_encaps(struct net_device *dev, unsigned char *icp, int len) spin_unlock_bh(&ax->buflock); set_bit(TTY_DO_WRITE_WAKEUP, &ax->tty->flags); - actual = ax->tty->ops->write(ax->tty, ax->xbuff, count); + actual = ax->tty->driver->write(ax->tty, ax->xbuff, count); ax->stats.tx_packets++; ax->stats.tx_bytes += actual; @@ -546,7 +546,7 @@ static int ax_xmit(struct sk_buff *skb, struct net_device *dev) } printk(KERN_ERR "mkiss: %s: transmit timed out, %s?\n", dev->name, - (ax->tty->ops->chars_in_buffer(ax->tty) || ax->xleft) ? + (ax->tty->driver->chars_in_buffer(ax->tty) || ax->xleft) ? "bad line quality" : "driver error"); ax->xleft = 0; @@ -736,8 +736,6 @@ static int mkiss_open(struct tty_struct *tty) if (!capable(CAP_NET_ADMIN)) return -EPERM; - if (tty->ops->write == NULL) - return -EOPNOTSUPP; dev = alloc_netdev(sizeof(struct mkiss), "ax%d", ax_setup); if (!dev) { @@ -756,7 +754,8 @@ static int mkiss_open(struct tty_struct *tty) tty->disc_data = ax; tty->receive_room = 65535; - tty_driver_flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); /* Restore default settings */ dev->type = ARPHRD_AX25; @@ -936,7 +935,9 @@ static void mkiss_receive_buf(struct tty_struct *tty, const unsigned char *cp, } mkiss_put(ax); - tty_unthrottle(tty); + if (test_and_clear_bit(TTY_THROTTLED, &tty->flags) + && tty->driver->unthrottle) + tty->driver->unthrottle(tty); } /* @@ -961,7 +962,7 @@ static void mkiss_write_wakeup(struct tty_struct *tty) goto out; } - actual = tty->ops->write(tty, ax->xhead, ax->xleft); + actual = tty->driver->write(tty, ax->xhead, ax->xleft); ax->xleft -= actual; ax->xhead += actual; diff --git a/trunk/drivers/net/irda/irtty-sir.c b/trunk/drivers/net/irda/irtty-sir.c index e6f40b7f9041..fc753d7f674e 100644 --- a/trunk/drivers/net/irda/irtty-sir.c +++ b/trunk/drivers/net/irda/irtty-sir.c @@ -64,7 +64,7 @@ static int irtty_chars_in_buffer(struct sir_dev *dev) IRDA_ASSERT(priv != NULL, return -1;); IRDA_ASSERT(priv->magic == IRTTY_MAGIC, return -1;); - return tty_chars_in_buffer(priv->tty); + return priv->tty->driver->chars_in_buffer(priv->tty); } /* Wait (sleep) until underlaying hardware finished transmission @@ -93,8 +93,10 @@ static void irtty_wait_until_sent(struct sir_dev *dev) IRDA_ASSERT(priv->magic == IRTTY_MAGIC, return;); tty = priv->tty; - if (tty->ops->wait_until_sent) { - tty->ops->wait_until_sent(tty, msecs_to_jiffies(100)); + if (tty->driver->wait_until_sent) { + lock_kernel(); + tty->driver->wait_until_sent(tty, msecs_to_jiffies(100)); + unlock_kernel(); } else { msleep(USBSERIAL_TX_DONE_DELAY); @@ -123,14 +125,48 @@ static int irtty_change_speed(struct sir_dev *dev, unsigned speed) tty = priv->tty; - mutex_lock(&tty->termios_mutex); + lock_kernel(); old_termios = *(tty->termios); cflag = tty->termios->c_cflag; - tty_encode_baud_rate(tty, speed, speed); - if (tty->ops->set_termios) - tty->ops->set_termios(tty, &old_termios); + + cflag &= ~CBAUD; + + IRDA_DEBUG(2, "%s(), Setting speed to %d\n", __FUNCTION__, speed); + + switch (speed) { + case 1200: + cflag |= B1200; + break; + case 2400: + cflag |= B2400; + break; + case 4800: + cflag |= B4800; + break; + case 19200: + cflag |= B19200; + break; + case 38400: + cflag |= B38400; + break; + case 57600: + cflag |= B57600; + break; + case 115200: + cflag |= B115200; + break; + case 9600: + default: + cflag |= B9600; + break; + } + + tty->termios->c_cflag = cflag; + if (tty->driver->set_termios) + tty->driver->set_termios(tty, &old_termios); + unlock_kernel(); + priv->io.speed = speed; - mutex_unlock(&tty->termios_mutex); return 0; } @@ -166,8 +202,8 @@ static int irtty_set_dtr_rts(struct sir_dev *dev, int dtr, int rts) * This function is not yet defined for all tty driver, so * let's be careful... Jean II */ - IRDA_ASSERT(priv->tty->ops->tiocmset != NULL, return -1;); - priv->tty->ops->tiocmset(priv->tty, NULL, set, clear); + IRDA_ASSERT(priv->tty->driver->tiocmset != NULL, return -1;); + priv->tty->driver->tiocmset(priv->tty, NULL, set, clear); return 0; } @@ -189,13 +225,17 @@ static int irtty_do_write(struct sir_dev *dev, const unsigned char *ptr, size_t IRDA_ASSERT(priv->magic == IRTTY_MAGIC, return -1;); tty = priv->tty; - if (!tty->ops->write) + if (!tty->driver->write) return 0; tty->flags |= (1 << TTY_DO_WRITE_WAKEUP); - writelen = tty_write_room(tty); - if (writelen > len) + if (tty->driver->write_room) { + writelen = tty->driver->write_room(tty); + if (writelen > len) + writelen = len; + } + else writelen = len; - return tty->ops->write(tty, ptr, writelen); + return tty->driver->write(tty, ptr, writelen); } /* ------------------------------------------------------- */ @@ -281,7 +321,7 @@ static inline void irtty_stop_receiver(struct tty_struct *tty, int stop) struct ktermios old_termios; int cflag; - mutex_lock(&tty->termios_mutex); + lock_kernel(); old_termios = *(tty->termios); cflag = tty->termios->c_cflag; @@ -291,9 +331,9 @@ static inline void irtty_stop_receiver(struct tty_struct *tty, int stop) cflag |= CREAD; tty->termios->c_cflag = cflag; - if (tty->ops->set_termios) - tty->ops->set_termios(tty, &old_termios); - mutex_unlock(&tty->termios_mutex); + if (tty->driver->set_termios) + tty->driver->set_termios(tty, &old_termios); + unlock_kernel(); } /*****************************************************************/ @@ -319,8 +359,8 @@ static int irtty_start_dev(struct sir_dev *dev) tty = priv->tty; - if (tty->ops->start) - tty->ops->start(tty); + if (tty->driver->start) + tty->driver->start(tty); /* Make sure we can receive more data */ irtty_stop_receiver(tty, FALSE); @@ -348,8 +388,8 @@ static int irtty_stop_dev(struct sir_dev *dev) /* Make sure we don't receive more data */ irtty_stop_receiver(tty, TRUE); - if (tty->ops->stop) - tty->ops->stop(tty); + if (tty->driver->stop) + tty->driver->stop(tty); mutex_unlock(&irtty_mutex); @@ -443,10 +483,11 @@ static int irtty_open(struct tty_struct *tty) /* stop the underlying driver */ irtty_stop_receiver(tty, TRUE); - if (tty->ops->stop) - tty->ops->stop(tty); + if (tty->driver->stop) + tty->driver->stop(tty); - tty_driver_flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); /* apply mtt override */ sir_tty_drv.qos_mtt_bits = qos_mtt_bits; @@ -523,8 +564,8 @@ static void irtty_close(struct tty_struct *tty) /* Stop tty */ irtty_stop_receiver(tty, TRUE); tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP); - if (tty->ops->stop) - tty->ops->stop(tty); + if (tty->driver->stop) + tty->driver->stop(tty); kfree(priv); diff --git a/trunk/drivers/net/ppp_async.c b/trunk/drivers/net/ppp_async.c index f1a52def1241..f023d5b67e6e 100644 --- a/trunk/drivers/net/ppp_async.c +++ b/trunk/drivers/net/ppp_async.c @@ -158,9 +158,6 @@ ppp_asynctty_open(struct tty_struct *tty) struct asyncppp *ap; int err; - if (tty->ops->write == NULL) - return -EOPNOTSUPP; - err = -ENOMEM; ap = kzalloc(sizeof(*ap), GFP_KERNEL); if (!ap) @@ -361,7 +358,9 @@ ppp_asynctty_receive(struct tty_struct *tty, const unsigned char *buf, if (!skb_queue_empty(&ap->rqueue)) tasklet_schedule(&ap->tsk); ap_put(ap); - tty_unthrottle(tty); + if (test_and_clear_bit(TTY_THROTTLED, &tty->flags) + && tty->driver->unthrottle) + tty->driver->unthrottle(tty); } static void @@ -677,7 +676,7 @@ ppp_async_push(struct asyncppp *ap) if (!tty_stuffed && ap->optr < ap->olim) { avail = ap->olim - ap->optr; set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); - sent = tty->ops->write(tty, ap->optr, avail); + sent = tty->driver->write(tty, ap->optr, avail); if (sent < 0) goto flush; /* error, e.g. loss of CD */ ap->optr += sent; diff --git a/trunk/drivers/net/ppp_synctty.c b/trunk/drivers/net/ppp_synctty.c index b8f0369a71e7..0d80fa546719 100644 --- a/trunk/drivers/net/ppp_synctty.c +++ b/trunk/drivers/net/ppp_synctty.c @@ -207,9 +207,6 @@ ppp_sync_open(struct tty_struct *tty) struct syncppp *ap; int err; - if (tty->ops->write == NULL) - return -EOPNOTSUPP; - ap = kzalloc(sizeof(*ap), GFP_KERNEL); err = -ENOMEM; if (!ap) @@ -401,7 +398,9 @@ ppp_sync_receive(struct tty_struct *tty, const unsigned char *buf, if (!skb_queue_empty(&ap->rqueue)) tasklet_schedule(&ap->tsk); sp_put(ap); - tty_unthrottle(tty); + if (test_and_clear_bit(TTY_THROTTLED, &tty->flags) + && tty->driver->unthrottle) + tty->driver->unthrottle(tty); } static void @@ -654,7 +653,7 @@ ppp_sync_push(struct syncppp *ap) tty_stuffed = 0; if (!tty_stuffed && ap->tpkt) { set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); - sent = tty->ops->write(tty, ap->tpkt->data, ap->tpkt->len); + sent = tty->driver->write(tty, ap->tpkt->data, ap->tpkt->len); if (sent < 0) goto flush; /* error, e.g. loss of CD */ if (sent < ap->tpkt->len) { diff --git a/trunk/drivers/net/slip.c b/trunk/drivers/net/slip.c index 84af68fdb6c2..5a55ede352f4 100644 --- a/trunk/drivers/net/slip.c +++ b/trunk/drivers/net/slip.c @@ -396,14 +396,14 @@ static void sl_encaps(struct slip *sl, unsigned char *icp, int len) /* Order of next two lines is *very* important. * When we are sending a little amount of data, - * the transfer may be completed inside the ops->write() + * the transfer may be completed inside driver.write() * routine, because it's running with interrupts enabled. * In this case we *never* got WRITE_WAKEUP event, * if we did not request it before write operation. * 14 Oct 1994 Dmitry Gorodchanin. */ sl->tty->flags |= (1 << TTY_DO_WRITE_WAKEUP); - actual = sl->tty->ops->write(sl->tty, sl->xbuff, count); + actual = sl->tty->driver->write(sl->tty, sl->xbuff, count); #ifdef SL_CHECK_TRANSMIT sl->dev->trans_start = jiffies; #endif @@ -437,7 +437,7 @@ static void slip_write_wakeup(struct tty_struct *tty) return; } - actual = tty->ops->write(tty, sl->xhead, sl->xleft); + actual = tty->driver->write(tty, sl->xhead, sl->xleft); sl->xleft -= actual; sl->xhead += actual; } @@ -462,7 +462,7 @@ static void sl_tx_timeout(struct net_device *dev) } printk(KERN_WARNING "%s: transmit timed out, %s?\n", dev->name, - (tty_chars_in_buffer(sl->tty) || sl->xleft) ? + (sl->tty->driver->chars_in_buffer(sl->tty) || sl->xleft) ? "bad line quality" : "driver error"); sl->xleft = 0; sl->tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP); @@ -830,9 +830,6 @@ static int slip_open(struct tty_struct *tty) if (!capable(CAP_NET_ADMIN)) return -EPERM; - if (tty->ops->write == NULL) - return -EOPNOTSUPP; - /* RTnetlink lock is misused here to serialize concurrent opens of slip channels. There are better ways, but it is the simplest one. @@ -1435,7 +1432,7 @@ static void sl_outfill(unsigned long sls) /* put END into tty queue. Is it right ??? */ if (!netif_queue_stopped(sl->dev)) { /* if device busy no outfill */ - sl->tty->ops->write(sl->tty, &s, 1); + sl->tty->driver->write(sl->tty, &s, 1); } } else set_bit(SLF_OUTWAIT, &sl->flags); diff --git a/trunk/drivers/net/wan/pc300_tty.c b/trunk/drivers/net/wan/pc300_tty.c index e03eef2f2282..63abfd72542d 100644 --- a/trunk/drivers/net/wan/pc300_tty.c +++ b/trunk/drivers/net/wan/pc300_tty.c @@ -178,20 +178,6 @@ static void cpc_tty_signal_on(pc300dev_t *pc300dev, unsigned char signal) CPC_TTY_UNLOCK(card,flags); } - -static const struct tty_operations pc300_ops = { - .open = cpc_tty_open, - .close = cpc_tty_close, - .write = cpc_tty_write, - .write_room = cpc_tty_write_room, - .chars_in_buffer = cpc_tty_chars_in_buffer, - .tiocmset = pc300_tiocmset, - .tiocmget = pc300_tiocmget, - .flush_buffer = cpc_tty_flush_buffer, - .hangup = cpc_tty_hangup, -}; - - /* * PC300 TTY initialization routine * @@ -239,7 +225,15 @@ void cpc_tty_init(pc300dev_t *pc300dev) serial_drv.flags = TTY_DRIVER_REAL_RAW; /* interface routines from the upper tty layer to the tty driver */ - tty_set_operations(&serial_drv, &pc300_ops); + serial_drv.open = cpc_tty_open; + serial_drv.close = cpc_tty_close; + serial_drv.write = cpc_tty_write; + serial_drv.write_room = cpc_tty_write_room; + serial_drv.chars_in_buffer = cpc_tty_chars_in_buffer; + serial_drv.tiocmset = pc300_tiocmset; + serial_drv.tiocmget = pc300_tiocmget; + serial_drv.flush_buffer = cpc_tty_flush_buffer; + serial_drv.hangup = cpc_tty_hangup; /* register the TTY driver */ if (tty_register_driver(&serial_drv)) { diff --git a/trunk/drivers/net/wan/x25_asy.c b/trunk/drivers/net/wan/x25_asy.c index 249e18053d5f..0f8aca8a4d43 100644 --- a/trunk/drivers/net/wan/x25_asy.c +++ b/trunk/drivers/net/wan/x25_asy.c @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include #include @@ -95,7 +95,7 @@ static struct x25_asy *x25_asy_alloc(void) x25_asy_devs[i] = dev; return sl; } else { - printk(KERN_WARNING "x25_asy_alloc() - register_netdev() failure.\n"); + printk("x25_asy_alloc() - register_netdev() failure.\n"); free_netdev(dev); } } @@ -112,22 +112,23 @@ static void x25_asy_free(struct x25_asy *sl) kfree(sl->xbuff); sl->xbuff = NULL; - if (!test_and_clear_bit(SLF_INUSE, &sl->flags)) - printk(KERN_ERR "%s: x25_asy_free for already free unit.\n", - sl->dev->name); + if (!test_and_clear_bit(SLF_INUSE, &sl->flags)) { + printk("%s: x25_asy_free for already free unit.\n", sl->dev->name); + } } static int x25_asy_change_mtu(struct net_device *dev, int newmtu) { struct x25_asy *sl = dev->priv; unsigned char *xbuff, *rbuff; - int len = 2 * newmtu; + int len = 2* newmtu; xbuff = kmalloc(len + 4, GFP_ATOMIC); rbuff = kmalloc(len + 4, GFP_ATOMIC); - if (xbuff == NULL || rbuff == NULL) { - printk(KERN_WARNING "%s: unable to grow X.25 buffers, MTU change cancelled.\n", + if (xbuff == NULL || rbuff == NULL) + { + printk("%s: unable to grow X.25 buffers, MTU change cancelled.\n", dev->name); kfree(xbuff); kfree(rbuff); @@ -192,23 +193,25 @@ static void x25_asy_bump(struct x25_asy *sl) int err; count = sl->rcount; - sl->stats.rx_bytes += count; - + sl->stats.rx_bytes+=count; + skb = dev_alloc_skb(count+1); - if (skb == NULL) { - printk(KERN_WARNING "%s: memory squeeze, dropping packet.\n", - sl->dev->name); + if (skb == NULL) + { + printk("%s: memory squeeze, dropping packet.\n", sl->dev->name); sl->stats.rx_dropped++; return; } - skb_push(skb, 1); /* LAPB internal control */ - memcpy(skb_put(skb, count), sl->rbuff, count); + skb_push(skb,1); /* LAPB internal control */ + memcpy(skb_put(skb,count), sl->rbuff, count); skb->protocol = x25_type_trans(skb, sl->dev); - err = lapb_data_received(skb->dev, skb); - if (err != LAPB_OK) { + if((err=lapb_data_received(skb->dev, skb))!=LAPB_OK) + { kfree_skb(skb); - printk(KERN_DEBUG "x25_asy: data received err - %d\n", err); - } else { + printk(KERN_DEBUG "x25_asy: data received err - %d\n",err); + } + else + { netif_rx(skb); sl->dev->last_rx = jiffies; sl->stats.rx_packets++; @@ -221,11 +224,10 @@ static void x25_asy_encaps(struct x25_asy *sl, unsigned char *icp, int len) unsigned char *p; int actual, count, mtu = sl->dev->mtu; - if (len > mtu) { - /* Sigh, shouldn't occur BUT ... */ + if (len > mtu) + { /* Sigh, shouldn't occur BUT ... */ len = mtu; - printk(KERN_DEBUG "%s: truncating oversized transmit packet!\n", - sl->dev->name); + printk ("%s: truncating oversized transmit packet!\n", sl->dev->name); sl->stats.tx_dropped++; x25_asy_unlock(sl); return; @@ -243,7 +245,7 @@ static void x25_asy_encaps(struct x25_asy *sl, unsigned char *icp, int len) * 14 Oct 1994 Dmitry Gorodchanin. */ sl->tty->flags |= (1 << TTY_DO_WRITE_WAKEUP); - actual = sl->tty->ops->write(sl->tty, sl->xbuff, count); + actual = sl->tty->driver->write(sl->tty, sl->xbuff, count); sl->xleft = count - actual; sl->xhead = sl->xbuff + actual; /* VSV */ @@ -263,7 +265,8 @@ static void x25_asy_write_wakeup(struct tty_struct *tty) if (!sl || sl->magic != X25_ASY_MAGIC || !netif_running(sl->dev)) return; - if (sl->xleft <= 0) { + if (sl->xleft <= 0) + { /* Now serial buffer is almost free & we can start * transmission of another packet */ sl->stats.tx_packets++; @@ -272,14 +275,14 @@ static void x25_asy_write_wakeup(struct tty_struct *tty) return; } - actual = tty->ops->write(tty, sl->xhead, sl->xleft); + actual = tty->driver->write(tty, sl->xhead, sl->xleft); sl->xleft -= actual; sl->xhead += actual; } static void x25_asy_timeout(struct net_device *dev) { - struct x25_asy *sl = dev->priv; + struct x25_asy *sl = (struct x25_asy*)(dev->priv); spin_lock(&sl->lock); if (netif_queue_stopped(dev)) { @@ -287,7 +290,7 @@ static void x25_asy_timeout(struct net_device *dev) * 14 Oct 1994 Dmitry Gorodchanin. */ printk(KERN_WARNING "%s: transmit timed out, %s?\n", dev->name, - (tty_chars_in_buffer(sl->tty) || sl->xleft) ? + (sl->tty->driver->chars_in_buffer(sl->tty) || sl->xleft) ? "bad line quality" : "driver error"); sl->xleft = 0; sl->tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP); @@ -300,34 +303,31 @@ static void x25_asy_timeout(struct net_device *dev) static int x25_asy_xmit(struct sk_buff *skb, struct net_device *dev) { - struct x25_asy *sl = dev->priv; + struct x25_asy *sl = (struct x25_asy*)(dev->priv); int err; if (!netif_running(sl->dev)) { - printk(KERN_ERR "%s: xmit call when iface is down\n", - dev->name); + printk("%s: xmit call when iface is down\n", dev->name); kfree_skb(skb); return 0; } - - switch (skb->data[0]) { - case 0x00: - break; - case 0x01: /* Connection request .. do nothing */ - err = lapb_connect_request(dev); - if (err != LAPB_OK) - printk(KERN_ERR "x25_asy: lapb_connect_request error - %d\n", err); - kfree_skb(skb); - return 0; - case 0x02: /* Disconnect request .. do nothing - hang up ?? */ - err = lapb_disconnect_request(dev); - if (err != LAPB_OK) - printk(KERN_ERR "x25_asy: lapb_disconnect_request error - %d\n", err); - default: - kfree_skb(skb); - return 0; + + switch(skb->data[0]) + { + case 0x00:break; + case 0x01: /* Connection request .. do nothing */ + if((err=lapb_connect_request(dev))!=LAPB_OK) + printk(KERN_ERR "x25_asy: lapb_connect_request error - %d\n", err); + kfree_skb(skb); + return 0; + case 0x02: /* Disconnect request .. do nothing - hang up ?? */ + if((err=lapb_disconnect_request(dev))!=LAPB_OK) + printk(KERN_ERR "x25_asy: lapb_disconnect_request error - %d\n", err); + default: + kfree_skb(skb); + return 0; } - skb_pull(skb, 1); /* Remove control byte */ + skb_pull(skb,1); /* Remove control byte */ /* * If we are busy already- too bad. We ought to be able * to queue things at this point, to allow for a little @@ -338,10 +338,10 @@ static int x25_asy_xmit(struct sk_buff *skb, struct net_device *dev) * So, no queues ! * 14 Oct 1994 Dmitry Gorodchanin. */ - - err = lapb_data_request(dev, skb); - if (err != LAPB_OK) { - printk(KERN_ERR "x25_asy: lapb_data_request error - %d\n", err); + + if((err=lapb_data_request(dev,skb))!=LAPB_OK) + { + printk(KERN_ERR "lapbeth: lapb_data_request error - %d\n", err); kfree_skb(skb); return 0; } @@ -357,7 +357,7 @@ static int x25_asy_xmit(struct sk_buff *skb, struct net_device *dev) * Called when I frame data arrives. We did the work above - throw it * at the net layer. */ - + static int x25_asy_data_indication(struct net_device *dev, struct sk_buff *skb) { skb->dev->last_rx = jiffies; @@ -369,22 +369,24 @@ static int x25_asy_data_indication(struct net_device *dev, struct sk_buff *skb) * busy cases too well. Its tricky to see how to do this nicely - * perhaps lapb should allow us to bounce this ? */ - + static void x25_asy_data_transmit(struct net_device *dev, struct sk_buff *skb) { - struct x25_asy *sl = dev->priv; - + struct x25_asy *sl=dev->priv; + spin_lock(&sl->lock); - if (netif_queue_stopped(sl->dev) || sl->tty == NULL) { + if (netif_queue_stopped(sl->dev) || sl->tty == NULL) + { spin_unlock(&sl->lock); printk(KERN_ERR "x25_asy: tbusy drop\n"); kfree_skb(skb); return; } /* We were not busy, so we are now... :-) */ - if (skb != NULL) { + if (skb != NULL) + { x25_asy_lock(sl); - sl->stats.tx_bytes += skb->len; + sl->stats.tx_bytes+=skb->len; x25_asy_encaps(sl, skb->data, skb->len); dev_kfree_skb(skb); } @@ -394,16 +396,15 @@ static void x25_asy_data_transmit(struct net_device *dev, struct sk_buff *skb) /* * LAPB connection establish/down information. */ - + static void x25_asy_connected(struct net_device *dev, int reason) { struct x25_asy *sl = dev->priv; struct sk_buff *skb; unsigned char *ptr; - skb = dev_alloc_skb(1); - if (skb == NULL) { - printk(KERN_ERR "x25_asy: out of memory\n"); + if ((skb = dev_alloc_skb(1)) == NULL) { + printk(KERN_ERR "lapbeth: out of memory\n"); return; } @@ -421,8 +422,7 @@ static void x25_asy_disconnected(struct net_device *dev, int reason) struct sk_buff *skb; unsigned char *ptr; - skb = dev_alloc_skb(1); - if (skb == NULL) { + if ((skb = dev_alloc_skb(1)) == NULL) { printk(KERN_ERR "x25_asy: out of memory\n"); return; } @@ -449,7 +449,7 @@ static struct lapb_register_struct x25_asy_callbacks = { /* Open the low-level part of the X.25 channel. Easy! */ static int x25_asy_open(struct net_device *dev) { - struct x25_asy *sl = dev->priv; + struct x25_asy *sl = (struct x25_asy*)(dev->priv); unsigned long len; int err; @@ -466,11 +466,13 @@ static int x25_asy_open(struct net_device *dev) len = dev->mtu * 2; sl->rbuff = kmalloc(len + 4, GFP_KERNEL); - if (sl->rbuff == NULL) + if (sl->rbuff == NULL) { goto norbuff; + } sl->xbuff = kmalloc(len + 4, GFP_KERNEL); - if (sl->xbuff == NULL) + if (sl->xbuff == NULL) { goto noxbuff; + } sl->buffsize = len; sl->rcount = 0; @@ -478,12 +480,11 @@ static int x25_asy_open(struct net_device *dev) sl->flags &= (1 << SLF_INUSE); /* Clear ESCAPE & ERROR flags */ netif_start_queue(dev); - + /* * Now attach LAPB */ - err = lapb_register(dev, &x25_asy_callbacks); - if (err == LAPB_OK) + if((err=lapb_register(dev, &x25_asy_callbacks))==LAPB_OK) return 0; /* Cleanup */ @@ -498,20 +499,18 @@ static int x25_asy_open(struct net_device *dev) /* Close the low-level part of the X.25 channel. Easy! */ static int x25_asy_close(struct net_device *dev) { - struct x25_asy *sl = dev->priv; + struct x25_asy *sl = (struct x25_asy*)(dev->priv); int err; spin_lock(&sl->lock); - if (sl->tty) + if (sl->tty) sl->tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP); netif_stop_queue(dev); sl->rcount = 0; sl->xleft = 0; - err = lapb_unregister(dev); - if (err != LAPB_OK) - printk(KERN_ERR "x25_asy_close: lapb_unregister error -%d\n", - err); + if((err=lapb_unregister(dev))!=LAPB_OK) + printk(KERN_ERR "x25_asy_close: lapb_unregister error -%d\n",err); spin_unlock(&sl->lock); return 0; } @@ -522,9 +521,8 @@ static int x25_asy_close(struct net_device *dev) * a block of X.25 data has been received, which can now be decapsulated * and sent on to some IP layer for further processing. */ - -static void x25_asy_receive_buf(struct tty_struct *tty, - const unsigned char *cp, char *fp, int count) + +static void x25_asy_receive_buf(struct tty_struct *tty, const unsigned char *cp, char *fp, int count) { struct x25_asy *sl = (struct x25_asy *) tty->disc_data; @@ -535,8 +533,9 @@ static void x25_asy_receive_buf(struct tty_struct *tty, /* Read the characters out of the buffer */ while (count--) { if (fp && *fp++) { - if (!test_and_set_bit(SLF_ERROR, &sl->flags)) + if (!test_and_set_bit(SLF_ERROR, &sl->flags)) { sl->stats.rx_errors++; + } cp++; continue; } @@ -557,31 +556,31 @@ static int x25_asy_open_tty(struct tty_struct *tty) struct x25_asy *sl = (struct x25_asy *) tty->disc_data; int err; - if (tty->ops->write == NULL) - return -EOPNOTSUPP; - /* First make sure we're not already connected. */ - if (sl && sl->magic == X25_ASY_MAGIC) + if (sl && sl->magic == X25_ASY_MAGIC) { return -EEXIST; + } /* OK. Find a free X.25 channel to use. */ - sl = x25_asy_alloc(); - if (sl == NULL) + if ((sl = x25_asy_alloc()) == NULL) { return -ENFILE; + } sl->tty = tty; tty->disc_data = sl; tty->receive_room = 65536; - tty_driver_flush_buffer(tty); + if (tty->driver->flush_buffer) { + tty->driver->flush_buffer(tty); + } tty_ldisc_flush(tty); /* Restore default settings */ sl->dev->type = ARPHRD_X25; - + /* Perform the low-level X.25 async init */ - err = x25_asy_open(sl->dev); - if (err) + if ((err = x25_asy_open(sl->dev))) return err; + /* Done. We have linked the TTY line to a channel. */ return sl->dev->base_addr; } @@ -602,7 +601,9 @@ static void x25_asy_close_tty(struct tty_struct *tty) return; if (sl->dev->flags & IFF_UP) - dev_close(sl->dev); + { + (void) dev_close(sl->dev); + } tty->disc_data = NULL; sl->tty = NULL; @@ -612,7 +613,8 @@ static void x25_asy_close_tty(struct tty_struct *tty) static struct net_device_stats *x25_asy_get_stats(struct net_device *dev) { - struct x25_asy *sl = dev->priv; + struct x25_asy *sl = (struct x25_asy*)(dev->priv); + return &sl->stats; } @@ -639,19 +641,21 @@ int x25_asy_esc(unsigned char *s, unsigned char *d, int len) * character sequence, according to the X.25 protocol. */ - while (len-- > 0) { - switch (c = *s++) { - case X25_END: - *ptr++ = X25_ESC; - *ptr++ = X25_ESCAPE(X25_END); - break; - case X25_ESC: - *ptr++ = X25_ESC; - *ptr++ = X25_ESCAPE(X25_ESC); - break; - default: - *ptr++ = c; - break; + while (len-- > 0) + { + switch(c = *s++) + { + case X25_END: + *ptr++ = X25_ESC; + *ptr++ = X25_ESCAPE(X25_END); + break; + case X25_ESC: + *ptr++ = X25_ESC; + *ptr++ = X25_ESCAPE(X25_ESC); + break; + default: + *ptr++ = c; + break; } } *ptr++ = X25_END; @@ -661,25 +665,31 @@ int x25_asy_esc(unsigned char *s, unsigned char *d, int len) static void x25_asy_unesc(struct x25_asy *sl, unsigned char s) { - switch (s) { - case X25_END: - if (!test_and_clear_bit(SLF_ERROR, &sl->flags) - && sl->rcount > 2) - x25_asy_bump(sl); - clear_bit(SLF_ESCAPE, &sl->flags); - sl->rcount = 0; - return; - case X25_ESC: - set_bit(SLF_ESCAPE, &sl->flags); - return; - case X25_ESCAPE(X25_ESC): - case X25_ESCAPE(X25_END): - if (test_and_clear_bit(SLF_ESCAPE, &sl->flags)) - s = X25_UNESCAPE(s); - break; - } - if (!test_bit(SLF_ERROR, &sl->flags)) { - if (sl->rcount < sl->buffsize) { + switch(s) + { + case X25_END: + if (!test_and_clear_bit(SLF_ERROR, &sl->flags) && (sl->rcount > 2)) + { + x25_asy_bump(sl); + } + clear_bit(SLF_ESCAPE, &sl->flags); + sl->rcount = 0; + return; + + case X25_ESC: + set_bit(SLF_ESCAPE, &sl->flags); + return; + + case X25_ESCAPE(X25_ESC): + case X25_ESCAPE(X25_END): + if (test_and_clear_bit(SLF_ESCAPE, &sl->flags)) + s = X25_UNESCAPE(s); + break; + } + if (!test_bit(SLF_ERROR, &sl->flags)) + { + if (sl->rcount < sl->buffsize) + { sl->rbuff[sl->rcount++] = s; return; } @@ -699,7 +709,7 @@ static int x25_asy_ioctl(struct tty_struct *tty, struct file *file, if (!sl || sl->magic != X25_ASY_MAGIC) return -EINVAL; - switch (cmd) { + switch(cmd) { case SIOCGIFNAME: if (copy_to_user((void __user *)arg, sl->dev->name, strlen(sl->dev->name) + 1)) @@ -714,8 +724,8 @@ static int x25_asy_ioctl(struct tty_struct *tty, struct file *file, static int x25_asy_open_dev(struct net_device *dev) { - struct x25_asy *sl = dev->priv; - if (sl->tty == NULL) + struct x25_asy *sl = (struct x25_asy*)(dev->priv); + if(sl->tty==NULL) return -ENODEV; return 0; } @@ -731,9 +741,9 @@ static void x25_asy_setup(struct net_device *dev) set_bit(SLF_INUSE, &sl->flags); /* - * Finish setting up the DEVICE info. + * Finish setting up the DEVICE info. */ - + dev->mtu = SL_MTU; dev->hard_start_xmit = x25_asy_xmit; dev->tx_timeout = x25_asy_timeout; @@ -768,10 +778,9 @@ static int __init init_x25_asy(void) x25_asy_maxdev = 4; /* Sanity */ printk(KERN_INFO "X.25 async: version 0.00 ALPHA " - "(dynamic channels, max=%d).\n", x25_asy_maxdev); + "(dynamic channels, max=%d).\n", x25_asy_maxdev ); - x25_asy_devs = kcalloc(x25_asy_maxdev, sizeof(struct net_device *), - GFP_KERNEL); + x25_asy_devs = kcalloc(x25_asy_maxdev, sizeof(struct net_device*), GFP_KERNEL); if (!x25_asy_devs) { printk(KERN_WARNING "X25 async: Can't allocate x25_asy_ctrls[] " "array! Uaargh! (-> No X.25 available)\n"); @@ -793,7 +802,7 @@ static void __exit exit_x25_asy(void) struct x25_asy *sl = dev->priv; spin_lock_bh(&sl->lock); - if (sl->tty) + if (sl->tty) tty_hangup(sl->tty); spin_unlock_bh(&sl->lock); diff --git a/trunk/drivers/net/wireless/strip.c b/trunk/drivers/net/wireless/strip.c index 5dd23c93497d..bced3fe1cf8a 100644 --- a/trunk/drivers/net/wireless/strip.c +++ b/trunk/drivers/net/wireless/strip.c @@ -768,17 +768,41 @@ static __u8 *UnStuffData(__u8 * src, __u8 * end, __u8 * dst, /* General routines for STRIP */ /* - * set_baud sets the baud rate to the rate defined by baudcode + * get_baud returns the current baud rate, as one of the constants defined in + * termbits.h + * If the user has issued a baud rate override using the 'setserial' command + * and the logical current rate is set to 38.4, then the true baud rate + * currently in effect (57.6 or 115.2) is returned. */ -static void set_baud(struct tty_struct *tty, speed_t baudrate) +static unsigned int get_baud(struct tty_struct *tty) { - struct ktermios old_termios; + if (!tty || !tty->termios) + return (0); + if ((tty->termios->c_cflag & CBAUD) == B38400 && tty->driver_data) { + struct async_struct *info = + (struct async_struct *) tty->driver_data; + if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) + return (B57600); + if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI) + return (B115200); + } + return (tty->termios->c_cflag & CBAUD); +} - mutex_lock(&tty->termios_mutex); - old_termios =*(tty->termios); - tty_encode_baud_rate(tty, baudrate, baudrate); - tty->ops->set_termios(tty, &old_termios); - mutex_unlock(&tty->termios_mutex); +/* + * set_baud sets the baud rate to the rate defined by baudcode + * Note: The rate B38400 should be avoided, because the user may have + * issued a 'setserial' speed override to map that to a different speed. + * We could achieve a true rate of 38400 if we needed to by cancelling + * any user speed override that is in place, but that might annoy the + * user, so it is simplest to just avoid using 38400. + */ +static void set_baud(struct tty_struct *tty, unsigned int baudcode) +{ + struct ktermios old_termios = *(tty->termios); + tty->termios->c_cflag &= ~CBAUD; /* Clear the old baud setting */ + tty->termios->c_cflag |= baudcode; /* Set the new baud setting */ + tty->driver->set_termios(tty, &old_termios); } /* @@ -1193,7 +1217,7 @@ static void ResetRadio(struct strip *strip_info) strip_info->watchdog_doreset = jiffies + 1 * HZ; /* If the user has selected a baud rate above 38.4 see what magic we have to do */ - if (strip_info->user_baud > 38400) { + if (strip_info->user_baud > B38400) { /* * Subtle stuff: Pay attention :-) * If the serial port is currently at the user's selected (>38.4) rate, @@ -1203,17 +1227,17 @@ static void ResetRadio(struct strip *strip_info) * issued the ATS304 command last time through, so this time we restore * the user's selected rate and issue the normal starmode reset string. */ - if (strip_info->user_baud == tty_get_baud_rate(tty)) { + if (strip_info->user_baud == get_baud(tty)) { static const char b0[] = "ate0q1s304=57600\r"; static const char b1[] = "ate0q1s304=115200\r"; static const StringDescriptor baudstring[2] = { {b0, sizeof(b0) - 1} , {b1, sizeof(b1) - 1} }; - set_baud(tty, 19200); - if (strip_info->user_baud == 57600) + set_baud(tty, B19200); + if (strip_info->user_baud == B57600) s = baudstring[0]; - else if (strip_info->user_baud == 115200) + else if (strip_info->user_baud == B115200) s = baudstring[1]; else s = baudstring[1]; /* For now */ @@ -1221,7 +1245,7 @@ static void ResetRadio(struct strip *strip_info) set_baud(tty, strip_info->user_baud); } - tty->ops->write(tty, s.string, s.length); + tty->driver->write(tty, s.string, s.length); #ifdef EXT_COUNTERS strip_info->tx_ebytes += s.length; #endif @@ -1243,7 +1267,7 @@ static void strip_write_some_more(struct tty_struct *tty) if (strip_info->tx_left > 0) { int num_written = - tty->ops->write(tty, strip_info->tx_head, + tty->driver->write(tty, strip_info->tx_head, strip_info->tx_left); strip_info->tx_left -= num_written; strip_info->tx_head += num_written; @@ -2433,7 +2457,7 @@ static int strip_open_low(struct net_device *dev) strip_info->working = FALSE; strip_info->firmware_level = NoStructure; strip_info->next_command = CompatibilityCommand; - strip_info->user_baud = tty_get_baud_rate(strip_info->tty); + strip_info->user_baud = get_baud(strip_info->tty); printk(KERN_INFO "%s: Initializing Radio.\n", strip_info->dev->name); @@ -2607,13 +2631,6 @@ static int strip_open(struct tty_struct *tty) if (strip_info && strip_info->magic == STRIP_MAGIC) return -EEXIST; - /* - * We need a write method. - */ - - if (tty->ops->write == NULL) - return -EOPNOTSUPP; - /* * OK. Find a free STRIP channel to use. */ @@ -2635,7 +2652,8 @@ static int strip_open(struct tty_struct *tty) tty->disc_data = strip_info; tty->receive_room = 65536; - tty_driver_flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); /* * Restore default settings diff --git a/trunk/drivers/parport/ieee1284.c b/trunk/drivers/parport/ieee1284.c index 0338b0912674..54a6ef72906e 100644 --- a/trunk/drivers/parport/ieee1284.c +++ b/trunk/drivers/parport/ieee1284.c @@ -76,7 +76,7 @@ int parport_wait_event (struct parport *port, signed long timeout) semaphore. */ return 1; - init_timer_on_stack(&timer); + init_timer (&timer); timer.expires = jiffies + timeout; timer.function = timeout_waiting_on_port; port_from_cookie[port->number % PARPORT_MAX] = port; @@ -88,8 +88,6 @@ int parport_wait_event (struct parport *port, signed long timeout) /* Timed out. */ ret = 1; - destroy_timer_on_stack(&timer); - return ret; } diff --git a/trunk/drivers/parport/parport_gsc.c b/trunk/drivers/parport/parport_gsc.c index e6a7e847ee80..0e77ae2b71a0 100644 --- a/trunk/drivers/parport/parport_gsc.c +++ b/trunk/drivers/parport/parport_gsc.c @@ -365,11 +365,11 @@ static int __devinit parport_init_chip(struct parisc_device *dev) if (boot_cpu_data.cpu_type > pcxt && !pdc_add_valid(port+4)) { /* Initialize bidirectional-mode (0x10) & data-tranfer-mode #1 (0x20) */ - printk("%s: initialize bidirectional-mode.\n", __func__); + printk("%s: initialize bidirectional-mode.\n", __FUNCTION__); parport_writeb ( (0x10 + 0x20), port + 4); } else { - printk("%s: enhanced parport-modes not supported.\n", __func__); + printk("%s: enhanced parport-modes not supported.\n", __FUNCTION__); } p = parport_gsc_probe_port(port, 0, dev->irq, diff --git a/trunk/drivers/parport/parport_pc.c b/trunk/drivers/parport/parport_pc.c index e0c2a4584ec6..e71092e80288 100644 --- a/trunk/drivers/parport/parport_pc.c +++ b/trunk/drivers/parport/parport_pc.c @@ -1415,7 +1415,7 @@ static void __devinit winbond_check(int io, int key) { int devid,devrev,oldid,x_devid,x_devrev,x_oldid; - if (!request_region(io, 3, __func__)) + if (!request_region(io, 3, __FUNCTION__)) return; /* First probe without key */ @@ -1449,7 +1449,7 @@ static void __devinit winbond_check2(int io,int key) { int devid,devrev,oldid,x_devid,x_devrev,x_oldid; - if (!request_region(io, 3, __func__)) + if (!request_region(io, 3, __FUNCTION__)) return; /* First probe without the key */ @@ -1482,7 +1482,7 @@ static void __devinit smsc_check(int io, int key) { int id,rev,oldid,oldrev,x_id,x_rev,x_oldid,x_oldrev; - if (!request_region(io, 3, __func__)) + if (!request_region(io, 3, __FUNCTION__)) return; /* First probe without the key */ @@ -1547,7 +1547,7 @@ static void __devinit detect_and_report_it87(void) u8 r; if (verbose_probing) printk(KERN_DEBUG "IT8705 Super-IO detection, now testing port 2E ...\n"); - if (!request_region(0x2e, 1, __func__)) + if (!request_region(0x2e, 1, __FUNCTION__)) return; outb(0x87, 0x2e); outb(0x01, 0x2e); diff --git a/trunk/drivers/s390/char/con3215.c b/trunk/drivers/s390/char/con3215.c index 3e5653c92f4b..0e1f35c9ed9d 100644 --- a/trunk/drivers/s390/char/con3215.c +++ b/trunk/drivers/s390/char/con3215.c @@ -982,16 +982,15 @@ tty3215_write(struct tty_struct * tty, /* * Put character routine for 3215 ttys */ -static int +static void tty3215_put_char(struct tty_struct *tty, unsigned char ch) { struct raw3215_info *raw; if (!tty) - return 0; + return; raw = (struct raw3215_info *) tty->driver_data; raw3215_putchar(raw, ch); - return 1; } static void diff --git a/trunk/drivers/s390/char/sclp_tty.c b/trunk/drivers/s390/char/sclp_tty.c index 40b11521cd20..e3b3d390b4a3 100644 --- a/trunk/drivers/s390/char/sclp_tty.c +++ b/trunk/drivers/s390/char/sclp_tty.c @@ -412,14 +412,14 @@ sclp_tty_write(struct tty_struct *tty, const unsigned char *buf, int count) * - including previous characters from sclp_tty_put_char() and strings from * sclp_write() without final '\n' - will be written. */ -static int +static void sclp_tty_put_char(struct tty_struct *tty, unsigned char ch) { sclp_tty_chars[sclp_tty_chars_count++] = ch; if (ch == '\n' || sclp_tty_chars_count >= SCLP_TTY_BUF_SIZE) { sclp_tty_write_string(sclp_tty_chars, sclp_tty_chars_count); sclp_tty_chars_count = 0; - } return 1; + } } /* diff --git a/trunk/drivers/s390/char/sclp_vt220.c b/trunk/drivers/s390/char/sclp_vt220.c index 35707c04e613..ed507594e62b 100644 --- a/trunk/drivers/s390/char/sclp_vt220.c +++ b/trunk/drivers/s390/char/sclp_vt220.c @@ -524,15 +524,11 @@ sclp_vt220_close(struct tty_struct *tty, struct file *filp) * NOTE: include/linux/tty_driver.h specifies that a character should be * ignored if there is no room in the queue. This driver implements a different * semantic in that it will block when there is no more room left. - * - * FIXME: putchar can currently be called from BH and other non blocking - * handlers so this semantic isn't a good idea. */ -static int +static void sclp_vt220_put_char(struct tty_struct *tty, unsigned char ch) { __sclp_vt220_write(&ch, 1, 0, 0, 1); - return 1; } /* diff --git a/trunk/drivers/s390/char/tty3270.c b/trunk/drivers/s390/char/tty3270.c index c1f2adefad41..70b1980a08b6 100644 --- a/trunk/drivers/s390/char/tty3270.c +++ b/trunk/drivers/s390/char/tty3270.c @@ -965,7 +965,7 @@ tty3270_write_room(struct tty_struct *tty) * Insert character into the screen at the current position with the * current color and highlight. This function does NOT do cursor movement. */ -static int +static void tty3270_put_character(struct tty3270 *tp, char ch) { struct tty3270_line *line; @@ -986,7 +986,6 @@ tty3270_put_character(struct tty3270 *tp, char ch) cell->character = tp->view.ascebc[(unsigned int) ch]; cell->highlight = tp->highlight; cell->f_color = tp->f_color; - return 1; } /* diff --git a/trunk/drivers/s390/cio/ccwgroup.c b/trunk/drivers/s390/cio/ccwgroup.c index fe1ad1722158..85b2e51a42ae 100644 --- a/trunk/drivers/s390/cio/ccwgroup.c +++ b/trunk/drivers/s390/cio/ccwgroup.c @@ -318,7 +318,7 @@ ccwgroup_online_store (struct device *dev, struct device_attribute *attr, const { struct ccwgroup_device *gdev; struct ccwgroup_driver *gdrv; - unsigned int value; + unsigned long value; int ret; gdev = to_ccwgroupdev(dev); @@ -329,7 +329,9 @@ ccwgroup_online_store (struct device *dev, struct device_attribute *attr, const if (!try_module_get(gdrv->owner)) return -EINVAL; - value = simple_strtoul(buf, NULL, 0); + ret = strict_strtoul(buf, 0, &value); + if (ret) + goto out; ret = count; if (value == 1) ccwgroup_set_online(gdev); @@ -337,6 +339,7 @@ ccwgroup_online_store (struct device *dev, struct device_attribute *attr, const ccwgroup_set_offline(gdev); else ret = -EINVAL; +out: module_put(gdrv->owner); return ret; } diff --git a/trunk/drivers/s390/cio/cmf.c b/trunk/drivers/s390/cio/cmf.c index f4c132ab39ed..2808b6833b9e 100644 --- a/trunk/drivers/s390/cio/cmf.c +++ b/trunk/drivers/s390/cio/cmf.c @@ -1219,16 +1219,21 @@ static ssize_t cmb_enable_store(struct device *dev, { struct ccw_device *cdev; int ret; + unsigned long val; + + ret = strict_strtoul(buf, 16, &val); + if (ret) + return ret; cdev = to_ccwdev(dev); - switch (buf[0]) { - case '0': + switch (val) { + case 0: ret = disable_cmf(cdev); if (ret) dev_info(&cdev->dev, "disable_cmf failed (%d)\n", ret); break; - case '1': + case 1: ret = enable_cmf(cdev); if (ret && ret != -EBUSY) dev_info(&cdev->dev, "enable_cmf failed (%d)\n", ret); diff --git a/trunk/drivers/s390/cio/css.c b/trunk/drivers/s390/cio/css.c index c1afab5f72d6..595e327d2f76 100644 --- a/trunk/drivers/s390/cio/css.c +++ b/trunk/drivers/s390/cio/css.c @@ -705,13 +705,17 @@ css_cm_enable_store(struct device *dev, struct device_attribute *attr, { struct channel_subsystem *css = to_css(dev); int ret; + unsigned long val; + ret = strict_strtoul(buf, 16, &val); + if (ret) + return ret; mutex_lock(&css->mutex); - switch (buf[0]) { - case '0': + switch (val) { + case 0: ret = css->cm_enabled ? chsc_secm(css, 0) : 0; break; - case '1': + case 1: ret = css->cm_enabled ? 0 : chsc_secm(css, 1); break; default: diff --git a/trunk/drivers/s390/cio/device.c b/trunk/drivers/s390/cio/device.c index e0c7adb8958e..abfd601d237a 100644 --- a/trunk/drivers/s390/cio/device.c +++ b/trunk/drivers/s390/cio/device.c @@ -512,8 +512,8 @@ static ssize_t online_store (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct ccw_device *cdev = to_ccwdev(dev); - int i, force; - char *tmp; + int force, ret; + unsigned long i; if (atomic_cmpxchg(&cdev->private->onoff, 0, 1) != 0) return -EAGAIN; @@ -525,25 +525,30 @@ static ssize_t online_store (struct device *dev, struct device_attribute *attr, if (!strncmp(buf, "force\n", count)) { force = 1; i = 1; + ret = 0; } else { force = 0; - i = simple_strtoul(buf, &tmp, 16); + ret = strict_strtoul(buf, 16, &i); } - + if (ret) + goto out; switch (i) { case 0: online_store_handle_offline(cdev); + ret = count; break; case 1: online_store_handle_online(cdev, force); + ret = count; break; default: - count = -EINVAL; + ret = -EINVAL; } +out: if (cdev->drv) module_put(cdev->drv->owner); atomic_set(&cdev->private->onoff, 0); - return count; + return ret; } static ssize_t diff --git a/trunk/drivers/s390/cio/qdio.c b/trunk/drivers/s390/cio/qdio.c index 43876e287370..445cf364e461 100644 --- a/trunk/drivers/s390/cio/qdio.c +++ b/trunk/drivers/s390/cio/qdio.c @@ -3663,11 +3663,11 @@ qdio_performance_stats_show(struct bus_type *bus, char *buf) static ssize_t qdio_performance_stats_store(struct bus_type *bus, const char *buf, size_t count) { - char *tmp; - int i; + unsigned long i; + int ret; - i = simple_strtoul(buf, &tmp, 16); - if ((i == 0) || (i == 1)) { + ret = strict_strtoul(buf, 16, &i); + if (!ret && ((i == 0) || (i == 1))) { if (i == qdio_performance_stats) return count; qdio_performance_stats = i; diff --git a/trunk/drivers/sbus/char/cpwatchdog.c b/trunk/drivers/sbus/char/cpwatchdog.c index 235703414370..a4e758143665 100644 --- a/trunk/drivers/sbus/char/cpwatchdog.c +++ b/trunk/drivers/sbus/char/cpwatchdog.c @@ -637,7 +637,7 @@ static int wd_inittimer(int whichdog) break; default: printk("%s: %s: invalid watchdog id: %i\n", - WD_OBPNAME, __func__, whichdog); + WD_OBPNAME, __FUNCTION__, whichdog); return(1); } if(0 != misc_register(whichmisc)) diff --git a/trunk/drivers/sbus/char/uctrl.c b/trunk/drivers/sbus/char/uctrl.c index 383f32c1d347..44d2ef906ac7 100644 --- a/trunk/drivers/sbus/char/uctrl.c +++ b/trunk/drivers/sbus/char/uctrl.c @@ -393,13 +393,13 @@ static int __init ts102_uctrl_init(void) err = request_irq(driver->irq, uctrl_interrupt, 0, "uctrl", driver); if (err) { printk("%s: unable to register irq %d\n", - __func__, driver->irq); + __FUNCTION__, driver->irq); return err; } if (misc_register(&uctrl_dev)) { printk("%s: unable to get misc minor %d\n", - __func__, uctrl_dev.minor); + __FUNCTION__, uctrl_dev.minor); free_irq(driver->irq, driver); return -ENODEV; } diff --git a/trunk/drivers/serial/68328serial.c b/trunk/drivers/serial/68328serial.c index bbf5bc5892c7..2b8a410e0959 100644 --- a/trunk/drivers/serial/68328serial.c +++ b/trunk/drivers/serial/68328serial.c @@ -200,7 +200,7 @@ static void rs_stop(struct tty_struct *tty) local_irq_restore(flags); } -static int rs_put_char(char ch) +static void rs_put_char(char ch) { int flags, loops = 0; @@ -214,7 +214,6 @@ static int rs_put_char(char ch) UTX_TXDATA = ch; udelay(5); local_irq_restore(flags); - return 1; } static void rs_start(struct tty_struct *tty) @@ -1018,6 +1017,18 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file, tty_wait_until_sent(tty, 0); send_break(info, arg ? arg*(100) : 250); return 0; + case TIOCGSOFTCAR: + error = put_user(C_CLOCAL(tty) ? 1 : 0, + (unsigned long *) arg); + if (error) + return error; + return 0; + case TIOCSSOFTCAR: + get_user(arg, (unsigned long *) arg); + tty->termios->c_cflag = + ((tty->termios->c_cflag & ~CLOCAL) | + (arg ? CLOCAL : 0)); + return 0; case TIOCGSERIAL: if (access_ok(VERIFY_WRITE, (void *) arg, sizeof(struct serial_struct))) @@ -1050,6 +1061,9 @@ static void rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios) { struct m68k_serial *info = (struct m68k_serial *)tty->driver_data; + if (tty->termios->c_cflag == old_termios->c_cflag) + return; + change_speed(info); if ((old_termios->c_cflag & CRTSCTS) && @@ -1126,7 +1140,8 @@ static void rs_close(struct tty_struct *tty, struct file * filp) uart->ustcnt &= ~(USTCNT_RXEN | USTCNT_RX_INTR_MASK); shutdown(info); - rs_flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); tty_ldisc_flush(tty); tty->closing = 0; diff --git a/trunk/drivers/serial/68360serial.c b/trunk/drivers/serial/68360serial.c index d9d4e9552a4d..f59463601874 100644 --- a/trunk/drivers/serial/68360serial.c +++ b/trunk/drivers/serial/68360serial.c @@ -995,10 +995,10 @@ static void rs_360_put_char(struct tty_struct *tty, unsigned char ch) volatile QUICC_BD *bdp; if (serial_paranoia_check(info, tty->name, "rs_put_char")) - return 0; + return; if (!tty) - return 0; + return; bdp = info->tx_cur; while (bdp->status & BD_SC_READY); @@ -1016,7 +1016,6 @@ static void rs_360_put_char(struct tty_struct *tty, unsigned char ch) bdp++; info->tx_cur = (QUICC_BD *)bdp; - return 1; } @@ -1247,7 +1246,7 @@ static int rs_360_tiocmget(struct tty_struct *tty, struct file *file) #ifdef modem_control unsigned char control, status; - if (serial_paranoia_check(info, tty->name, __func__)) + if (serial_paranoia_check(info, tty->name, __FUNCTION__)) return -ENODEV; if (tty->flags & (1 << TTY_IO_ERROR)) @@ -1278,12 +1277,12 @@ static int rs_360_tiocmset(struct tty_struct *tty, struct file *file, ser_info_t *info = (ser_info_t *)tty->driver_data; unsigned int arg; - if (serial_paranoia_check(info, tty->name, __func__)) + if (serial_paranoia_check(info, tty->name, __FUNCTION__)) return -ENODEV; if (tty->flags & (1 << TTY_IO_ERROR)) return -EIO; - /* FIXME: locking on info->mcr */ + if (set & TIOCM_RTS) info->mcr |= UART_MCR_RTS; if (set & TIOCM_DTR) @@ -1437,6 +1436,18 @@ static int rs_360_ioctl(struct tty_struct *tty, struct file * file, return retval; end_break(info); return 0; + case TIOCGSOFTCAR: + /* return put_user(C_CLOCAL(tty) ? 1 : 0, (int *) arg); */ + put_user(C_CLOCAL(tty) ? 1 : 0, (int *) arg); + return 0; + case TIOCSSOFTCAR: + error = get_user(arg, (unsigned int *) arg); + if (error) + return error; + tty->termios->c_cflag = + ((tty->termios->c_cflag & ~CLOCAL) | + (arg ? CLOCAL : 0)); + return 0; #ifdef maybe case TIOCSERGETLSR: /* Get line status register */ return get_lsr_info(info, (unsigned int *) arg); @@ -1654,7 +1665,8 @@ static void rs_360_close(struct tty_struct *tty, struct file * filp) rs_360_wait_until_sent(tty, info->timeout); } shutdown(info); - rs_360_flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); tty_ldisc_flush(tty); tty->closing = 0; info->event = 0; @@ -1705,7 +1717,6 @@ static void rs_360_wait_until_sent(struct tty_struct *tty, int timeout) printk("jiff=%lu...", jiffies); #endif - lock_kernel(); /* We go through the loop at least once because we can't tell * exactly when the last character exits the shifter. There can * be at least two characters waiting to be sent after the buffers @@ -1734,7 +1745,6 @@ static void rs_360_wait_until_sent(struct tty_struct *tty, int timeout) bdp--; } while (bdp->status & BD_SC_READY); current->state = TASK_RUNNING; - unlock_kernel(); #ifdef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT printk("lsr = %d (jiff=%lu)...done\n", lsr, jiffies); #endif diff --git a/trunk/drivers/serial/8250_early.c b/trunk/drivers/serial/8250_early.c index cd898704ba4f..38776e8b064b 100644 --- a/trunk/drivers/serial/8250_early.c +++ b/trunk/drivers/serial/8250_early.c @@ -156,7 +156,7 @@ static int __init parse_options(struct early_serial8250_device *device, port->membase = ioremap(port->mapbase, 64); if (!port->membase) { printk(KERN_ERR "%s: Couldn't ioremap 0x%llx\n", - __func__, + __FUNCTION__, (unsigned long long)port->mapbase); return -ENOMEM; } diff --git a/trunk/drivers/serial/Kconfig b/trunk/drivers/serial/Kconfig index 36acbcca2d48..34b809e3b596 100644 --- a/trunk/drivers/serial/Kconfig +++ b/trunk/drivers/serial/Kconfig @@ -1355,47 +1355,4 @@ config SERIAL_SC26XX_CONSOLE help Support for Console on SC2681/SC2692 serial ports. -config SERIAL_BFIN_SPORT - tristate "Blackfin SPORT emulate UART (EXPERIMENTAL)" - depends on BFIN && EXPERIMENTAL - select SERIAL_CORE - help - Enble support SPORT emulate UART on Blackfin series. - - To compile this driver as a module, choose M here: the - module will be called bfin_sport_uart. - -choice - prompt "Baud rate for Blackfin SPORT UART" - depends on SERIAL_BFIN_SPORT - default SERIAL_SPORT_BAUD_RATE_57600 - help - Choose a baud rate for the SPORT UART, other uart settings are - 8 bit, 1 stop bit, no parity, no flow control. - -config SERIAL_SPORT_BAUD_RATE_115200 - bool "115200" - -config SERIAL_SPORT_BAUD_RATE_57600 - bool "57600" - -config SERIAL_SPORT_BAUD_RATE_38400 - bool "38400" - -config SERIAL_SPORT_BAUD_RATE_19200 - bool "19200" - -config SERIAL_SPORT_BAUD_RATE_9600 - bool "9600" -endchoice - -config SPORT_BAUD_RATE - int - depends on SERIAL_BFIN_SPORT - default 115200 if (SERIAL_SPORT_BAUD_RATE_115200) - default 57600 if (SERIAL_SPORT_BAUD_RATE_57600) - default 38400 if (SERIAL_SPORT_BAUD_RATE_38400) - default 19200 if (SERIAL_SPORT_BAUD_RATE_19200) - default 9600 if (SERIAL_SPORT_BAUD_RATE_9600) - endmenu diff --git a/trunk/drivers/serial/Makefile b/trunk/drivers/serial/Makefile index 0d9c09b1e836..f02ff9fad017 100644 --- a/trunk/drivers/serial/Makefile +++ b/trunk/drivers/serial/Makefile @@ -27,7 +27,6 @@ obj-$(CONFIG_SERIAL_PXA) += pxa.o obj-$(CONFIG_SERIAL_PNX8XXX) += pnx8xxx_uart.o obj-$(CONFIG_SERIAL_SA1100) += sa1100.o obj-$(CONFIG_SERIAL_BFIN) += bfin_5xx.o -obj-$(CONFIG_SERIAL_BFIN_SPORT) += bfin_sport_uart.o obj-$(CONFIG_SERIAL_S3C2410) += s3c2410.o obj-$(CONFIG_SERIAL_SUNCORE) += suncore.o obj-$(CONFIG_SERIAL_SUNHV) += sunhv.o diff --git a/trunk/drivers/serial/bfin_5xx.c b/trunk/drivers/serial/bfin_5xx.c index 8a2f6a1baa74..5f55534a290b 100644 --- a/trunk/drivers/serial/bfin_5xx.c +++ b/trunk/drivers/serial/bfin_5xx.c @@ -762,7 +762,7 @@ bfin_serial_set_termios(struct uart_port *port, struct ktermios *termios, break; default: printk(KERN_ERR "%s: word lengh not supported\n", - __func__); + __FUNCTION__); } if (termios->c_cflag & CSTOPB) @@ -1029,7 +1029,7 @@ bfin_serial_console_get_options(struct bfin_serial_port *uart, int *baud, *baud = get_sclk() / (16*(dll | dlh << 8)); } - pr_debug("%s:baud = %d, parity = %c, bits= %d\n", __func__, *baud, *parity, *bits); + pr_debug("%s:baud = %d, parity = %c, bits= %d\n", __FUNCTION__, *baud, *parity, *bits); } #endif diff --git a/trunk/drivers/serial/bfin_sport_uart.c b/trunk/drivers/serial/bfin_sport_uart.c deleted file mode 100644 index aca1240ad808..000000000000 --- a/trunk/drivers/serial/bfin_sport_uart.c +++ /dev/null @@ -1,614 +0,0 @@ -/* - * File: linux/drivers/serial/bfin_sport_uart.c - * - * Based on: drivers/serial/bfin_5xx.c by Aubrey Li. - * Author: Roy Huang - * - * Created: Nov 22, 2006 - * Copyright: (c) 2006-2007 Analog Devices Inc. - * Description: this driver enable SPORTs on Blackfin emulate UART. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see the file COPYING, or write - * to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/* - * This driver and the hardware supported are in term of EE-191 of ADI. - * http://www.analog.com/UploadedFiles/Application_Notes/399447663EE191.pdf - * This application note describe how to implement a UART on a Sharc DSP, - * but this driver is implemented on Blackfin Processor. - */ - -/* After reset, there is a prelude of low level pulse when transmit data first - * time. No addtional pulse in following transmit. - * According to document: - * The SPORTs are ready to start transmitting or receiving data no later than - * three serial clock cycles after they are enabled in the SPORTx_TCR1 or - * SPORTx_RCR1 register. No serial clock cycles are lost from this point on. - * The first internal frame sync will occur one frame sync delay after the - * SPORTs are ready. External frame syncs can occur as soon as the SPORT is - * ready. - */ - -/* Thanks to Axel Alatalo for fixing sport rx bug. Sometimes - * sport receives data incorrectly. The following is Axel's words. - * As EE-191, sport rx samples 3 times of the UART baudrate and takes the - * middle smaple of every 3 samples as the data bit. For a 8-N-1 UART setting, - * 30 samples will be required for a byte. If transmitter sends a 1/3 bit short - * byte due to buadrate drift, then the 30th sample of a byte, this sample is - * also the third sample of the stop bit, will happens on the immediately - * following start bit which will be thrown away and missed. Thus since parts - * of the startbit will be missed and the receiver will begin to drift, the - * effect accumulates over time until synchronization is lost. - * If only require 2 samples of the stopbit (by sampling in total 29 samples), - * then a to short byte as in the case above will be tolerated. Then the 1/3 - * early startbit will trigger a framesync since the last read is complete - * after only 2/3 stopbit and framesync is active during the last 1/3 looking - * for a possible early startbit. */ - -//#define DEBUG - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "bfin_sport_uart.h" - -unsigned short bfin_uart_pin_req_sport0[] = - {P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS, \ - P_SPORT0_DRPRI, P_SPORT0_RSCLK, P_SPORT0_DRSEC, P_SPORT0_DTSEC, 0}; - -unsigned short bfin_uart_pin_req_sport1[] = - {P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS, \ - P_SPORT1_DRPRI, P_SPORT1_RSCLK, P_SPORT1_DRSEC, P_SPORT1_DTSEC, 0}; - -#define DRV_NAME "bfin-sport-uart" - -struct sport_uart_port { - struct uart_port port; - char *name; - - int tx_irq; - int rx_irq; - int err_irq; -}; - -static void sport_uart_tx_chars(struct sport_uart_port *up); -static void sport_stop_tx(struct uart_port *port); - -static inline void tx_one_byte(struct sport_uart_port *up, unsigned int value) -{ - pr_debug("%s value:%x\n", __FUNCTION__, value); - /* Place a Start and Stop bit */ - __asm__ volatile ( - "R2 = b#01111111100;\n\t" - "R3 = b#10000000001;\n\t" - "%0 <<= 2;\n\t" - "%0 = %0 & R2;\n\t" - "%0 = %0 | R3;\n\t" - :"=r"(value) - :"0"(value) - :"R2", "R3"); - pr_debug("%s value:%x\n", __FUNCTION__, value); - - SPORT_PUT_TX(up, value); -} - -static inline unsigned int rx_one_byte(struct sport_uart_port *up) -{ - unsigned int value, extract; - - value = SPORT_GET_RX32(up); - pr_debug("%s value:%x\n", __FUNCTION__, value); - - /* Extract 8 bits data */ - __asm__ volatile ( - "R5 = 0;\n\t" - "P0 = 8;\n\t" - "R1 = 0x1801(Z);\n\t" - "R3 = 0x0300(Z);\n\t" - "R4 = 0;\n\t" - "LSETUP(loop_s, loop_e) LC0 = P0;\nloop_s:\t" - "R2 = extract(%1, R1.L)(Z);\n\t" - "R2 <<= R4;\n\t" - "R5 = R5 | R2;\n\t" - "R1 = R1 - R3;\nloop_e:\t" - "R4 += 1;\n\t" - "%0 = R5;\n\t" - :"=r"(extract) - :"r"(value) - :"P0", "R1", "R2","R3","R4", "R5"); - - pr_debug(" extract:%x\n", extract); - return extract; -} - -static int sport_uart_setup(struct sport_uart_port *up, int sclk, int baud_rate) -{ - int tclkdiv, tfsdiv, rclkdiv; - - /* Set TCR1 and TCR2 */ - SPORT_PUT_TCR1(up, (LTFS | ITFS | TFSR | TLSBIT | ITCLK)); - SPORT_PUT_TCR2(up, 10); - pr_debug("%s TCR1:%x, TCR2:%x\n", __FUNCTION__, SPORT_GET_TCR1(up), SPORT_GET_TCR2(up)); - - /* Set RCR1 and RCR2 */ - SPORT_PUT_RCR1(up, (RCKFE | LARFS | LRFS | RFSR | IRCLK)); - SPORT_PUT_RCR2(up, 28); - pr_debug("%s RCR1:%x, RCR2:%x\n", __FUNCTION__, SPORT_GET_RCR1(up), SPORT_GET_RCR2(up)); - - tclkdiv = sclk/(2 * baud_rate) - 1; - tfsdiv = 12; - rclkdiv = sclk/(2 * baud_rate * 3) - 1; - SPORT_PUT_TCLKDIV(up, tclkdiv); - SPORT_PUT_TFSDIV(up, tfsdiv); - SPORT_PUT_RCLKDIV(up, rclkdiv); - SSYNC(); - pr_debug("%s sclk:%d, baud_rate:%d, tclkdiv:%d, tfsdiv:%d, rclkdiv:%d\n", - __FUNCTION__, sclk, baud_rate, tclkdiv, tfsdiv, rclkdiv); - - return 0; -} - -static irqreturn_t sport_uart_rx_irq(int irq, void *dev_id) -{ - struct sport_uart_port *up = dev_id; - struct tty_struct *tty = up->port.info->tty; - unsigned int ch; - - do { - ch = rx_one_byte(up); - up->port.icount.rx++; - - if (uart_handle_sysrq_char(&up->port, ch)) - ; - else - tty_insert_flip_char(tty, ch, TTY_NORMAL); - } while (SPORT_GET_STAT(up) & RXNE); - tty_flip_buffer_push(tty); - - return IRQ_HANDLED; -} - -static irqreturn_t sport_uart_tx_irq(int irq, void *dev_id) -{ - sport_uart_tx_chars(dev_id); - - return IRQ_HANDLED; -} - -static irqreturn_t sport_uart_err_irq(int irq, void *dev_id) -{ - struct sport_uart_port *up = dev_id; - struct tty_struct *tty = up->port.info->tty; - unsigned int stat = SPORT_GET_STAT(up); - - /* Overflow in RX FIFO */ - if (stat & ROVF) { - up->port.icount.overrun++; - tty_insert_flip_char(tty, 0, TTY_OVERRUN); - SPORT_PUT_STAT(up, ROVF); /* Clear ROVF bit */ - } - /* These should not happen */ - if (stat & (TOVF | TUVF | RUVF)) { - printk(KERN_ERR "SPORT Error:%s %s %s\n", - (stat & TOVF)?"TX overflow":"", - (stat & TUVF)?"TX underflow":"", - (stat & RUVF)?"RX underflow":""); - SPORT_PUT_TCR1(up, SPORT_GET_TCR1(up) & ~TSPEN); - SPORT_PUT_RCR1(up, SPORT_GET_RCR1(up) & ~RSPEN); - } - SSYNC(); - - return IRQ_HANDLED; -} - -/* Reqeust IRQ, Setup clock */ -static int sport_startup(struct uart_port *port) -{ - struct sport_uart_port *up = (struct sport_uart_port *)port; - char buffer[20]; - int retval; - - pr_debug("%s enter\n", __FUNCTION__); - memset(buffer, 20, '\0'); - snprintf(buffer, 20, "%s rx", up->name); - retval = request_irq(up->rx_irq, sport_uart_rx_irq, IRQF_SAMPLE_RANDOM, buffer, up); - if (retval) { - printk(KERN_ERR "Unable to request interrupt %s\n", buffer); - return retval; - } - - snprintf(buffer, 20, "%s tx", up->name); - retval = request_irq(up->tx_irq, sport_uart_tx_irq, IRQF_SAMPLE_RANDOM, buffer, up); - if (retval) { - printk(KERN_ERR "Unable to request interrupt %s\n", buffer); - goto fail1; - } - - snprintf(buffer, 20, "%s err", up->name); - retval = request_irq(up->err_irq, sport_uart_err_irq, IRQF_SAMPLE_RANDOM, buffer, up); - if (retval) { - printk(KERN_ERR "Unable to request interrupt %s\n", buffer); - goto fail2; - } - - if (port->line) { - if (peripheral_request_list(bfin_uart_pin_req_sport1, DRV_NAME)) - goto fail3; - } else { - if (peripheral_request_list(bfin_uart_pin_req_sport0, DRV_NAME)) - goto fail3; - } - - sport_uart_setup(up, get_sclk(), port->uartclk); - - /* Enable receive interrupt */ - SPORT_PUT_RCR1(up, (SPORT_GET_RCR1(up) | RSPEN)); - SSYNC(); - - return 0; - - -fail3: - printk(KERN_ERR DRV_NAME - ": Requesting Peripherals failed\n"); - - free_irq(up->err_irq, up); -fail2: - free_irq(up->tx_irq, up); -fail1: - free_irq(up->rx_irq, up); - - return retval; - -} - -static void sport_uart_tx_chars(struct sport_uart_port *up) -{ - struct circ_buf *xmit = &up->port.info->xmit; - - if (SPORT_GET_STAT(up) & TXF) - return; - - if (up->port.x_char) { - tx_one_byte(up, up->port.x_char); - up->port.icount.tx++; - up->port.x_char = 0; - return; - } - - if (uart_circ_empty(xmit) || uart_tx_stopped(&up->port)) { - sport_stop_tx(&up->port); - return; - } - - while(!(SPORT_GET_STAT(up) & TXF) && !uart_circ_empty(xmit)) { - tx_one_byte(up, xmit->buf[xmit->tail]); - xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE -1); - up->port.icount.tx++; - } - - if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) - uart_write_wakeup(&up->port); -} - -static unsigned int sport_tx_empty(struct uart_port *port) -{ - struct sport_uart_port *up = (struct sport_uart_port *)port; - unsigned int stat; - - stat = SPORT_GET_STAT(up); - pr_debug("%s stat:%04x\n", __FUNCTION__, stat); - if (stat & TXHRE) { - return TIOCSER_TEMT; - } else - return 0; -} - -static unsigned int sport_get_mctrl(struct uart_port *port) -{ - pr_debug("%s enter\n", __FUNCTION__); - return (TIOCM_CTS | TIOCM_CD | TIOCM_DSR); -} - -static void sport_set_mctrl(struct uart_port *port, unsigned int mctrl) -{ - pr_debug("%s enter\n", __FUNCTION__); -} - -static void sport_stop_tx(struct uart_port *port) -{ - struct sport_uart_port *up = (struct sport_uart_port *)port; - unsigned int stat; - - pr_debug("%s enter\n", __FUNCTION__); - - stat = SPORT_GET_STAT(up); - while(!(stat & TXHRE)) { - udelay(1); - stat = SPORT_GET_STAT(up); - } - /* Although the hold register is empty, last byte is still in shift - * register and not sent out yet. If baud rate is lower than default, - * delay should be longer. For example, if the baud rate is 9600, - * the delay must be at least 2ms by experience */ - udelay(500); - - SPORT_PUT_TCR1(up, (SPORT_GET_TCR1(up) & ~TSPEN)); - SSYNC(); - - return; -} - -static void sport_start_tx(struct uart_port *port) -{ - struct sport_uart_port *up = (struct sport_uart_port *)port; - - pr_debug("%s enter\n", __FUNCTION__); - /* Write data into SPORT FIFO before enable SPROT to transmit */ - sport_uart_tx_chars(up); - - /* Enable transmit, then an interrupt will generated */ - SPORT_PUT_TCR1(up, (SPORT_GET_TCR1(up) | TSPEN)); - SSYNC(); - pr_debug("%s exit\n", __FUNCTION__); -} - -static void sport_stop_rx(struct uart_port *port) -{ - struct sport_uart_port *up = (struct sport_uart_port *)port; - - pr_debug("%s enter\n", __FUNCTION__); - /* Disable sport to stop rx */ - SPORT_PUT_RCR1(up, (SPORT_GET_RCR1(up) & ~RSPEN)); - SSYNC(); -} - -static void sport_enable_ms(struct uart_port *port) -{ - pr_debug("%s enter\n", __FUNCTION__); -} - -static void sport_break_ctl(struct uart_port *port, int break_state) -{ - pr_debug("%s enter\n", __FUNCTION__); -} - -static void sport_shutdown(struct uart_port *port) -{ - struct sport_uart_port *up = (struct sport_uart_port *)port; - - pr_debug("%s enter\n", __FUNCTION__); - - /* Disable sport */ - SPORT_PUT_TCR1(up, (SPORT_GET_TCR1(up) & ~TSPEN)); - SPORT_PUT_RCR1(up, (SPORT_GET_RCR1(up) & ~RSPEN)); - SSYNC(); - - if (port->line) { - peripheral_free_list(bfin_uart_pin_req_sport1); - } else { - peripheral_free_list(bfin_uart_pin_req_sport0); - } - - free_irq(up->rx_irq, up); - free_irq(up->tx_irq, up); - free_irq(up->err_irq, up); -} - -static void sport_set_termios(struct uart_port *port, - struct termios *termios, struct termios *old) -{ - pr_debug("%s enter, c_cflag:%08x\n", __FUNCTION__, termios->c_cflag); - uart_update_timeout(port, CS8 ,port->uartclk); -} - -static const char *sport_type(struct uart_port *port) -{ - struct sport_uart_port *up = (struct sport_uart_port *)port; - - pr_debug("%s enter\n", __FUNCTION__); - return up->name; -} - -static void sport_release_port(struct uart_port *port) -{ - pr_debug("%s enter\n", __FUNCTION__); -} - -static int sport_request_port(struct uart_port *port) -{ - pr_debug("%s enter\n", __FUNCTION__); - return 0; -} - -static void sport_config_port(struct uart_port *port, int flags) -{ - struct sport_uart_port *up = (struct sport_uart_port *)port; - - pr_debug("%s enter\n", __FUNCTION__); - up->port.type = PORT_BFIN_SPORT; -} - -static int sport_verify_port(struct uart_port *port, struct serial_struct *ser) -{ - pr_debug("%s enter\n", __FUNCTION__); - return 0; -} - -struct uart_ops sport_uart_ops = { - .tx_empty = sport_tx_empty, - .set_mctrl = sport_set_mctrl, - .get_mctrl = sport_get_mctrl, - .stop_tx = sport_stop_tx, - .start_tx = sport_start_tx, - .stop_rx = sport_stop_rx, - .enable_ms = sport_enable_ms, - .break_ctl = sport_break_ctl, - .startup = sport_startup, - .shutdown = sport_shutdown, - .set_termios = sport_set_termios, - .type = sport_type, - .release_port = sport_release_port, - .request_port = sport_request_port, - .config_port = sport_config_port, - .verify_port = sport_verify_port, -}; - -static struct sport_uart_port sport_uart_ports[] = { - { /* SPORT 0 */ - .name = "SPORT0", - .tx_irq = IRQ_SPORT0_TX, - .rx_irq = IRQ_SPORT0_RX, - .err_irq= IRQ_SPORT0_ERROR, - .port = { - .type = PORT_BFIN_SPORT, - .iotype = UPIO_MEM, - .membase = (void __iomem *)SPORT0_TCR1, - .mapbase = SPORT0_TCR1, - .irq = IRQ_SPORT0_RX, - .uartclk = CONFIG_SPORT_BAUD_RATE, - .fifosize = 8, - .ops = &sport_uart_ops, - .line = 0, - }, - }, { /* SPORT 1 */ - .name = "SPORT1", - .tx_irq = IRQ_SPORT1_TX, - .rx_irq = IRQ_SPORT1_RX, - .err_irq= IRQ_SPORT1_ERROR, - .port = { - .type = PORT_BFIN_SPORT, - .iotype = UPIO_MEM, - .membase = (void __iomem *)SPORT1_TCR1, - .mapbase = SPORT1_TCR1, - .irq = IRQ_SPORT1_RX, - .uartclk = CONFIG_SPORT_BAUD_RATE, - .fifosize = 8, - .ops = &sport_uart_ops, - .line = 1, - }, - } -}; - -static struct uart_driver sport_uart_reg = { - .owner = THIS_MODULE, - .driver_name = "SPORT-UART", - .dev_name = "ttySS", - .major = 204, - .minor = 84, - .nr = ARRAY_SIZE(sport_uart_ports), - .cons = NULL, -}; - -static int sport_uart_suspend(struct platform_device *dev, pm_message_t state) -{ - struct sport_uart_port *sport = platform_get_drvdata(dev); - - pr_debug("%s enter\n", __FUNCTION__); - if (sport) - uart_suspend_port(&sport_uart_reg, &sport->port); - - return 0; -} - -static int sport_uart_resume(struct platform_device *dev) -{ - struct sport_uart_port *sport = platform_get_drvdata(dev); - - pr_debug("%s enter\n", __FUNCTION__); - if (sport) - uart_resume_port(&sport_uart_reg, &sport->port); - - return 0; -} - -static int sport_uart_probe(struct platform_device *dev) -{ - pr_debug("%s enter\n", __FUNCTION__); - sport_uart_ports[dev->id].port.dev = &dev->dev; - uart_add_one_port(&sport_uart_reg, &sport_uart_ports[dev->id].port); - platform_set_drvdata(dev, &sport_uart_ports[dev->id]); - - return 0; -} - -static int sport_uart_remove(struct platform_device *dev) -{ - struct sport_uart_port *sport = platform_get_drvdata(dev); - - pr_debug("%s enter\n", __FUNCTION__); - platform_set_drvdata(dev, NULL); - - if (sport) - uart_remove_one_port(&sport_uart_reg, &sport->port); - - return 0; -} - -static struct platform_driver sport_uart_driver = { - .probe = sport_uart_probe, - .remove = sport_uart_remove, - .suspend = sport_uart_suspend, - .resume = sport_uart_resume, - .driver = { - .name = DRV_NAME, - }, -}; - -static int __init sport_uart_init(void) -{ - int ret; - - pr_debug("%s enter\n", __FUNCTION__); - ret = uart_register_driver(&sport_uart_reg); - if (ret != 0) { - printk(KERN_ERR "Failed to register %s:%d\n", - sport_uart_reg.driver_name, ret); - return ret; - } - - ret = platform_driver_register(&sport_uart_driver); - if (ret != 0) { - printk(KERN_ERR "Failed to register sport uart driver:%d\n", ret); - uart_unregister_driver(&sport_uart_reg); - } - - - pr_debug("%s exit\n", __FUNCTION__); - return ret; -} - -static void __exit sport_uart_exit(void) -{ - pr_debug("%s enter\n", __FUNCTION__); - platform_driver_unregister(&sport_uart_driver); - uart_unregister_driver(&sport_uart_reg); -} - -module_init(sport_uart_init); -module_exit(sport_uart_exit); - -MODULE_LICENSE("GPL"); diff --git a/trunk/drivers/serial/bfin_sport_uart.h b/trunk/drivers/serial/bfin_sport_uart.h deleted file mode 100644 index 671d41cc1a3f..000000000000 --- a/trunk/drivers/serial/bfin_sport_uart.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * File: linux/drivers/serial/bfin_sport_uart.h - * - * Based on: include/asm-blackfin/mach-533/bfin_serial_5xx.h - * Author: Roy Huang analog.com> - * - * Created: Nov 22, 2006 - * Copyright: (C) Analog Device Inc. - * Description: this driver enable SPORTs on Blackfin emulate UART. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see the file COPYING, or write - * to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - - -#define OFFSET_TCR1 0x00 /* Transmit Configuration 1 Register */ -#define OFFSET_TCR2 0x04 /* Transmit Configuration 2 Register */ -#define OFFSET_TCLKDIV 0x08 /* Transmit Serial Clock Divider Register */ -#define OFFSET_TFSDIV 0x0C /* Transmit Frame Sync Divider Register */ -#define OFFSET_TX 0x10 /* Transmit Data Register */ -#define OFFSET_RX 0x18 /* Receive Data Register */ -#define OFFSET_RCR1 0x20 /* Receive Configuration 1 Register */ -#define OFFSET_RCR2 0x24 /* Receive Configuration 2 Register */ -#define OFFSET_RCLKDIV 0x28 /* Receive Serial Clock Divider Register */ -#define OFFSET_RFSDIV 0x2c /* Receive Frame Sync Divider Register */ -#define OFFSET_STAT 0x30 /* Status Register */ - -#define SPORT_GET_TCR1(sport) bfin_read16(((sport)->port.membase + OFFSET_TCR1)) -#define SPORT_GET_TCR2(sport) bfin_read16(((sport)->port.membase + OFFSET_TCR2)) -#define SPORT_GET_TCLKDIV(sport) bfin_read16(((sport)->port.membase + OFFSET_TCLKDIV)) -#define SPORT_GET_TFSDIV(sport) bfin_read16(((sport)->port.membase + OFFSET_TFSDIV)) -#define SPORT_GET_TX(sport) bfin_read16(((sport)->port.membase + OFFSET_TX)) -#define SPORT_GET_RX(sport) bfin_read16(((sport)->port.membase + OFFSET_RX)) -#define SPORT_GET_RX32(sport) bfin_read32(((sport)->port.membase + OFFSET_RX)) -#define SPORT_GET_RCR1(sport) bfin_read16(((sport)->port.membase + OFFSET_RCR1)) -#define SPORT_GET_RCR2(sport) bfin_read16(((sport)->port.membase + OFFSET_RCR2)) -#define SPORT_GET_RCLKDIV(sport) bfin_read16(((sport)->port.membase + OFFSET_RCLKDIV)) -#define SPORT_GET_RFSDIV(sport) bfin_read16(((sport)->port.membase + OFFSET_RFSDIV)) -#define SPORT_GET_STAT(sport) bfin_read16(((sport)->port.membase + OFFSET_STAT)) - -#define SPORT_PUT_TCR1(sport, v) bfin_write16(((sport)->port.membase + OFFSET_TCR1), v) -#define SPORT_PUT_TCR2(sport, v) bfin_write16(((sport)->port.membase + OFFSET_TCR2), v) -#define SPORT_PUT_TCLKDIV(sport, v) bfin_write16(((sport)->port.membase + OFFSET_TCLKDIV), v) -#define SPORT_PUT_TFSDIV(sport, v) bfin_write16(((sport)->port.membase + OFFSET_TFSDIV), v) -#define SPORT_PUT_TX(sport, v) bfin_write16(((sport)->port.membase + OFFSET_TX), v) -#define SPORT_PUT_RX(sport, v) bfin_write16(((sport)->port.membase + OFFSET_RX), v) -#define SPORT_PUT_RCR1(sport, v) bfin_write16(((sport)->port.membase + OFFSET_RCR1), v) -#define SPORT_PUT_RCR2(sport, v) bfin_write16(((sport)->port.membase + OFFSET_RCR2), v) -#define SPORT_PUT_RCLKDIV(sport, v) bfin_write16(((sport)->port.membase + OFFSET_RCLKDIV), v) -#define SPORT_PUT_RFSDIV(sport, v) bfin_write16(((sport)->port.membase + OFFSET_RFSDIV), v) -#define SPORT_PUT_STAT(sport, v) bfin_write16(((sport)->port.membase + OFFSET_STAT), v) diff --git a/trunk/drivers/serial/cpm_uart/cpm_uart_core.c b/trunk/drivers/serial/cpm_uart/cpm_uart_core.c index a19dc7ef8861..a638ba0679ac 100644 --- a/trunk/drivers/serial/cpm_uart/cpm_uart_core.c +++ b/trunk/drivers/serial/cpm_uart/cpm_uart_core.c @@ -1117,7 +1117,7 @@ int cpm_uart_drv_get_platform_data(struct platform_device *pdev, int is_con) line = cpm_uart_id2nr(idx); if(line < 0) { - printk(KERN_ERR"%s(): port %d is not registered", __func__, idx); + printk(KERN_ERR"%s(): port %d is not registered", __FUNCTION__, idx); return -EINVAL; } diff --git a/trunk/drivers/serial/crisv10.c b/trunk/drivers/serial/crisv10.c index f9fa237aa949..88e7c1d5b919 100644 --- a/trunk/drivers/serial/crisv10.c +++ b/trunk/drivers/serial/crisv10.c @@ -1788,7 +1788,7 @@ static unsigned int handle_descr_data(struct e100_serial *info, if (info->recv_cnt + recvl > 65536) { printk(KERN_CRIT - "%s: Too much pending incoming serial data! Dropping %u bytes.\n", __func__, recvl); + "%s: Too much pending incoming serial data! Dropping %u bytes.\n", __FUNCTION__, recvl); return 0; } @@ -1801,7 +1801,7 @@ static unsigned int handle_descr_data(struct e100_serial *info, append_recv_buffer(info, buffer); if (!(buffer = alloc_recv_buffer(SERIAL_DESCR_BUF_SIZE))) - panic("%s: Failed to allocate memory for receive buffer!\n", __func__); + panic("%s: Failed to allocate memory for receive buffer!\n", __FUNCTION__); descr->buf = virt_to_phys(buffer->buffer); @@ -1925,7 +1925,7 @@ static int start_recv_dma(struct e100_serial *info) /* Set up the receiving descriptors */ for (i = 0; i < SERIAL_RECV_DESCRIPTORS; i++) { if (!(buffer = alloc_recv_buffer(SERIAL_DESCR_BUF_SIZE))) - panic("%s: Failed to allocate memory for receive buffer!\n", __func__); + panic("%s: Failed to allocate memory for receive buffer!\n", __FUNCTION__); descr[i].ctrl = d_int; descr[i].buf = virt_to_phys(buffer->buffer); @@ -3581,9 +3581,8 @@ rs_tiocmset(struct tty_struct *tty, struct file *file, unsigned int set, unsigned int clear) { struct e100_serial *info = (struct e100_serial *)tty->driver_data; - unsigned long flags; - local_irq_save(flags); + lock_kernel(); if (clear & TIOCM_RTS) e100_rts(info, 0); @@ -3605,7 +3604,7 @@ rs_tiocmset(struct tty_struct *tty, struct file *file, if (set & TIOCM_CD) e100_cd_out(info, 1); - local_irq_restore(flags); + unlock_kernel(); return 0; } @@ -3614,10 +3613,8 @@ rs_tiocmget(struct tty_struct *tty, struct file *file) { struct e100_serial *info = (struct e100_serial *)tty->driver_data; unsigned int result; - unsigned long flags; - - local_irq_save(flags); + lock_kernel(); result = (!E100_RTS_GET(info) ? TIOCM_RTS : 0) | (!E100_DTR_GET(info) ? TIOCM_DTR : 0) @@ -3626,7 +3623,7 @@ rs_tiocmget(struct tty_struct *tty, struct file *file) | (!E100_CD_GET(info) ? TIOCM_CAR : 0) | (!E100_CTS_GET(info) ? TIOCM_CTS : 0); - local_irq_restore(flags); + unlock_kernel(); #ifdef SERIAL_DEBUG_IO printk(KERN_DEBUG "ser%i: modem state: %i 0x%08X\n", @@ -3705,6 +3702,10 @@ rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios) { struct e100_serial *info = (struct e100_serial *)tty->driver_data; + if (tty->termios->c_cflag == old_termios->c_cflag && + tty->termios->c_iflag == old_termios->c_iflag) + return; + change_speed(info); /* Handle turning off CRTSCTS */ @@ -3807,8 +3808,10 @@ rs_close(struct tty_struct *tty, struct file * filp) #endif shutdown(info); - rs_flush_buffer(tty); - tty_ldisc_flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); + if (tty->ldisc.flush_buffer) + tty->ldisc.flush_buffer(tty); tty->closing = 0; info->event = 0; info->tty = 0; @@ -3882,7 +3885,6 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout) * Check R_DMA_CHx_STATUS bit 0-6=number of available bytes in FIFO * R_DMA_CHx_HWSW bit 31-16=nbr of bytes left in DMA buffer (0=64k) */ - lock_kernel(); orig_jiffies = jiffies; while (info->xmit.head != info->xmit.tail || /* More in send queue */ (*info->ostatusadr & 0x007f) || /* more in FIFO */ @@ -3899,7 +3901,6 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout) curr_time_usec - info->last_tx_active_usec; } set_current_state(TASK_RUNNING); - unlock_kernel(); } /* @@ -4519,7 +4520,7 @@ rs_init(void) if (request_irq(SERIAL_IRQ_NBR, ser_interrupt, IRQF_SHARED | IRQF_DISABLED, "serial ", driver)) - panic("%s: Failed to request irq8", __func__); + panic("%s: Failed to request irq8", __FUNCTION__); #endif #endif /* CONFIG_SVINTO_SIM */ diff --git a/trunk/drivers/serial/ioc3_serial.c b/trunk/drivers/serial/ioc3_serial.c index 4f1af71e9a1b..168073f12cec 100644 --- a/trunk/drivers/serial/ioc3_serial.c +++ b/trunk/drivers/serial/ioc3_serial.c @@ -52,7 +52,7 @@ static unsigned int Submodule_slot; #define DPRINT_CONFIG(_x...) ; //#define DPRINT_CONFIG(_x...) printk _x #define NOT_PROGRESS() ; -//#define NOT_PROGRESS() printk("%s : fails %d\n", __func__, __LINE__) +//#define NOT_PROGRESS() printk("%s : fails %d\n", __FUNCTION__, __LINE__) /* number of characters we want to transmit to the lower level at a time */ #define MAX_CHARS 256 @@ -445,7 +445,7 @@ static int inline port_init(struct ioc3_port *port) sbbr_h = &idd->vma->sbbr_h; ring_pci_addr = (unsigned long __iomem)port->ip_dma_ringbuf; DPRINT_CONFIG(("%s: ring_pci_addr 0x%p\n", - __func__, (void *)ring_pci_addr)); + __FUNCTION__, (void *)ring_pci_addr)); writel((unsigned int)((uint64_t) ring_pci_addr >> 32), sbbr_h); writel((unsigned int)ring_pci_addr | BUF_SIZE_BIT, sbbr_l); @@ -593,7 +593,7 @@ config_port(struct ioc3_port *port, DPRINT_CONFIG(("%s: line %d baud %d byte_size %d stop %d parenb %d " "parodd %d\n", - __func__, ((struct uart_port *)port->ip_port)->line, + __FUNCTION__, ((struct uart_port *)port->ip_port)->line, baud, byte_size, stop_bits, parenb, parodd)); if (set_baud(port, baud)) @@ -871,14 +871,14 @@ static int ioc3_set_proto(struct ioc3_port *port, int proto) default: case PROTO_RS232: /* Clear the appropriate GIO pin */ - DPRINT_CONFIG(("%s: rs232\n", __func__)); + DPRINT_CONFIG(("%s: rs232\n", __FUNCTION__)); writel(0, (&port->ip_idd->vma->gppr[0] + hooks->rs422_select_pin)); break; case PROTO_RS422: /* Set the appropriate GIO pin */ - DPRINT_CONFIG(("%s: rs422\n", __func__)); + DPRINT_CONFIG(("%s: rs422\n", __FUNCTION__)); writel(1, (&port->ip_idd->vma->gppr[0] + hooks->rs422_select_pin)); break; @@ -988,7 +988,7 @@ ioc3_change_speed(struct uart_port *the_port, } baud = uart_get_baud_rate(the_port, new_termios, old_termios, MIN_BAUD_SUPPORTED, MAX_BAUD_SUPPORTED); - DPRINT_CONFIG(("%s: returned baud %d for line %d\n", __func__, baud, + DPRINT_CONFIG(("%s: returned baud %d for line %d\n", __FUNCTION__, baud, the_port->line)); if (!the_port->fifosize) @@ -1026,7 +1026,7 @@ ioc3_change_speed(struct uart_port *the_port, DPRINT_CONFIG(("%s : port 0x%p line %d cflag 0%o " "config_port(baud %d data %d stop %d penable %d " " parity %d), notification 0x%x\n", - __func__, (void *)port, the_port->line, cflag, baud, + __FUNCTION__, (void *)port, the_port->line, cflag, baud, new_data, new_stop, new_parity_enable, new_parity, the_port->ignore_status_mask)); @@ -1919,7 +1919,7 @@ static inline int ioc3_serial_core_attach( struct ioc3_submodule *is, struct pci_dev *pdev = idd->pdev; DPRINT_CONFIG(("%s: attach pdev 0x%p - card_ptr 0x%p\n", - __func__, pdev, (void *)card_ptr)); + __FUNCTION__, pdev, (void *)card_ptr)); if (!card_ptr) return -ENODEV; @@ -1933,7 +1933,7 @@ static inline int ioc3_serial_core_attach( struct ioc3_submodule *is, port->ip_port = the_port; DPRINT_CONFIG(("%s: attach the_port 0x%p / port 0x%p [%d/%d]\n", - __func__, (void *)the_port, (void *)port, + __FUNCTION__, (void *)the_port, (void *)port, phys_port, ii)); /* membase, iobase and mapbase just need to be non-0 */ @@ -1950,7 +1950,7 @@ static inline int ioc3_serial_core_attach( struct ioc3_submodule *is, if (uart_add_one_port(&ioc3_uart, the_port) < 0) { printk(KERN_WARNING "%s: unable to add port %d bus %d\n", - __func__, the_port->line, pdev->bus->number); + __FUNCTION__, the_port->line, pdev->bus->number); } else { DPRINT_CONFIG(("IOC3 serial port %d irq %d bus %d\n", the_port->line, the_port->irq, pdev->bus->number)); @@ -2017,7 +2017,7 @@ ioc3uart_probe(struct ioc3_submodule *is, struct ioc3_driver_data *idd) struct ioc3_port *ports[PORTS_PER_CARD]; int phys_port; - DPRINT_CONFIG(("%s (0x%p, 0x%p)\n", __func__, is, idd)); + DPRINT_CONFIG(("%s (0x%p, 0x%p)\n", __FUNCTION__, is, idd)); card_ptr = kzalloc(sizeof(struct ioc3_card), GFP_KERNEL); if (!card_ptr) { @@ -2067,7 +2067,7 @@ ioc3uart_probe(struct ioc3_submodule *is, struct ioc3_driver_data *idd) DPRINT_CONFIG(("%s : Port A ip_serial_regs 0x%p " "ip_uart_regs 0x%p\n", - __func__, + __FUNCTION__, (void *)port->ip_serial_regs, (void *)port->ip_uart_regs)); @@ -2082,7 +2082,7 @@ ioc3uart_probe(struct ioc3_submodule *is, struct ioc3_driver_data *idd) DPRINT_CONFIG(("%s : Port A ip_cpu_ringbuf 0x%p " "ip_dma_ringbuf 0x%p, ip_inring 0x%p " "ip_outring 0x%p\n", - __func__, + __FUNCTION__, (void *)port->ip_cpu_ringbuf, (void *)port->ip_dma_ringbuf, (void *)port->ip_inring, @@ -2094,7 +2094,7 @@ ioc3uart_probe(struct ioc3_submodule *is, struct ioc3_driver_data *idd) DPRINT_CONFIG(("%s : Port B ip_serial_regs 0x%p " "ip_uart_regs 0x%p\n", - __func__, + __FUNCTION__, (void *)port->ip_serial_regs, (void *)port->ip_uart_regs)); @@ -2108,7 +2108,7 @@ ioc3uart_probe(struct ioc3_submodule *is, struct ioc3_driver_data *idd) DPRINT_CONFIG(("%s : Port B ip_cpu_ringbuf 0x%p " "ip_dma_ringbuf 0x%p, ip_inring 0x%p " "ip_outring 0x%p\n", - __func__, + __FUNCTION__, (void *)port->ip_cpu_ringbuf, (void *)port->ip_dma_ringbuf, (void *)port->ip_inring, @@ -2116,7 +2116,7 @@ ioc3uart_probe(struct ioc3_submodule *is, struct ioc3_driver_data *idd) } DPRINT_CONFIG(("%s : port %d [addr 0x%p] card_ptr 0x%p", - __func__, + __FUNCTION__, phys_port, (void *)port, (void *)card_ptr)); DPRINT_CONFIG((" ip_serial_regs 0x%p ip_uart_regs 0x%p\n", (void *)port->ip_serial_regs, @@ -2127,7 +2127,7 @@ ioc3uart_probe(struct ioc3_submodule *is, struct ioc3_driver_data *idd) DPRINT_CONFIG(("%s: phys_port %d port 0x%p inring 0x%p " "outring 0x%p\n", - __func__, + __FUNCTION__, phys_port, (void *)port, (void *)port->ip_inring, (void *)port->ip_outring)); @@ -2170,7 +2170,7 @@ static int __devinit ioc3uart_init(void) if ((ret = uart_register_driver(&ioc3_uart)) < 0) { printk(KERN_WARNING "%s: Couldn't register IOC3 uart serial driver\n", - __func__); + __FUNCTION__); return ret; } ret = ioc3_register_submodule(&ioc3uart_submodule); diff --git a/trunk/drivers/serial/ioc4_serial.c b/trunk/drivers/serial/ioc4_serial.c index 49b8a82b7b9f..0c179384fb0c 100644 --- a/trunk/drivers/serial/ioc4_serial.c +++ b/trunk/drivers/serial/ioc4_serial.c @@ -889,7 +889,7 @@ static int inline port_init(struct ioc4_port *port) ring_pci_addr = (unsigned long __iomem)port->ip_dma_ringbuf; DPRINT_CONFIG(("%s: ring_pci_addr 0x%lx\n", - __func__, ring_pci_addr)); + __FUNCTION__, ring_pci_addr)); writel((unsigned int)((uint64_t)ring_pci_addr >> 32), sbbr_h); writel((unsigned int)ring_pci_addr | IOC4_BUF_SIZE_BIT, sbbr_l); @@ -1028,7 +1028,7 @@ static irqreturn_t ioc4_intr(int irq, void *arg) spin_lock_irqsave(&soft->is_ir_lock, flag); printk ("%s : %d : mem 0x%p sio_ir 0x%x sio_ies 0x%x " "other_ir 0x%x other_ies 0x%x mask 0x%x\n", - __func__, __LINE__, + __FUNCTION__, __LINE__, (void *)mem, readl(&mem->sio_ir.raw), readl(&mem->sio_ies.raw), readl(&mem->other_ir.raw), @@ -1155,14 +1155,14 @@ static int inline ioc4_attach_local(struct ioc4_driver_data *idd) (TOTAL_RING_BUF_SIZE - 1)) == 0)); DPRINT_CONFIG(("%s : ip_cpu_ringbuf 0x%p " "ip_dma_ringbuf 0x%p\n", - __func__, + __FUNCTION__, (void *)port->ip_cpu_ringbuf, (void *)port->ip_dma_ringbuf)); port->ip_inring = RING(port, RX_0_OR_2); port->ip_outring = RING(port, TX_0_OR_2); } DPRINT_CONFIG(("%s : port %d [addr 0x%p] control 0x%p", - __func__, + __FUNCTION__, port_number, (void *)port, (void *)control)); DPRINT_CONFIG((" ip_serial_regs 0x%p ip_uart_regs 0x%p\n", (void *)port->ip_serial_regs, @@ -1173,7 +1173,7 @@ static int inline ioc4_attach_local(struct ioc4_driver_data *idd) DPRINT_CONFIG(("%s: port_number %d port 0x%p inring 0x%p " "outring 0x%p\n", - __func__, + __FUNCTION__, port_number, (void *)port, (void *)port->ip_inring, (void *)port->ip_outring)); @@ -1317,7 +1317,7 @@ config_port(struct ioc4_port *port, int spiniter = 0; DPRINT_CONFIG(("%s: baud %d byte_size %d stop %d parenb %d parodd %d\n", - __func__, baud, byte_size, stop_bits, parenb, parodd)); + __FUNCTION__, baud, byte_size, stop_bits, parenb, parodd)); if (set_baud(port, baud)) return 1; @@ -1725,7 +1725,7 @@ ioc4_change_speed(struct uart_port *the_port, } baud = uart_get_baud_rate(the_port, new_termios, old_termios, MIN_BAUD_SUPPORTED, MAX_BAUD_SUPPORTED); - DPRINT_CONFIG(("%s: returned baud %d\n", __func__, baud)); + DPRINT_CONFIG(("%s: returned baud %d\n", __FUNCTION__, baud)); /* default is 9600 */ if (!baud) @@ -1765,7 +1765,7 @@ ioc4_change_speed(struct uart_port *the_port, DPRINT_CONFIG(("%s : port 0x%p cflag 0%o " "config_port(baud %d data %d stop %d p enable %d parity %d)," " notification 0x%x\n", - __func__, (void *)port, cflag, baud, new_data, new_stop, + __FUNCTION__, (void *)port, cflag, baud, new_data, new_stop, new_parity_enable, new_parity, the_port->ignore_status_mask)); if ((config_port(port, baud, /* baud */ @@ -2715,7 +2715,7 @@ ioc4_serial_core_attach(struct pci_dev *pdev, int port_type) DPRINT_CONFIG(("%s: attach pdev 0x%p - control 0x%p\n", - __func__, pdev, (void *)control)); + __FUNCTION__, pdev, (void *)control)); if (!control) return -ENODEV; @@ -2734,7 +2734,7 @@ ioc4_serial_core_attach(struct pci_dev *pdev, int port_type) port->ip_all_ports[port_type_idx] = the_port; DPRINT_CONFIG(("%s: attach the_port 0x%p / port 0x%p : type %s\n", - __func__, (void *)the_port, + __FUNCTION__, (void *)the_port, (void *)port, port_type == PROTO_RS232 ? "rs232" : "rs422")); @@ -2752,7 +2752,7 @@ ioc4_serial_core_attach(struct pci_dev *pdev, int port_type) if (uart_add_one_port(u_driver, the_port) < 0) { printk(KERN_WARNING "%s: unable to add port %d bus %d\n", - __func__, the_port->line, pdev->bus->number); + __FUNCTION__, the_port->line, pdev->bus->number); } else { DPRINT_CONFIG( ("IOC4 serial port %d irq = %d, bus %d\n", @@ -2777,7 +2777,7 @@ ioc4_serial_attach_one(struct ioc4_driver_data *idd) int ret = 0; - DPRINT_CONFIG(("%s (0x%p, 0x%p)\n", __func__, idd->idd_pdev, + DPRINT_CONFIG(("%s (0x%p, 0x%p)\n", __FUNCTION__, idd->idd_pdev, idd->idd_pci_id)); /* PCI-RT does not bring out serial connections. @@ -2806,7 +2806,7 @@ ioc4_serial_attach_one(struct ioc4_driver_data *idd) goto out2; } DPRINT_CONFIG(("%s : mem 0x%p, serial 0x%p\n", - __func__, (void *)idd->idd_misc_regs, + __FUNCTION__, (void *)idd->idd_misc_regs, (void *)serial)); /* Get memory for the new card */ @@ -2858,7 +2858,7 @@ ioc4_serial_attach_one(struct ioc4_driver_data *idd) } else { printk(KERN_WARNING "%s : request_irq fails for IRQ 0x%x\n ", - __func__, idd->idd_pdev->irq); + __FUNCTION__, idd->idd_pdev->irq); } ret = ioc4_attach_local(idd); if (ret) @@ -2911,13 +2911,13 @@ int ioc4_serial_init(void) if ((ret = uart_register_driver(&ioc4_uart_rs232)) < 0) { printk(KERN_WARNING "%s: Couldn't register rs232 IOC4 serial driver\n", - __func__); + __FUNCTION__); return ret; } if ((ret = uart_register_driver(&ioc4_uart_rs422)) < 0) { printk(KERN_WARNING "%s: Couldn't register rs422 IOC4 serial driver\n", - __func__); + __FUNCTION__); return ret; } diff --git a/trunk/drivers/serial/kgdboc.c b/trunk/drivers/serial/kgdboc.c index eadc1ab6bbce..9cf03327386a 100644 --- a/trunk/drivers/serial/kgdboc.c +++ b/trunk/drivers/serial/kgdboc.c @@ -96,14 +96,12 @@ static void cleanup_kgdboc(void) static int kgdboc_get_char(void) { - return kgdb_tty_driver->ops->poll_get_char(kgdb_tty_driver, - kgdb_tty_line); + return kgdb_tty_driver->poll_get_char(kgdb_tty_driver, kgdb_tty_line); } static void kgdboc_put_char(u8 chr) { - kgdb_tty_driver->ops->poll_put_char(kgdb_tty_driver, - kgdb_tty_line, chr); + kgdb_tty_driver->poll_put_char(kgdb_tty_driver, kgdb_tty_line, chr); } static int param_set_kgdboc_var(const char *kmessage, struct kernel_param *kp) diff --git a/trunk/drivers/serial/mcfserial.c b/trunk/drivers/serial/mcfserial.c index 43af40d59b8a..ddd3aa50d4ad 100644 --- a/trunk/drivers/serial/mcfserial.c +++ b/trunk/drivers/serial/mcfserial.c @@ -1072,6 +1072,18 @@ static int mcfrs_ioctl(struct tty_struct *tty, struct file * file, tty_wait_until_sent(tty, 0); send_break(info, arg ? arg*(HZ/10) : HZ/4); return 0; + case TIOCGSOFTCAR: + error = put_user(C_CLOCAL(tty) ? 1 : 0, + (unsigned long *) arg); + if (error) + return error; + return 0; + case TIOCSSOFTCAR: + get_user(arg, (unsigned long *) arg); + tty->termios->c_cflag = + ((tty->termios->c_cflag & ~CLOCAL) | + (arg ? CLOCAL : 0)); + return 0; case TIOCGSERIAL: if (access_ok(VERIFY_WRITE, (void *) arg, sizeof(struct serial_struct))) @@ -1210,7 +1222,8 @@ static void mcfrs_close(struct tty_struct *tty, struct file * filp) } else #endif shutdown(info); - mcfrs_flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); tty_ldisc_flush(tty); tty->closing = 0; @@ -1263,8 +1276,6 @@ mcfrs_wait_until_sent(struct tty_struct *tty, int timeout) * Note: we have to use pretty tight timings here to satisfy * the NIST-PCTS. */ - lock_kernel(); - fifo_time = (MCF5272_FIFO_SIZE * HZ * 10) / info->baud; char_time = fifo_time / 5; if (char_time == 0) @@ -1301,7 +1312,6 @@ mcfrs_wait_until_sent(struct tty_struct *tty, int timeout) if (timeout && time_after(jiffies, orig_jiffies + timeout)) break; } - unlock_kernel(); #else /* * For the other coldfire models, assume all data has been sent @@ -1897,7 +1907,7 @@ static struct tty_driver *mcfrs_console_device(struct console *c, int *index) * This is used for console output. */ -int mcfrs_put_char(char ch) +void mcfrs_put_char(char ch) { volatile unsigned char *uartp; unsigned long flags; @@ -1921,7 +1931,7 @@ int mcfrs_put_char(char ch) mcfrs_init_console(); /* try and get it back */ local_irq_restore(flags); - return 1; + return; } diff --git a/trunk/drivers/serial/mpc52xx_uart.c b/trunk/drivers/serial/mpc52xx_uart.c index 7a3625f52a03..d93b3578c5e2 100644 --- a/trunk/drivers/serial/mpc52xx_uart.c +++ b/trunk/drivers/serial/mpc52xx_uart.c @@ -1221,8 +1221,8 @@ static struct of_device_id mpc52xx_uart_of_match[] = { #endif #ifdef CONFIG_PPC_MPC512x { .compatible = "fsl,mpc5121-psc-uart", .data = &mpc512x_psc_ops, }, -#endif {}, +#endif }; static int __devinit diff --git a/trunk/drivers/serial/netx-serial.c b/trunk/drivers/serial/netx-serial.c index 81ac9bb4f39b..3123ffeac8ad 100644 --- a/trunk/drivers/serial/netx-serial.c +++ b/trunk/drivers/serial/netx-serial.c @@ -287,7 +287,6 @@ static void netx_set_mctrl(struct uart_port *port, unsigned int mctrl) { unsigned int val; - /* FIXME: Locking needed ? */ if (mctrl & TIOCM_RTS) { val = readl(port->membase + UART_RTS_CR); writel(val | RTS_CR_RTS, port->membase + UART_RTS_CR); diff --git a/trunk/drivers/serial/s3c2410.c b/trunk/drivers/serial/s3c2410.c index 2b6a013639e6..da5a02cb4f63 100644 --- a/trunk/drivers/serial/s3c2410.c +++ b/trunk/drivers/serial/s3c2410.c @@ -1096,13 +1096,13 @@ static int s3c24xx_serial_probe(struct platform_device *dev, ourport = &s3c24xx_serial_ports[probe_index]; probe_index++; - dbg("%s: initialising port %p...\n", __func__, ourport); + dbg("%s: initialising port %p...\n", __FUNCTION__, ourport); ret = s3c24xx_serial_init_port(ourport, info, dev); if (ret < 0) goto probe_err; - dbg("%s: adding port\n", __func__); + dbg("%s: adding port\n", __FUNCTION__); uart_add_one_port(&s3c24xx_uart_drv, &ourport->port); platform_set_drvdata(dev, &ourport->port); @@ -1587,7 +1587,7 @@ static int s3c2412_serial_resetport(struct uart_port *port, unsigned long ucon = rd_regl(port, S3C2410_UCON); dbg("%s: port=%p (%08lx), cfg=%p\n", - __func__, port, port->mapbase, cfg); + __FUNCTION__, port, port->mapbase, cfg); /* ensure we don't change the clock settings... */ diff --git a/trunk/drivers/serial/sa1100.c b/trunk/drivers/serial/sa1100.c index 62b38582f5e9..67b2338913c2 100644 --- a/trunk/drivers/serial/sa1100.c +++ b/trunk/drivers/serial/sa1100.c @@ -655,7 +655,7 @@ void __init sa1100_register_uart_fns(struct sa1100_port_fns *fns) void __init sa1100_register_uart(int idx, int port) { if (idx >= NR_PORTS) { - printk(KERN_ERR "%s: bad index number %d\n", __func__, idx); + printk(KERN_ERR "%s: bad index number %d\n", __FUNCTION__, idx); return; } @@ -682,7 +682,7 @@ void __init sa1100_register_uart(int idx, int port) break; default: - printk(KERN_ERR "%s: bad port number %d\n", __func__, port); + printk(KERN_ERR "%s: bad port number %d\n", __FUNCTION__, port); } } diff --git a/trunk/drivers/serial/serial_core.c b/trunk/drivers/serial/serial_core.c index 1e2b9d826f69..977ce820ce30 100644 --- a/trunk/drivers/serial/serial_core.c +++ b/trunk/drivers/serial/serial_core.c @@ -422,7 +422,6 @@ uart_get_divisor(struct uart_port *port, unsigned int baud) EXPORT_SYMBOL(uart_get_divisor); -/* FIXME: Consistent locking policy */ static void uart_change_speed(struct uart_state *state, struct ktermios *old_termios) { @@ -455,30 +454,27 @@ uart_change_speed(struct uart_state *state, struct ktermios *old_termios) port->ops->set_termios(port, termios, old_termios); } -static inline int +static inline void __uart_put_char(struct uart_port *port, struct circ_buf *circ, unsigned char c) { unsigned long flags; - int ret = 0; if (!circ->buf) - return 0; + return; spin_lock_irqsave(&port->lock, flags); if (uart_circ_chars_free(circ) != 0) { circ->buf[circ->head] = c; circ->head = (circ->head + 1) & (UART_XMIT_SIZE - 1); - ret = 1; } spin_unlock_irqrestore(&port->lock, flags); - return ret; } -static int uart_put_char(struct tty_struct *tty, unsigned char ch) +static void uart_put_char(struct tty_struct *tty, unsigned char ch) { struct uart_state *state = tty->driver_data; - return __uart_put_char(state->port, &state->info->xmit, ch); + __uart_put_char(state->port, &state->info->xmit, ch); } static void uart_flush_chars(struct tty_struct *tty) @@ -532,25 +528,15 @@ uart_write(struct tty_struct *tty, const unsigned char *buf, int count) static int uart_write_room(struct tty_struct *tty) { struct uart_state *state = tty->driver_data; - unsigned long flags; - int ret; - spin_lock_irqsave(&state->port->lock, flags); - ret = uart_circ_chars_free(&state->info->xmit); - spin_unlock_irqrestore(&state->port->lock, flags); - return ret; + return uart_circ_chars_free(&state->info->xmit); } static int uart_chars_in_buffer(struct tty_struct *tty) { struct uart_state *state = tty->driver_data; - unsigned long flags; - int ret; - spin_lock_irqsave(&state->port->lock, flags); - ret = uart_circ_chars_pending(&state->info->xmit); - spin_unlock_irqrestore(&state->port->lock, flags); - return ret; + return uart_circ_chars_pending(&state->info->xmit); } static void uart_flush_buffer(struct tty_struct *tty) @@ -632,11 +618,6 @@ static int uart_get_info(struct uart_state *state, struct serial_struct tmp; memset(&tmp, 0, sizeof(tmp)); - - /* Ensure the state we copy is consistent and no hardware changes - occur as we go */ - mutex_lock(&state->mutex); - tmp.type = port->type; tmp.line = port->line; tmp.port = port->iobase; @@ -656,8 +637,6 @@ static int uart_get_info(struct uart_state *state, tmp.iomem_reg_shift = port->regshift; tmp.iomem_base = (void *)(unsigned long)port->mapbase; - mutex_unlock(&state->mutex); - if (copy_to_user(retinfo, &tmp, sizeof(*retinfo))) return -EFAULT; return 0; @@ -935,6 +914,8 @@ static void uart_break_ctl(struct tty_struct *tty, int break_state) struct uart_state *state = tty->driver_data; struct uart_port *port = state->port; + BUG_ON(!kernel_locked()); + mutex_lock(&state->mutex); if (port->type != PORT_UNKNOWN) @@ -1078,7 +1059,7 @@ static int uart_get_count(struct uart_state *state, } /* - * Called via sys_ioctl. We can use spin_lock_irq() here. + * Called via sys_ioctl under the BKL. We can use spin_lock_irq() here. */ static int uart_ioctl(struct tty_struct *tty, struct file *filp, unsigned int cmd, @@ -1088,6 +1069,7 @@ uart_ioctl(struct tty_struct *tty, struct file *filp, unsigned int cmd, void __user *uarg = (void __user *)arg; int ret = -ENOIOCTLCMD; + BUG_ON(!kernel_locked()); /* * These ioctls don't rely on the hardware to be present. @@ -1158,9 +1140,9 @@ uart_ioctl(struct tty_struct *tty, struct file *filp, unsigned int cmd, break; } } -out_up: + out_up: mutex_unlock(&state->mutex); -out: + out: return ret; } @@ -1171,6 +1153,7 @@ static void uart_set_termios(struct tty_struct *tty, unsigned long flags; unsigned int cflag = tty->termios->c_cflag; + BUG_ON(!kernel_locked()); /* * These are the bits that are used to setup various @@ -1182,9 +1165,8 @@ static void uart_set_termios(struct tty_struct *tty, if ((cflag ^ old_termios->c_cflag) == 0 && tty->termios->c_ospeed == old_termios->c_ospeed && tty->termios->c_ispeed == old_termios->c_ispeed && - RELEVANT_IFLAG(tty->termios->c_iflag ^ old_termios->c_iflag) == 0) { + RELEVANT_IFLAG(tty->termios->c_iflag ^ old_termios->c_iflag) == 0) return; - } uart_change_speed(state, old_termios); @@ -1218,6 +1200,7 @@ static void uart_set_termios(struct tty_struct *tty, } spin_unlock_irqrestore(&state->port->lock, flags); } + #if 0 /* * No need to wake up processes in open wait, since they @@ -1333,11 +1316,11 @@ static void uart_wait_until_sent(struct tty_struct *tty, int timeout) struct uart_port *port = state->port; unsigned long char_time, expire; + BUG_ON(!kernel_locked()); + if (port->type == PORT_UNKNOWN || port->fifosize == 0) return; - lock_kernel(); - /* * Set the check interval to be 1/5 of the estimated time to * send a single character, and make it at least 1. The check @@ -1383,7 +1366,6 @@ static void uart_wait_until_sent(struct tty_struct *tty, int timeout) break; } set_current_state(TASK_RUNNING); /* might not be needed */ - unlock_kernel(); } /* @@ -2097,9 +2079,7 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *port) int ret; uart_change_pm(state, 0); - spin_lock_irq(&port->lock); ops->set_mctrl(port, 0); - spin_unlock_irq(&port->lock); ret = ops->startup(port); if (ret == 0) { uart_change_speed(state, NULL); diff --git a/trunk/drivers/serial/sh-sci.c b/trunk/drivers/serial/sh-sci.c index 969106187718..c2ea5d4df44a 100644 --- a/trunk/drivers/serial/sh-sci.c +++ b/trunk/drivers/serial/sh-sci.c @@ -855,7 +855,7 @@ static int sci_notifier(struct notifier_block *self, printk(KERN_INFO "%s: got a postchange notification " "for cpu %d (old %d, new %d)\n", - __func__, freqs->cpu, freqs->old, freqs->new); + __FUNCTION__, freqs->cpu, freqs->old, freqs->new); } return NOTIFY_OK; diff --git a/trunk/drivers/serial/sn_console.c b/trunk/drivers/serial/sn_console.c index 019da2e05f0b..41fc61264443 100644 --- a/trunk/drivers/serial/sn_console.c +++ b/trunk/drivers/serial/sn_console.c @@ -839,7 +839,7 @@ static int __init sn_sal_module_init(void) if (uart_add_one_port(&sal_console_uart, &sal_console_port.sc_port) < 0) { /* error - not sure what I'd do - so I'll do nothing */ - printk(KERN_ERR "%s: unable to add port\n", __func__); + printk(KERN_ERR "%s: unable to add port\n", __FUNCTION__); } /* when this driver is compiled in, the console initialization diff --git a/trunk/drivers/serial/uartlite.c b/trunk/drivers/serial/uartlite.c index b51c24245be4..b565d5a37499 100644 --- a/trunk/drivers/serial/uartlite.c +++ b/trunk/drivers/serial/uartlite.c @@ -584,7 +584,7 @@ ulite_of_probe(struct of_device *op, const struct of_device_id *match) const unsigned int *id; int irq, rc; - dev_dbg(&op->dev, "%s(%p, %p)\n", __func__, op, match); + dev_dbg(&op->dev, "%s(%p, %p)\n", __FUNCTION__, op, match); rc = of_address_to_resource(op->node, 0, &res); if (rc) { diff --git a/trunk/drivers/serial/ucc_uart.c b/trunk/drivers/serial/ucc_uart.c index 01917c433f17..5e4310ccd591 100644 --- a/trunk/drivers/serial/ucc_uart.c +++ b/trunk/drivers/serial/ucc_uart.c @@ -215,7 +215,7 @@ static inline dma_addr_t cpu2qe_addr(void *addr, struct uart_qe_port *qe_port) return qe_port->bd_dma_addr + (addr - qe_port->bd_virt); /* something nasty happened */ - printk(KERN_ERR "%s: addr=%p\n", __func__, addr); + printk(KERN_ERR "%s: addr=%p\n", __FUNCTION__, addr); BUG(); return 0; } @@ -234,7 +234,7 @@ static inline void *qe2cpu_addr(dma_addr_t addr, struct uart_qe_port *qe_port) return qe_port->bd_virt + (addr - qe_port->bd_dma_addr); /* something nasty happened */ - printk(KERN_ERR "%s: addr=%x\n", __func__, addr); + printk(KERN_ERR "%s: addr=%x\n", __FUNCTION__, addr); BUG(); return NULL; } diff --git a/trunk/drivers/spi/atmel_spi.c b/trunk/drivers/spi/atmel_spi.c index e81d59d78910..02c8e305b14f 100644 --- a/trunk/drivers/spi/atmel_spi.c +++ b/trunk/drivers/spi/atmel_spi.c @@ -497,7 +497,7 @@ static int atmel_spi_setup(struct spi_device *spi) struct atmel_spi *as; u32 scbr, csr; unsigned int bits = spi->bits_per_word; - unsigned long bus_hz; + unsigned long bus_hz, sck_hz; unsigned int npcs_pin; int ret; @@ -536,25 +536,14 @@ static int atmel_spi_setup(struct spi_device *spi) return -EINVAL; } - /* - * Pre-new_1 chips start out at half the peripheral - * bus speed. - */ + /* speed zero convention is used by some upper layers */ bus_hz = clk_get_rate(as->clk); - if (!as->new_1) - bus_hz /= 2; - if (spi->max_speed_hz) { - /* - * Calculate the lowest divider that satisfies the - * constraint, assuming div32/fdiv/mbz == 0. - */ - scbr = DIV_ROUND_UP(bus_hz, spi->max_speed_hz); - - /* - * If the resulting divider doesn't fit into the - * register bitfield, we can't satisfy the constraint. - */ + /* assume div32/fdiv/mbz == 0 */ + if (!as->new_1) + bus_hz /= 2; + scbr = ((bus_hz + spi->max_speed_hz - 1) + / spi->max_speed_hz); if (scbr >= (1 << SPI_SCBR_SIZE)) { dev_dbg(&spi->dev, "setup: %d Hz too slow, scbr %u; min %ld Hz\n", @@ -562,8 +551,8 @@ static int atmel_spi_setup(struct spi_device *spi) return -EINVAL; } } else - /* speed zero means "as slow as possible" */ scbr = 0xff; + sck_hz = bus_hz / scbr; csr = SPI_BF(SCBR, scbr) | SPI_BF(BITS, bits - 8); if (spi->mode & SPI_CPOL) @@ -600,7 +589,7 @@ static int atmel_spi_setup(struct spi_device *spi) dev_dbg(&spi->dev, "setup: %lu Hz bpw %u mode 0x%x -> csr%d %08x\n", - bus_hz / scbr, bits, spi->mode, spi->chip_select, csr); + sck_hz, bits, spi->mode, spi->chip_select, csr); spi_writel(as, CSR0 + 4 * spi->chip_select, csr); diff --git a/trunk/drivers/usb/gadget/serial.c b/trunk/drivers/usb/gadget/serial.c index 8d158e5640e3..433b3f44f42e 100644 --- a/trunk/drivers/usb/gadget/serial.c +++ b/trunk/drivers/usb/gadget/serial.c @@ -170,7 +170,7 @@ static int gs_open(struct tty_struct *tty, struct file *file); static void gs_close(struct tty_struct *tty, struct file *file); static int gs_write(struct tty_struct *tty, const unsigned char *buf, int count); -static int gs_put_char(struct tty_struct *tty, unsigned char ch); +static void gs_put_char(struct tty_struct *tty, unsigned char ch); static void gs_flush_chars(struct tty_struct *tty); static int gs_write_room(struct tty_struct *tty); static int gs_chars_in_buffer(struct tty_struct *tty); @@ -883,15 +883,14 @@ static int gs_write(struct tty_struct *tty, const unsigned char *buf, int count) /* * gs_put_char */ -static int gs_put_char(struct tty_struct *tty, unsigned char ch) +static void gs_put_char(struct tty_struct *tty, unsigned char ch) { unsigned long flags; struct gs_port *port = tty->driver_data; - int ret = 0; if (port == NULL) { pr_err("gs_put_char: NULL port pointer\n"); - return 0; + return; } gs_debug("gs_put_char: (%d,%p) char=0x%x, called from %p\n", @@ -911,11 +910,10 @@ static int gs_put_char(struct tty_struct *tty, unsigned char ch) goto exit; } - ret = gs_buf_put(port->port_write_buf, &ch, 1); + gs_buf_put(port->port_write_buf, &ch, 1); exit: spin_unlock_irqrestore(&port->port_lock, flags); - return ret; } /* diff --git a/trunk/drivers/usb/serial/digi_acceleport.c b/trunk/drivers/usb/serial/digi_acceleport.c index 04a56f300ea6..d17d1645714f 100644 --- a/trunk/drivers/usb/serial/digi_acceleport.c +++ b/trunk/drivers/usb/serial/digi_acceleport.c @@ -1421,7 +1421,8 @@ static void digi_close(struct usb_serial_port *port, struct file *filp) tty_wait_until_sent(tty, DIGI_CLOSE_TIMEOUT); /* flush driver and line discipline buffers */ - tty_driver_flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); tty_ldisc_flush(tty); if (port->serial->dev) { diff --git a/trunk/drivers/usb/serial/usb-serial.c b/trunk/drivers/usb/serial/usb-serial.c index 0cb0d77dc429..a9934a3f9845 100644 --- a/trunk/drivers/usb/serial/usb-serial.c +++ b/trunk/drivers/usb/serial/usb-serial.c @@ -296,14 +296,16 @@ static int serial_write (struct tty_struct * tty, const unsigned char *buf, int struct usb_serial_port *port = tty->driver_data; int retval = -ENODEV; - if (port->serial->dev->state == USB_STATE_NOTATTACHED) + if (!port || port->serial->dev->state == USB_STATE_NOTATTACHED) goto exit; dbg("%s - port %d, %d byte(s)", __func__, port->number, count); - /* open_count is managed under the mutex lock for the tty so cannot - drop to zero until after the last close completes */ - WARN_ON(!port->open_count); + if (!port->open_count) { + retval = -EINVAL; + dbg("%s - port not opened", __func__); + goto exit; + } /* pass on to the driver specific version of this function */ retval = port->serial->type->write(port, buf, count); @@ -315,28 +317,61 @@ static int serial_write (struct tty_struct * tty, const unsigned char *buf, int static int serial_write_room (struct tty_struct *tty) { struct usb_serial_port *port = tty->driver_data; + int retval = -ENODEV; + + if (!port) + goto exit; + dbg("%s - port %d", __func__, port->number); - WARN_ON(!port->open_count); + + if (!port->open_count) { + dbg("%s - port not open", __func__); + goto exit; + } + /* pass on to the driver specific version of this function */ - return port->serial->type->write_room(port); + retval = port->serial->type->write_room(port); + +exit: + return retval; } static int serial_chars_in_buffer (struct tty_struct *tty) { struct usb_serial_port *port = tty->driver_data; + int retval = -ENODEV; + + if (!port) + goto exit; + dbg("%s = port %d", __func__, port->number); - WARN_ON(!port->open_count); + if (!port->open_count) { + dbg("%s - port not open", __func__); + goto exit; + } + /* pass on to the driver specific version of this function */ - return port->serial->type->chars_in_buffer(port); + retval = port->serial->type->chars_in_buffer(port); + +exit: + return retval; } static void serial_throttle (struct tty_struct * tty) { struct usb_serial_port *port = tty->driver_data; + + if (!port) + return; + dbg("%s - port %d", __func__, port->number); - WARN_ON(!port->open_count); + if (!port->open_count) { + dbg ("%s - port not open", __func__); + return; + } + /* pass on to the driver specific version of this function */ if (port->serial->type->throttle) port->serial->type->throttle(port); @@ -345,9 +380,17 @@ static void serial_throttle (struct tty_struct * tty) static void serial_unthrottle (struct tty_struct * tty) { struct usb_serial_port *port = tty->driver_data; + + if (!port) + return; + dbg("%s - port %d", __func__, port->number); - WARN_ON(!port->open_count); + if (!port->open_count) { + dbg("%s - port not open", __func__); + return; + } + /* pass on to the driver specific version of this function */ if (port->serial->type->unthrottle) port->serial->type->unthrottle(port); @@ -358,27 +401,42 @@ static int serial_ioctl (struct tty_struct *tty, struct file * file, unsigned in struct usb_serial_port *port = tty->driver_data; int retval = -ENODEV; + lock_kernel(); + if (!port) + goto exit; + dbg("%s - port %d, cmd 0x%.4x", __func__, port->number, cmd); - WARN_ON(!port->open_count); + /* Caution - port->open_count is BKL protected */ + if (!port->open_count) { + dbg ("%s - port not open", __func__); + goto exit; + } /* pass on to the driver specific version of this function if it is available */ - if (port->serial->type->ioctl) { - lock_kernel(); + if (port->serial->type->ioctl) retval = port->serial->type->ioctl(port, file, cmd, arg); - unlock_kernel(); - } else retval = -ENOIOCTLCMD; +exit: + unlock_kernel(); return retval; } static void serial_set_termios (struct tty_struct *tty, struct ktermios * old) { struct usb_serial_port *port = tty->driver_data; + + if (!port) + return; + dbg("%s - port %d", __func__, port->number); - WARN_ON(!port->open_count); + if (!port->open_count) { + dbg("%s - port not open", __func__); + return; + } + /* pass on to the driver specific version of this function if it is available */ if (port->serial->type->set_termios) port->serial->type->set_termios(port, old); @@ -390,15 +448,24 @@ static void serial_break (struct tty_struct *tty, int break_state) { struct usb_serial_port *port = tty->driver_data; + lock_kernel(); + if (!port) { + unlock_kernel(); + return; + } + dbg("%s - port %d", __func__, port->number); - WARN_ON(!port->open_count); - /* pass on to the driver specific version of this function if it is available */ - if (port->serial->type->break_ctl) { - lock_kernel(); - port->serial->type->break_ctl(port, break_state); + if (!port->open_count) { + dbg("%s - port not open", __func__); unlock_kernel(); + return; } + + /* pass on to the driver specific version of this function if it is available */ + if (port->serial->type->break_ctl) + port->serial->type->break_ctl(port, break_state); + unlock_kernel(); } static int serial_read_proc (char *page, char **start, off_t off, int count, int *eof, void *data) @@ -452,11 +519,19 @@ static int serial_tiocmget (struct tty_struct *tty, struct file *file) { struct usb_serial_port *port = tty->driver_data; + if (!port) + return -ENODEV; + dbg("%s - port %d", __func__, port->number); - WARN_ON(!port->open_count); + if (!port->open_count) { + dbg("%s - port not open", __func__); + return -ENODEV; + } + if (port->serial->type->tiocmget) return port->serial->type->tiocmget(port, file); + return -EINVAL; } @@ -465,11 +540,19 @@ static int serial_tiocmset (struct tty_struct *tty, struct file *file, { struct usb_serial_port *port = tty->driver_data; + if (!port) + return -ENODEV; + dbg("%s - port %d", __func__, port->number); - WARN_ON(!port->open_count); + if (!port->open_count) { + dbg("%s - port not open", __func__); + return -ENODEV; + } + if (port->serial->type->tiocmset) return port->serial->type->tiocmset(port, file, set, clear); + return -EINVAL; } diff --git a/trunk/drivers/usb/serial/whiteheat.c b/trunk/drivers/usb/serial/whiteheat.c index f07e8a4c1f3d..e96bf8663ffc 100644 --- a/trunk/drivers/usb/serial/whiteheat.c +++ b/trunk/drivers/usb/serial/whiteheat.c @@ -673,13 +673,15 @@ static void whiteheat_close(struct usb_serial_port *port, struct file * filp) } */ - tty_driver_flush_buffer(port->tty); + if (port->tty->driver->flush_buffer) + port->tty->driver->flush_buffer(port->tty); tty_ldisc_flush(port->tty); firm_report_tx_done(port); firm_close(port); +printk(KERN_ERR"Before processing rx_urbs_submitted.\n"); /* shutdown our bulk reads and writes */ mutex_lock(&info->deathwarrant); spin_lock_irq(&info->lock); diff --git a/trunk/drivers/video/Kconfig b/trunk/drivers/video/Kconfig index bb1dadaa4a23..a576dc261732 100644 --- a/trunk/drivers/video/Kconfig +++ b/trunk/drivers/video/Kconfig @@ -1774,11 +1774,6 @@ config FB_PXA If unsure, say N. -config FB_PXA_SMARTPANEL - bool "PXA Smartpanel LCD support" - default n - depends on FB_PXA - config FB_PXA_PARAMETERS bool "PXA LCD command line parameters" default n diff --git a/trunk/drivers/video/pxafb.c b/trunk/drivers/video/pxafb.c index 3ab6e3d973a1..757651954e6c 100644 --- a/trunk/drivers/video/pxafb.c +++ b/trunk/drivers/video/pxafb.c @@ -39,9 +39,6 @@ #include #include #include -#include -#include -#include #include #include @@ -60,31 +57,19 @@ #include "pxafb.h" /* Bits which should not be set in machine configuration structures */ -#define LCCR0_INVALID_CONFIG_MASK (LCCR0_OUM | LCCR0_BM | LCCR0_QDM |\ - LCCR0_DIS | LCCR0_EFM | LCCR0_IUM |\ - LCCR0_SFM | LCCR0_LDM | LCCR0_ENB) - -#define LCCR3_INVALID_CONFIG_MASK (LCCR3_HSP | LCCR3_VSP |\ - LCCR3_PCD | LCCR3_BPP) +#define LCCR0_INVALID_CONFIG_MASK (LCCR0_OUM|LCCR0_BM|LCCR0_QDM|LCCR0_DIS|LCCR0_EFM|LCCR0_IUM|LCCR0_SFM|LCCR0_LDM|LCCR0_ENB) +#define LCCR3_INVALID_CONFIG_MASK (LCCR3_HSP|LCCR3_VSP|LCCR3_PCD|LCCR3_BPP) static void (*pxafb_backlight_power)(int); static void (*pxafb_lcd_power)(int, struct fb_var_screeninfo *); -static int pxafb_activate_var(struct fb_var_screeninfo *var, - struct pxafb_info *); +static int pxafb_activate_var(struct fb_var_screeninfo *var, struct pxafb_info *); static void set_ctrlr_state(struct pxafb_info *fbi, u_int state); -static inline unsigned long -lcd_readl(struct pxafb_info *fbi, unsigned int off) -{ - return __raw_readl(fbi->mmio_base + off); -} - -static inline void -lcd_writel(struct pxafb_info *fbi, unsigned int off, unsigned long val) -{ - __raw_writel(val, fbi->mmio_base + off); -} +#ifdef CONFIG_FB_PXA_PARAMETERS +#define PXAFB_OPTIONS_SIZE 256 +static char g_options[PXAFB_OPTIONS_SIZE] __devinitdata = ""; +#endif static inline void pxafb_schedule_work(struct pxafb_info *fbi, u_int state) { @@ -94,12 +79,10 @@ static inline void pxafb_schedule_work(struct pxafb_info *fbi, u_int state) /* * We need to handle two requests being made at the same time. * There are two important cases: - * 1. When we are changing VT (C_REENABLE) while unblanking - * (C_ENABLE) We must perform the unblanking, which will - * do our REENABLE for us. - * 2. When we are blanking, but immediately unblank before - * we have blanked. We do the "REENABLE" thing here as - * well, just to be sure. + * 1. When we are changing VT (C_REENABLE) while unblanking (C_ENABLE) + * We must perform the unblanking, which will do our REENABLE for us. + * 2. When we are blanking, but immediately unblank before we have + * blanked. We do the "REENABLE" thing here as well, just to be sure. */ if (fbi->task_state == C_ENABLE && state == C_REENABLE) state = (u_int) -1; @@ -146,13 +129,13 @@ pxafb_setpalettereg(u_int regno, u_int red, u_int green, u_int blue, val = ((red << 8) & 0x00f80000); val |= ((green >> 0) & 0x0000fc00); val |= ((blue >> 8) & 0x000000f8); - ((u32 *)(fbi->palette_cpu))[regno] = val; + ((u32*)(fbi->palette_cpu))[regno] = val; break; case LCCR4_PAL_FOR_2: val = ((red << 8) & 0x00fc0000); val |= ((green >> 0) & 0x0000fc00); val |= ((blue >> 8) & 0x000000fc); - ((u32 *)(fbi->palette_cpu))[regno] = val; + ((u32*)(fbi->palette_cpu))[regno] = val; break; } @@ -220,15 +203,15 @@ pxafb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, */ static int pxafb_bpp_to_lccr3(struct fb_var_screeninfo *var) { - int ret = 0; - switch (var->bits_per_pixel) { - case 1: ret = LCCR3_1BPP; break; - case 2: ret = LCCR3_2BPP; break; - case 4: ret = LCCR3_4BPP; break; - case 8: ret = LCCR3_8BPP; break; - case 16: ret = LCCR3_16BPP; break; - } - return ret; + int ret = 0; + switch (var->bits_per_pixel) { + case 1: ret = LCCR3_1BPP; break; + case 2: ret = LCCR3_2BPP; break; + case 4: ret = LCCR3_4BPP; break; + case 8: ret = LCCR3_8BPP; break; + case 16: ret = LCCR3_16BPP; break; + } + return ret; } #ifdef CONFIG_CPU_FREQ @@ -240,32 +223,31 @@ static int pxafb_bpp_to_lccr3(struct fb_var_screeninfo *var) */ static unsigned int pxafb_display_dma_period(struct fb_var_screeninfo *var) { - /* - * Period = pixclock * bits_per_byte * bytes_per_transfer - * / memory_bits_per_pixel; - */ - return var->pixclock * 8 * 16 / var->bits_per_pixel; + /* + * Period = pixclock * bits_per_byte * bytes_per_transfer + * / memory_bits_per_pixel; + */ + return var->pixclock * 8 * 16 / var->bits_per_pixel; } + +extern unsigned int get_clk_frequency_khz(int info); #endif /* * Select the smallest mode that allows the desired resolution to be * displayed. If desired parameters can be rounded up. */ -static struct pxafb_mode_info *pxafb_getmode(struct pxafb_mach_info *mach, - struct fb_var_screeninfo *var) +static struct pxafb_mode_info *pxafb_getmode(struct pxafb_mach_info *mach, struct fb_var_screeninfo *var) { struct pxafb_mode_info *mode = NULL; struct pxafb_mode_info *modelist = mach->modes; unsigned int best_x = 0xffffffff, best_y = 0xffffffff; unsigned int i; - for (i = 0; i < mach->num_modes; i++) { - if (modelist[i].xres >= var->xres && - modelist[i].yres >= var->yres && - modelist[i].xres < best_x && - modelist[i].yres < best_y && - modelist[i].bpp >= var->bits_per_pixel) { + for (i = 0 ; i < mach->num_modes ; i++) { + if (modelist[i].xres >= var->xres && modelist[i].yres >= var->yres && + modelist[i].xres < best_x && modelist[i].yres < best_y && + modelist[i].bpp >= var->bits_per_pixel ) { best_x = modelist[i].xres; best_y = modelist[i].yres; mode = &modelist[i]; @@ -275,8 +257,7 @@ static struct pxafb_mode_info *pxafb_getmode(struct pxafb_mach_info *mach, return mode; } -static void pxafb_setmode(struct fb_var_screeninfo *var, - struct pxafb_mode_info *mode) +static void pxafb_setmode(struct fb_var_screeninfo *var, struct pxafb_mode_info *mode) { var->xres = mode->xres; var->yres = mode->yres; @@ -334,20 +315,19 @@ static int pxafb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) var->yres_virtual = max(var->yres_virtual, var->yres); - /* + /* * Setup the RGB parameters for this display. * * The pixel packing format is described on page 7-11 of the * PXA2XX Developer's Manual. - */ + */ if (var->bits_per_pixel == 16) { var->red.offset = 11; var->red.length = 5; var->green.offset = 5; var->green.length = 6; var->blue.offset = 0; var->blue.length = 5; var->transp.offset = var->transp.length = 0; } else { - var->red.offset = var->green.offset = 0; - var->blue.offset = var->transp.offset = 0; + var->red.offset = var->green.offset = var->blue.offset = var->transp.offset = 0; var->red.length = 8; var->green.length = 8; var->blue.length = 8; @@ -365,7 +345,8 @@ static int pxafb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) static inline void pxafb_set_truecolor(u_int is_true_color) { - /* do your machine-specific setup if needed */ + pr_debug("pxafb: true_color = %d\n", is_true_color); + // do your machine-specific setup if needed } /* @@ -376,6 +357,9 @@ static int pxafb_set_par(struct fb_info *info) { struct pxafb_info *fbi = (struct pxafb_info *)info; struct fb_var_screeninfo *var = &info->var; + unsigned long palette_mem_size; + + pr_debug("pxafb: set_par\n"); if (var->bits_per_pixel == 16) fbi->fb.fix.visual = FB_VISUAL_TRUECOLOR; @@ -395,10 +379,17 @@ static int pxafb_set_par(struct fb_info *info) if (var->bits_per_pixel == 16) fbi->palette_size = 0; else - fbi->palette_size = var->bits_per_pixel == 1 ? - 4 : 1 << var->bits_per_pixel; + fbi->palette_size = var->bits_per_pixel == 1 ? 4 : 1 << var->bits_per_pixel; + + if ((fbi->lccr4 & LCCR4_PAL_FOR_MASK) == LCCR4_PAL_FOR_0) + palette_mem_size = fbi->palette_size * sizeof(u16); + else + palette_mem_size = fbi->palette_size * sizeof(u32); + + pr_debug("pxafb: palette_mem_size = 0x%08lx\n", palette_mem_size); - fbi->palette_cpu = (u16 *)&fbi->dma_buff->palette[0]; + fbi->palette_cpu = (u16 *)(fbi->map_cpu + PAGE_SIZE - palette_mem_size); + fbi->palette_dma = fbi->map_dma + PAGE_SIZE - palette_mem_size; /* * Set (any) board control register to handle new color depth @@ -415,6 +406,36 @@ static int pxafb_set_par(struct fb_info *info) return 0; } +/* + * Formal definition of the VESA spec: + * On + * This refers to the state of the display when it is in full operation + * Stand-By + * This defines an optional operating state of minimal power reduction with + * the shortest recovery time + * Suspend + * This refers to a level of power management in which substantial power + * reduction is achieved by the display. The display can have a longer + * recovery time from this state than from the Stand-by state + * Off + * This indicates that the display is consuming the lowest level of power + * and is non-operational. Recovery from this state may optionally require + * the user to manually power on the monitor + * + * Now, the fbdev driver adds an additional state, (blank), where they + * turn off the video (maybe by colormap tricks), but don't mess with the + * video itself: think of it semantically between on and Stand-By. + * + * So here's what we should do in our fbdev blank routine: + * + * VESA_NO_BLANKING (mode 0) Video on, front/back light on + * VESA_VSYNC_SUSPEND (mode 1) Video on, front/back light off + * VESA_HSYNC_SUSPEND (mode 2) Video on, front/back light off + * VESA_POWERDOWN (mode 3) Video off, front/back light off + * + * This will match the matrox implementation. + */ + /* * pxafb_blank(): * Blank the display by setting all palette values to zero. Note, the @@ -426,6 +447,8 @@ static int pxafb_blank(int blank, struct fb_info *info) struct pxafb_info *fbi = (struct pxafb_info *)info; int i; + pr_debug("pxafb: blank=%d\n", blank); + switch (blank) { case FB_BLANK_POWERDOWN: case FB_BLANK_VSYNC_SUSPEND: @@ -437,11 +460,11 @@ static int pxafb_blank(int blank, struct fb_info *info) pxafb_setpalettereg(i, 0, 0, 0, 0, info); pxafb_schedule_work(fbi, C_DISABLE); - /* TODO if (pxafb_blank_helper) pxafb_blank_helper(blank); */ + //TODO if (pxafb_blank_helper) pxafb_blank_helper(blank); break; case FB_BLANK_UNBLANK: - /* TODO if (pxafb_blank_helper) pxafb_blank_helper(blank); */ + //TODO if (pxafb_blank_helper) pxafb_blank_helper(blank); if (fbi->fb.fix.visual == FB_VISUAL_PSEUDOCOLOR || fbi->fb.fix.visual == FB_VISUAL_STATIC_PSEUDOCOLOR) fb_set_cmap(&fbi->fb.cmap, info); @@ -457,7 +480,7 @@ static int pxafb_mmap(struct fb_info *info, unsigned long off = vma->vm_pgoff << PAGE_SHIFT; if (off < info->fix.smem_len) { - vma->vm_pgoff += fbi->video_offset / PAGE_SIZE; + vma->vm_pgoff += 1; return dma_mmap_writecombine(fbi->dev, vma, fbi->map_cpu, fbi->map_dma, fbi->map_size); } @@ -506,8 +529,7 @@ static struct fb_ops pxafb_ops = { * * Factoring the 10^4 and 10^-12 out gives 10^-8 == 1 / 100000000 as used below. */ -static inline unsigned int get_pcd(struct pxafb_info *fbi, - unsigned int pixclock) +static inline unsigned int get_pcd(struct pxafb_info *fbi, unsigned int pixclock) { unsigned long long pcd; @@ -533,7 +555,7 @@ static inline void set_hsync_time(struct pxafb_info *fbi, unsigned int pcd) unsigned long htime; if ((pcd == 0) || (fbi->fb.var.hsync_len == 0)) { - fbi->hsync_time = 0; + fbi->hsync_time=0; return; } @@ -554,231 +576,71 @@ unsigned long pxafb_get_hsync_time(struct device *dev) } EXPORT_SYMBOL(pxafb_get_hsync_time); -static int setup_frame_dma(struct pxafb_info *fbi, int dma, int pal, - unsigned int offset, size_t size) -{ - struct pxafb_dma_descriptor *dma_desc, *pal_desc; - unsigned int dma_desc_off, pal_desc_off; - - if (dma < 0 || dma >= DMA_MAX) - return -EINVAL; - - dma_desc = &fbi->dma_buff->dma_desc[dma]; - dma_desc_off = offsetof(struct pxafb_dma_buff, dma_desc[dma]); - - dma_desc->fsadr = fbi->screen_dma + offset; - dma_desc->fidr = 0; - dma_desc->ldcmd = size; - - if (pal < 0 || pal >= PAL_MAX) { - dma_desc->fdadr = fbi->dma_buff_phys + dma_desc_off; - fbi->fdadr[dma] = fbi->dma_buff_phys + dma_desc_off; - } else { - pal_desc = &fbi->dma_buff->pal_desc[dma]; - pal_desc_off = offsetof(struct pxafb_dma_buff, dma_desc[pal]); - - pal_desc->fsadr = fbi->dma_buff_phys + pal * PALETTE_SIZE; - pal_desc->fidr = 0; - - if ((fbi->lccr4 & LCCR4_PAL_FOR_MASK) == LCCR4_PAL_FOR_0) - pal_desc->ldcmd = fbi->palette_size * sizeof(u16); - else - pal_desc->ldcmd = fbi->palette_size * sizeof(u32); - - pal_desc->ldcmd |= LDCMD_PAL; - - /* flip back and forth between palette and frame buffer */ - pal_desc->fdadr = fbi->dma_buff_phys + dma_desc_off; - dma_desc->fdadr = fbi->dma_buff_phys + pal_desc_off; - fbi->fdadr[dma] = fbi->dma_buff_phys + dma_desc_off; - } - - return 0; -} - -#ifdef CONFIG_FB_PXA_SMARTPANEL -static int setup_smart_dma(struct pxafb_info *fbi) -{ - struct pxafb_dma_descriptor *dma_desc; - unsigned long dma_desc_off, cmd_buff_off; - - dma_desc = &fbi->dma_buff->dma_desc[DMA_CMD]; - dma_desc_off = offsetof(struct pxafb_dma_buff, dma_desc[DMA_CMD]); - cmd_buff_off = offsetof(struct pxafb_dma_buff, cmd_buff); - - dma_desc->fdadr = fbi->dma_buff_phys + dma_desc_off; - dma_desc->fsadr = fbi->dma_buff_phys + cmd_buff_off; - dma_desc->fidr = 0; - dma_desc->ldcmd = fbi->n_smart_cmds * sizeof(uint16_t); - - fbi->fdadr[DMA_CMD] = dma_desc->fdadr; - return 0; -} - -int pxafb_smart_flush(struct fb_info *info) -{ - struct pxafb_info *fbi = container_of(info, struct pxafb_info, fb); - uint32_t prsr; - int ret = 0; - - /* disable controller until all registers are set up */ - lcd_writel(fbi, LCCR0, fbi->reg_lccr0 & ~LCCR0_ENB); - - /* 1. make it an even number of commands to align on 32-bit boundary - * 2. add the interrupt command to the end of the chain so we can - * keep track of the end of the transfer - */ - - while (fbi->n_smart_cmds & 1) - fbi->smart_cmds[fbi->n_smart_cmds++] = SMART_CMD_NOOP; - - fbi->smart_cmds[fbi->n_smart_cmds++] = SMART_CMD_INTERRUPT; - fbi->smart_cmds[fbi->n_smart_cmds++] = SMART_CMD_WAIT_FOR_VSYNC; - setup_smart_dma(fbi); - - /* continue to execute next command */ - prsr = lcd_readl(fbi, PRSR) | PRSR_ST_OK | PRSR_CON_NT; - lcd_writel(fbi, PRSR, prsr); - - /* stop the processor in case it executed "wait for sync" cmd */ - lcd_writel(fbi, CMDCR, 0x0001); - - /* don't send interrupts for fifo underruns on channel 6 */ - lcd_writel(fbi, LCCR5, LCCR5_IUM(6)); - - lcd_writel(fbi, LCCR1, fbi->reg_lccr1); - lcd_writel(fbi, LCCR2, fbi->reg_lccr2); - lcd_writel(fbi, LCCR3, fbi->reg_lccr3); - lcd_writel(fbi, FDADR0, fbi->fdadr[0]); - lcd_writel(fbi, FDADR6, fbi->fdadr[6]); - - /* begin sending */ - lcd_writel(fbi, LCCR0, fbi->reg_lccr0 | LCCR0_ENB); - - if (wait_for_completion_timeout(&fbi->command_done, HZ/2) == 0) { - pr_warning("%s: timeout waiting for command done\n", - __func__); - ret = -ETIMEDOUT; - } - - /* quick disable */ - prsr = lcd_readl(fbi, PRSR) & ~(PRSR_ST_OK | PRSR_CON_NT); - lcd_writel(fbi, PRSR, prsr); - lcd_writel(fbi, LCCR0, fbi->reg_lccr0 & ~LCCR0_ENB); - lcd_writel(fbi, FDADR6, 0); - fbi->n_smart_cmds = 0; - return ret; -} - -int pxafb_smart_queue(struct fb_info *info, uint16_t *cmds, int n_cmds) -{ - int i; - struct pxafb_info *fbi = container_of(info, struct pxafb_info, fb); - - /* leave 2 commands for INTERRUPT and WAIT_FOR_SYNC */ - for (i = 0; i < n_cmds; i++) { - if (fbi->n_smart_cmds == CMD_BUFF_SIZE - 8) - pxafb_smart_flush(info); - - fbi->smart_cmds[fbi->n_smart_cmds++] = *cmds++; - } - - return 0; -} - -static unsigned int __smart_timing(unsigned time_ns, unsigned long lcd_clk) -{ - unsigned int t = (time_ns * (lcd_clk / 1000000) / 1000); - return (t == 0) ? 1 : t; -} - -static void setup_smart_timing(struct pxafb_info *fbi, - struct fb_var_screeninfo *var) -{ - struct pxafb_mach_info *inf = fbi->dev->platform_data; - struct pxafb_mode_info *mode = &inf->modes[0]; - unsigned long lclk = clk_get_rate(fbi->clk); - unsigned t1, t2, t3, t4; - - t1 = max(mode->a0csrd_set_hld, mode->a0cswr_set_hld); - t2 = max(mode->rd_pulse_width, mode->wr_pulse_width); - t3 = mode->op_hold_time; - t4 = mode->cmd_inh_time; - - fbi->reg_lccr1 = - LCCR1_DisWdth(var->xres) | - LCCR1_BegLnDel(__smart_timing(t1, lclk)) | - LCCR1_EndLnDel(__smart_timing(t2, lclk)) | - LCCR1_HorSnchWdth(__smart_timing(t3, lclk)); - - fbi->reg_lccr2 = LCCR2_DisHght(var->yres); - fbi->reg_lccr3 = LCCR3_PixClkDiv(__smart_timing(t4, lclk)); - - /* FIXME: make this configurable */ - fbi->reg_cmdcr = 1; -} - -static int pxafb_smart_thread(void *arg) +/* + * pxafb_activate_var(): + * Configures LCD Controller based on entries in var parameter. Settings are + * only written to the controller if changes were made. + */ +static int pxafb_activate_var(struct fb_var_screeninfo *var, struct pxafb_info *fbi) { - struct pxafb_info *fbi = arg; - struct pxafb_mach_info *inf = fbi->dev->platform_data; - - if (!fbi || !inf->smart_update) { - pr_err("%s: not properly initialized, thread terminated\n", - __func__); - return -EINVAL; - } - - pr_debug("%s(): task starting\n", __func__); - - set_freezable(); - while (!kthread_should_stop()) { + struct pxafb_lcd_reg new_regs; + u_long flags; + u_int lines_per_panel, pcd = get_pcd(fbi, var->pixclock); - if (try_to_freeze()) - continue; + pr_debug("pxafb: Configuring PXA LCD\n"); - if (fbi->state == C_ENABLE) { - inf->smart_update(&fbi->fb); - complete(&fbi->refresh_done); - } + pr_debug("var: xres=%d hslen=%d lm=%d rm=%d\n", + var->xres, var->hsync_len, + var->left_margin, var->right_margin); + pr_debug("var: yres=%d vslen=%d um=%d bm=%d\n", + var->yres, var->vsync_len, + var->upper_margin, var->lower_margin); + pr_debug("var: pixclock=%d pcd=%d\n", var->pixclock, pcd); - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(30 * HZ / 1000); - } - - pr_debug("%s(): task ending\n", __func__); - return 0; -} - -static int pxafb_smart_init(struct pxafb_info *fbi) -{ - fbi->smart_thread = kthread_run(pxafb_smart_thread, fbi, - "lcd_refresh"); - if (IS_ERR(fbi->smart_thread)) { - printk(KERN_ERR "%s: unable to create kernel thread\n", - __func__); - return PTR_ERR(fbi->smart_thread); +#if DEBUG_VAR + if (var->xres < 16 || var->xres > 1024) + printk(KERN_ERR "%s: invalid xres %d\n", + fbi->fb.fix.id, var->xres); + switch(var->bits_per_pixel) { + case 1: + case 2: + case 4: + case 8: + case 16: + break; + default: + printk(KERN_ERR "%s: invalid bit depth %d\n", + fbi->fb.fix.id, var->bits_per_pixel); + break; } - return 0; -} -#else -int pxafb_smart_queue(struct fb_info *info, uint16_t *cmds, int n_cmds) -{ - return 0; -} - -int pxafb_smart_flush(struct fb_info *info) -{ - return 0; -} -#endif /* CONFIG_FB_SMART_PANEL */ + if (var->hsync_len < 1 || var->hsync_len > 64) + printk(KERN_ERR "%s: invalid hsync_len %d\n", + fbi->fb.fix.id, var->hsync_len); + if (var->left_margin < 1 || var->left_margin > 255) + printk(KERN_ERR "%s: invalid left_margin %d\n", + fbi->fb.fix.id, var->left_margin); + if (var->right_margin < 1 || var->right_margin > 255) + printk(KERN_ERR "%s: invalid right_margin %d\n", + fbi->fb.fix.id, var->right_margin); + if (var->yres < 1 || var->yres > 1024) + printk(KERN_ERR "%s: invalid yres %d\n", + fbi->fb.fix.id, var->yres); + if (var->vsync_len < 1 || var->vsync_len > 64) + printk(KERN_ERR "%s: invalid vsync_len %d\n", + fbi->fb.fix.id, var->vsync_len); + if (var->upper_margin < 0 || var->upper_margin > 255) + printk(KERN_ERR "%s: invalid upper_margin %d\n", + fbi->fb.fix.id, var->upper_margin); + if (var->lower_margin < 0 || var->lower_margin > 255) + printk(KERN_ERR "%s: invalid lower_margin %d\n", + fbi->fb.fix.id, var->lower_margin); +#endif -static void setup_parallel_timing(struct pxafb_info *fbi, - struct fb_var_screeninfo *var) -{ - unsigned int lines_per_panel, pcd = get_pcd(fbi, var->pixclock); + new_regs.lccr0 = fbi->lccr0 | + (LCCR0_LDM | LCCR0_SFM | LCCR0_IUM | LCCR0_EFM | + LCCR0_QDM | LCCR0_BM | LCCR0_OUM); - fbi->reg_lccr1 = + new_regs.lccr1 = LCCR1_DisWdth(var->xres) + LCCR1_HorSnchWdth(var->hsync_len) + LCCR1_BegLnDel(var->left_margin) + @@ -792,118 +654,110 @@ static void setup_parallel_timing(struct pxafb_info *fbi, if ((fbi->lccr0 & LCCR0_SDS) == LCCR0_Dual) lines_per_panel /= 2; - fbi->reg_lccr2 = + new_regs.lccr2 = LCCR2_DisHght(lines_per_panel) + LCCR2_VrtSnchWdth(var->vsync_len) + LCCR2_BegFrmDel(var->upper_margin) + LCCR2_EndFrmDel(var->lower_margin); - fbi->reg_lccr3 = fbi->lccr3 | - (var->sync & FB_SYNC_HOR_HIGH_ACT ? - LCCR3_HorSnchH : LCCR3_HorSnchL) | - (var->sync & FB_SYNC_VERT_HIGH_ACT ? - LCCR3_VrtSnchH : LCCR3_VrtSnchL); - - if (pcd) { - fbi->reg_lccr3 |= LCCR3_PixClkDiv(pcd); - set_hsync_time(fbi, pcd); - } -} + new_regs.lccr3 = fbi->lccr3 | + pxafb_bpp_to_lccr3(var) | + (var->sync & FB_SYNC_HOR_HIGH_ACT ? LCCR3_HorSnchH : LCCR3_HorSnchL) | + (var->sync & FB_SYNC_VERT_HIGH_ACT ? LCCR3_VrtSnchH : LCCR3_VrtSnchL); -/* - * pxafb_activate_var(): - * Configures LCD Controller based on entries in var parameter. - * Settings are only written to the controller if changes were made. - */ -static int pxafb_activate_var(struct fb_var_screeninfo *var, - struct pxafb_info *fbi) -{ - u_long flags; - size_t nbytes; + if (pcd) + new_regs.lccr3 |= LCCR3_PixClkDiv(pcd); -#if DEBUG_VAR - if (!(fbi->lccr0 & LCCR0_LCDT)) { - if (var->xres < 16 || var->xres > 1024) - printk(KERN_ERR "%s: invalid xres %d\n", - fbi->fb.fix.id, var->xres); - switch (var->bits_per_pixel) { - case 1: - case 2: - case 4: - case 8: - case 16: - break; - default: - printk(KERN_ERR "%s: invalid bit depth %d\n", - fbi->fb.fix.id, var->bits_per_pixel); - break; - } + pr_debug("nlccr0 = 0x%08x\n", new_regs.lccr0); + pr_debug("nlccr1 = 0x%08x\n", new_regs.lccr1); + pr_debug("nlccr2 = 0x%08x\n", new_regs.lccr2); + pr_debug("nlccr3 = 0x%08x\n", new_regs.lccr3); - if (var->hsync_len < 1 || var->hsync_len > 64) - printk(KERN_ERR "%s: invalid hsync_len %d\n", - fbi->fb.fix.id, var->hsync_len); - if (var->left_margin < 1 || var->left_margin > 255) - printk(KERN_ERR "%s: invalid left_margin %d\n", - fbi->fb.fix.id, var->left_margin); - if (var->right_margin < 1 || var->right_margin > 255) - printk(KERN_ERR "%s: invalid right_margin %d\n", - fbi->fb.fix.id, var->right_margin); - if (var->yres < 1 || var->yres > 1024) - printk(KERN_ERR "%s: invalid yres %d\n", - fbi->fb.fix.id, var->yres); - if (var->vsync_len < 1 || var->vsync_len > 64) - printk(KERN_ERR "%s: invalid vsync_len %d\n", - fbi->fb.fix.id, var->vsync_len); - if (var->upper_margin < 0 || var->upper_margin > 255) - printk(KERN_ERR "%s: invalid upper_margin %d\n", - fbi->fb.fix.id, var->upper_margin); - if (var->lower_margin < 0 || var->lower_margin > 255) - printk(KERN_ERR "%s: invalid lower_margin %d\n", - fbi->fb.fix.id, var->lower_margin); - } -#endif /* Update shadow copy atomically */ local_irq_save(flags); -#ifdef CONFIG_FB_PXA_SMARTPANEL - if (fbi->lccr0 & LCCR0_LCDT) - setup_smart_timing(fbi, var); - else -#endif - setup_parallel_timing(fbi, var); + /* setup dma descriptors */ + fbi->dmadesc_fblow_cpu = (struct pxafb_dma_descriptor *)((unsigned int)fbi->palette_cpu - 3*16); + fbi->dmadesc_fbhigh_cpu = (struct pxafb_dma_descriptor *)((unsigned int)fbi->palette_cpu - 2*16); + fbi->dmadesc_palette_cpu = (struct pxafb_dma_descriptor *)((unsigned int)fbi->palette_cpu - 1*16); - fbi->reg_lccr0 = fbi->lccr0 | - (LCCR0_LDM | LCCR0_SFM | LCCR0_IUM | LCCR0_EFM | - LCCR0_QDM | LCCR0_BM | LCCR0_OUM); + fbi->dmadesc_fblow_dma = fbi->palette_dma - 3*16; + fbi->dmadesc_fbhigh_dma = fbi->palette_dma - 2*16; + fbi->dmadesc_palette_dma = fbi->palette_dma - 1*16; - fbi->reg_lccr3 |= pxafb_bpp_to_lccr3(var); +#define BYTES_PER_PANEL (lines_per_panel * fbi->fb.fix.line_length) - nbytes = var->yres * fbi->fb.fix.line_length; + /* populate descriptors */ + fbi->dmadesc_fblow_cpu->fdadr = fbi->dmadesc_fblow_dma; + fbi->dmadesc_fblow_cpu->fsadr = fbi->screen_dma + BYTES_PER_PANEL; + fbi->dmadesc_fblow_cpu->fidr = 0; + fbi->dmadesc_fblow_cpu->ldcmd = BYTES_PER_PANEL; - if ((fbi->lccr0 & LCCR0_SDS) == LCCR0_Dual) { - nbytes = nbytes / 2; - setup_frame_dma(fbi, DMA_LOWER, PAL_NONE, nbytes, nbytes); - } + fbi->fdadr1 = fbi->dmadesc_fblow_dma; /* only used in dual-panel mode */ + + fbi->dmadesc_fbhigh_cpu->fsadr = fbi->screen_dma; + fbi->dmadesc_fbhigh_cpu->fidr = 0; + fbi->dmadesc_fbhigh_cpu->ldcmd = BYTES_PER_PANEL; - if ((var->bits_per_pixel >= 16) || (fbi->lccr0 & LCCR0_LCDT)) - setup_frame_dma(fbi, DMA_BASE, PAL_NONE, 0, nbytes); + fbi->dmadesc_palette_cpu->fsadr = fbi->palette_dma; + fbi->dmadesc_palette_cpu->fidr = 0; + if ((fbi->lccr4 & LCCR4_PAL_FOR_MASK) == LCCR4_PAL_FOR_0) + fbi->dmadesc_palette_cpu->ldcmd = fbi->palette_size * + sizeof(u16); else - setup_frame_dma(fbi, DMA_BASE, PAL_BASE, 0, nbytes); + fbi->dmadesc_palette_cpu->ldcmd = fbi->palette_size * + sizeof(u32); + fbi->dmadesc_palette_cpu->ldcmd |= LDCMD_PAL; - fbi->reg_lccr4 = lcd_readl(fbi, LCCR4) & ~LCCR4_PAL_FOR_MASK; + if (var->bits_per_pixel == 16) { + /* palette shouldn't be loaded in true-color mode */ + fbi->dmadesc_fbhigh_cpu->fdadr = fbi->dmadesc_fbhigh_dma; + fbi->fdadr0 = fbi->dmadesc_fbhigh_dma; /* no pal just fbhigh */ + /* init it to something, even though we won't be using it */ + fbi->dmadesc_palette_cpu->fdadr = fbi->dmadesc_palette_dma; + } else { + fbi->dmadesc_palette_cpu->fdadr = fbi->dmadesc_fbhigh_dma; + fbi->dmadesc_fbhigh_cpu->fdadr = fbi->dmadesc_palette_dma; + fbi->fdadr0 = fbi->dmadesc_palette_dma; /* flips back and forth between pal and fbhigh */ + } + +#if 0 + pr_debug("fbi->dmadesc_fblow_cpu = 0x%p\n", fbi->dmadesc_fblow_cpu); + pr_debug("fbi->dmadesc_fbhigh_cpu = 0x%p\n", fbi->dmadesc_fbhigh_cpu); + pr_debug("fbi->dmadesc_palette_cpu = 0x%p\n", fbi->dmadesc_palette_cpu); + pr_debug("fbi->dmadesc_fblow_dma = 0x%x\n", fbi->dmadesc_fblow_dma); + pr_debug("fbi->dmadesc_fbhigh_dma = 0x%x\n", fbi->dmadesc_fbhigh_dma); + pr_debug("fbi->dmadesc_palette_dma = 0x%x\n", fbi->dmadesc_palette_dma); + + pr_debug("fbi->dmadesc_fblow_cpu->fdadr = 0x%x\n", fbi->dmadesc_fblow_cpu->fdadr); + pr_debug("fbi->dmadesc_fbhigh_cpu->fdadr = 0x%x\n", fbi->dmadesc_fbhigh_cpu->fdadr); + pr_debug("fbi->dmadesc_palette_cpu->fdadr = 0x%x\n", fbi->dmadesc_palette_cpu->fdadr); + + pr_debug("fbi->dmadesc_fblow_cpu->fsadr = 0x%x\n", fbi->dmadesc_fblow_cpu->fsadr); + pr_debug("fbi->dmadesc_fbhigh_cpu->fsadr = 0x%x\n", fbi->dmadesc_fbhigh_cpu->fsadr); + pr_debug("fbi->dmadesc_palette_cpu->fsadr = 0x%x\n", fbi->dmadesc_palette_cpu->fsadr); + + pr_debug("fbi->dmadesc_fblow_cpu->ldcmd = 0x%x\n", fbi->dmadesc_fblow_cpu->ldcmd); + pr_debug("fbi->dmadesc_fbhigh_cpu->ldcmd = 0x%x\n", fbi->dmadesc_fbhigh_cpu->ldcmd); + pr_debug("fbi->dmadesc_palette_cpu->ldcmd = 0x%x\n", fbi->dmadesc_palette_cpu->ldcmd); +#endif + + fbi->reg_lccr0 = new_regs.lccr0; + fbi->reg_lccr1 = new_regs.lccr1; + fbi->reg_lccr2 = new_regs.lccr2; + fbi->reg_lccr3 = new_regs.lccr3; + fbi->reg_lccr4 = LCCR4 & (~LCCR4_PAL_FOR_MASK); fbi->reg_lccr4 |= (fbi->lccr4 & LCCR4_PAL_FOR_MASK); + set_hsync_time(fbi, pcd); local_irq_restore(flags); /* * Only update the registers if the controller is enabled * and something has changed. */ - if ((lcd_readl(fbi, LCCR0) != fbi->reg_lccr0) || - (lcd_readl(fbi, LCCR1) != fbi->reg_lccr1) || - (lcd_readl(fbi, LCCR2) != fbi->reg_lccr2) || - (lcd_readl(fbi, LCCR3) != fbi->reg_lccr3) || - (lcd_readl(fbi, FDADR0) != fbi->fdadr[0]) || - (lcd_readl(fbi, FDADR1) != fbi->fdadr[1])) + if ((LCCR0 != fbi->reg_lccr0) || (LCCR1 != fbi->reg_lccr1) || + (LCCR2 != fbi->reg_lccr2) || (LCCR3 != fbi->reg_lccr3) || + (FDADR0 != fbi->fdadr0) || (FDADR1 != fbi->fdadr1)) pxafb_schedule_work(fbi, C_REENABLE); return 0; @@ -919,8 +773,8 @@ static inline void __pxafb_backlight_power(struct pxafb_info *fbi, int on) { pr_debug("pxafb: backlight o%s\n", on ? "n" : "ff"); - if (pxafb_backlight_power) - pxafb_backlight_power(on); + if (pxafb_backlight_power) + pxafb_backlight_power(on); } static inline void __pxafb_lcd_power(struct pxafb_info *fbi, int on) @@ -934,11 +788,11 @@ static inline void __pxafb_lcd_power(struct pxafb_info *fbi, int on) static void pxafb_setup_gpio(struct pxafb_info *fbi) { int gpio, ldd_bits; - unsigned int lccr0 = fbi->lccr0; + unsigned int lccr0 = fbi->lccr0; /* * setup is based on type of panel supported - */ + */ /* 4 bit interface */ if ((lccr0 & LCCR0_CMS) == LCCR0_Mono && @@ -947,25 +801,21 @@ static void pxafb_setup_gpio(struct pxafb_info *fbi) ldd_bits = 4; /* 8 bit interface */ - else if (((lccr0 & LCCR0_CMS) == LCCR0_Mono && - ((lccr0 & LCCR0_SDS) == LCCR0_Dual || - (lccr0 & LCCR0_DPD) == LCCR0_8PixMono)) || - ((lccr0 & LCCR0_CMS) == LCCR0_Color && - (lccr0 & LCCR0_PAS) == LCCR0_Pas && - (lccr0 & LCCR0_SDS) == LCCR0_Sngl)) + else if (((lccr0 & LCCR0_CMS) == LCCR0_Mono && + ((lccr0 & LCCR0_SDS) == LCCR0_Dual || (lccr0 & LCCR0_DPD) == LCCR0_8PixMono)) || + ((lccr0 & LCCR0_CMS) == LCCR0_Color && + (lccr0 & LCCR0_PAS) == LCCR0_Pas && (lccr0 & LCCR0_SDS) == LCCR0_Sngl)) ldd_bits = 8; /* 16 bit interface */ else if ((lccr0 & LCCR0_CMS) == LCCR0_Color && - ((lccr0 & LCCR0_SDS) == LCCR0_Dual || - (lccr0 & LCCR0_PAS) == LCCR0_Act)) + ((lccr0 & LCCR0_SDS) == LCCR0_Dual || (lccr0 & LCCR0_PAS) == LCCR0_Act)) ldd_bits = 16; else { - printk(KERN_ERR "pxafb_setup_gpio: unable to determine " - "bits per pixel\n"); + printk(KERN_ERR "pxafb_setup_gpio: unable to determine bits per pixel\n"); return; - } + } for (gpio = 58; ldd_bits; gpio++, ldd_bits--) pxa_gpio_mode(gpio | GPIO_ALT_FN_2_OUT); @@ -978,8 +828,8 @@ static void pxafb_setup_gpio(struct pxafb_info *fbi) static void pxafb_enable_controller(struct pxafb_info *fbi) { pr_debug("pxafb: Enabling LCD controller\n"); - pr_debug("fdadr0 0x%08x\n", (unsigned int) fbi->fdadr[0]); - pr_debug("fdadr1 0x%08x\n", (unsigned int) fbi->fdadr[1]); + pr_debug("fdadr0 0x%08x\n", (unsigned int) fbi->fdadr0); + pr_debug("fdadr1 0x%08x\n", (unsigned int) fbi->fdadr1); pr_debug("reg_lccr0 0x%08x\n", (unsigned int) fbi->reg_lccr0); pr_debug("reg_lccr1 0x%08x\n", (unsigned int) fbi->reg_lccr1); pr_debug("reg_lccr2 0x%08x\n", (unsigned int) fbi->reg_lccr2); @@ -988,40 +838,40 @@ static void pxafb_enable_controller(struct pxafb_info *fbi) /* enable LCD controller clock */ clk_enable(fbi->clk); - if (fbi->lccr0 & LCCR0_LCDT) - return; - /* Sequence from 11.7.10 */ - lcd_writel(fbi, LCCR3, fbi->reg_lccr3); - lcd_writel(fbi, LCCR2, fbi->reg_lccr2); - lcd_writel(fbi, LCCR1, fbi->reg_lccr1); - lcd_writel(fbi, LCCR0, fbi->reg_lccr0 & ~LCCR0_ENB); - - lcd_writel(fbi, FDADR0, fbi->fdadr[0]); - lcd_writel(fbi, FDADR1, fbi->fdadr[1]); - lcd_writel(fbi, LCCR0, fbi->reg_lccr0 | LCCR0_ENB); + LCCR3 = fbi->reg_lccr3; + LCCR2 = fbi->reg_lccr2; + LCCR1 = fbi->reg_lccr1; + LCCR0 = fbi->reg_lccr0 & ~LCCR0_ENB; + + FDADR0 = fbi->fdadr0; + FDADR1 = fbi->fdadr1; + LCCR0 |= LCCR0_ENB; + + pr_debug("FDADR0 0x%08x\n", (unsigned int) FDADR0); + pr_debug("FDADR1 0x%08x\n", (unsigned int) FDADR1); + pr_debug("LCCR0 0x%08x\n", (unsigned int) LCCR0); + pr_debug("LCCR1 0x%08x\n", (unsigned int) LCCR1); + pr_debug("LCCR2 0x%08x\n", (unsigned int) LCCR2); + pr_debug("LCCR3 0x%08x\n", (unsigned int) LCCR3); + pr_debug("LCCR4 0x%08x\n", (unsigned int) LCCR4); } static void pxafb_disable_controller(struct pxafb_info *fbi) { - uint32_t lccr0; + DECLARE_WAITQUEUE(wait, current); -#ifdef CONFIG_FB_PXA_SMARTPANEL - if (fbi->lccr0 & LCCR0_LCDT) { - wait_for_completion_timeout(&fbi->refresh_done, - 200 * HZ / 1000); - return; - } -#endif + pr_debug("pxafb: disabling LCD controller\n"); - /* Clear LCD Status Register */ - lcd_writel(fbi, LCSR, 0xffffffff); + set_current_state(TASK_UNINTERRUPTIBLE); + add_wait_queue(&fbi->ctrlr_wait, &wait); - lccr0 = lcd_readl(fbi, LCCR0) & ~LCCR0_LDM; - lcd_writel(fbi, LCCR0, lccr0); - lcd_writel(fbi, LCCR0, lccr0 | LCCR0_DIS); + LCSR = 0xffffffff; /* Clear LCD Status Register */ + LCCR0 &= ~LCCR0_LDM; /* Enable LCD Disable Done Interrupt */ + LCCR0 |= LCCR0_DIS; /* Disable LCD Controller */ - wait_for_completion_timeout(&fbi->disable_done, 200 * HZ / 1000); + schedule_timeout(200 * HZ / 1000); + remove_wait_queue(&fbi->ctrlr_wait, &wait); /* disable LCD controller clock */ clk_disable(fbi->clk); @@ -1033,20 +883,14 @@ static void pxafb_disable_controller(struct pxafb_info *fbi) static irqreturn_t pxafb_handle_irq(int irq, void *dev_id) { struct pxafb_info *fbi = dev_id; - unsigned int lccr0, lcsr = lcd_readl(fbi, LCSR); + unsigned int lcsr = LCSR; if (lcsr & LCSR_LDD) { - lccr0 = lcd_readl(fbi, LCCR0); - lcd_writel(fbi, LCCR0, lccr0 | LCCR0_LDM); - complete(&fbi->disable_done); + LCCR0 |= LCCR0_LDM; + wake_up(&fbi->ctrlr_wait); } -#ifdef CONFIG_FB_PXA_SMARTPANEL - if (lcsr & LCSR_CMD_INT) - complete(&fbi->command_done); -#endif - - lcd_writel(fbi, LCSR, lcsr); + LCSR = lcsr; return IRQ_HANDLED; } @@ -1077,7 +921,7 @@ static void set_ctrlr_state(struct pxafb_info *fbi, u_int state) */ if (old_state != C_DISABLE && old_state != C_DISABLE_PM) { fbi->state = state; - /* TODO __pxafb_lcd_power(fbi, 0); */ + //TODO __pxafb_lcd_power(fbi, 0); pxafb_disable_controller(fbi); } break; @@ -1104,7 +948,7 @@ static void set_ctrlr_state(struct pxafb_info *fbi, u_int state) if (old_state == C_DISABLE_CLKCHANGE) { fbi->state = C_ENABLE; pxafb_enable_controller(fbi); - /* TODO __pxafb_lcd_power(fbi, 1); */ + //TODO __pxafb_lcd_power(fbi, 1); } break; @@ -1175,7 +1019,7 @@ static int pxafb_freq_transition(struct notifier_block *nb, unsigned long val, void *data) { struct pxafb_info *fbi = TO_INF(nb, freq_transition); - /* TODO struct cpufreq_freqs *f = data; */ + //TODO struct cpufreq_freqs *f = data; u_int pcd; switch (val) { @@ -1186,8 +1030,7 @@ pxafb_freq_transition(struct notifier_block *nb, unsigned long val, void *data) case CPUFREQ_POSTCHANGE: pcd = get_pcd(fbi, fbi->fb.var.pixclock); set_hsync_time(fbi, pcd); - fbi->reg_lccr3 = (fbi->reg_lccr3 & ~0xff) | - LCCR3_PixClkDiv(pcd); + fbi->reg_lccr3 = (fbi->reg_lccr3 & ~0xff) | LCCR3_PixClkDiv(pcd); set_ctrlr_state(fbi, C_ENABLE_CLKCHANGE); break; } @@ -1207,8 +1050,18 @@ pxafb_freq_policy(struct notifier_block *nb, unsigned long val, void *data) pr_debug("min dma period: %d ps, " "new clock %d kHz\n", pxafb_display_dma_period(var), policy->max); - /* TODO: fill in min/max values */ + // TODO: fill in min/max values + break; +#if 0 + case CPUFREQ_NOTIFY: + printk(KERN_ERR "%s: got CPUFREQ_NOTIFY\n", __FUNCTION__); + do {} while(0); + /* todo: panic if min/max values aren't fulfilled + * [can't really happen unless there's a bug in the + * CPU policy verification process * + */ break; +#endif } return 0; } @@ -1249,21 +1102,21 @@ static int pxafb_resume(struct platform_device *dev) */ static int __init pxafb_map_video_memory(struct pxafb_info *fbi) { + u_long palette_mem_size; + /* * We reserve one page for the palette, plus the size * of the framebuffer. */ - fbi->video_offset = PAGE_ALIGN(sizeof(struct pxafb_dma_buff)); - fbi->map_size = PAGE_ALIGN(fbi->fb.fix.smem_len + fbi->video_offset); + fbi->map_size = PAGE_ALIGN(fbi->fb.fix.smem_len + PAGE_SIZE); fbi->map_cpu = dma_alloc_writecombine(fbi->dev, fbi->map_size, &fbi->map_dma, GFP_KERNEL); if (fbi->map_cpu) { /* prevent initial garbage on screen */ memset(fbi->map_cpu, 0, fbi->map_size); - fbi->fb.screen_base = fbi->map_cpu + fbi->video_offset; - fbi->screen_dma = fbi->map_dma + fbi->video_offset; - + fbi->fb.screen_base = fbi->map_cpu + PAGE_SIZE; + fbi->screen_dma = fbi->map_dma + PAGE_SIZE; /* * FIXME: this is actually the wrong thing to place in * smem_start. But fbdev suffers from the problem that @@ -1273,78 +1126,18 @@ static int __init pxafb_map_video_memory(struct pxafb_info *fbi) fbi->fb.fix.smem_start = fbi->screen_dma; fbi->palette_size = fbi->fb.var.bits_per_pixel == 8 ? 256 : 16; - fbi->dma_buff = (void *) fbi->map_cpu; - fbi->dma_buff_phys = fbi->map_dma; - fbi->palette_cpu = (u16 *) fbi->dma_buff->palette; - -#ifdef CONFIG_FB_PXA_SMARTPANEL - fbi->smart_cmds = (uint16_t *) fbi->dma_buff->cmd_buff; - fbi->n_smart_cmds = 0; -#endif - } - - return fbi->map_cpu ? 0 : -ENOMEM; -} - -static void pxafb_decode_mode_info(struct pxafb_info *fbi, - struct pxafb_mode_info *modes, - unsigned int num_modes) -{ - unsigned int i, smemlen; - - pxafb_setmode(&fbi->fb.var, &modes[0]); - - for (i = 0; i < num_modes; i++) { - smemlen = modes[i].xres * modes[i].yres * modes[i].bpp / 8; - if (smemlen > fbi->fb.fix.smem_len) - fbi->fb.fix.smem_len = smemlen; - } -} - -static int pxafb_decode_mach_info(struct pxafb_info *fbi, - struct pxafb_mach_info *inf) -{ - unsigned int lcd_conn = inf->lcd_conn; + if ((fbi->lccr4 & LCCR4_PAL_FOR_MASK) == LCCR4_PAL_FOR_0) + palette_mem_size = fbi->palette_size * sizeof(u16); + else + palette_mem_size = fbi->palette_size * sizeof(u32); - fbi->cmap_inverse = inf->cmap_inverse; - fbi->cmap_static = inf->cmap_static; + pr_debug("pxafb: palette_mem_size = 0x%08lx\n", palette_mem_size); - switch (lcd_conn & 0xf) { - case LCD_TYPE_MONO_STN: - fbi->lccr0 = LCCR0_CMS; - break; - case LCD_TYPE_MONO_DSTN: - fbi->lccr0 = LCCR0_CMS | LCCR0_SDS; - break; - case LCD_TYPE_COLOR_STN: - fbi->lccr0 = 0; - break; - case LCD_TYPE_COLOR_DSTN: - fbi->lccr0 = LCCR0_SDS; - break; - case LCD_TYPE_COLOR_TFT: - fbi->lccr0 = LCCR0_PAS; - break; - case LCD_TYPE_SMART_PANEL: - fbi->lccr0 = LCCR0_LCDT | LCCR0_PAS; - break; - default: - /* fall back to backward compatibility way */ - fbi->lccr0 = inf->lccr0; - fbi->lccr3 = inf->lccr3; - fbi->lccr4 = inf->lccr4; - return -EINVAL; + fbi->palette_cpu = (u16 *)(fbi->map_cpu + PAGE_SIZE - palette_mem_size); + fbi->palette_dma = fbi->map_dma + PAGE_SIZE - palette_mem_size; } - if (lcd_conn == LCD_MONO_STN_8BPP) - fbi->lccr0 |= LCCR0_DPD; - - fbi->lccr3 = LCCR3_Acb((inf->lcd_conn >> 10) & 0xff); - fbi->lccr3 |= (lcd_conn & LCD_BIAS_ACTIVE_LOW) ? LCCR3_OEP : 0; - fbi->lccr3 |= (lcd_conn & LCD_PCLK_EDGE_FALL) ? LCCR3_PCP : 0; - - pxafb_decode_mode_info(fbi, inf->modes, inf->num_modes); - return 0; + return fbi->map_cpu ? 0 : -ENOMEM; } static struct pxafb_info * __init pxafb_init_fbinfo(struct device *dev) @@ -1353,6 +1146,7 @@ static struct pxafb_info * __init pxafb_init_fbinfo(struct device *dev) void *addr; struct pxafb_mach_info *inf = dev->platform_data; struct pxafb_mode_info *mode = inf->modes; + int i, smemlen; /* Alloc the pxafb_info and pseudo_palette in one step */ fbi = kmalloc(sizeof(struct pxafb_info) + sizeof(u32) * 16, GFP_KERNEL); @@ -1392,233 +1186,187 @@ static struct pxafb_info * __init pxafb_init_fbinfo(struct device *dev) addr = addr + sizeof(struct pxafb_info); fbi->fb.pseudo_palette = addr; - fbi->state = C_STARTUP; - fbi->task_state = (u_char)-1; + pxafb_setmode(&fbi->fb.var, mode); - pxafb_decode_mach_info(fbi, inf); + fbi->cmap_inverse = inf->cmap_inverse; + fbi->cmap_static = inf->cmap_static; + + fbi->lccr0 = inf->lccr0; + fbi->lccr3 = inf->lccr3; + fbi->lccr4 = inf->lccr4; + fbi->state = C_STARTUP; + fbi->task_state = (u_char)-1; + + for (i = 0; i < inf->num_modes; i++) { + smemlen = mode[i].xres * mode[i].yres * mode[i].bpp / 8; + if (smemlen > fbi->fb.fix.smem_len) + fbi->fb.fix.smem_len = smemlen; + } init_waitqueue_head(&fbi->ctrlr_wait); INIT_WORK(&fbi->task, pxafb_task); init_MUTEX(&fbi->ctrlr_sem); - init_completion(&fbi->disable_done); -#ifdef CONFIG_FB_PXA_SMARTPANEL - init_completion(&fbi->command_done); - init_completion(&fbi->refresh_done); -#endif return fbi; } #ifdef CONFIG_FB_PXA_PARAMETERS -static int __init parse_opt_mode(struct device *dev, const char *this_opt) -{ - struct pxafb_mach_info *inf = dev->platform_data; - - const char *name = this_opt+5; - unsigned int namelen = strlen(name); - int res_specified = 0, bpp_specified = 0; - unsigned int xres = 0, yres = 0, bpp = 0; - int yres_specified = 0; - int i; - for (i = namelen-1; i >= 0; i--) { - switch (name[i]) { - case '-': - namelen = i; - if (!bpp_specified && !yres_specified) { - bpp = simple_strtoul(&name[i+1], NULL, 0); - bpp_specified = 1; - } else - goto done; - break; - case 'x': - if (!yres_specified) { - yres = simple_strtoul(&name[i+1], NULL, 0); - yres_specified = 1; - } else - goto done; - break; - case '0' ... '9': - break; - default: - goto done; - } - } - if (i < 0 && yres_specified) { - xres = simple_strtoul(name, NULL, 0); - res_specified = 1; - } -done: - if (res_specified) { - dev_info(dev, "overriding resolution: %dx%d\n", xres, yres); - inf->modes[0].xres = xres; inf->modes[0].yres = yres; - } - if (bpp_specified) - switch (bpp) { - case 1: - case 2: - case 4: - case 8: - case 16: - inf->modes[0].bpp = bpp; - dev_info(dev, "overriding bit depth: %d\n", bpp); - break; - default: - dev_err(dev, "Depth %d is not valid\n", bpp); - return -EINVAL; - } - return 0; -} - -static int __init parse_opt(struct device *dev, char *this_opt) -{ - struct pxafb_mach_info *inf = dev->platform_data; - struct pxafb_mode_info *mode = &inf->modes[0]; - char s[64]; - - s[0] = '\0'; - - if (!strncmp(this_opt, "mode:", 5)) { - return parse_opt_mode(dev, this_opt); - } else if (!strncmp(this_opt, "pixclock:", 9)) { - mode->pixclock = simple_strtoul(this_opt+9, NULL, 0); - sprintf(s, "pixclock: %ld\n", mode->pixclock); - } else if (!strncmp(this_opt, "left:", 5)) { - mode->left_margin = simple_strtoul(this_opt+5, NULL, 0); - sprintf(s, "left: %u\n", mode->left_margin); - } else if (!strncmp(this_opt, "right:", 6)) { - mode->right_margin = simple_strtoul(this_opt+6, NULL, 0); - sprintf(s, "right: %u\n", mode->right_margin); - } else if (!strncmp(this_opt, "upper:", 6)) { - mode->upper_margin = simple_strtoul(this_opt+6, NULL, 0); - sprintf(s, "upper: %u\n", mode->upper_margin); - } else if (!strncmp(this_opt, "lower:", 6)) { - mode->lower_margin = simple_strtoul(this_opt+6, NULL, 0); - sprintf(s, "lower: %u\n", mode->lower_margin); - } else if (!strncmp(this_opt, "hsynclen:", 9)) { - mode->hsync_len = simple_strtoul(this_opt+9, NULL, 0); - sprintf(s, "hsynclen: %u\n", mode->hsync_len); - } else if (!strncmp(this_opt, "vsynclen:", 9)) { - mode->vsync_len = simple_strtoul(this_opt+9, NULL, 0); - sprintf(s, "vsynclen: %u\n", mode->vsync_len); - } else if (!strncmp(this_opt, "hsync:", 6)) { - if (simple_strtoul(this_opt+6, NULL, 0) == 0) { - sprintf(s, "hsync: Active Low\n"); - mode->sync &= ~FB_SYNC_HOR_HIGH_ACT; - } else { - sprintf(s, "hsync: Active High\n"); - mode->sync |= FB_SYNC_HOR_HIGH_ACT; - } - } else if (!strncmp(this_opt, "vsync:", 6)) { - if (simple_strtoul(this_opt+6, NULL, 0) == 0) { - sprintf(s, "vsync: Active Low\n"); - mode->sync &= ~FB_SYNC_VERT_HIGH_ACT; - } else { - sprintf(s, "vsync: Active High\n"); - mode->sync |= FB_SYNC_VERT_HIGH_ACT; - } - } else if (!strncmp(this_opt, "dpc:", 4)) { - if (simple_strtoul(this_opt+4, NULL, 0) == 0) { - sprintf(s, "double pixel clock: false\n"); - inf->lccr3 &= ~LCCR3_DPC; - } else { - sprintf(s, "double pixel clock: true\n"); - inf->lccr3 |= LCCR3_DPC; - } - } else if (!strncmp(this_opt, "outputen:", 9)) { - if (simple_strtoul(this_opt+9, NULL, 0) == 0) { - sprintf(s, "output enable: active low\n"); - inf->lccr3 = (inf->lccr3 & ~LCCR3_OEP) | LCCR3_OutEnL; - } else { - sprintf(s, "output enable: active high\n"); - inf->lccr3 = (inf->lccr3 & ~LCCR3_OEP) | LCCR3_OutEnH; - } - } else if (!strncmp(this_opt, "pixclockpol:", 12)) { - if (simple_strtoul(this_opt+12, NULL, 0) == 0) { - sprintf(s, "pixel clock polarity: falling edge\n"); - inf->lccr3 = (inf->lccr3 & ~LCCR3_PCP) | LCCR3_PixFlEdg; - } else { - sprintf(s, "pixel clock polarity: rising edge\n"); - inf->lccr3 = (inf->lccr3 & ~LCCR3_PCP) | LCCR3_PixRsEdg; - } - } else if (!strncmp(this_opt, "color", 5)) { - inf->lccr0 = (inf->lccr0 & ~LCCR0_CMS) | LCCR0_Color; - } else if (!strncmp(this_opt, "mono", 4)) { - inf->lccr0 = (inf->lccr0 & ~LCCR0_CMS) | LCCR0_Mono; - } else if (!strncmp(this_opt, "active", 6)) { - inf->lccr0 = (inf->lccr0 & ~LCCR0_PAS) | LCCR0_Act; - } else if (!strncmp(this_opt, "passive", 7)) { - inf->lccr0 = (inf->lccr0 & ~LCCR0_PAS) | LCCR0_Pas; - } else if (!strncmp(this_opt, "single", 6)) { - inf->lccr0 = (inf->lccr0 & ~LCCR0_SDS) | LCCR0_Sngl; - } else if (!strncmp(this_opt, "dual", 4)) { - inf->lccr0 = (inf->lccr0 & ~LCCR0_SDS) | LCCR0_Dual; - } else if (!strncmp(this_opt, "4pix", 4)) { - inf->lccr0 = (inf->lccr0 & ~LCCR0_DPD) | LCCR0_4PixMono; - } else if (!strncmp(this_opt, "8pix", 4)) { - inf->lccr0 = (inf->lccr0 & ~LCCR0_DPD) | LCCR0_8PixMono; - } else { - dev_err(dev, "unknown option: %s\n", this_opt); - return -EINVAL; - } - - if (s[0] != '\0') - dev_info(dev, "override %s", s); - - return 0; -} - static int __init pxafb_parse_options(struct device *dev, char *options) { + struct pxafb_mach_info *inf = dev->platform_data; char *this_opt; - int ret; - if (!options || !*options) - return 0; + if (!options || !*options) + return 0; dev_dbg(dev, "options are \"%s\"\n", options ? options : "null"); /* could be made table driven or similar?... */ - while ((this_opt = strsep(&options, ",")) != NULL) { - ret = parse_opt(dev, this_opt); - if (ret) - return ret; - } - return 0; -} - -static char g_options[256] __devinitdata = ""; - -#ifndef CONFIG_MODULES -static int __devinit pxafb_setup_options(void) -{ - char *options = NULL; - - if (fb_get_options("pxafb", &options)) - return -ENODEV; - - if (options) - strlcpy(g_options, options, sizeof(g_options)); + while ((this_opt = strsep(&options, ",")) != NULL) { + if (!strncmp(this_opt, "mode:", 5)) { + const char *name = this_opt+5; + unsigned int namelen = strlen(name); + int res_specified = 0, bpp_specified = 0; + unsigned int xres = 0, yres = 0, bpp = 0; + int yres_specified = 0; + int i; + for (i = namelen-1; i >= 0; i--) { + switch (name[i]) { + case '-': + namelen = i; + if (!bpp_specified && !yres_specified) { + bpp = simple_strtoul(&name[i+1], NULL, 0); + bpp_specified = 1; + } else + goto done; + break; + case 'x': + if (!yres_specified) { + yres = simple_strtoul(&name[i+1], NULL, 0); + yres_specified = 1; + } else + goto done; + break; + case '0' ... '9': + break; + default: + goto done; + } + } + if (i < 0 && yres_specified) { + xres = simple_strtoul(name, NULL, 0); + res_specified = 1; + } + done: + if (res_specified) { + dev_info(dev, "overriding resolution: %dx%d\n", xres, yres); + inf->modes[0].xres = xres; inf->modes[0].yres = yres; + } + if (bpp_specified) + switch (bpp) { + case 1: + case 2: + case 4: + case 8: + case 16: + inf->modes[0].bpp = bpp; + dev_info(dev, "overriding bit depth: %d\n", bpp); + break; + default: + dev_err(dev, "Depth %d is not valid\n", bpp); + } + } else if (!strncmp(this_opt, "pixclock:", 9)) { + inf->modes[0].pixclock = simple_strtoul(this_opt+9, NULL, 0); + dev_info(dev, "override pixclock: %ld\n", inf->modes[0].pixclock); + } else if (!strncmp(this_opt, "left:", 5)) { + inf->modes[0].left_margin = simple_strtoul(this_opt+5, NULL, 0); + dev_info(dev, "override left: %u\n", inf->modes[0].left_margin); + } else if (!strncmp(this_opt, "right:", 6)) { + inf->modes[0].right_margin = simple_strtoul(this_opt+6, NULL, 0); + dev_info(dev, "override right: %u\n", inf->modes[0].right_margin); + } else if (!strncmp(this_opt, "upper:", 6)) { + inf->modes[0].upper_margin = simple_strtoul(this_opt+6, NULL, 0); + dev_info(dev, "override upper: %u\n", inf->modes[0].upper_margin); + } else if (!strncmp(this_opt, "lower:", 6)) { + inf->modes[0].lower_margin = simple_strtoul(this_opt+6, NULL, 0); + dev_info(dev, "override lower: %u\n", inf->modes[0].lower_margin); + } else if (!strncmp(this_opt, "hsynclen:", 9)) { + inf->modes[0].hsync_len = simple_strtoul(this_opt+9, NULL, 0); + dev_info(dev, "override hsynclen: %u\n", inf->modes[0].hsync_len); + } else if (!strncmp(this_opt, "vsynclen:", 9)) { + inf->modes[0].vsync_len = simple_strtoul(this_opt+9, NULL, 0); + dev_info(dev, "override vsynclen: %u\n", inf->modes[0].vsync_len); + } else if (!strncmp(this_opt, "hsync:", 6)) { + if (simple_strtoul(this_opt+6, NULL, 0) == 0) { + dev_info(dev, "override hsync: Active Low\n"); + inf->modes[0].sync &= ~FB_SYNC_HOR_HIGH_ACT; + } else { + dev_info(dev, "override hsync: Active High\n"); + inf->modes[0].sync |= FB_SYNC_HOR_HIGH_ACT; + } + } else if (!strncmp(this_opt, "vsync:", 6)) { + if (simple_strtoul(this_opt+6, NULL, 0) == 0) { + dev_info(dev, "override vsync: Active Low\n"); + inf->modes[0].sync &= ~FB_SYNC_VERT_HIGH_ACT; + } else { + dev_info(dev, "override vsync: Active High\n"); + inf->modes[0].sync |= FB_SYNC_VERT_HIGH_ACT; + } + } else if (!strncmp(this_opt, "dpc:", 4)) { + if (simple_strtoul(this_opt+4, NULL, 0) == 0) { + dev_info(dev, "override double pixel clock: false\n"); + inf->lccr3 &= ~LCCR3_DPC; + } else { + dev_info(dev, "override double pixel clock: true\n"); + inf->lccr3 |= LCCR3_DPC; + } + } else if (!strncmp(this_opt, "outputen:", 9)) { + if (simple_strtoul(this_opt+9, NULL, 0) == 0) { + dev_info(dev, "override output enable: active low\n"); + inf->lccr3 = (inf->lccr3 & ~LCCR3_OEP) | LCCR3_OutEnL; + } else { + dev_info(dev, "override output enable: active high\n"); + inf->lccr3 = (inf->lccr3 & ~LCCR3_OEP) | LCCR3_OutEnH; + } + } else if (!strncmp(this_opt, "pixclockpol:", 12)) { + if (simple_strtoul(this_opt+12, NULL, 0) == 0) { + dev_info(dev, "override pixel clock polarity: falling edge\n"); + inf->lccr3 = (inf->lccr3 & ~LCCR3_PCP) | LCCR3_PixFlEdg; + } else { + dev_info(dev, "override pixel clock polarity: rising edge\n"); + inf->lccr3 = (inf->lccr3 & ~LCCR3_PCP) | LCCR3_PixRsEdg; + } + } else if (!strncmp(this_opt, "color", 5)) { + inf->lccr0 = (inf->lccr0 & ~LCCR0_CMS) | LCCR0_Color; + } else if (!strncmp(this_opt, "mono", 4)) { + inf->lccr0 = (inf->lccr0 & ~LCCR0_CMS) | LCCR0_Mono; + } else if (!strncmp(this_opt, "active", 6)) { + inf->lccr0 = (inf->lccr0 & ~LCCR0_PAS) | LCCR0_Act; + } else if (!strncmp(this_opt, "passive", 7)) { + inf->lccr0 = (inf->lccr0 & ~LCCR0_PAS) | LCCR0_Pas; + } else if (!strncmp(this_opt, "single", 6)) { + inf->lccr0 = (inf->lccr0 & ~LCCR0_SDS) | LCCR0_Sngl; + } else if (!strncmp(this_opt, "dual", 4)) { + inf->lccr0 = (inf->lccr0 & ~LCCR0_SDS) | LCCR0_Dual; + } else if (!strncmp(this_opt, "4pix", 4)) { + inf->lccr0 = (inf->lccr0 & ~LCCR0_DPD) | LCCR0_4PixMono; + } else if (!strncmp(this_opt, "8pix", 4)) { + inf->lccr0 = (inf->lccr0 & ~LCCR0_DPD) | LCCR0_8PixMono; + } else { + dev_err(dev, "unknown option: %s\n", this_opt); + return -EINVAL; + } + } + return 0; - return 0; } -#else -#define pxafb_setup_options() (0) - -module_param_string(options, g_options, sizeof(g_options), 0); -MODULE_PARM_DESC(options, "LCD parameters (see Documentation/fb/pxafb.txt)"); -#endif - -#else -#define pxafb_parse_options(...) (0) -#define pxafb_setup_options() (0) #endif static int __init pxafb_probe(struct platform_device *dev) { struct pxafb_info *fbi; struct pxafb_mach_info *inf; - struct resource *r; - int irq, ret; + int ret; dev_dbg(&dev->dev, "pxafb_probe\n"); @@ -1628,45 +1376,38 @@ static int __init pxafb_probe(struct platform_device *dev) if (!inf) goto failed; +#ifdef CONFIG_FB_PXA_PARAMETERS ret = pxafb_parse_options(&dev->dev, g_options); if (ret < 0) goto failed; +#endif #ifdef DEBUG_VAR - /* Check for various illegal bit-combinations. Currently only + /* Check for various illegal bit-combinations. Currently only * a warning is given. */ - if (inf->lccr0 & LCCR0_INVALID_CONFIG_MASK) - dev_warn(&dev->dev, "machine LCCR0 setting contains " - "illegal bits: %08x\n", - inf->lccr0 & LCCR0_INVALID_CONFIG_MASK); - if (inf->lccr3 & LCCR3_INVALID_CONFIG_MASK) - dev_warn(&dev->dev, "machine LCCR3 setting contains " - "illegal bits: %08x\n", - inf->lccr3 & LCCR3_INVALID_CONFIG_MASK); - if (inf->lccr0 & LCCR0_DPD && + if (inf->lccr0 & LCCR0_INVALID_CONFIG_MASK) + dev_warn(&dev->dev, "machine LCCR0 setting contains illegal bits: %08x\n", + inf->lccr0 & LCCR0_INVALID_CONFIG_MASK); + if (inf->lccr3 & LCCR3_INVALID_CONFIG_MASK) + dev_warn(&dev->dev, "machine LCCR3 setting contains illegal bits: %08x\n", + inf->lccr3 & LCCR3_INVALID_CONFIG_MASK); + if (inf->lccr0 & LCCR0_DPD && ((inf->lccr0 & LCCR0_PAS) != LCCR0_Pas || (inf->lccr0 & LCCR0_SDS) != LCCR0_Sngl || (inf->lccr0 & LCCR0_CMS) != LCCR0_Mono)) - dev_warn(&dev->dev, "Double Pixel Data (DPD) mode is " - "only valid in passive mono" - " single panel mode\n"); - if ((inf->lccr0 & LCCR0_PAS) == LCCR0_Act && + dev_warn(&dev->dev, "Double Pixel Data (DPD) mode is only valid in passive mono" + " single panel mode\n"); + if ((inf->lccr0 & LCCR0_PAS) == LCCR0_Act && (inf->lccr0 & LCCR0_SDS) == LCCR0_Dual) - dev_warn(&dev->dev, "Dual panel only valid in passive mode\n"); - if ((inf->lccr0 & LCCR0_PAS) == LCCR0_Pas && - (inf->modes->upper_margin || inf->modes->lower_margin)) - dev_warn(&dev->dev, "Upper and lower margins must be 0 in " - "passive mode\n"); + dev_warn(&dev->dev, "Dual panel only valid in passive mode\n"); + if ((inf->lccr0 & LCCR0_PAS) == LCCR0_Pas && + (inf->modes->upper_margin || inf->modes->lower_margin)) + dev_warn(&dev->dev, "Upper and lower margins must be 0 in passive mode\n"); #endif - dev_dbg(&dev->dev, "got a %dx%dx%d LCD\n", - inf->modes->xres, - inf->modes->yres, - inf->modes->bpp); - if (inf->modes->xres == 0 || - inf->modes->yres == 0 || - inf->modes->bpp == 0) { + dev_dbg(&dev->dev, "got a %dx%dx%d LCD\n",inf->modes->xres, inf->modes->yres, inf->modes->bpp); + if (inf->modes->xres == 0 || inf->modes->yres == 0 || inf->modes->bpp == 0) { dev_err(&dev->dev, "Invalid resolution or bit depth\n"); ret = -EINVAL; goto failed; @@ -1675,62 +1416,26 @@ static int __init pxafb_probe(struct platform_device *dev) pxafb_lcd_power = inf->pxafb_lcd_power; fbi = pxafb_init_fbinfo(&dev->dev); if (!fbi) { - /* only reason for pxafb_init_fbinfo to fail is kmalloc */ dev_err(&dev->dev, "Failed to initialize framebuffer device\n"); - ret = -ENOMEM; + ret = -ENOMEM; // only reason for pxafb_init_fbinfo to fail is kmalloc goto failed; } - r = platform_get_resource(dev, IORESOURCE_MEM, 0); - if (r == NULL) { - dev_err(&dev->dev, "no I/O memory resource defined\n"); - ret = -ENODEV; - goto failed; - } - - r = request_mem_region(r->start, r->end - r->start + 1, dev->name); - if (r == NULL) { - dev_err(&dev->dev, "failed to request I/O memory\n"); - ret = -EBUSY; - goto failed; - } - - fbi->mmio_base = ioremap(r->start, r->end - r->start + 1); - if (fbi->mmio_base == NULL) { - dev_err(&dev->dev, "failed to map I/O memory\n"); - ret = -EBUSY; - goto failed_free_res; - } - /* Initialize video memory */ ret = pxafb_map_video_memory(fbi); if (ret) { dev_err(&dev->dev, "Failed to allocate video RAM: %d\n", ret); ret = -ENOMEM; - goto failed_free_io; - } - - irq = platform_get_irq(dev, 0); - if (irq < 0) { - dev_err(&dev->dev, "no IRQ defined\n"); - ret = -ENODEV; - goto failed_free_mem; + goto failed; } - ret = request_irq(irq, pxafb_handle_irq, IRQF_DISABLED, "LCD", fbi); + ret = request_irq(IRQ_LCD, pxafb_handle_irq, IRQF_DISABLED, "LCD", fbi); if (ret) { dev_err(&dev->dev, "request_irq failed: %d\n", ret); ret = -EBUSY; - goto failed_free_mem; + goto failed; } -#ifdef CONFIG_FB_PXA_SMARTPANEL - ret = pxafb_smart_init(fbi); - if (ret) { - dev_err(&dev->dev, "failed to initialize smartpanel\n"); - goto failed_free_irq; - } -#endif /* * This makes sure that our colour bitfield * descriptors are correctly initialised. @@ -1742,18 +1447,19 @@ static int __init pxafb_probe(struct platform_device *dev) ret = register_framebuffer(&fbi->fb); if (ret < 0) { - dev_err(&dev->dev, - "Failed to register framebuffer device: %d\n", ret); - goto failed_free_irq; + dev_err(&dev->dev, "Failed to register framebuffer device: %d\n", ret); + goto failed; } +#ifdef CONFIG_PM + // TODO +#endif + #ifdef CONFIG_CPU_FREQ fbi->freq_transition.notifier_call = pxafb_freq_transition; fbi->freq_policy.notifier_call = pxafb_freq_policy; - cpufreq_register_notifier(&fbi->freq_transition, - CPUFREQ_TRANSITION_NOTIFIER); - cpufreq_register_notifier(&fbi->freq_policy, - CPUFREQ_POLICY_NOTIFIER); + cpufreq_register_notifier(&fbi->freq_transition, CPUFREQ_TRANSITION_NOTIFIER); + cpufreq_register_notifier(&fbi->freq_policy, CPUFREQ_POLICY_NOTIFIER); #endif /* @@ -1763,15 +1469,6 @@ static int __init pxafb_probe(struct platform_device *dev) return 0; -failed_free_irq: - free_irq(irq, fbi); -failed_free_res: - release_mem_region(r->start, r->end - r->start + 1); -failed_free_io: - iounmap(fbi->mmio_base); -failed_free_mem: - dma_free_writecombine(&dev->dev, fbi->map_size, - fbi->map_cpu, fbi->map_dma); failed: platform_set_drvdata(dev, NULL); kfree(fbi); @@ -1780,18 +1477,40 @@ static int __init pxafb_probe(struct platform_device *dev) static struct platform_driver pxafb_driver = { .probe = pxafb_probe, +#ifdef CONFIG_PM .suspend = pxafb_suspend, .resume = pxafb_resume, +#endif .driver = { .name = "pxa2xx-fb", }, }; +#ifndef MODULE +static int __devinit pxafb_setup(char *options) +{ +# ifdef CONFIG_FB_PXA_PARAMETERS + if (options) + strlcpy(g_options, options, sizeof(g_options)); +# endif + return 0; +} +#else +# ifdef CONFIG_FB_PXA_PARAMETERS +module_param_string(options, g_options, sizeof(g_options), 0); +MODULE_PARM_DESC(options, "LCD parameters (see Documentation/fb/pxafb.txt)"); +# endif +#endif + static int __devinit pxafb_init(void) { - if (pxafb_setup_options()) - return -EINVAL; +#ifndef MODULE + char *option = NULL; + if (fb_get_options("pxafb", &option)) + return -ENODEV; + pxafb_setup(option); +#endif return platform_driver_register(&pxafb_driver); } diff --git a/trunk/drivers/video/pxafb.h b/trunk/drivers/video/pxafb.h index 8238dc826429..d920b8a14c35 100644 --- a/trunk/drivers/video/pxafb.h +++ b/trunk/drivers/video/pxafb.h @@ -21,6 +21,14 @@ * for more details. */ +/* Shadows for LCD controller registers */ +struct pxafb_lcd_reg { + unsigned int lccr0; + unsigned int lccr1; + unsigned int lccr2; + unsigned int lccr3; +}; + /* PXA LCD DMA descriptor */ struct pxafb_dma_descriptor { unsigned int fdadr; @@ -29,49 +37,11 @@ struct pxafb_dma_descriptor { unsigned int ldcmd; }; -enum { - PAL_NONE = -1, - PAL_BASE = 0, - PAL_OV1 = 1, - PAL_OV2 = 2, - PAL_MAX, -}; - -enum { - DMA_BASE = 0, - DMA_UPPER = 0, - DMA_LOWER = 1, - DMA_OV1 = 1, - DMA_OV2_Y = 2, - DMA_OV2_Cb = 3, - DMA_OV2_Cr = 4, - DMA_CURSOR = 5, - DMA_CMD = 6, - DMA_MAX, -}; - -/* maximum palette size - 256 entries, each 4 bytes long */ -#define PALETTE_SIZE (256 * 4) -#define CMD_BUFF_SIZE (1024 * 50) - -struct pxafb_dma_buff { - unsigned char palette[PAL_MAX * PALETTE_SIZE]; - uint16_t cmd_buff[CMD_BUFF_SIZE]; - struct pxafb_dma_descriptor pal_desc[PAL_MAX]; - struct pxafb_dma_descriptor dma_desc[DMA_MAX]; -}; - struct pxafb_info { struct fb_info fb; struct device *dev; struct clk *clk; - void __iomem *mmio_base; - - struct pxafb_dma_buff *dma_buff; - dma_addr_t dma_buff_phys; - dma_addr_t fdadr[DMA_MAX]; - /* * These are the addresses we mapped * the framebuffer memory region to. @@ -85,8 +55,19 @@ struct pxafb_info { u_char * screen_cpu; /* virtual address of frame buffer */ dma_addr_t screen_dma; /* physical address of frame buffer */ u16 * palette_cpu; /* virtual address of palette memory */ + dma_addr_t palette_dma; /* physical address of palette memory */ u_int palette_size; - ssize_t video_offset; + + /* DMA descriptors */ + struct pxafb_dma_descriptor * dmadesc_fblow_cpu; + dma_addr_t dmadesc_fblow_dma; + struct pxafb_dma_descriptor * dmadesc_fbhigh_cpu; + dma_addr_t dmadesc_fbhigh_dma; + struct pxafb_dma_descriptor * dmadesc_palette_cpu; + dma_addr_t dmadesc_palette_dma; + + dma_addr_t fdadr0; + dma_addr_t fdadr1; u_int lccr0; u_int lccr3; @@ -100,7 +81,6 @@ struct pxafb_info { u_int reg_lccr2; u_int reg_lccr3; u_int reg_lccr4; - u_int reg_cmdcr; unsigned long hsync_time; @@ -110,16 +90,6 @@ struct pxafb_info { wait_queue_head_t ctrlr_wait; struct work_struct task; - struct completion disable_done; - -#ifdef CONFIG_FB_PXA_SMARTPANEL - uint16_t *smart_cmds; - size_t n_smart_cmds; - struct completion command_done; - struct completion refresh_done; - struct task_struct *smart_thread; -#endif - #ifdef CONFIG_CPU_FREQ struct notifier_block freq_transition; struct notifier_block freq_policy; diff --git a/trunk/drivers/w1/w1_log.h b/trunk/drivers/w1/w1_log.h index e6ab7cf08f88..fe6bdf43380f 100644 --- a/trunk/drivers/w1/w1_log.h +++ b/trunk/drivers/w1/w1_log.h @@ -30,7 +30,7 @@ # define assert(expr) \ if(unlikely(!(expr))) { \ printk(KERN_ERR "Assertion failed! %s,%s,%s,line=%d\n", \ - #expr, __FILE__, __func__, __LINE__); \ + #expr,__FILE__,__FUNCTION__,__LINE__); \ } #endif diff --git a/trunk/fs/adfs/adfs.h b/trunk/fs/adfs/adfs.h index 831157502d5a..936f2af39c43 100644 --- a/trunk/fs/adfs/adfs.h +++ b/trunk/fs/adfs/adfs.h @@ -75,7 +75,7 @@ extern unsigned int adfs_map_free(struct super_block *sb); /* Misc */ void __adfs_error(struct super_block *sb, const char *function, const char *fmt, ...); -#define adfs_error(sb, fmt...) __adfs_error(sb, __func__, fmt) +#define adfs_error(sb, fmt...) __adfs_error(sb, __FUNCTION__, fmt) /* super.c */ diff --git a/trunk/fs/affs/file.c b/trunk/fs/affs/file.c index 1a4f092f24ef..e87ede608f77 100644 --- a/trunk/fs/affs/file.c +++ b/trunk/fs/affs/file.c @@ -539,7 +539,7 @@ affs_extent_file_ofs(struct inode *inode, u32 newsize) tmp = min(bsize - boff, newsize - size); BUG_ON(boff + tmp > bsize || tmp > bsize); memset(AFFS_DATA(bh) + boff, 0, tmp); - be32_add_cpu(&AFFS_DATA_HEAD(bh)->size, tmp); + AFFS_DATA_HEAD(bh)->size = cpu_to_be32(be32_to_cpu(AFFS_DATA_HEAD(bh)->size) + tmp); affs_fix_checksum(sb, bh); mark_buffer_dirty_inode(bh, inode); size += tmp; @@ -680,7 +680,7 @@ static int affs_write_end_ofs(struct file *file, struct address_space *mapping, tmp = min(bsize - boff, to - from); BUG_ON(boff + tmp > bsize || tmp > bsize); memcpy(AFFS_DATA(bh) + boff, data + from, tmp); - be32_add_cpu(&AFFS_DATA_HEAD(bh)->size, tmp); + AFFS_DATA_HEAD(bh)->size = cpu_to_be32(be32_to_cpu(AFFS_DATA_HEAD(bh)->size) + tmp); affs_fix_checksum(sb, bh); mark_buffer_dirty_inode(bh, inode); written += tmp; diff --git a/trunk/fs/afs/dir.c b/trunk/fs/afs/dir.c index dfda03d4397d..b58af8f18bc4 100644 --- a/trunk/fs/afs/dir.c +++ b/trunk/fs/afs/dir.c @@ -140,7 +140,7 @@ static inline void afs_dir_check_page(struct inode *dir, struct page *page) if (page->index == 0 && qty != ntohs(dbuf->blocks[0].pagehdr.npages)) { printk("kAFS: %s(%lu): wrong number of dir blocks %d!=%hu\n", - __func__, dir->i_ino, qty, + __FUNCTION__, dir->i_ino, qty, ntohs(dbuf->blocks[0].pagehdr.npages)); goto error; } @@ -159,7 +159,7 @@ static inline void afs_dir_check_page(struct inode *dir, struct page *page) for (tmp = 0; tmp < qty; tmp++) { if (dbuf->blocks[tmp].pagehdr.magic != AFS_DIR_MAGIC) { printk("kAFS: %s(%lu): bad magic %d/%d is %04hx\n", - __func__, dir->i_ino, tmp, qty, + __FUNCTION__, dir->i_ino, tmp, qty, ntohs(dbuf->blocks[tmp].pagehdr.magic)); goto error; } diff --git a/trunk/fs/afs/internal.h b/trunk/fs/afs/internal.h index 7102824ba847..eec41c76de72 100644 --- a/trunk/fs/afs/internal.h +++ b/trunk/fs/afs/internal.h @@ -757,8 +757,8 @@ void _dbprintk(const char *fmt, ...) { } -#define kenter(FMT,...) dbgprintk("==> %s("FMT")",__func__ ,##__VA_ARGS__) -#define kleave(FMT,...) dbgprintk("<== %s()"FMT"",__func__ ,##__VA_ARGS__) +#define kenter(FMT,...) dbgprintk("==> %s("FMT")",__FUNCTION__ ,##__VA_ARGS__) +#define kleave(FMT,...) dbgprintk("<== %s()"FMT"",__FUNCTION__ ,##__VA_ARGS__) #define kdebug(FMT,...) dbgprintk(" "FMT ,##__VA_ARGS__) @@ -791,8 +791,8 @@ do { \ } while (0) #else -#define _enter(FMT,...) _dbprintk("==> %s("FMT")",__func__ ,##__VA_ARGS__) -#define _leave(FMT,...) _dbprintk("<== %s()"FMT"",__func__ ,##__VA_ARGS__) +#define _enter(FMT,...) _dbprintk("==> %s("FMT")",__FUNCTION__ ,##__VA_ARGS__) +#define _leave(FMT,...) _dbprintk("<== %s()"FMT"",__FUNCTION__ ,##__VA_ARGS__) #define _debug(FMT,...) _dbprintk(" "FMT ,##__VA_ARGS__) #endif diff --git a/trunk/fs/aio.c b/trunk/fs/aio.c index b5253e77eb2f..99c2352906a0 100644 --- a/trunk/fs/aio.c +++ b/trunk/fs/aio.c @@ -1078,7 +1078,9 @@ static void timeout_func(unsigned long data) static inline void init_timeout(struct aio_timeout *to) { - setup_timer_on_stack(&to->timer, timeout_func, (unsigned long) to); + init_timer(&to->timer); + to->timer.data = (unsigned long)to; + to->timer.function = timeout_func; to->timed_out = 0; to->p = current; } @@ -1211,7 +1213,6 @@ static int read_events(struct kioctx *ctx, if (timeout) clear_timeout(&to); out: - destroy_timer_on_stack(&to.timer); return i ? i : ret; } diff --git a/trunk/fs/autofs4/autofs_i.h b/trunk/fs/autofs4/autofs_i.h index c3d352d7fa93..2d4ae40718d9 100644 --- a/trunk/fs/autofs4/autofs_i.h +++ b/trunk/fs/autofs4/autofs_i.h @@ -35,7 +35,7 @@ /* #define DEBUG */ #ifdef DEBUG -#define DPRINTK(fmt,args...) do { printk(KERN_DEBUG "pid %d: %s: " fmt "\n" , current->pid , __func__ , ##args); } while(0) +#define DPRINTK(fmt,args...) do { printk(KERN_DEBUG "pid %d: %s: " fmt "\n" , current->pid , __FUNCTION__ , ##args); } while(0) #else #define DPRINTK(fmt,args...) do {} while(0) #endif diff --git a/trunk/fs/bfs/bfs.h b/trunk/fs/bfs/bfs.h index 70f5d3a8eede..71faf4d23908 100644 --- a/trunk/fs/bfs/bfs.h +++ b/trunk/fs/bfs/bfs.h @@ -42,7 +42,7 @@ static inline struct bfs_inode_info *BFS_I(struct inode *inode) #define printf(format, args...) \ - printk(KERN_ERR "BFS-fs: %s(): " format, __func__, ## args) + printk(KERN_ERR "BFS-fs: %s(): " format, __FUNCTION__, ## args) /* inode.c */ extern struct inode *bfs_iget(struct super_block *sb, unsigned long ino); diff --git a/trunk/fs/buffer.c b/trunk/fs/buffer.c index a073f3f4f013..189efa4efc6e 100644 --- a/trunk/fs/buffer.c +++ b/trunk/fs/buffer.c @@ -1101,7 +1101,7 @@ grow_buffers(struct block_device *bdev, sector_t block, int size) printk(KERN_ERR "%s: requested out-of-range block %llu for " "device %s\n", - __func__, (unsigned long long)block, + __FUNCTION__, (unsigned long long)block, bdevname(bdev, b)); return -EIO; } diff --git a/trunk/fs/compat.c b/trunk/fs/compat.c index 139dc93c092d..2ce4456aad30 100644 --- a/trunk/fs/compat.c +++ b/trunk/fs/compat.c @@ -1634,7 +1634,7 @@ asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp, return ret; } -#ifdef HAVE_SET_RESTORE_SIGMASK +#ifdef TIF_RESTORE_SIGMASK asmlinkage long compat_sys_pselect7(int n, compat_ulong_t __user *inp, compat_ulong_t __user *outp, compat_ulong_t __user *exp, struct compat_timespec __user *tsp, compat_sigset_t __user *sigmask, @@ -1720,7 +1720,7 @@ asmlinkage long compat_sys_pselect7(int n, compat_ulong_t __user *inp, if (sigmask) { memcpy(¤t->saved_sigmask, &sigsaved, sizeof(sigsaved)); - set_restore_sigmask(); + set_thread_flag(TIF_RESTORE_SIGMASK); } } else if (sigmask) sigprocmask(SIG_SETMASK, &sigsaved, NULL); @@ -1791,7 +1791,7 @@ asmlinkage long compat_sys_ppoll(struct pollfd __user *ufds, if (sigmask) { memcpy(¤t->saved_sigmask, &sigsaved, sizeof(sigsaved)); - set_restore_sigmask(); + set_thread_flag(TIF_RESTORE_SIGMASK); } ret = -ERESTARTNOHAND; } else if (sigmask) @@ -1825,7 +1825,7 @@ asmlinkage long compat_sys_ppoll(struct pollfd __user *ufds, return ret; } -#endif /* HAVE_SET_RESTORE_SIGMASK */ +#endif /* TIF_RESTORE_SIGMASK */ #if defined(CONFIG_NFSD) || defined(CONFIG_NFSD_MODULE) /* Stuff for NFS server syscalls... */ @@ -2080,7 +2080,7 @@ long asmlinkage compat_sys_nfsservctl(int cmd, void *notused, void *notused2) #ifdef CONFIG_EPOLL -#ifdef HAVE_SET_RESTORE_SIGMASK +#ifdef TIF_RESTORE_SIGMASK asmlinkage long compat_sys_epoll_pwait(int epfd, struct compat_epoll_event __user *events, int maxevents, int timeout, @@ -2117,14 +2117,14 @@ asmlinkage long compat_sys_epoll_pwait(int epfd, if (err == -EINTR) { memcpy(¤t->saved_sigmask, &sigsaved, sizeof(sigsaved)); - set_restore_sigmask(); + set_thread_flag(TIF_RESTORE_SIGMASK); } else sigprocmask(SIG_SETMASK, &sigsaved, NULL); } return err; } -#endif /* HAVE_SET_RESTORE_SIGMASK */ +#endif /* TIF_RESTORE_SIGMASK */ #endif /* CONFIG_EPOLL */ diff --git a/trunk/fs/compat_ioctl.c b/trunk/fs/compat_ioctl.c index 97dba0d92348..c6e72aebd16b 100644 --- a/trunk/fs/compat_ioctl.c +++ b/trunk/fs/compat_ioctl.c @@ -1046,14 +1046,14 @@ static int vt_check(struct file *file) struct inode *inode = file->f_path.dentry->d_inode; struct vc_data *vc; - if (file->f_op->unlocked_ioctl != tty_ioctl) + if (file->f_op->ioctl != tty_ioctl) return -EINVAL; tty = (struct tty_struct *)file->private_data; if (tty_paranoia_check(tty, inode, "tty_ioctl")) return -EINVAL; - if (tty->ops->ioctl != vt_ioctl) + if (tty->driver->ioctl != vt_ioctl) return -EINVAL; vc = (struct vc_data *)tty->driver_data; diff --git a/trunk/fs/configfs/file.c b/trunk/fs/configfs/file.c index 2b6cb23dd14e..397cb503a180 100644 --- a/trunk/fs/configfs/file.c +++ b/trunk/fs/configfs/file.c @@ -115,7 +115,7 @@ configfs_read_file(struct file *file, char __user *buf, size_t count, loff_t *pp goto out; } pr_debug("%s: count = %zd, ppos = %lld, buf = %s\n", - __func__, count, *ppos, buffer->page); + __FUNCTION__, count, *ppos, buffer->page); retval = simple_read_from_buffer(buf, count, ppos, buffer->page, buffer->count); out: diff --git a/trunk/fs/configfs/inode.c b/trunk/fs/configfs/inode.c index b9a1d810346d..4c1ebff778ee 100644 --- a/trunk/fs/configfs/inode.c +++ b/trunk/fs/configfs/inode.c @@ -47,7 +47,7 @@ static const struct address_space_operations configfs_aops = { static struct backing_dev_info configfs_backing_dev_info = { .ra_pages = 0, /* No readahead */ - .capabilities = BDI_CAP_NO_ACCT_AND_WRITEBACK, + .capabilities = BDI_CAP_NO_ACCT_DIRTY | BDI_CAP_NO_WRITEBACK, }; static const struct inode_operations configfs_inode_operations ={ diff --git a/trunk/fs/configfs/mount.c b/trunk/fs/configfs/mount.c index 8421cea7d8c7..de3b31d0a37d 100644 --- a/trunk/fs/configfs/mount.c +++ b/trunk/fs/configfs/mount.c @@ -92,7 +92,7 @@ static int configfs_fill_super(struct super_block *sb, void *data, int silent) root = d_alloc_root(inode); if (!root) { - pr_debug("%s: could not get root dentry!\n",__func__); + pr_debug("%s: could not get root dentry!\n",__FUNCTION__); iput(inode); return -ENOMEM; } diff --git a/trunk/fs/configfs/symlink.c b/trunk/fs/configfs/symlink.c index 2a731ef5f305..78929ea84ff2 100644 --- a/trunk/fs/configfs/symlink.c +++ b/trunk/fs/configfs/symlink.c @@ -210,13 +210,13 @@ static int configfs_get_target_path(struct config_item * item, struct config_ite if (size > PATH_MAX) return -ENAMETOOLONG; - pr_debug("%s: depth = %d, size = %d\n", __func__, depth, size); + pr_debug("%s: depth = %d, size = %d\n", __FUNCTION__, depth, size); for (s = path; depth--; s += 3) strcpy(s,"../"); fill_item_path(target, path, size); - pr_debug("%s: path = '%s'\n", __func__, path); + pr_debug("%s: path = '%s'\n", __FUNCTION__, path); return 0; } diff --git a/trunk/fs/devpts/inode.c b/trunk/fs/devpts/inode.c index 285b64a8b06e..f120e1207874 100644 --- a/trunk/fs/devpts/inode.c +++ b/trunk/fs/devpts/inode.c @@ -17,8 +17,6 @@ #include #include #include -#include -#include #include #include #include @@ -28,10 +26,6 @@ #define DEVPTS_DEFAULT_MODE 0600 -extern int pty_limit; /* Config limit on Unix98 ptys */ -static DEFINE_IDR(allocated_ptys); -static DEFINE_MUTEX(allocated_ptys_lock); - static struct vfsmount *devpts_mnt; static struct dentry *devpts_root; @@ -177,44 +171,9 @@ static struct dentry *get_node(int num) return lookup_one_len(s, root, sprintf(s, "%d", num)); } -int devpts_new_index(void) -{ - int index; - int idr_ret; - -retry: - if (!idr_pre_get(&allocated_ptys, GFP_KERNEL)) { - return -ENOMEM; - } - - mutex_lock(&allocated_ptys_lock); - idr_ret = idr_get_new(&allocated_ptys, NULL, &index); - if (idr_ret < 0) { - mutex_unlock(&allocated_ptys_lock); - if (idr_ret == -EAGAIN) - goto retry; - return -EIO; - } - - if (index >= pty_limit) { - idr_remove(&allocated_ptys, index); - mutex_unlock(&allocated_ptys_lock); - return -EIO; - } - mutex_unlock(&allocated_ptys_lock); - return index; -} - -void devpts_kill_index(int idx) -{ - mutex_lock(&allocated_ptys_lock); - idr_remove(&allocated_ptys, idx); - mutex_unlock(&allocated_ptys_lock); -} - int devpts_pty_new(struct tty_struct *tty) { - int number = tty->index; /* tty layer puts index from devpts_new_index() in here */ + int number = tty->index; struct tty_driver *driver = tty->driver; dev_t device = MKDEV(driver->major, driver->minor_start+number); struct dentry *dentry; diff --git a/trunk/fs/dlm/lockspace.c b/trunk/fs/dlm/lockspace.c index 499e16759e96..b64e55e0515d 100644 --- a/trunk/fs/dlm/lockspace.c +++ b/trunk/fs/dlm/lockspace.c @@ -200,7 +200,7 @@ int __init dlm_lockspace_init(void) dlm_kset = kset_create_and_add("dlm", NULL, kernel_kobj); if (!dlm_kset) { - printk(KERN_WARNING "%s: can not create kset\n", __func__); + printk(KERN_WARNING "%s: can not create kset\n", __FUNCTION__); return -ENOMEM; } return 0; diff --git a/trunk/fs/eventpoll.c b/trunk/fs/eventpoll.c index 221086fef174..0d237182d721 100644 --- a/trunk/fs/eventpoll.c +++ b/trunk/fs/eventpoll.c @@ -1241,7 +1241,7 @@ asmlinkage long sys_epoll_wait(int epfd, struct epoll_event __user *events, return error; } -#ifdef HAVE_SET_RESTORE_SIGMASK +#ifdef TIF_RESTORE_SIGMASK /* * Implement the event wait interface for the eventpoll file. It is the kernel @@ -1279,7 +1279,7 @@ asmlinkage long sys_epoll_pwait(int epfd, struct epoll_event __user *events, if (error == -EINTR) { memcpy(¤t->saved_sigmask, &sigsaved, sizeof(sigsaved)); - set_restore_sigmask(); + set_thread_flag(TIF_RESTORE_SIGMASK); } else sigprocmask(SIG_SETMASK, &sigsaved, NULL); } @@ -1287,7 +1287,7 @@ asmlinkage long sys_epoll_pwait(int epfd, struct epoll_event __user *events, return error; } -#endif /* HAVE_SET_RESTORE_SIGMASK */ +#endif /* #ifdef TIF_RESTORE_SIGMASK */ static int __init eventpoll_init(void) { @@ -1309,3 +1309,4 @@ static int __init eventpoll_init(void) return 0; } fs_initcall(eventpoll_init); + diff --git a/trunk/fs/exec.c b/trunk/fs/exec.c index 9f9f931ef949..a13883903ee9 100644 --- a/trunk/fs/exec.c +++ b/trunk/fs/exec.c @@ -766,7 +766,9 @@ static int de_thread(struct task_struct *tsk) /* * Kill all other threads in the thread group. + * We must hold tasklist_lock to call zap_other_threads. */ + read_lock(&tasklist_lock); spin_lock_irq(lock); if (signal_group_exit(sig)) { /* @@ -774,10 +776,21 @@ static int de_thread(struct task_struct *tsk) * return so that the signal is processed. */ spin_unlock_irq(lock); + read_unlock(&tasklist_lock); return -EAGAIN; } + + /* + * child_reaper ignores SIGKILL, change it now. + * Reparenting needs write_lock on tasklist_lock, + * so it is safe to do it under read_lock. + */ + if (unlikely(tsk->group_leader == task_child_reaper(tsk))) + task_active_pid_ns(tsk)->child_reaper = tsk; + sig->group_exit_task = tsk; zap_other_threads(tsk); + read_unlock(&tasklist_lock); /* Account for the thread group leader hanging around: */ count = thread_group_leader(tsk) ? 1 : 2; @@ -798,7 +811,7 @@ static int de_thread(struct task_struct *tsk) if (!thread_group_leader(tsk)) { leader = tsk->group_leader; - sig->notify_count = -1; /* for exit_notify() */ + sig->notify_count = -1; for (;;) { write_lock_irq(&tasklist_lock); if (likely(leader->exit_state)) @@ -808,8 +821,6 @@ static int de_thread(struct task_struct *tsk) schedule(); } - if (unlikely(task_child_reaper(tsk) == leader)) - task_active_pid_ns(tsk)->child_reaper = tsk; /* * The only record we have of the real-time age of a * process, regardless of execs it's done, is start_time. diff --git a/trunk/fs/exportfs/expfs.c b/trunk/fs/exportfs/expfs.c index cc91227d3bb8..109ab5e44eca 100644 --- a/trunk/fs/exportfs/expfs.c +++ b/trunk/fs/exportfs/expfs.c @@ -150,12 +150,12 @@ reconnect_path(struct vfsmount *mnt, struct dentry *target_dir) if (IS_ERR(ppd)) { err = PTR_ERR(ppd); dprintk("%s: get_parent of %ld failed, err %d\n", - __func__, pd->d_inode->i_ino, err); + __FUNCTION__, pd->d_inode->i_ino, err); dput(pd); break; } - dprintk("%s: find name of %lu in %lu\n", __func__, + dprintk("%s: find name of %lu in %lu\n", __FUNCTION__, pd->d_inode->i_ino, ppd->d_inode->i_ino); err = exportfs_get_name(mnt, ppd, nbuf, pd); if (err) { @@ -168,14 +168,14 @@ reconnect_path(struct vfsmount *mnt, struct dentry *target_dir) continue; break; } - dprintk("%s: found name: %s\n", __func__, nbuf); + dprintk("%s: found name: %s\n", __FUNCTION__, nbuf); mutex_lock(&ppd->d_inode->i_mutex); npd = lookup_one_len(nbuf, ppd, strlen(nbuf)); mutex_unlock(&ppd->d_inode->i_mutex); if (IS_ERR(npd)) { err = PTR_ERR(npd); dprintk("%s: lookup failed: %d\n", - __func__, err); + __FUNCTION__, err); dput(ppd); dput(pd); break; @@ -188,7 +188,7 @@ reconnect_path(struct vfsmount *mnt, struct dentry *target_dir) if (npd == pd) noprogress = 0; else - printk("%s: npd != pd\n", __func__); + printk("%s: npd != pd\n", __FUNCTION__); dput(npd); dput(ppd); if (IS_ROOT(pd)) { diff --git a/trunk/fs/fat/cache.c b/trunk/fs/fat/cache.c index fda25479af26..639b3b4f86d1 100644 --- a/trunk/fs/fat/cache.c +++ b/trunk/fs/fat/cache.c @@ -242,7 +242,7 @@ int fat_get_cluster(struct inode *inode, int cluster, int *fclus, int *dclus) /* prevent the infinite loop of cluster chain */ if (*fclus > limit) { fat_fs_panic(sb, "%s: detected the cluster chain loop" - " (i_pos %lld)", __func__, + " (i_pos %lld)", __FUNCTION__, MSDOS_I(inode)->i_pos); nr = -EIO; goto out; @@ -253,7 +253,7 @@ int fat_get_cluster(struct inode *inode, int cluster, int *fclus, int *dclus) goto out; else if (nr == FAT_ENT_FREE) { fat_fs_panic(sb, "%s: invalid cluster chain" - " (i_pos %lld)", __func__, + " (i_pos %lld)", __FUNCTION__, MSDOS_I(inode)->i_pos); nr = -EIO; goto out; @@ -286,7 +286,7 @@ static int fat_bmap_cluster(struct inode *inode, int cluster) return ret; else if (ret == FAT_ENT_EOF) { fat_fs_panic(sb, "%s: request beyond EOF (i_pos %lld)", - __func__, MSDOS_I(inode)->i_pos); + __FUNCTION__, MSDOS_I(inode)->i_pos); return -EIO; } return dclus; diff --git a/trunk/fs/fat/fatent.c b/trunk/fs/fat/fatent.c index 302e95c4af7e..13ab763cc510 100644 --- a/trunk/fs/fat/fatent.c +++ b/trunk/fs/fat/fatent.c @@ -546,7 +546,7 @@ int fat_free_clusters(struct inode *inode, int cluster) goto error; } else if (cluster == FAT_ENT_FREE) { fat_fs_panic(sb, "%s: deleting FAT entry beyond EOF", - __func__); + __FUNCTION__); err = -EIO; goto error; } diff --git a/trunk/fs/fat/file.c b/trunk/fs/fat/file.c index 27cc1164ec36..d604bb132422 100644 --- a/trunk/fs/fat/file.c +++ b/trunk/fs/fat/file.c @@ -208,7 +208,7 @@ static int fat_free(struct inode *inode, int skip) } else if (ret == FAT_ENT_FREE) { fat_fs_panic(sb, "%s: invalid cluster chain (i_pos %lld)", - __func__, MSDOS_I(inode)->i_pos); + __FUNCTION__, MSDOS_I(inode)->i_pos); ret = -EIO; } else if (ret > 0) { err = fat_ent_write(inode, &fatent, FAT_ENT_EOF, wait); diff --git a/trunk/fs/fuse/control.c b/trunk/fs/fuse/control.c index 4f3cab321415..105d4a271e07 100644 --- a/trunk/fs/fuse/control.c +++ b/trunk/fs/fuse/control.c @@ -117,7 +117,7 @@ int fuse_ctl_add_conn(struct fuse_conn *fc) parent = fuse_control_sb->s_root; inc_nlink(parent->d_inode); - sprintf(name, "%u", fc->dev); + sprintf(name, "%llu", (unsigned long long) fc->id); parent = fuse_ctl_add_dentry(parent, fc, name, S_IFDIR | 0500, 2, &simple_dir_inode_operations, &simple_dir_operations); diff --git a/trunk/fs/fuse/dev.c b/trunk/fs/fuse/dev.c index 87250b6a8682..af639807524e 100644 --- a/trunk/fs/fuse/dev.c +++ b/trunk/fs/fuse/dev.c @@ -47,14 +47,6 @@ struct fuse_req *fuse_request_alloc(void) return req; } -struct fuse_req *fuse_request_alloc_nofs(void) -{ - struct fuse_req *req = kmem_cache_alloc(fuse_req_cachep, GFP_NOFS); - if (req) - fuse_request_init(req); - return req; -} - void fuse_request_free(struct fuse_req *req) { kmem_cache_free(fuse_req_cachep, req); @@ -299,7 +291,6 @@ static void request_end(struct fuse_conn *fc, struct fuse_req *req) static void wait_answer_interruptible(struct fuse_conn *fc, struct fuse_req *req) - __releases(fc->lock) __acquires(fc->lock) { if (signal_pending(current)) return; @@ -316,8 +307,8 @@ static void queue_interrupt(struct fuse_conn *fc, struct fuse_req *req) kill_fasync(&fc->fasync, SIGIO, POLL_IN); } +/* Called with fc->lock held. Releases, and then reacquires it. */ static void request_wait_answer(struct fuse_conn *fc, struct fuse_req *req) - __releases(fc->lock) __acquires(fc->lock) { if (!fc->no_interrupt) { /* Any signal may interrupt this */ @@ -438,17 +429,6 @@ void request_send_background(struct fuse_conn *fc, struct fuse_req *req) request_send_nowait(fc, req); } -/* - * Called under fc->lock - * - * fc->connected must have been checked previously - */ -void request_send_background_locked(struct fuse_conn *fc, struct fuse_req *req) -{ - req->isreply = 1; - request_send_nowait_locked(fc, req); -} - /* * Lock the request. Up to the next unlock_request() there mustn't be * anything that could cause a page-fault. If the request was already @@ -988,7 +968,6 @@ static void end_requests(struct fuse_conn *fc, struct list_head *head) * locked). */ static void end_io_requests(struct fuse_conn *fc) - __releases(fc->lock) __acquires(fc->lock) { while (!list_empty(&fc->io)) { struct fuse_req *req = diff --git a/trunk/fs/fuse/dir.c b/trunk/fs/fuse/dir.c index 2060bf06b906..c4807b3fc8a3 100644 --- a/trunk/fs/fuse/dir.c +++ b/trunk/fs/fuse/dir.c @@ -132,7 +132,7 @@ static void fuse_lookup_init(struct fuse_req *req, struct inode *dir, req->out.args[0].value = outarg; } -u64 fuse_get_attr_version(struct fuse_conn *fc) +static u64 fuse_get_attr_version(struct fuse_conn *fc) { u64 curr_version; @@ -1106,50 +1106,6 @@ static void iattr_to_fattr(struct iattr *iattr, struct fuse_setattr_in *arg) } } -/* - * Prevent concurrent writepages on inode - * - * This is done by adding a negative bias to the inode write counter - * and waiting for all pending writes to finish. - */ -void fuse_set_nowrite(struct inode *inode) -{ - struct fuse_conn *fc = get_fuse_conn(inode); - struct fuse_inode *fi = get_fuse_inode(inode); - - BUG_ON(!mutex_is_locked(&inode->i_mutex)); - - spin_lock(&fc->lock); - BUG_ON(fi->writectr < 0); - fi->writectr += FUSE_NOWRITE; - spin_unlock(&fc->lock); - wait_event(fi->page_waitq, fi->writectr == FUSE_NOWRITE); -} - -/* - * Allow writepages on inode - * - * Remove the bias from the writecounter and send any queued - * writepages. - */ -static void __fuse_release_nowrite(struct inode *inode) -{ - struct fuse_inode *fi = get_fuse_inode(inode); - - BUG_ON(fi->writectr != FUSE_NOWRITE); - fi->writectr = 0; - fuse_flush_writepages(inode); -} - -void fuse_release_nowrite(struct inode *inode) -{ - struct fuse_conn *fc = get_fuse_conn(inode); - - spin_lock(&fc->lock); - __fuse_release_nowrite(inode); - spin_unlock(&fc->lock); -} - /* * Set attributes, and at the same time refresh them. * @@ -1166,8 +1122,6 @@ static int fuse_do_setattr(struct dentry *entry, struct iattr *attr, struct fuse_req *req; struct fuse_setattr_in inarg; struct fuse_attr_out outarg; - bool is_truncate = false; - loff_t oldsize; int err; if (!fuse_allow_task(fc, current)) @@ -1191,16 +1145,12 @@ static int fuse_do_setattr(struct dentry *entry, struct iattr *attr, send_sig(SIGXFSZ, current, 0); return -EFBIG; } - is_truncate = true; } req = fuse_get_req(fc); if (IS_ERR(req)) return PTR_ERR(req); - if (is_truncate) - fuse_set_nowrite(inode); - memset(&inarg, 0, sizeof(inarg)); memset(&outarg, 0, sizeof(outarg)); iattr_to_fattr(attr, &inarg); @@ -1231,44 +1181,16 @@ static int fuse_do_setattr(struct dentry *entry, struct iattr *attr, if (err) { if (err == -EINTR) fuse_invalidate_attr(inode); - goto error; + return err; } if ((inode->i_mode ^ outarg.attr.mode) & S_IFMT) { make_bad_inode(inode); - err = -EIO; - goto error; - } - - spin_lock(&fc->lock); - fuse_change_attributes_common(inode, &outarg.attr, - attr_timeout(&outarg)); - oldsize = inode->i_size; - i_size_write(inode, outarg.attr.size); - - if (is_truncate) { - /* NOTE: this may release/reacquire fc->lock */ - __fuse_release_nowrite(inode); - } - spin_unlock(&fc->lock); - - /* - * Only call invalidate_inode_pages2() after removing - * FUSE_NOWRITE, otherwise fuse_launder_page() would deadlock. - */ - if (S_ISREG(inode->i_mode) && oldsize != outarg.attr.size) { - if (outarg.attr.size < oldsize) - fuse_truncate(inode->i_mapping, outarg.attr.size); - invalidate_inode_pages2(inode->i_mapping); + return -EIO; } + fuse_change_attributes(inode, &outarg.attr, attr_timeout(&outarg), 0); return 0; - -error: - if (is_truncate) - fuse_release_nowrite(inode); - - return err; } static int fuse_setattr(struct dentry *entry, struct iattr *attr) diff --git a/trunk/fs/fuse/file.c b/trunk/fs/fuse/file.c index 9ced35b00686..676b0bc8a86d 100644 --- a/trunk/fs/fuse/file.c +++ b/trunk/fs/fuse/file.c @@ -210,49 +210,6 @@ u64 fuse_lock_owner_id(struct fuse_conn *fc, fl_owner_t id) return (u64) v0 + ((u64) v1 << 32); } -/* - * Check if page is under writeback - * - * This is currently done by walking the list of writepage requests - * for the inode, which can be pretty inefficient. - */ -static bool fuse_page_is_writeback(struct inode *inode, pgoff_t index) -{ - struct fuse_conn *fc = get_fuse_conn(inode); - struct fuse_inode *fi = get_fuse_inode(inode); - struct fuse_req *req; - bool found = false; - - spin_lock(&fc->lock); - list_for_each_entry(req, &fi->writepages, writepages_entry) { - pgoff_t curr_index; - - BUG_ON(req->inode != inode); - curr_index = req->misc.write.in.offset >> PAGE_CACHE_SHIFT; - if (curr_index == index) { - found = true; - break; - } - } - spin_unlock(&fc->lock); - - return found; -} - -/* - * Wait for page writeback to be completed. - * - * Since fuse doesn't rely on the VM writeback tracking, this has to - * use some other means. - */ -static int fuse_wait_on_page_writeback(struct inode *inode, pgoff_t index) -{ - struct fuse_inode *fi = get_fuse_inode(inode); - - wait_event(fi->page_waitq, !fuse_page_is_writeback(inode, index)); - return 0; -} - static int fuse_flush(struct file *file, fl_owner_t id) { struct inode *inode = file->f_path.dentry->d_inode; @@ -288,21 +245,6 @@ static int fuse_flush(struct file *file, fl_owner_t id) return err; } -/* - * Wait for all pending writepages on the inode to finish. - * - * This is currently done by blocking further writes with FUSE_NOWRITE - * and waiting for all sent writes to complete. - * - * This must be called under i_mutex, otherwise the FUSE_NOWRITE usage - * could conflict with truncation. - */ -static void fuse_sync_writes(struct inode *inode) -{ - fuse_set_nowrite(inode); - fuse_release_nowrite(inode); -} - int fuse_fsync_common(struct file *file, struct dentry *de, int datasync, int isdir) { @@ -319,17 +261,6 @@ int fuse_fsync_common(struct file *file, struct dentry *de, int datasync, if ((!isdir && fc->no_fsync) || (isdir && fc->no_fsyncdir)) return 0; - /* - * Start writeback against all dirty pages of the inode, then - * wait for all outstanding writes, before sending the FSYNC - * request. - */ - err = write_inode_now(inode, 0); - if (err) - return err; - - fuse_sync_writes(inode); - req = fuse_get_req(fc); if (IS_ERR(req)) return PTR_ERR(req); @@ -363,7 +294,7 @@ static int fuse_fsync(struct file *file, struct dentry *de, int datasync) void fuse_read_fill(struct fuse_req *req, struct file *file, struct inode *inode, loff_t pos, size_t count, int opcode) { - struct fuse_read_in *inarg = &req->misc.read.in; + struct fuse_read_in *inarg = &req->misc.read_in; struct fuse_file *ff = file->private_data; inarg->fh = ff->fh; @@ -389,7 +320,7 @@ static size_t fuse_send_read(struct fuse_req *req, struct file *file, fuse_read_fill(req, file, inode, pos, count, FUSE_READ); if (owner != NULL) { - struct fuse_read_in *inarg = &req->misc.read.in; + struct fuse_read_in *inarg = &req->misc.read_in; inarg->read_flags |= FUSE_READ_LOCKOWNER; inarg->lock_owner = fuse_lock_owner_id(fc, owner); @@ -398,66 +329,31 @@ static size_t fuse_send_read(struct fuse_req *req, struct file *file, return req->out.args[0].size; } -static void fuse_read_update_size(struct inode *inode, loff_t size, - u64 attr_ver) -{ - struct fuse_conn *fc = get_fuse_conn(inode); - struct fuse_inode *fi = get_fuse_inode(inode); - - spin_lock(&fc->lock); - if (attr_ver == fi->attr_version && size < inode->i_size) { - fi->attr_version = ++fc->attr_version; - i_size_write(inode, size); - } - spin_unlock(&fc->lock); -} - static int fuse_readpage(struct file *file, struct page *page) { struct inode *inode = page->mapping->host; struct fuse_conn *fc = get_fuse_conn(inode); struct fuse_req *req; - size_t num_read; - loff_t pos = page_offset(page); - size_t count = PAGE_CACHE_SIZE; - u64 attr_ver; int err; err = -EIO; if (is_bad_inode(inode)) goto out; - /* - * Page writeback can extend beyond the liftime of the - * page-cache page, so make sure we read a properly synced - * page. - */ - fuse_wait_on_page_writeback(inode, page->index); - req = fuse_get_req(fc); err = PTR_ERR(req); if (IS_ERR(req)) goto out; - attr_ver = fuse_get_attr_version(fc); - req->out.page_zeroing = 1; req->num_pages = 1; req->pages[0] = page; - num_read = fuse_send_read(req, file, inode, pos, count, NULL); + fuse_send_read(req, file, inode, page_offset(page), PAGE_CACHE_SIZE, + NULL); err = req->out.h.error; fuse_put_request(fc, req); - - if (!err) { - /* - * Short read means EOF. If file size is larger, truncate it - */ - if (num_read < count) - fuse_read_update_size(inode, pos + num_read, attr_ver); - + if (!err) SetPageUptodate(page); - } - fuse_invalidate_attr(inode); /* atime changed */ out: unlock_page(page); @@ -467,19 +363,8 @@ static int fuse_readpage(struct file *file, struct page *page) static void fuse_readpages_end(struct fuse_conn *fc, struct fuse_req *req) { int i; - size_t count = req->misc.read.in.size; - size_t num_read = req->out.args[0].size; - struct inode *inode = req->pages[0]->mapping->host; - - /* - * Short read means EOF. If file size is larger, truncate it - */ - if (!req->out.h.error && num_read < count) { - loff_t pos = page_offset(req->pages[0]) + num_read; - fuse_read_update_size(inode, pos, req->misc.read.attr_ver); - } - fuse_invalidate_attr(inode); /* atime changed */ + fuse_invalidate_attr(req->pages[0]->mapping->host); /* atime changed */ for (i = 0; i < req->num_pages; i++) { struct page *page = req->pages[i]; @@ -502,7 +387,6 @@ static void fuse_send_readpages(struct fuse_req *req, struct file *file, size_t count = req->num_pages << PAGE_CACHE_SHIFT; req->out.page_zeroing = 1; fuse_read_fill(req, file, inode, pos, count, FUSE_READ); - req->misc.read.attr_ver = fuse_get_attr_version(fc); if (fc->async_read) { struct fuse_file *ff = file->private_data; req->ff = fuse_file_get(ff); @@ -527,8 +411,6 @@ static int fuse_readpages_fill(void *_data, struct page *page) struct inode *inode = data->inode; struct fuse_conn *fc = get_fuse_conn(inode); - fuse_wait_on_page_writeback(inode, page->index); - if (req->num_pages && (req->num_pages == FUSE_MAX_PAGES_PER_REQ || (req->num_pages + 1) * PAGE_CACHE_SIZE > fc->max_read || @@ -595,10 +477,11 @@ static ssize_t fuse_file_aio_read(struct kiocb *iocb, const struct iovec *iov, } static void fuse_write_fill(struct fuse_req *req, struct file *file, - struct fuse_file *ff, struct inode *inode, - loff_t pos, size_t count, int writepage) + struct inode *inode, loff_t pos, size_t count, + int writepage) { struct fuse_conn *fc = get_fuse_conn(inode); + struct fuse_file *ff = file->private_data; struct fuse_write_in *inarg = &req->misc.write.in; struct fuse_write_out *outarg = &req->misc.write.out; @@ -607,7 +490,7 @@ static void fuse_write_fill(struct fuse_req *req, struct file *file, inarg->offset = pos; inarg->size = count; inarg->write_flags = writepage ? FUSE_WRITE_CACHE : 0; - inarg->flags = file ? file->f_flags : 0; + inarg->flags = file->f_flags; req->in.h.opcode = FUSE_WRITE; req->in.h.nodeid = get_node_id(inode); req->in.argpages = 1; @@ -628,7 +511,7 @@ static size_t fuse_send_write(struct fuse_req *req, struct file *file, fl_owner_t owner) { struct fuse_conn *fc = get_fuse_conn(inode); - fuse_write_fill(req, file, file->private_data, inode, pos, count, 0); + fuse_write_fill(req, file, inode, pos, count, 0); if (owner != NULL) { struct fuse_write_in *inarg = &req->misc.write.in; inarg->write_flags |= FUSE_WRITE_LOCKOWNER; @@ -650,36 +533,19 @@ static int fuse_write_begin(struct file *file, struct address_space *mapping, return 0; } -static void fuse_write_update_size(struct inode *inode, loff_t pos) -{ - struct fuse_conn *fc = get_fuse_conn(inode); - struct fuse_inode *fi = get_fuse_inode(inode); - - spin_lock(&fc->lock); - fi->attr_version = ++fc->attr_version; - if (pos > inode->i_size) - i_size_write(inode, pos); - spin_unlock(&fc->lock); -} - static int fuse_buffered_write(struct file *file, struct inode *inode, loff_t pos, unsigned count, struct page *page) { int err; size_t nres; struct fuse_conn *fc = get_fuse_conn(inode); + struct fuse_inode *fi = get_fuse_inode(inode); unsigned offset = pos & (PAGE_CACHE_SIZE - 1); struct fuse_req *req; if (is_bad_inode(inode)) return -EIO; - /* - * Make sure writepages on the same page are not mixed up with - * plain writes. - */ - fuse_wait_on_page_writeback(inode, page->index); - req = fuse_get_req(fc); if (IS_ERR(req)) return PTR_ERR(req); @@ -694,7 +560,12 @@ static int fuse_buffered_write(struct file *file, struct inode *inode, err = -EIO; if (!err) { pos += nres; - fuse_write_update_size(inode, pos); + spin_lock(&fc->lock); + fi->attr_version = ++fc->attr_version; + if (pos > inode->i_size) + i_size_write(inode, pos); + spin_unlock(&fc->lock); + if (count == PAGE_CACHE_SIZE) SetPageUptodate(page); } @@ -717,198 +588,6 @@ static int fuse_write_end(struct file *file, struct address_space *mapping, return res; } -static size_t fuse_send_write_pages(struct fuse_req *req, struct file *file, - struct inode *inode, loff_t pos, - size_t count) -{ - size_t res; - unsigned offset; - unsigned i; - - for (i = 0; i < req->num_pages; i++) - fuse_wait_on_page_writeback(inode, req->pages[i]->index); - - res = fuse_send_write(req, file, inode, pos, count, NULL); - - offset = req->page_offset; - count = res; - for (i = 0; i < req->num_pages; i++) { - struct page *page = req->pages[i]; - - if (!req->out.h.error && !offset && count >= PAGE_CACHE_SIZE) - SetPageUptodate(page); - - if (count > PAGE_CACHE_SIZE - offset) - count -= PAGE_CACHE_SIZE - offset; - else - count = 0; - offset = 0; - - unlock_page(page); - page_cache_release(page); - } - - return res; -} - -static ssize_t fuse_fill_write_pages(struct fuse_req *req, - struct address_space *mapping, - struct iov_iter *ii, loff_t pos) -{ - struct fuse_conn *fc = get_fuse_conn(mapping->host); - unsigned offset = pos & (PAGE_CACHE_SIZE - 1); - size_t count = 0; - int err; - - req->page_offset = offset; - - do { - size_t tmp; - struct page *page; - pgoff_t index = pos >> PAGE_CACHE_SHIFT; - size_t bytes = min_t(size_t, PAGE_CACHE_SIZE - offset, - iov_iter_count(ii)); - - bytes = min_t(size_t, bytes, fc->max_write - count); - - again: - err = -EFAULT; - if (iov_iter_fault_in_readable(ii, bytes)) - break; - - err = -ENOMEM; - page = __grab_cache_page(mapping, index); - if (!page) - break; - - pagefault_disable(); - tmp = iov_iter_copy_from_user_atomic(page, ii, offset, bytes); - pagefault_enable(); - flush_dcache_page(page); - - if (!tmp) { - unlock_page(page); - page_cache_release(page); - bytes = min(bytes, iov_iter_single_seg_count(ii)); - goto again; - } - - err = 0; - req->pages[req->num_pages] = page; - req->num_pages++; - - iov_iter_advance(ii, tmp); - count += tmp; - pos += tmp; - offset += tmp; - if (offset == PAGE_CACHE_SIZE) - offset = 0; - - } while (iov_iter_count(ii) && count < fc->max_write && - req->num_pages < FUSE_MAX_PAGES_PER_REQ && offset == 0); - - return count > 0 ? count : err; -} - -static ssize_t fuse_perform_write(struct file *file, - struct address_space *mapping, - struct iov_iter *ii, loff_t pos) -{ - struct inode *inode = mapping->host; - struct fuse_conn *fc = get_fuse_conn(inode); - int err = 0; - ssize_t res = 0; - - if (is_bad_inode(inode)) - return -EIO; - - do { - struct fuse_req *req; - ssize_t count; - - req = fuse_get_req(fc); - if (IS_ERR(req)) { - err = PTR_ERR(req); - break; - } - - count = fuse_fill_write_pages(req, mapping, ii, pos); - if (count <= 0) { - err = count; - } else { - size_t num_written; - - num_written = fuse_send_write_pages(req, file, inode, - pos, count); - err = req->out.h.error; - if (!err) { - res += num_written; - pos += num_written; - - /* break out of the loop on short write */ - if (num_written != count) - err = -EIO; - } - } - fuse_put_request(fc, req); - } while (!err && iov_iter_count(ii)); - - if (res > 0) - fuse_write_update_size(inode, pos); - - fuse_invalidate_attr(inode); - - return res > 0 ? res : err; -} - -static ssize_t fuse_file_aio_write(struct kiocb *iocb, const struct iovec *iov, - unsigned long nr_segs, loff_t pos) -{ - struct file *file = iocb->ki_filp; - struct address_space *mapping = file->f_mapping; - size_t count = 0; - ssize_t written = 0; - struct inode *inode = mapping->host; - ssize_t err; - struct iov_iter i; - - WARN_ON(iocb->ki_pos != pos); - - err = generic_segment_checks(iov, &nr_segs, &count, VERIFY_READ); - if (err) - return err; - - mutex_lock(&inode->i_mutex); - vfs_check_frozen(inode->i_sb, SB_FREEZE_WRITE); - - /* We can write back this queue in page reclaim */ - current->backing_dev_info = mapping->backing_dev_info; - - err = generic_write_checks(file, &pos, &count, S_ISBLK(inode->i_mode)); - if (err) - goto out; - - if (count == 0) - goto out; - - err = remove_suid(file->f_path.dentry); - if (err) - goto out; - - file_update_time(file); - - iov_iter_init(&i, iov, nr_segs, count, 0); - written = fuse_perform_write(file, mapping, &i, pos); - if (written >= 0) - iocb->ki_pos = pos + written; - -out: - current->backing_dev_info = NULL; - mutex_unlock(&inode->i_mutex); - - return written ? written : err; -} - static void fuse_release_user_pages(struct fuse_req *req, int write) { unsigned i; @@ -966,15 +645,14 @@ static ssize_t fuse_direct_io(struct file *file, const char __user *buf, while (count) { size_t nres; - size_t nbytes_limit = min(count, nmax); - size_t nbytes; - int err = fuse_get_user_pages(req, buf, nbytes_limit, !write); + size_t nbytes = min(count, nmax); + int err = fuse_get_user_pages(req, buf, nbytes, !write); if (err) { res = err; break; } nbytes = (req->num_pages << PAGE_SHIFT) - req->page_offset; - nbytes = min(nbytes_limit, nbytes); + nbytes = min(count, nbytes); if (write) nres = fuse_send_write(req, file, inode, pos, nbytes, current->files); @@ -1005,8 +683,12 @@ static ssize_t fuse_direct_io(struct file *file, const char __user *buf, } fuse_put_request(fc, req); if (res > 0) { - if (write) - fuse_write_update_size(inode, pos); + if (write) { + spin_lock(&fc->lock); + if (pos > inode->i_size) + i_size_write(inode, pos); + spin_unlock(&fc->lock); + } *ppos = pos; } fuse_invalidate_attr(inode); @@ -1034,225 +716,21 @@ static ssize_t fuse_direct_write(struct file *file, const char __user *buf, return res; } -static void fuse_writepage_free(struct fuse_conn *fc, struct fuse_req *req) -{ - __free_page(req->pages[0]); - fuse_file_put(req->ff); - fuse_put_request(fc, req); -} - -static void fuse_writepage_finish(struct fuse_conn *fc, struct fuse_req *req) -{ - struct inode *inode = req->inode; - struct fuse_inode *fi = get_fuse_inode(inode); - struct backing_dev_info *bdi = inode->i_mapping->backing_dev_info; - - list_del(&req->writepages_entry); - dec_bdi_stat(bdi, BDI_WRITEBACK); - dec_zone_page_state(req->pages[0], NR_WRITEBACK_TEMP); - bdi_writeout_inc(bdi); - wake_up(&fi->page_waitq); -} - -/* Called under fc->lock, may release and reacquire it */ -static void fuse_send_writepage(struct fuse_conn *fc, struct fuse_req *req) -{ - struct fuse_inode *fi = get_fuse_inode(req->inode); - loff_t size = i_size_read(req->inode); - struct fuse_write_in *inarg = &req->misc.write.in; - - if (!fc->connected) - goto out_free; - - if (inarg->offset + PAGE_CACHE_SIZE <= size) { - inarg->size = PAGE_CACHE_SIZE; - } else if (inarg->offset < size) { - inarg->size = size & (PAGE_CACHE_SIZE - 1); - } else { - /* Got truncated off completely */ - goto out_free; - } - - req->in.args[1].size = inarg->size; - fi->writectr++; - request_send_background_locked(fc, req); - return; - - out_free: - fuse_writepage_finish(fc, req); - spin_unlock(&fc->lock); - fuse_writepage_free(fc, req); - spin_lock(&fc->lock); -} - -/* - * If fi->writectr is positive (no truncate or fsync going on) send - * all queued writepage requests. - * - * Called with fc->lock - */ -void fuse_flush_writepages(struct inode *inode) -{ - struct fuse_conn *fc = get_fuse_conn(inode); - struct fuse_inode *fi = get_fuse_inode(inode); - struct fuse_req *req; - - while (fi->writectr >= 0 && !list_empty(&fi->queued_writes)) { - req = list_entry(fi->queued_writes.next, struct fuse_req, list); - list_del_init(&req->list); - fuse_send_writepage(fc, req); - } -} - -static void fuse_writepage_end(struct fuse_conn *fc, struct fuse_req *req) -{ - struct inode *inode = req->inode; - struct fuse_inode *fi = get_fuse_inode(inode); - - mapping_set_error(inode->i_mapping, req->out.h.error); - spin_lock(&fc->lock); - fi->writectr--; - fuse_writepage_finish(fc, req); - spin_unlock(&fc->lock); - fuse_writepage_free(fc, req); -} - -static int fuse_writepage_locked(struct page *page) -{ - struct address_space *mapping = page->mapping; - struct inode *inode = mapping->host; - struct fuse_conn *fc = get_fuse_conn(inode); - struct fuse_inode *fi = get_fuse_inode(inode); - struct fuse_req *req; - struct fuse_file *ff; - struct page *tmp_page; - - set_page_writeback(page); - - req = fuse_request_alloc_nofs(); - if (!req) - goto err; - - tmp_page = alloc_page(GFP_NOFS | __GFP_HIGHMEM); - if (!tmp_page) - goto err_free; - - spin_lock(&fc->lock); - BUG_ON(list_empty(&fi->write_files)); - ff = list_entry(fi->write_files.next, struct fuse_file, write_entry); - req->ff = fuse_file_get(ff); - spin_unlock(&fc->lock); - - fuse_write_fill(req, NULL, ff, inode, page_offset(page), 0, 1); - - copy_highpage(tmp_page, page); - req->num_pages = 1; - req->pages[0] = tmp_page; - req->page_offset = 0; - req->end = fuse_writepage_end; - req->inode = inode; - - inc_bdi_stat(mapping->backing_dev_info, BDI_WRITEBACK); - inc_zone_page_state(tmp_page, NR_WRITEBACK_TEMP); - end_page_writeback(page); - - spin_lock(&fc->lock); - list_add(&req->writepages_entry, &fi->writepages); - list_add_tail(&req->list, &fi->queued_writes); - fuse_flush_writepages(inode); - spin_unlock(&fc->lock); - - return 0; - -err_free: - fuse_request_free(req); -err: - end_page_writeback(page); - return -ENOMEM; -} - -static int fuse_writepage(struct page *page, struct writeback_control *wbc) -{ - int err; - - err = fuse_writepage_locked(page); - unlock_page(page); - - return err; -} - -static int fuse_launder_page(struct page *page) +static int fuse_file_mmap(struct file *file, struct vm_area_struct *vma) { - int err = 0; - if (clear_page_dirty_for_io(page)) { - struct inode *inode = page->mapping->host; - err = fuse_writepage_locked(page); - if (!err) - fuse_wait_on_page_writeback(inode, page->index); + if ((vma->vm_flags & VM_SHARED)) { + if ((vma->vm_flags & VM_WRITE)) + return -ENODEV; + else + vma->vm_flags &= ~VM_MAYWRITE; } - return err; + return generic_file_mmap(file, vma); } -/* - * Write back dirty pages now, because there may not be any suitable - * open files later - */ -static void fuse_vma_close(struct vm_area_struct *vma) +static int fuse_set_page_dirty(struct page *page) { - filemap_write_and_wait(vma->vm_file->f_mapping); -} - -/* - * Wait for writeback against this page to complete before allowing it - * to be marked dirty again, and hence written back again, possibly - * before the previous writepage completed. - * - * Block here, instead of in ->writepage(), so that the userspace fs - * can only block processes actually operating on the filesystem. - * - * Otherwise unprivileged userspace fs would be able to block - * unrelated: - * - * - page migration - * - sync(2) - * - try_to_free_pages() with order > PAGE_ALLOC_COSTLY_ORDER - */ -static int fuse_page_mkwrite(struct vm_area_struct *vma, struct page *page) -{ - /* - * Don't use page->mapping as it may become NULL from a - * concurrent truncate. - */ - struct inode *inode = vma->vm_file->f_mapping->host; - - fuse_wait_on_page_writeback(inode, page->index); - return 0; -} - -static struct vm_operations_struct fuse_file_vm_ops = { - .close = fuse_vma_close, - .fault = filemap_fault, - .page_mkwrite = fuse_page_mkwrite, -}; - -static int fuse_file_mmap(struct file *file, struct vm_area_struct *vma) -{ - if ((vma->vm_flags & VM_SHARED) && (vma->vm_flags & VM_MAYWRITE)) { - struct inode *inode = file->f_dentry->d_inode; - struct fuse_conn *fc = get_fuse_conn(inode); - struct fuse_inode *fi = get_fuse_inode(inode); - struct fuse_file *ff = file->private_data; - /* - * file may be written through mmap, so chain it onto the - * inodes's write_file list - */ - spin_lock(&fc->lock); - if (list_empty(&ff->write_entry)) - list_add(&ff->write_entry, &fi->write_files); - spin_unlock(&fc->lock); - } - file_accessed(file); - vma->vm_ops = &fuse_file_vm_ops; + printk("fuse_set_page_dirty: should not happen\n"); + dump_stack(); return 0; } @@ -1431,37 +909,12 @@ static sector_t fuse_bmap(struct address_space *mapping, sector_t block) return err ? 0 : outarg.block; } -static loff_t fuse_file_llseek(struct file *file, loff_t offset, int origin) -{ - loff_t retval; - struct inode *inode = file->f_path.dentry->d_inode; - - mutex_lock(&inode->i_mutex); - switch (origin) { - case SEEK_END: - offset += i_size_read(inode); - break; - case SEEK_CUR: - offset += file->f_pos; - } - retval = -EINVAL; - if (offset >= 0 && offset <= inode->i_sb->s_maxbytes) { - if (offset != file->f_pos) { - file->f_pos = offset; - file->f_version = 0; - } - retval = offset; - } - mutex_unlock(&inode->i_mutex); - return retval; -} - static const struct file_operations fuse_file_operations = { - .llseek = fuse_file_llseek, + .llseek = generic_file_llseek, .read = do_sync_read, .aio_read = fuse_file_aio_read, .write = do_sync_write, - .aio_write = fuse_file_aio_write, + .aio_write = generic_file_aio_write, .mmap = fuse_file_mmap, .open = fuse_open, .flush = fuse_flush, @@ -1473,7 +926,7 @@ static const struct file_operations fuse_file_operations = { }; static const struct file_operations fuse_direct_io_file_operations = { - .llseek = fuse_file_llseek, + .llseek = generic_file_llseek, .read = fuse_direct_read, .write = fuse_direct_write, .open = fuse_open, @@ -1487,12 +940,10 @@ static const struct file_operations fuse_direct_io_file_operations = { static const struct address_space_operations fuse_file_aops = { .readpage = fuse_readpage, - .writepage = fuse_writepage, - .launder_page = fuse_launder_page, .write_begin = fuse_write_begin, .write_end = fuse_write_end, .readpages = fuse_readpages, - .set_page_dirty = __set_page_dirty_nobuffers, + .set_page_dirty = fuse_set_page_dirty, .bmap = fuse_bmap, }; diff --git a/trunk/fs/fuse/fuse_i.h b/trunk/fs/fuse/fuse_i.h index dadffa21a206..67aaf6ee38ea 100644 --- a/trunk/fs/fuse/fuse_i.h +++ b/trunk/fs/fuse/fuse_i.h @@ -15,7 +15,6 @@ #include #include #include -#include /** Max number of pages that can be used in a single read request */ #define FUSE_MAX_PAGES_PER_REQ 32 @@ -26,9 +25,6 @@ /** Congestion starts at 75% of maximum */ #define FUSE_CONGESTION_THRESHOLD (FUSE_MAX_BACKGROUND * 75 / 100) -/** Bias for fi->writectr, meaning new writepages must not be sent */ -#define FUSE_NOWRITE INT_MIN - /** It could be as large as PATH_MAX, but would that have any uses? */ #define FUSE_NAME_MAX 1024 @@ -77,19 +73,6 @@ struct fuse_inode { /** Files usable in writepage. Protected by fc->lock */ struct list_head write_files; - - /** Writepages pending on truncate or fsync */ - struct list_head queued_writes; - - /** Number of sent writes, a negative bias (FUSE_NOWRITE) - * means more writes are blocked */ - int writectr; - - /** Waitq for writepage completion */ - wait_queue_head_t page_waitq; - - /** List of writepage requestst (pending or sent) */ - struct list_head writepages; }; /** FUSE specific file data */ @@ -239,10 +222,7 @@ struct fuse_req { } release; struct fuse_init_in init_in; struct fuse_init_out init_out; - struct { - struct fuse_read_in in; - u64 attr_ver; - } read; + struct fuse_read_in read_in; struct { struct fuse_write_in in; struct fuse_write_out out; @@ -262,12 +242,6 @@ struct fuse_req { /** File used in the request (or NULL) */ struct fuse_file *ff; - /** Inode used in the request or NULL */ - struct inode *inode; - - /** Link on fi->writepages */ - struct list_head writepages_entry; - /** Request completion callback */ void (*end)(struct fuse_conn *, struct fuse_req *); @@ -416,8 +390,8 @@ struct fuse_conn { /** Entry on the fuse_conn_list */ struct list_head entry; - /** Device ID from super block */ - dev_t dev; + /** Unique ID */ + u64 id; /** Dentries in the control filesystem */ struct dentry *ctl_dentry[FUSE_CTL_NUM_DENTRIES]; @@ -464,7 +438,7 @@ extern const struct file_operations fuse_dev_operations; /** * Get a filled in inode */ -struct inode *fuse_iget(struct super_block *sb, u64 nodeid, +struct inode *fuse_iget(struct super_block *sb, unsigned long nodeid, int generation, struct fuse_attr *attr, u64 attr_valid, u64 attr_version); @@ -472,7 +446,7 @@ struct inode *fuse_iget(struct super_block *sb, u64 nodeid, * Send FORGET command */ void fuse_send_forget(struct fuse_conn *fc, struct fuse_req *req, - u64 nodeid, u64 nlookup); + unsigned long nodeid, u64 nlookup); /** * Initialize READ or READDIR request @@ -530,11 +504,6 @@ void fuse_init_symlink(struct inode *inode); void fuse_change_attributes(struct inode *inode, struct fuse_attr *attr, u64 attr_valid, u64 attr_version); -void fuse_change_attributes_common(struct inode *inode, struct fuse_attr *attr, - u64 attr_valid); - -void fuse_truncate(struct address_space *mapping, loff_t offset); - /** * Initialize the client device */ @@ -553,8 +522,6 @@ void fuse_ctl_cleanup(void); */ struct fuse_req *fuse_request_alloc(void); -struct fuse_req *fuse_request_alloc_nofs(void); - /** * Free a request */ @@ -591,8 +558,6 @@ void request_send_noreply(struct fuse_conn *fc, struct fuse_req *req); */ void request_send_background(struct fuse_conn *fc, struct fuse_req *req); -void request_send_background_locked(struct fuse_conn *fc, struct fuse_req *req); - /* Abort all requests */ void fuse_abort_conn(struct fuse_conn *fc); @@ -635,10 +600,3 @@ u64 fuse_lock_owner_id(struct fuse_conn *fc, fl_owner_t id); int fuse_update_attributes(struct inode *inode, struct kstat *stat, struct file *file, bool *refreshed); - -void fuse_flush_writepages(struct inode *inode); - -void fuse_set_nowrite(struct inode *inode); -void fuse_release_nowrite(struct inode *inode); - -u64 fuse_get_attr_version(struct fuse_conn *fc); diff --git a/trunk/fs/fuse/inode.c b/trunk/fs/fuse/inode.c index 79b615873838..4df34da2284a 100644 --- a/trunk/fs/fuse/inode.c +++ b/trunk/fs/fuse/inode.c @@ -59,11 +59,7 @@ static struct inode *fuse_alloc_inode(struct super_block *sb) fi->nodeid = 0; fi->nlookup = 0; fi->attr_version = 0; - fi->writectr = 0; INIT_LIST_HEAD(&fi->write_files); - INIT_LIST_HEAD(&fi->queued_writes); - INIT_LIST_HEAD(&fi->writepages); - init_waitqueue_head(&fi->page_waitq); fi->forget_req = fuse_request_alloc(); if (!fi->forget_req) { kmem_cache_free(fuse_inode_cachep, inode); @@ -77,14 +73,13 @@ static void fuse_destroy_inode(struct inode *inode) { struct fuse_inode *fi = get_fuse_inode(inode); BUG_ON(!list_empty(&fi->write_files)); - BUG_ON(!list_empty(&fi->queued_writes)); if (fi->forget_req) fuse_request_free(fi->forget_req); kmem_cache_free(fuse_inode_cachep, inode); } void fuse_send_forget(struct fuse_conn *fc, struct fuse_req *req, - u64 nodeid, u64 nlookup) + unsigned long nodeid, u64 nlookup) { struct fuse_forget_in *inarg = &req->misc.forget_in; inarg->nlookup = nlookup; @@ -114,7 +109,7 @@ static int fuse_remount_fs(struct super_block *sb, int *flags, char *data) return 0; } -void fuse_truncate(struct address_space *mapping, loff_t offset) +static void fuse_truncate(struct address_space *mapping, loff_t offset) { /* See vmtruncate() */ unmap_mapping_range(mapping, offset + PAGE_SIZE - 1, 0, 1); @@ -122,12 +117,19 @@ void fuse_truncate(struct address_space *mapping, loff_t offset) unmap_mapping_range(mapping, offset + PAGE_SIZE - 1, 0, 1); } -void fuse_change_attributes_common(struct inode *inode, struct fuse_attr *attr, - u64 attr_valid) + +void fuse_change_attributes(struct inode *inode, struct fuse_attr *attr, + u64 attr_valid, u64 attr_version) { struct fuse_conn *fc = get_fuse_conn(inode); struct fuse_inode *fi = get_fuse_inode(inode); + loff_t oldsize; + spin_lock(&fc->lock); + if (attr_version != 0 && fi->attr_version > attr_version) { + spin_unlock(&fc->lock); + return; + } fi->attr_version = ++fc->attr_version; fi->i_time = attr_valid; @@ -157,22 +159,6 @@ void fuse_change_attributes_common(struct inode *inode, struct fuse_attr *attr, fi->orig_i_mode = inode->i_mode; if (!(fc->flags & FUSE_DEFAULT_PERMISSIONS)) inode->i_mode &= ~S_ISVTX; -} - -void fuse_change_attributes(struct inode *inode, struct fuse_attr *attr, - u64 attr_valid, u64 attr_version) -{ - struct fuse_conn *fc = get_fuse_conn(inode); - struct fuse_inode *fi = get_fuse_inode(inode); - loff_t oldsize; - - spin_lock(&fc->lock); - if (attr_version != 0 && fi->attr_version > attr_version) { - spin_unlock(&fc->lock); - return; - } - - fuse_change_attributes_common(inode, attr, attr_valid); oldsize = inode->i_size; i_size_write(inode, attr->size); @@ -207,7 +193,7 @@ static void fuse_init_inode(struct inode *inode, struct fuse_attr *attr) static int fuse_inode_eq(struct inode *inode, void *_nodeidp) { - u64 nodeid = *(u64 *) _nodeidp; + unsigned long nodeid = *(unsigned long *) _nodeidp; if (get_node_id(inode) == nodeid) return 1; else @@ -216,12 +202,12 @@ static int fuse_inode_eq(struct inode *inode, void *_nodeidp) static int fuse_inode_set(struct inode *inode, void *_nodeidp) { - u64 nodeid = *(u64 *) _nodeidp; + unsigned long nodeid = *(unsigned long *) _nodeidp; get_fuse_inode(inode)->nodeid = nodeid; return 0; } -struct inode *fuse_iget(struct super_block *sb, u64 nodeid, +struct inode *fuse_iget(struct super_block *sb, unsigned long nodeid, int generation, struct fuse_attr *attr, u64 attr_valid, u64 attr_version) { @@ -461,7 +447,7 @@ static int fuse_show_options(struct seq_file *m, struct vfsmount *mnt) return 0; } -static struct fuse_conn *new_conn(struct super_block *sb) +static struct fuse_conn *new_conn(void) { struct fuse_conn *fc; int err; @@ -482,41 +468,19 @@ static struct fuse_conn *new_conn(struct super_block *sb) atomic_set(&fc->num_waiting, 0); fc->bdi.ra_pages = (VM_MAX_READAHEAD * 1024) / PAGE_CACHE_SIZE; fc->bdi.unplug_io_fn = default_unplug_io_fn; - /* fuse does it's own writeback accounting */ - fc->bdi.capabilities = BDI_CAP_NO_ACCT_WB; - fc->dev = sb->s_dev; err = bdi_init(&fc->bdi); - if (err) - goto error_kfree; - err = bdi_register_dev(&fc->bdi, fc->dev); - if (err) - goto error_bdi_destroy; - /* - * For a single fuse filesystem use max 1% of dirty + - * writeback threshold. - * - * This gives about 1M of write buffer for memory maps on a - * machine with 1G and 10% dirty_ratio, which should be more - * than enough. - * - * Privileged users can raise it by writing to - * - * /sys/class/bdi//max_ratio - */ - bdi_set_max_ratio(&fc->bdi, 1); + if (err) { + kfree(fc); + fc = NULL; + goto out; + } fc->reqctr = 0; fc->blocked = 1; fc->attr_version = 1; get_random_bytes(&fc->scramble_key, sizeof(fc->scramble_key)); } +out: return fc; - -error_bdi_destroy: - bdi_destroy(&fc->bdi); -error_kfree: - mutex_destroy(&fc->inst_mutex); - kfree(fc); - return NULL; } void fuse_conn_put(struct fuse_conn *fc) @@ -584,7 +548,6 @@ static void process_init_reply(struct fuse_conn *fc, struct fuse_req *req) fc->bdi.ra_pages = min(fc->bdi.ra_pages, ra_pages); fc->minor = arg->minor; fc->max_write = arg->minor < 5 ? 4096 : arg->max_write; - fc->max_write = min_t(unsigned, 4096, fc->max_write); fc->conn_init = 1; } fuse_put_request(fc, req); @@ -615,6 +578,12 @@ static void fuse_send_init(struct fuse_conn *fc, struct fuse_req *req) request_send_background(fc, req); } +static u64 conn_id(void) +{ + static u64 ctr = 1; + return ctr++; +} + static int fuse_fill_super(struct super_block *sb, void *data, int silent) { struct fuse_conn *fc; @@ -652,14 +621,14 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent) if (file->f_op != &fuse_dev_operations) return -EINVAL; - fc = new_conn(sb); + fc = new_conn(); if (!fc) return -ENOMEM; fc->flags = d.flags; fc->user_id = d.user_id; fc->group_id = d.group_id; - fc->max_read = min_t(unsigned, 4096, d.max_read); + fc->max_read = d.max_read; /* Used by get_root_inode() */ sb->s_fs_info = fc; @@ -690,6 +659,7 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent) if (file->private_data) goto err_unlock; + fc->id = conn_id(); err = fuse_ctl_add_conn(fc); if (err) goto err_unlock; diff --git a/trunk/fs/gfs2/locking/dlm/sysfs.c b/trunk/fs/gfs2/locking/dlm/sysfs.c index a4ff271df9ee..8479da47049c 100644 --- a/trunk/fs/gfs2/locking/dlm/sysfs.c +++ b/trunk/fs/gfs2/locking/dlm/sysfs.c @@ -212,7 +212,7 @@ int gdlm_sysfs_init(void) { gdlm_kset = kset_create_and_add("lock_dlm", NULL, kernel_kobj); if (!gdlm_kset) { - printk(KERN_WARNING "%s: can not create kset\n", __func__); + printk(KERN_WARNING "%s: can not create kset\n", __FUNCTION__); return -ENOMEM; } return 0; diff --git a/trunk/fs/gfs2/util.h b/trunk/fs/gfs2/util.h index 7f48576289c9..509c5d60bd80 100644 --- a/trunk/fs/gfs2/util.h +++ b/trunk/fs/gfs2/util.h @@ -41,7 +41,7 @@ int gfs2_assert_withdraw_i(struct gfs2_sbd *sdp, char *assertion, #define gfs2_assert_withdraw(sdp, assertion) \ ((likely(assertion)) ? 0 : gfs2_assert_withdraw_i((sdp), #assertion, \ - __func__, __FILE__, __LINE__)) + __FUNCTION__, __FILE__, __LINE__)) int gfs2_assert_warn_i(struct gfs2_sbd *sdp, char *assertion, @@ -49,28 +49,28 @@ int gfs2_assert_warn_i(struct gfs2_sbd *sdp, char *assertion, #define gfs2_assert_warn(sdp, assertion) \ ((likely(assertion)) ? 0 : gfs2_assert_warn_i((sdp), #assertion, \ - __func__, __FILE__, __LINE__)) + __FUNCTION__, __FILE__, __LINE__)) int gfs2_consist_i(struct gfs2_sbd *sdp, int cluster_wide, const char *function, char *file, unsigned int line); #define gfs2_consist(sdp) \ -gfs2_consist_i((sdp), 0, __func__, __FILE__, __LINE__) +gfs2_consist_i((sdp), 0, __FUNCTION__, __FILE__, __LINE__) int gfs2_consist_inode_i(struct gfs2_inode *ip, int cluster_wide, const char *function, char *file, unsigned int line); #define gfs2_consist_inode(ip) \ -gfs2_consist_inode_i((ip), 0, __func__, __FILE__, __LINE__) +gfs2_consist_inode_i((ip), 0, __FUNCTION__, __FILE__, __LINE__) int gfs2_consist_rgrpd_i(struct gfs2_rgrpd *rgd, int cluster_wide, const char *function, char *file, unsigned int line); #define gfs2_consist_rgrpd(rgd) \ -gfs2_consist_rgrpd_i((rgd), 0, __func__, __FILE__, __LINE__) +gfs2_consist_rgrpd_i((rgd), 0, __FUNCTION__, __FILE__, __LINE__) int gfs2_meta_check_ii(struct gfs2_sbd *sdp, struct buffer_head *bh, @@ -91,7 +91,7 @@ static inline int gfs2_meta_check_i(struct gfs2_sbd *sdp, } #define gfs2_meta_check(sdp, bh) \ -gfs2_meta_check_i((sdp), (bh), __func__, __FILE__, __LINE__) +gfs2_meta_check_i((sdp), (bh), __FUNCTION__, __FILE__, __LINE__) int gfs2_metatype_check_ii(struct gfs2_sbd *sdp, struct buffer_head *bh, @@ -118,7 +118,7 @@ static inline int gfs2_metatype_check_i(struct gfs2_sbd *sdp, } #define gfs2_metatype_check(sdp, bh, type) \ -gfs2_metatype_check_i((sdp), (bh), (type), __func__, __FILE__, __LINE__) +gfs2_metatype_check_i((sdp), (bh), (type), __FUNCTION__, __FILE__, __LINE__) static inline void gfs2_metatype_set(struct buffer_head *bh, u16 type, u16 format) @@ -134,14 +134,14 @@ int gfs2_io_error_i(struct gfs2_sbd *sdp, const char *function, char *file, unsigned int line); #define gfs2_io_error(sdp) \ -gfs2_io_error_i((sdp), __func__, __FILE__, __LINE__); +gfs2_io_error_i((sdp), __FUNCTION__, __FILE__, __LINE__); int gfs2_io_error_bh_i(struct gfs2_sbd *sdp, struct buffer_head *bh, const char *function, char *file, unsigned int line); #define gfs2_io_error_bh(sdp, bh) \ -gfs2_io_error_bh_i((sdp), (bh), __func__, __FILE__, __LINE__); +gfs2_io_error_bh_i((sdp), (bh), __FUNCTION__, __FILE__, __LINE__); extern struct kmem_cache *gfs2_glock_cachep; diff --git a/trunk/fs/hfs/btree.c b/trunk/fs/hfs/btree.c index f6621a785202..24cf6fc43021 100644 --- a/trunk/fs/hfs/btree.c +++ b/trunk/fs/hfs/btree.c @@ -208,9 +208,7 @@ struct hfs_bnode *hfs_bmap_alloc(struct hfs_btree *tree) struct hfs_bnode *node, *next_node; struct page **pagep; u32 nidx, idx; - unsigned off; - u16 off16; - u16 len; + u16 off, len; u8 *data, byte, m; int i; @@ -237,8 +235,7 @@ struct hfs_bnode *hfs_bmap_alloc(struct hfs_btree *tree) node = hfs_bnode_find(tree, nidx); if (IS_ERR(node)) return node; - len = hfs_brec_lenoff(node, 2, &off16); - off = off16; + len = hfs_brec_lenoff(node, 2, &off); off += node->page_offset; pagep = node->page + (off >> PAGE_CACHE_SHIFT); @@ -283,8 +280,7 @@ struct hfs_bnode *hfs_bmap_alloc(struct hfs_btree *tree) return next_node; node = next_node; - len = hfs_brec_lenoff(node, 0, &off16); - off = off16; + len = hfs_brec_lenoff(node, 0, &off); off += node->page_offset; pagep = node->page + (off >> PAGE_CACHE_SHIFT); data = kmap(*pagep); diff --git a/trunk/fs/hfs/mdb.c b/trunk/fs/hfs/mdb.c index 36ca2e1a4fa3..b4651e128d7f 100644 --- a/trunk/fs/hfs/mdb.c +++ b/trunk/fs/hfs/mdb.c @@ -215,7 +215,7 @@ int hfs_mdb_get(struct super_block *sb) attrib &= cpu_to_be16(~HFS_SB_ATTRIB_UNMNT); attrib |= cpu_to_be16(HFS_SB_ATTRIB_INCNSTNT); mdb->drAtrb = attrib; - be32_add_cpu(&mdb->drWrCnt, 1); + mdb->drWrCnt = cpu_to_be32(be32_to_cpu(mdb->drWrCnt) + 1); mdb->drLsMod = hfs_mtime(); mark_buffer_dirty(HFS_SB(sb)->mdb_bh); diff --git a/trunk/fs/hfsplus/btree.c b/trunk/fs/hfsplus/btree.c index e49fcee1e293..bb5433608a42 100644 --- a/trunk/fs/hfsplus/btree.c +++ b/trunk/fs/hfsplus/btree.c @@ -184,9 +184,7 @@ struct hfs_bnode *hfs_bmap_alloc(struct hfs_btree *tree) struct hfs_bnode *node, *next_node; struct page **pagep; u32 nidx, idx; - unsigned off; - u16 off16; - u16 len; + u16 off, len; u8 *data, byte, m; int i; @@ -213,8 +211,7 @@ struct hfs_bnode *hfs_bmap_alloc(struct hfs_btree *tree) node = hfs_bnode_find(tree, nidx); if (IS_ERR(node)) return node; - len = hfs_brec_lenoff(node, 2, &off16); - off = off16; + len = hfs_brec_lenoff(node, 2, &off); off += node->page_offset; pagep = node->page + (off >> PAGE_CACHE_SHIFT); @@ -259,8 +256,7 @@ struct hfs_bnode *hfs_bmap_alloc(struct hfs_btree *tree) return next_node; node = next_node; - len = hfs_brec_lenoff(node, 0, &off16); - off = off16; + len = hfs_brec_lenoff(node, 0, &off); off += node->page_offset; pagep = node->page + (off >> PAGE_CACHE_SHIFT); data = kmap(*pagep); diff --git a/trunk/fs/hfsplus/super.c b/trunk/fs/hfsplus/super.c index ce97a54518d8..946466cd9f25 100644 --- a/trunk/fs/hfsplus/super.c +++ b/trunk/fs/hfsplus/super.c @@ -423,7 +423,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent) */ vhdr->last_mount_vers = cpu_to_be32(HFSP_MOUNT_VERSION); vhdr->modify_date = hfsp_now2mt(); - be32_add_cpu(&vhdr->write_count, 1); + vhdr->write_count = cpu_to_be32(be32_to_cpu(vhdr->write_count) + 1); vhdr->attributes &= cpu_to_be32(~HFSPLUS_VOL_UNMNT); vhdr->attributes |= cpu_to_be32(HFSPLUS_VOL_INCNSTNT); mark_buffer_dirty(HFSPLUS_SB(sb).s_vhbh); diff --git a/trunk/fs/hugetlbfs/inode.c b/trunk/fs/hugetlbfs/inode.c index aeabf80f81a5..9783723e8ffe 100644 --- a/trunk/fs/hugetlbfs/inode.c +++ b/trunk/fs/hugetlbfs/inode.c @@ -45,7 +45,7 @@ static const struct inode_operations hugetlbfs_inode_operations; static struct backing_dev_info hugetlbfs_backing_dev_info = { .ra_pages = 0, /* No readahead */ - .capabilities = BDI_CAP_NO_ACCT_AND_WRITEBACK, + .capabilities = BDI_CAP_NO_ACCT_DIRTY | BDI_CAP_NO_WRITEBACK, }; int sysctl_hugetlb_shm_group; diff --git a/trunk/fs/isofs/dir.c b/trunk/fs/isofs/dir.c index 2f0dc5a14633..1ba407c64df1 100644 --- a/trunk/fs/isofs/dir.c +++ b/trunk/fs/isofs/dir.c @@ -145,14 +145,6 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp, } de = tmpde; } - /* Basic sanity check, whether name doesn't exceed dir entry */ - if (de_len < de->name_len[0] + - sizeof(struct iso_directory_record)) { - printk(KERN_NOTICE "iso9660: Corrupted directory entry" - " in block %lu of inode %lu\n", block, - inode->i_ino); - return -EIO; - } if (first_de) { isofs_normalize_block_and_offset(de, diff --git a/trunk/fs/isofs/namei.c b/trunk/fs/isofs/namei.c index 8299889a835e..344b247bc29a 100644 --- a/trunk/fs/isofs/namei.c +++ b/trunk/fs/isofs/namei.c @@ -111,13 +111,6 @@ isofs_find_entry(struct inode *dir, struct dentry *dentry, dlen = de->name_len[0]; dpnt = de->name; - /* Basic sanity check, whether name doesn't exceed dir entry */ - if (de_len < dlen + sizeof(struct iso_directory_record)) { - printk(KERN_NOTICE "iso9660: Corrupted directory entry" - " in block %lu of inode %lu\n", block, - dir->i_ino); - return 0; - } if (sbi->s_rock && ((i = get_rock_ridge_filename(de, tmpname, dir)))) { diff --git a/trunk/fs/jffs2/debug.h b/trunk/fs/jffs2/debug.h index a113ecc3bafe..9645275023e6 100644 --- a/trunk/fs/jffs2/debug.h +++ b/trunk/fs/jffs2/debug.h @@ -82,28 +82,28 @@ do { \ printk(JFFS2_ERR_MSG_PREFIX \ " (%d) %s: " fmt, task_pid_nr(current), \ - __func__ , ##__VA_ARGS__); \ + __FUNCTION__ , ##__VA_ARGS__); \ } while(0) #define JFFS2_WARNING(fmt, ...) \ do { \ printk(JFFS2_WARN_MSG_PREFIX \ " (%d) %s: " fmt, task_pid_nr(current), \ - __func__ , ##__VA_ARGS__); \ + __FUNCTION__ , ##__VA_ARGS__); \ } while(0) #define JFFS2_NOTICE(fmt, ...) \ do { \ printk(JFFS2_NOTICE_MSG_PREFIX \ " (%d) %s: " fmt, task_pid_nr(current), \ - __func__ , ##__VA_ARGS__); \ + __FUNCTION__ , ##__VA_ARGS__); \ } while(0) #define JFFS2_DEBUG(fmt, ...) \ do { \ printk(JFFS2_DBG_MSG_PREFIX \ " (%d) %s: " fmt, task_pid_nr(current), \ - __func__ , ##__VA_ARGS__); \ + __FUNCTION__ , ##__VA_ARGS__); \ } while(0) /* diff --git a/trunk/fs/jffs2/xattr.c b/trunk/fs/jffs2/xattr.c index 574cb7532d6c..e48665984cb3 100644 --- a/trunk/fs/jffs2/xattr.c +++ b/trunk/fs/jffs2/xattr.c @@ -82,7 +82,7 @@ static int is_xattr_datum_unchecked(struct jffs2_sb_info *c, struct jffs2_xattr_ static void unload_xattr_datum(struct jffs2_sb_info *c, struct jffs2_xattr_datum *xd) { /* must be called under down_write(xattr_sem) */ - D1(dbg_xattr("%s: xid=%u, version=%u\n", __func__, xd->xid, xd->version)); + D1(dbg_xattr("%s: xid=%u, version=%u\n", __FUNCTION__, xd->xid, xd->version)); if (xd->xname) { c->xdatum_mem_usage -= (xd->name_len + 1 + xd->value_len); kfree(xd->xname); @@ -1252,7 +1252,7 @@ int jffs2_garbage_collect_xattr_ref(struct jffs2_sb_info *c, struct jffs2_xattr_ rc = jffs2_reserve_space_gc(c, totlen, &length, JFFS2_SUMMARY_XREF_SIZE); if (rc) { JFFS2_WARNING("%s: jffs2_reserve_space_gc() = %d, request = %u\n", - __func__, rc, totlen); + __FUNCTION__, rc, totlen); rc = rc ? rc : -EBADFD; goto out; } diff --git a/trunk/fs/lockd/clntproc.c b/trunk/fs/lockd/clntproc.c index 5df517b81f3f..40b16f23e49a 100644 --- a/trunk/fs/lockd/clntproc.c +++ b/trunk/fs/lockd/clntproc.c @@ -573,7 +573,7 @@ nlmclnt_lock(struct nlm_rqst *req, struct file_lock *fl) /* Ensure the resulting lock will get added to granted list */ fl->fl_flags |= FL_SLEEP; if (do_vfs_lock(fl) < 0) - printk(KERN_WARNING "%s: VFS is out of sync with lock manager!\n", __func__); + printk(KERN_WARNING "%s: VFS is out of sync with lock manager!\n", __FUNCTION__); up_read(&host->h_rwsem); fl->fl_flags = fl_flags; status = 0; diff --git a/trunk/fs/lockd/svclock.c b/trunk/fs/lockd/svclock.c index 81aca859bfde..4d81553d2948 100644 --- a/trunk/fs/lockd/svclock.c +++ b/trunk/fs/lockd/svclock.c @@ -752,7 +752,7 @@ nlmsvc_grant_blocked(struct nlm_block *block) return; default: printk(KERN_WARNING "lockd: unexpected error %d in %s!\n", - -error, __func__); + -error, __FUNCTION__); nlmsvc_insert_block(block, 10 * HZ); nlmsvc_release_block(block); return; diff --git a/trunk/fs/msdos/namei.c b/trunk/fs/msdos/namei.c index 05ff4f1d7026..2d4358c59f68 100644 --- a/trunk/fs/msdos/namei.c +++ b/trunk/fs/msdos/namei.c @@ -609,7 +609,7 @@ static int do_msdos_rename(struct inode *old_dir, unsigned char *old_name, if (corrupt < 0) { fat_fs_panic(new_dir->i_sb, "%s: Filesystem corrupted (i_pos %lld)", - __func__, sinfo.i_pos); + __FUNCTION__, sinfo.i_pos); } goto out; } diff --git a/trunk/fs/namespace.c b/trunk/fs/namespace.c index 4fc302c2a0e0..061e5edb4d27 100644 --- a/trunk/fs/namespace.c +++ b/trunk/fs/namespace.c @@ -2329,10 +2329,10 @@ void __init mnt_init(void) err = sysfs_init(); if (err) printk(KERN_WARNING "%s: sysfs_init error: %d\n", - __func__, err); + __FUNCTION__, err); fs_kobj = kobject_create_and_add("fs", NULL); if (!fs_kobj) - printk(KERN_WARNING "%s: kobj create error\n", __func__); + printk(KERN_WARNING "%s: kobj create error\n", __FUNCTION__); init_rootfs(); init_mount_tree(); } diff --git a/trunk/fs/nfs/super.c b/trunk/fs/nfs/super.c index 7226a506f3ca..fa220dc74609 100644 --- a/trunk/fs/nfs/super.c +++ b/trunk/fs/nfs/super.c @@ -1575,11 +1575,6 @@ static int nfs_compare_super(struct super_block *sb, void *data) return nfs_compare_mount_options(sb, server, mntflags); } -static int nfs_bdi_register(struct nfs_server *server) -{ - return bdi_register_dev(&server->backing_dev_info, server->s_dev); -} - static int nfs_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name, void *raw_data, struct vfsmount *mnt) { @@ -1622,10 +1617,6 @@ static int nfs_get_sb(struct file_system_type *fs_type, if (s->s_fs_info != server) { nfs_free_server(server); server = NULL; - } else { - error = nfs_bdi_register(server); - if (error) - goto error_splat_super; } if (!s->s_root) { @@ -1673,7 +1664,6 @@ static void nfs_kill_super(struct super_block *s) { struct nfs_server *server = NFS_SB(s); - bdi_unregister(&server->backing_dev_info); kill_anon_super(s); nfs_free_server(server); } @@ -1718,10 +1708,6 @@ static int nfs_xdev_get_sb(struct file_system_type *fs_type, int flags, if (s->s_fs_info != server) { nfs_free_server(server); server = NULL; - } else { - error = nfs_bdi_register(server); - if (error) - goto error_splat_super; } if (!s->s_root) { @@ -1998,10 +1984,6 @@ static int nfs4_get_sb(struct file_system_type *fs_type, if (s->s_fs_info != server) { nfs_free_server(server); server = NULL; - } else { - error = nfs_bdi_register(server); - if (error) - goto error_splat_super; } if (!s->s_root) { @@ -2088,10 +2070,6 @@ static int nfs4_xdev_get_sb(struct file_system_type *fs_type, int flags, if (s->s_fs_info != server) { nfs_free_server(server); server = NULL; - } else { - error = nfs_bdi_register(server); - if (error) - goto error_splat_super; } if (!s->s_root) { @@ -2171,10 +2149,6 @@ static int nfs4_referral_get_sb(struct file_system_type *fs_type, int flags, if (s->s_fs_info != server) { nfs_free_server(server); server = NULL; - } else { - error = nfs_bdi_register(server); - if (error) - goto error_splat_super; } if (!s->s_root) { diff --git a/trunk/fs/nfsd/nfs4callback.c b/trunk/fs/nfsd/nfs4callback.c index 0b3ffa9840c2..562abf3380d0 100644 --- a/trunk/fs/nfsd/nfs4callback.c +++ b/trunk/fs/nfsd/nfs4callback.c @@ -104,7 +104,7 @@ xdr_writemem(__be32 *p, const void *ptr, int nbytes) } while (0) #define RESERVE_SPACE(nbytes) do { \ p = xdr_reserve_space(xdr, nbytes); \ - if (!p) dprintk("NFSD: RESERVE_SPACE(%d) failed in function %s\n", (int) (nbytes), __func__); \ + if (!p) dprintk("NFSD: RESERVE_SPACE(%d) failed in function %s\n", (int) (nbytes), __FUNCTION__); \ BUG_ON(!p); \ } while (0) @@ -134,7 +134,7 @@ xdr_error: \ p = xdr_inline_decode(xdr, nbytes); \ if (!p) { \ dprintk("NFSD: %s: reply buffer overflowed in line %d.\n", \ - __func__, __LINE__); \ + __FUNCTION__, __LINE__); \ return -EIO; \ } \ } while (0) diff --git a/trunk/fs/ntfs/debug.h b/trunk/fs/ntfs/debug.h index 5e6724c1afd1..8ac37c33d127 100644 --- a/trunk/fs/ntfs/debug.h +++ b/trunk/fs/ntfs/debug.h @@ -45,7 +45,7 @@ static void ntfs_debug(const char *f, ...); extern void __ntfs_debug (const char *file, int line, const char *function, const char *format, ...) __attribute__ ((format (printf, 4, 5))); #define ntfs_debug(f, a...) \ - __ntfs_debug(__FILE__, __LINE__, __func__, f, ##a) + __ntfs_debug(__FILE__, __LINE__, __FUNCTION__, f, ##a) extern void ntfs_debug_dump_runlist(const runlist_element *rl); @@ -58,10 +58,10 @@ extern void ntfs_debug_dump_runlist(const runlist_element *rl); extern void __ntfs_warning(const char *function, const struct super_block *sb, const char *fmt, ...) __attribute__ ((format (printf, 3, 4))); -#define ntfs_warning(sb, f, a...) __ntfs_warning(__func__, sb, f, ##a) +#define ntfs_warning(sb, f, a...) __ntfs_warning(__FUNCTION__, sb, f, ##a) extern void __ntfs_error(const char *function, const struct super_block *sb, const char *fmt, ...) __attribute__ ((format (printf, 3, 4))); -#define ntfs_error(sb, f, a...) __ntfs_error(__func__, sb, f, ##a) +#define ntfs_error(sb, f, a...) __ntfs_error(__FUNCTION__, sb, f, ##a) #endif /* _LINUX_NTFS_DEBUG_H */ diff --git a/trunk/fs/ocfs2/dlm/dlmfs.c b/trunk/fs/ocfs2/dlm/dlmfs.c index e48aba698b77..61a000f8524c 100644 --- a/trunk/fs/ocfs2/dlm/dlmfs.c +++ b/trunk/fs/ocfs2/dlm/dlmfs.c @@ -327,7 +327,7 @@ static void dlmfs_clear_inode(struct inode *inode) static struct backing_dev_info dlmfs_backing_dev_info = { .ra_pages = 0, /* No readahead */ - .capabilities = BDI_CAP_NO_ACCT_AND_WRITEBACK, + .capabilities = BDI_CAP_NO_ACCT_DIRTY | BDI_CAP_NO_WRITEBACK, }; static struct inode *dlmfs_get_root_inode(struct super_block *sb) diff --git a/trunk/fs/partitions/ldm.c b/trunk/fs/partitions/ldm.c index 0fdda2e8a4cc..e7dd1d4e3473 100644 --- a/trunk/fs/partitions/ldm.c +++ b/trunk/fs/partitions/ldm.c @@ -41,12 +41,12 @@ #ifndef CONFIG_LDM_DEBUG #define ldm_debug(...) do {} while (0) #else -#define ldm_debug(f, a...) _ldm_printk (KERN_DEBUG, __func__, f, ##a) +#define ldm_debug(f, a...) _ldm_printk (KERN_DEBUG, __FUNCTION__, f, ##a) #endif -#define ldm_crit(f, a...) _ldm_printk (KERN_CRIT, __func__, f, ##a) -#define ldm_error(f, a...) _ldm_printk (KERN_ERR, __func__, f, ##a) -#define ldm_info(f, a...) _ldm_printk (KERN_INFO, __func__, f, ##a) +#define ldm_crit(f, a...) _ldm_printk (KERN_CRIT, __FUNCTION__, f, ##a) +#define ldm_error(f, a...) _ldm_printk (KERN_ERR, __FUNCTION__, f, ##a) +#define ldm_info(f, a...) _ldm_printk (KERN_INFO, __FUNCTION__, f, ##a) __attribute__ ((format (printf, 3, 4))) static void _ldm_printk (const char *level, const char *function, diff --git a/trunk/fs/proc/array.c b/trunk/fs/proc/array.c index c135cbdd9127..07d6c4853fe8 100644 --- a/trunk/fs/proc/array.c +++ b/trunk/fs/proc/array.c @@ -425,13 +425,12 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns, cutime = cstime = utime = stime = cputime_zero; cgtime = gtime = cputime_zero; + rcu_read_lock(); if (lock_task_sighand(task, &flags)) { struct signal_struct *sig = task->signal; if (sig->tty) { - struct pid *pgrp = tty_get_pgrp(sig->tty); - tty_pgrp = pid_nr_ns(pgrp, ns); - put_pid(pgrp); + tty_pgrp = pid_nr_ns(sig->tty->pgrp, ns); tty_nr = new_encode_dev(tty_devnum(sig->tty)); } @@ -470,6 +469,7 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns, unlock_task_sighand(task, &flags); } + rcu_read_unlock(); if (!whole || num_threads < 2) wchan = get_wchan(task); diff --git a/trunk/fs/proc/proc_misc.c b/trunk/fs/proc/proc_misc.c index 74a323d2b850..48bcf20cec2f 100644 --- a/trunk/fs/proc/proc_misc.c +++ b/trunk/fs/proc/proc_misc.c @@ -179,7 +179,6 @@ static int meminfo_read_proc(char *page, char **start, off_t off, "PageTables: %8lu kB\n" "NFS_Unstable: %8lu kB\n" "Bounce: %8lu kB\n" - "WritebackTmp: %8lu kB\n" "CommitLimit: %8lu kB\n" "Committed_AS: %8lu kB\n" "VmallocTotal: %8lu kB\n" @@ -211,7 +210,6 @@ static int meminfo_read_proc(char *page, char **start, off_t off, K(global_page_state(NR_PAGETABLE)), K(global_page_state(NR_UNSTABLE_NFS)), K(global_page_state(NR_BOUNCE)), - K(global_page_state(NR_WRITEBACK_TEMP)), K(allowed), K(committed), (unsigned long)VMALLOC_TOTAL >> 10, diff --git a/trunk/fs/proc/proc_tty.c b/trunk/fs/proc/proc_tty.c index 21f490f5d65c..ac26ccc25f42 100644 --- a/trunk/fs/proc/proc_tty.c +++ b/trunk/fs/proc/proc_tty.c @@ -192,14 +192,16 @@ void proc_tty_register_driver(struct tty_driver *driver) { struct proc_dir_entry *ent; - if (!driver->ops->read_proc || !driver->driver_name || + if ((!driver->read_proc && !driver->write_proc) || + !driver->driver_name || driver->proc_entry) return; ent = create_proc_entry(driver->driver_name, 0, proc_tty_driver); if (!ent) return; - ent->read_proc = driver->ops->read_proc; + ent->read_proc = driver->read_proc; + ent->write_proc = driver->write_proc; ent->owner = driver->owner; ent->data = driver; diff --git a/trunk/fs/quota_v2.c b/trunk/fs/quota_v2.c index 234ada903633..23b647f25d08 100644 --- a/trunk/fs/quota_v2.c +++ b/trunk/fs/quota_v2.c @@ -306,7 +306,7 @@ static uint find_free_dqentry(struct dquot *dquot, int *err) printk(KERN_ERR "VFS: find_free_dqentry(): Can't remove block (%u) from entry free list.\n", blk); goto out_buf; } - le16_add_cpu(&dh->dqdh_entries, 1); + dh->dqdh_entries = cpu_to_le16(le16_to_cpu(dh->dqdh_entries)+1); memset(&fakedquot, 0, sizeof(struct v2_disk_dqblk)); /* Find free structure in block */ for (i = 0; i < V2_DQSTRINBLK && memcmp(&fakedquot, ddquot+i, sizeof(struct v2_disk_dqblk)); i++); @@ -448,7 +448,7 @@ static int free_dqentry(struct dquot *dquot, uint blk) goto out_buf; } dh = (struct v2_disk_dqdbheader *)buf; - le16_add_cpu(&dh->dqdh_entries, -1); + dh->dqdh_entries = cpu_to_le16(le16_to_cpu(dh->dqdh_entries)-1); if (!le16_to_cpu(dh->dqdh_entries)) { /* Block got free? */ if ((ret = remove_free_dqentry(sb, type, buf, blk)) < 0 || (ret = put_free_dqblk(sb, type, buf, blk)) < 0) { diff --git a/trunk/fs/ramfs/inode.c b/trunk/fs/ramfs/inode.c index b13123424e49..8428d5b2711d 100644 --- a/trunk/fs/ramfs/inode.c +++ b/trunk/fs/ramfs/inode.c @@ -44,7 +44,7 @@ static const struct inode_operations ramfs_dir_inode_operations; static struct backing_dev_info ramfs_backing_dev_info = { .ra_pages = 0, /* No readahead */ - .capabilities = BDI_CAP_NO_ACCT_AND_WRITEBACK | + .capabilities = BDI_CAP_NO_ACCT_DIRTY | BDI_CAP_NO_WRITEBACK | BDI_CAP_MAP_DIRECT | BDI_CAP_MAP_COPY | BDI_CAP_READ_MAP | BDI_CAP_WRITE_MAP | BDI_CAP_EXEC_MAP, }; diff --git a/trunk/fs/reiserfs/journal.c b/trunk/fs/reiserfs/journal.c index e396b2fa4743..da86042b3e03 100644 --- a/trunk/fs/reiserfs/journal.c +++ b/trunk/fs/reiserfs/journal.c @@ -2574,9 +2574,11 @@ static int release_journal_dev(struct super_block *super, result = 0; - if (journal->j_dev_bd != NULL) { - if (journal->j_dev_bd->bd_dev != super->s_dev) - bd_release(journal->j_dev_bd); + if (journal->j_dev_file != NULL) { + result = filp_close(journal->j_dev_file, NULL); + journal->j_dev_file = NULL; + journal->j_dev_bd = NULL; + } else if (journal->j_dev_bd != NULL) { result = blkdev_put(journal->j_dev_bd); journal->j_dev_bd = NULL; } @@ -2601,6 +2603,7 @@ static int journal_init_dev(struct super_block *super, result = 0; journal->j_dev_bd = NULL; + journal->j_dev_file = NULL; jdev = SB_ONDISK_JOURNAL_DEVICE(super) ? new_decode_dev(SB_ONDISK_JOURNAL_DEVICE(super)) : super->s_dev; @@ -2617,34 +2620,35 @@ static int journal_init_dev(struct super_block *super, "cannot init journal device '%s': %i", __bdevname(jdev, b), result); return result; - } else if (jdev != super->s_dev) { - result = bd_claim(journal->j_dev_bd, journal); - if (result) { - blkdev_put(journal->j_dev_bd); - return result; - } - + } else if (jdev != super->s_dev) set_blocksize(journal->j_dev_bd, super->s_blocksize); - } - return 0; } - journal->j_dev_bd = open_bdev_excl(jdev_name, 0, journal); - if (IS_ERR(journal->j_dev_bd)) { - result = PTR_ERR(journal->j_dev_bd); - journal->j_dev_bd = NULL; + journal->j_dev_file = filp_open(jdev_name, 0, 0); + if (!IS_ERR(journal->j_dev_file)) { + struct inode *jdev_inode = journal->j_dev_file->f_mapping->host; + if (!S_ISBLK(jdev_inode->i_mode)) { + reiserfs_warning(super, "journal_init_dev: '%s' is " + "not a block device", jdev_name); + result = -ENOTBLK; + release_journal_dev(super, journal); + } else { + /* ok */ + journal->j_dev_bd = I_BDEV(jdev_inode); + set_blocksize(journal->j_dev_bd, super->s_blocksize); + reiserfs_info(super, + "journal_init_dev: journal device: %s\n", + bdevname(journal->j_dev_bd, b)); + } + } else { + result = PTR_ERR(journal->j_dev_file); + journal->j_dev_file = NULL; reiserfs_warning(super, "journal_init_dev: Cannot open '%s': %i", jdev_name, result); - return result; } - - set_blocksize(journal->j_dev_bd, super->s_blocksize); - reiserfs_info(super, - "journal_init_dev: journal device: %s\n", - bdevname(journal->j_dev_bd, b)); - return 0; + return result; } /** diff --git a/trunk/fs/select.c b/trunk/fs/select.c index 2c292146e246..00f58c5c7e05 100644 --- a/trunk/fs/select.c +++ b/trunk/fs/select.c @@ -425,7 +425,7 @@ asmlinkage long sys_select(int n, fd_set __user *inp, fd_set __user *outp, return ret; } -#ifdef HAVE_SET_RESTORE_SIGMASK +#ifdef TIF_RESTORE_SIGMASK asmlinkage long sys_pselect7(int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp, struct timespec __user *tsp, const sigset_t __user *sigmask, size_t sigsetsize) @@ -498,7 +498,7 @@ asmlinkage long sys_pselect7(int n, fd_set __user *inp, fd_set __user *outp, if (sigmask) { memcpy(¤t->saved_sigmask, &sigsaved, sizeof(sigsaved)); - set_restore_sigmask(); + set_thread_flag(TIF_RESTORE_SIGMASK); } } else if (sigmask) sigprocmask(SIG_SETMASK, &sigsaved, NULL); @@ -528,7 +528,7 @@ asmlinkage long sys_pselect6(int n, fd_set __user *inp, fd_set __user *outp, return sys_pselect7(n, inp, outp, exp, tsp, up, sigsetsize); } -#endif /* HAVE_SET_RESTORE_SIGMASK */ +#endif /* TIF_RESTORE_SIGMASK */ struct poll_list { struct poll_list *next; @@ -759,7 +759,7 @@ asmlinkage long sys_poll(struct pollfd __user *ufds, unsigned int nfds, return ret; } -#ifdef HAVE_SET_RESTORE_SIGMASK +#ifdef TIF_RESTORE_SIGMASK asmlinkage long sys_ppoll(struct pollfd __user *ufds, unsigned int nfds, struct timespec __user *tsp, const sigset_t __user *sigmask, size_t sigsetsize) @@ -805,7 +805,7 @@ asmlinkage long sys_ppoll(struct pollfd __user *ufds, unsigned int nfds, if (sigmask) { memcpy(¤t->saved_sigmask, &sigsaved, sizeof(sigsaved)); - set_restore_sigmask(); + set_thread_flag(TIF_RESTORE_SIGMASK); } ret = -ERESTARTNOHAND; } else if (sigmask) @@ -839,4 +839,4 @@ asmlinkage long sys_ppoll(struct pollfd __user *ufds, unsigned int nfds, return ret; } -#endif /* HAVE_SET_RESTORE_SIGMASK */ +#endif /* TIF_RESTORE_SIGMASK */ diff --git a/trunk/fs/smbfs/smb_debug.h b/trunk/fs/smbfs/smb_debug.h index fc4b1a5dd755..734972b92694 100644 --- a/trunk/fs/smbfs/smb_debug.h +++ b/trunk/fs/smbfs/smb_debug.h @@ -11,14 +11,14 @@ * these are normally enabled. */ #ifdef SMBFS_PARANOIA -# define PARANOIA(f, a...) printk(KERN_NOTICE "%s: " f, __func__ , ## a) +# define PARANOIA(f, a...) printk(KERN_NOTICE "%s: " f, __FUNCTION__ , ## a) #else # define PARANOIA(f, a...) do { ; } while(0) #endif /* lots of debug messages */ #ifdef SMBFS_DEBUG_VERBOSE -# define VERBOSE(f, a...) printk(KERN_DEBUG "%s: " f, __func__ , ## a) +# define VERBOSE(f, a...) printk(KERN_DEBUG "%s: " f, __FUNCTION__ , ## a) #else # define VERBOSE(f, a...) do { ; } while(0) #endif @@ -28,7 +28,7 @@ * too common name. */ #ifdef SMBFS_DEBUG -#define DEBUG1(f, a...) printk(KERN_DEBUG "%s: " f, __func__ , ## a) +#define DEBUG1(f, a...) printk(KERN_DEBUG "%s: " f, __FUNCTION__ , ## a) #else #define DEBUG1(f, a...) do { ; } while(0) #endif diff --git a/trunk/fs/sysfs/file.c b/trunk/fs/sysfs/file.c index e7735f643cd1..dbdfabbfd609 100644 --- a/trunk/fs/sysfs/file.c +++ b/trunk/fs/sysfs/file.c @@ -135,7 +135,7 @@ sysfs_read_file(struct file *file, char __user *buf, size_t count, loff_t *ppos) goto out; } pr_debug("%s: count = %zd, ppos = %lld, buf = %s\n", - __func__, count, *ppos, buffer->page); + __FUNCTION__, count, *ppos, buffer->page); retval = simple_read_from_buffer(buf, count, ppos, buffer->page, buffer->count); out: diff --git a/trunk/fs/sysfs/inode.c b/trunk/fs/sysfs/inode.c index f8b82e73b3bf..d9262f74f94e 100644 --- a/trunk/fs/sysfs/inode.c +++ b/trunk/fs/sysfs/inode.c @@ -30,7 +30,7 @@ static const struct address_space_operations sysfs_aops = { static struct backing_dev_info sysfs_backing_dev_info = { .ra_pages = 0, /* No readahead */ - .capabilities = BDI_CAP_NO_ACCT_AND_WRITEBACK, + .capabilities = BDI_CAP_NO_ACCT_DIRTY | BDI_CAP_NO_WRITEBACK, }; static const struct inode_operations sysfs_inode_operations ={ diff --git a/trunk/fs/sysfs/mount.c b/trunk/fs/sysfs/mount.c index 14f0023984d7..74168266cd59 100644 --- a/trunk/fs/sysfs/mount.c +++ b/trunk/fs/sysfs/mount.c @@ -61,7 +61,7 @@ static int sysfs_fill_super(struct super_block *sb, void *data, int silent) /* instantiate and link root dentry */ root = d_alloc_root(inode); if (!root) { - pr_debug("%s: could not get root dentry!\n",__func__); + pr_debug("%s: could not get root dentry!\n",__FUNCTION__); iput(inode); return -ENOMEM; } diff --git a/trunk/fs/sysv/sysv.h b/trunk/fs/sysv/sysv.h index 38ebe3f85b3d..42d51d1c05cd 100644 --- a/trunk/fs/sysv/sysv.h +++ b/trunk/fs/sysv/sysv.h @@ -217,9 +217,9 @@ static inline __fs32 fs32_add(struct sysv_sb_info *sbi, __fs32 *n, int d) if (sbi->s_bytesex == BYTESEX_PDP) *(__u32*)n = PDP_swab(PDP_swab(*(__u32*)n)+d); else if (sbi->s_bytesex == BYTESEX_LE) - le32_add_cpu((__le32 *)n, d); + *(__le32*)n = cpu_to_le32(le32_to_cpu(*(__le32*)n)+d); else - be32_add_cpu((__be32 *)n, d); + *(__be32*)n = cpu_to_be32(be32_to_cpu(*(__be32*)n)+d); return *n; } @@ -242,9 +242,9 @@ static inline __fs16 cpu_to_fs16(struct sysv_sb_info *sbi, __u16 n) static inline __fs16 fs16_add(struct sysv_sb_info *sbi, __fs16 *n, int d) { if (sbi->s_bytesex != BYTESEX_BE) - le16_add_cpu((__le16 *)n, d); + *(__le16*)n = cpu_to_le16(le16_to_cpu(*(__le16 *)n)+d); else - be16_add_cpu((__be16 *)n, d); + *(__be16*)n = cpu_to_be16(be16_to_cpu(*(__be16 *)n)+d); return *n; } diff --git a/trunk/fs/udf/super.c b/trunk/fs/udf/super.c index 9fb18a340fc1..b564fc140fe4 100644 --- a/trunk/fs/udf/super.c +++ b/trunk/fs/udf/super.c @@ -240,7 +240,7 @@ static int udf_sb_alloc_partition_maps(struct super_block *sb, u32 count) sbi->s_partmaps = kcalloc(count, sizeof(struct udf_part_map), GFP_KERNEL); if (!sbi->s_partmaps) { - udf_error(sb, __func__, + udf_error(sb, __FUNCTION__, "Unable to allocate space for %d partition maps", count); sbi->s_partitions = 0; @@ -1086,7 +1086,7 @@ static struct udf_bitmap *udf_sb_alloc_bitmap(struct super_block *sb, u32 index) bitmap = vmalloc(size); /* TODO: get rid of vmalloc */ if (bitmap == NULL) { - udf_error(sb, __func__, + udf_error(sb, __FUNCTION__, "Unable to allocate space for bitmap " "and %d buffer_head pointers", nr_groups); return NULL; diff --git a/trunk/fs/vfat/namei.c b/trunk/fs/vfat/namei.c index a3522727ea5b..5b66162d0747 100644 --- a/trunk/fs/vfat/namei.c +++ b/trunk/fs/vfat/namei.c @@ -986,7 +986,7 @@ static int vfat_rename(struct inode *old_dir, struct dentry *old_dentry, if (corrupt < 0) { fat_fs_panic(new_dir->i_sb, "%s: Filesystem corrupted (i_pos %lld)", - __func__, sinfo.i_pos); + __FUNCTION__, sinfo.i_pos); } goto out; } diff --git a/trunk/fs/xfs/linux-2.6/xfs_linux.h b/trunk/fs/xfs/linux-2.6/xfs_linux.h index 4edc46915b57..1bc9f600365f 100644 --- a/trunk/fs/xfs/linux-2.6/xfs_linux.h +++ b/trunk/fs/xfs/linux-2.6/xfs_linux.h @@ -75,7 +75,6 @@ #include #include #include -#include #include #include diff --git a/trunk/fs/xfs/support/debug.h b/trunk/fs/xfs/support/debug.h index 75845f950814..855da0408647 100644 --- a/trunk/fs/xfs/support/debug.h +++ b/trunk/fs/xfs/support/debug.h @@ -49,6 +49,8 @@ extern void assfail(char *expr, char *f, int l); #else /* DEBUG */ +#include + #define ASSERT(expr) \ (unlikely(expr) ? (void)0 : assfail(#expr, __FILE__, __LINE__)) diff --git a/trunk/include/asm-arm/arch-pxa/pxa-regs.h b/trunk/include/asm-arm/arch-pxa/pxa-regs.h index 4b2ea1e95c57..a322012f16ac 100644 --- a/trunk/include/asm-arm/arch-pxa/pxa-regs.h +++ b/trunk/include/asm-arm/arch-pxa/pxa-regs.h @@ -1406,6 +1406,202 @@ #define OSCC_OON (1 << 1) /* 32.768kHz OON (write-once only bit) */ #define OSCC_OOK (1 << 0) /* 32.768kHz OOK (read-only bit) */ + +/* + * LCD + */ + +#define LCCR0 __REG(0x44000000) /* LCD Controller Control Register 0 */ +#define LCCR1 __REG(0x44000004) /* LCD Controller Control Register 1 */ +#define LCCR2 __REG(0x44000008) /* LCD Controller Control Register 2 */ +#define LCCR3 __REG(0x4400000C) /* LCD Controller Control Register 3 */ +#define LCCR4 __REG(0x44000010) /* LCD Controller Control Register 3 */ +#define DFBR0 __REG(0x44000020) /* DMA Channel 0 Frame Branch Register */ +#define DFBR1 __REG(0x44000024) /* DMA Channel 1 Frame Branch Register */ +#define LCSR __REG(0x44000038) /* LCD Controller Status Register */ +#define LIIDR __REG(0x4400003C) /* LCD Controller Interrupt ID Register */ +#define TMEDRGBR __REG(0x44000040) /* TMED RGB Seed Register */ +#define TMEDCR __REG(0x44000044) /* TMED Control Register */ + +#define LCCR3_1BPP (0 << 24) +#define LCCR3_2BPP (1 << 24) +#define LCCR3_4BPP (2 << 24) +#define LCCR3_8BPP (3 << 24) +#define LCCR3_16BPP (4 << 24) + +#define LCCR3_PDFOR_0 (0 << 30) +#define LCCR3_PDFOR_1 (1 << 30) +#define LCCR3_PDFOR_2 (2 << 30) +#define LCCR3_PDFOR_3 (3 << 30) + +#define LCCR4_PAL_FOR_0 (0 << 15) +#define LCCR4_PAL_FOR_1 (1 << 15) +#define LCCR4_PAL_FOR_2 (2 << 15) +#define LCCR4_PAL_FOR_MASK (3 << 15) + +#define FDADR0 __REG(0x44000200) /* DMA Channel 0 Frame Descriptor Address Register */ +#define FSADR0 __REG(0x44000204) /* DMA Channel 0 Frame Source Address Register */ +#define FIDR0 __REG(0x44000208) /* DMA Channel 0 Frame ID Register */ +#define LDCMD0 __REG(0x4400020C) /* DMA Channel 0 Command Register */ +#define FDADR1 __REG(0x44000210) /* DMA Channel 1 Frame Descriptor Address Register */ +#define FSADR1 __REG(0x44000214) /* DMA Channel 1 Frame Source Address Register */ +#define FIDR1 __REG(0x44000218) /* DMA Channel 1 Frame ID Register */ +#define LDCMD1 __REG(0x4400021C) /* DMA Channel 1 Command Register */ + +#define LCCR0_ENB (1 << 0) /* LCD Controller enable */ +#define LCCR0_CMS (1 << 1) /* Color/Monochrome Display Select */ +#define LCCR0_Color (LCCR0_CMS*0) /* Color display */ +#define LCCR0_Mono (LCCR0_CMS*1) /* Monochrome display */ +#define LCCR0_SDS (1 << 2) /* Single/Dual Panel Display */ + /* Select */ +#define LCCR0_Sngl (LCCR0_SDS*0) /* Single panel display */ +#define LCCR0_Dual (LCCR0_SDS*1) /* Dual panel display */ + +#define LCCR0_LDM (1 << 3) /* LCD Disable Done Mask */ +#define LCCR0_SFM (1 << 4) /* Start of frame mask */ +#define LCCR0_IUM (1 << 5) /* Input FIFO underrun mask */ +#define LCCR0_EFM (1 << 6) /* End of Frame mask */ +#define LCCR0_PAS (1 << 7) /* Passive/Active display Select */ +#define LCCR0_Pas (LCCR0_PAS*0) /* Passive display (STN) */ +#define LCCR0_Act (LCCR0_PAS*1) /* Active display (TFT) */ +#define LCCR0_DPD (1 << 9) /* Double Pixel Data (monochrome */ + /* display mode) */ +#define LCCR0_4PixMono (LCCR0_DPD*0) /* 4-Pixel/clock Monochrome */ + /* display */ +#define LCCR0_8PixMono (LCCR0_DPD*1) /* 8-Pixel/clock Monochrome */ + /* display */ +#define LCCR0_DIS (1 << 10) /* LCD Disable */ +#define LCCR0_QDM (1 << 11) /* LCD Quick Disable mask */ +#define LCCR0_PDD (0xff << 12) /* Palette DMA request delay */ +#define LCCR0_PDD_S 12 +#define LCCR0_BM (1 << 20) /* Branch mask */ +#define LCCR0_OUM (1 << 21) /* Output FIFO underrun mask */ +#define LCCR0_LCDT (1 << 22) /* LCD panel type */ +#define LCCR0_RDSTM (1 << 23) /* Read status interrupt mask */ +#define LCCR0_CMDIM (1 << 24) /* Command interrupt mask */ +#define LCCR0_OUC (1 << 25) /* Overlay Underlay control bit */ +#define LCCR0_LDDALT (1 << 26) /* LDD alternate mapping control */ + +#define LCCR1_PPL Fld (10, 0) /* Pixels Per Line - 1 */ +#define LCCR1_DisWdth(Pixel) /* Display Width [1..800 pix.] */ \ + (((Pixel) - 1) << FShft (LCCR1_PPL)) + +#define LCCR1_HSW Fld (6, 10) /* Horizontal Synchronization */ +#define LCCR1_HorSnchWdth(Tpix) /* Horizontal Synchronization */ \ + /* pulse Width [1..64 Tpix] */ \ + (((Tpix) - 1) << FShft (LCCR1_HSW)) + +#define LCCR1_ELW Fld (8, 16) /* End-of-Line pixel clock Wait */ + /* count - 1 [Tpix] */ +#define LCCR1_EndLnDel(Tpix) /* End-of-Line Delay */ \ + /* [1..256 Tpix] */ \ + (((Tpix) - 1) << FShft (LCCR1_ELW)) + +#define LCCR1_BLW Fld (8, 24) /* Beginning-of-Line pixel clock */ + /* Wait count - 1 [Tpix] */ +#define LCCR1_BegLnDel(Tpix) /* Beginning-of-Line Delay */ \ + /* [1..256 Tpix] */ \ + (((Tpix) - 1) << FShft (LCCR1_BLW)) + + +#define LCCR2_LPP Fld (10, 0) /* Line Per Panel - 1 */ +#define LCCR2_DisHght(Line) /* Display Height [1..1024 lines] */ \ + (((Line) - 1) << FShft (LCCR2_LPP)) + +#define LCCR2_VSW Fld (6, 10) /* Vertical Synchronization pulse */ + /* Width - 1 [Tln] (L_FCLK) */ +#define LCCR2_VrtSnchWdth(Tln) /* Vertical Synchronization pulse */ \ + /* Width [1..64 Tln] */ \ + (((Tln) - 1) << FShft (LCCR2_VSW)) + +#define LCCR2_EFW Fld (8, 16) /* End-of-Frame line clock Wait */ + /* count [Tln] */ +#define LCCR2_EndFrmDel(Tln) /* End-of-Frame Delay */ \ + /* [0..255 Tln] */ \ + ((Tln) << FShft (LCCR2_EFW)) + +#define LCCR2_BFW Fld (8, 24) /* Beginning-of-Frame line clock */ + /* Wait count [Tln] */ +#define LCCR2_BegFrmDel(Tln) /* Beginning-of-Frame Delay */ \ + /* [0..255 Tln] */ \ + ((Tln) << FShft (LCCR2_BFW)) + +#if 0 +#define LCCR3_PCD (0xff) /* Pixel clock divisor */ +#define LCCR3_ACB (0xff << 8) /* AC Bias pin frequency */ +#define LCCR3_ACB_S 8 +#endif + +#define LCCR3_API (0xf << 16) /* AC Bias pin trasitions per interrupt */ +#define LCCR3_API_S 16 +#define LCCR3_VSP (1 << 20) /* vertical sync polarity */ +#define LCCR3_HSP (1 << 21) /* horizontal sync polarity */ +#define LCCR3_PCP (1 << 22) /* Pixel Clock Polarity (L_PCLK) */ +#define LCCR3_PixRsEdg (LCCR3_PCP*0) /* Pixel clock Rising-Edge */ +#define LCCR3_PixFlEdg (LCCR3_PCP*1) /* Pixel clock Falling-Edge */ + +#define LCCR3_OEP (1 << 23) /* Output Enable Polarity (L_BIAS, */ + /* active display mode) */ +#define LCCR3_OutEnH (LCCR3_OEP*0) /* Output Enable active High */ +#define LCCR3_OutEnL (LCCR3_OEP*1) /* Output Enable active Low */ + +#if 0 +#define LCCR3_BPP (7 << 24) /* bits per pixel */ +#define LCCR3_BPP_S 24 +#endif +#define LCCR3_DPC (1 << 27) /* double pixel clock mode */ + + +#define LCCR3_PCD Fld (8, 0) /* Pixel Clock Divisor */ +#define LCCR3_PixClkDiv(Div) /* Pixel Clock Divisor */ \ + (((Div) << FShft (LCCR3_PCD))) + + +#define LCCR3_BPP Fld (3, 24) /* Bit Per Pixel */ +#define LCCR3_Bpp(Bpp) /* Bit Per Pixel */ \ + (((Bpp) << FShft (LCCR3_BPP))) + +#define LCCR3_ACB Fld (8, 8) /* AC Bias */ +#define LCCR3_Acb(Acb) /* BAC Bias */ \ + (((Acb) << FShft (LCCR3_ACB))) + +#define LCCR3_HorSnchH (LCCR3_HSP*0) /* Horizontal Synchronization */ + /* pulse active High */ +#define LCCR3_HorSnchL (LCCR3_HSP*1) /* Horizontal Synchronization */ + +#define LCCR3_VrtSnchH (LCCR3_VSP*0) /* Vertical Synchronization pulse */ + /* active High */ +#define LCCR3_VrtSnchL (LCCR3_VSP*1) /* Vertical Synchronization pulse */ + /* active Low */ + +#define LCSR_LDD (1 << 0) /* LCD Disable Done */ +#define LCSR_SOF (1 << 1) /* Start of frame */ +#define LCSR_BER (1 << 2) /* Bus error */ +#define LCSR_ABC (1 << 3) /* AC Bias count */ +#define LCSR_IUL (1 << 4) /* input FIFO underrun Lower panel */ +#define LCSR_IUU (1 << 5) /* input FIFO underrun Upper panel */ +#define LCSR_OU (1 << 6) /* output FIFO underrun */ +#define LCSR_QD (1 << 7) /* quick disable */ +#define LCSR_EOF (1 << 8) /* end of frame */ +#define LCSR_BS (1 << 9) /* branch status */ +#define LCSR_SINT (1 << 10) /* subsequent interrupt */ + +#define LDCMD_PAL (1 << 26) /* instructs DMA to load palette buffer */ + +#define LCSR_LDD (1 << 0) /* LCD Disable Done */ +#define LCSR_SOF (1 << 1) /* Start of frame */ +#define LCSR_BER (1 << 2) /* Bus error */ +#define LCSR_ABC (1 << 3) /* AC Bias count */ +#define LCSR_IUL (1 << 4) /* input FIFO underrun Lower panel */ +#define LCSR_IUU (1 << 5) /* input FIFO underrun Upper panel */ +#define LCSR_OU (1 << 6) /* output FIFO underrun */ +#define LCSR_QD (1 << 7) /* quick disable */ +#define LCSR_EOF (1 << 8) /* end of frame */ +#define LCSR_BS (1 << 9) /* branch status */ +#define LCSR_SINT (1 << 10) /* subsequent interrupt */ + +#define LDCMD_PAL (1 << 26) /* instructs DMA to load palette buffer */ + #ifdef CONFIG_PXA27x /* Camera Interface */ diff --git a/trunk/include/asm-arm/arch-pxa/pxafb.h b/trunk/include/asm-arm/arch-pxa/pxafb.h index bbd22396841a..ea2336aa70e4 100644 --- a/trunk/include/asm-arm/arch-pxa/pxafb.h +++ b/trunk/include/asm-arm/arch-pxa/pxafb.h @@ -13,50 +13,6 @@ */ #include -#include - -/* - * Supported LCD connections - * - * bits 0 - 3: for LCD panel type: - * - * STN - for passive matrix - * DSTN - for dual scan passive matrix - * TFT - for active matrix - * - * bits 4 - 9 : for bus width - * bits 10-17 : for AC Bias Pin Frequency - * bit 18 : for output enable polarity - * bit 19 : for pixel clock edge - */ -#define LCD_CONN_TYPE(_x) ((_x) & 0x0f) -#define LCD_CONN_WIDTH(_x) (((_x) >> 4) & 0x1f) - -#define LCD_TYPE_UNKNOWN 0 -#define LCD_TYPE_MONO_STN 1 -#define LCD_TYPE_MONO_DSTN 2 -#define LCD_TYPE_COLOR_STN 3 -#define LCD_TYPE_COLOR_DSTN 4 -#define LCD_TYPE_COLOR_TFT 5 -#define LCD_TYPE_SMART_PANEL 6 -#define LCD_TYPE_MAX 7 - -#define LCD_MONO_STN_4BPP ((4 << 4) | LCD_TYPE_MONO_STN) -#define LCD_MONO_STN_8BPP ((8 << 4) | LCD_TYPE_MONO_STN) -#define LCD_MONO_DSTN_8BPP ((8 << 4) | LCD_TYPE_MONO_DSTN) -#define LCD_COLOR_STN_8BPP ((8 << 4) | LCD_TYPE_COLOR_STN) -#define LCD_COLOR_DSTN_16BPP ((16 << 4) | LCD_TYPE_COLOR_DSTN) -#define LCD_COLOR_TFT_16BPP ((16 << 4) | LCD_TYPE_COLOR_TFT) -#define LCD_COLOR_TFT_18BPP ((18 << 4) | LCD_TYPE_COLOR_TFT) -#define LCD_SMART_PANEL_8BPP ((8 << 4) | LCD_TYPE_SMART_PANEL) -#define LCD_SMART_PANEL_16BPP ((16 << 4) | LCD_TYPE_SMART_PANEL) -#define LCD_SMART_PANEL_18BPP ((18 << 4) | LCD_TYPE_SMART_PANEL) - -#define LCD_AC_BIAS_FREQ(x) (((x) & 0xff) << 10) -#define LCD_BIAS_ACTIVE_HIGH (0 << 17) -#define LCD_BIAS_ACTIVE_LOW (1 << 17) -#define LCD_PCLK_EDGE_RISE (0 << 18) -#define LCD_PCLK_EDGE_FALL (1 << 18) /* * This structure describes the machine which we are running on. @@ -70,10 +26,6 @@ struct pxafb_mode_info { u_short yres; u_char bpp; - u_int cmap_greyscale:1, - unused:31; - - /* Parallel Mode Timing */ u_char hsync_len; u_char left_margin; u_char right_margin; @@ -83,28 +35,14 @@ struct pxafb_mode_info { u_char lower_margin; u_char sync; - /* Smart Panel Mode Timing - see PXA27x DM 7.4.15.0.3 for details - * Note: - * 1. all parameters in nanosecond (ns) - * 2. a0cs{rd,wr}_set_hld are controlled by the same register bits - * in pxa27x and pxa3xx, initialize them to the same value or - * the larger one will be used - * 3. same to {rd,wr}_pulse_width - */ - unsigned a0csrd_set_hld; /* A0 and CS Setup/Hold Time before/after L_FCLK_RD */ - unsigned a0cswr_set_hld; /* A0 and CS Setup/Hold Time before/after L_PCLK_WR */ - unsigned wr_pulse_width; /* L_PCLK_WR pulse width */ - unsigned rd_pulse_width; /* L_FCLK_RD pulse width */ - unsigned cmd_inh_time; /* Command Inhibit time between two writes */ - unsigned op_hold_time; /* Output Hold time from L_FCLK_RD negation */ + u_int cmap_greyscale:1, + unused:31; }; struct pxafb_mach_info { struct pxafb_mode_info *modes; unsigned int num_modes; - unsigned int lcd_conn; - u_int fixed_modes:1, cmap_inverse:1, cmap_static:1, @@ -140,11 +78,8 @@ struct pxafb_mach_info { u_int lccr4; void (*pxafb_backlight_power)(int); void (*pxafb_lcd_power)(int, struct fb_var_screeninfo *); - void (*smart_update)(struct fb_info *); + }; void set_pxa_fb_info(struct pxafb_mach_info *hard_pxa_fb_info); void set_pxa_fb_parent(struct device *parent_dev); unsigned long pxafb_get_hsync_time(struct device *dev); - -extern int pxafb_smart_queue(struct fb_info *info, uint16_t *cmds, int); -extern int pxafb_smart_flush(struct fb_info *info); diff --git a/trunk/include/asm-arm/arch-pxa/regs-lcd.h b/trunk/include/asm-arm/arch-pxa/regs-lcd.h deleted file mode 100644 index f762493f5141..000000000000 --- a/trunk/include/asm-arm/arch-pxa/regs-lcd.h +++ /dev/null @@ -1,171 +0,0 @@ -#ifndef __ASM_ARCH_REGS_LCD_H -#define __ASM_ARCH_REGS_LCD_H -/* - * LCD Controller Registers and Bits Definitions - */ -#define LCCR0 (0x000) /* LCD Controller Control Register 0 */ -#define LCCR1 (0x004) /* LCD Controller Control Register 1 */ -#define LCCR2 (0x008) /* LCD Controller Control Register 2 */ -#define LCCR3 (0x00C) /* LCD Controller Control Register 3 */ -#define LCCR4 (0x010) /* LCD Controller Control Register 4 */ -#define LCCR5 (0x014) /* LCD Controller Control Register 5 */ -#define DFBR0 (0x020) /* DMA Channel 0 Frame Branch Register */ -#define DFBR1 (0x024) /* DMA Channel 1 Frame Branch Register */ -#define LCSR (0x038) /* LCD Controller Status Register */ -#define LIIDR (0x03C) /* LCD Controller Interrupt ID Register */ -#define TMEDRGBR (0x040) /* TMED RGB Seed Register */ -#define TMEDCR (0x044) /* TMED Control Register */ - -#define CMDCR (0x100) /* Command Control Register */ -#define PRSR (0x104) /* Panel Read Status Register */ - -#define LCCR3_1BPP (0 << 24) -#define LCCR3_2BPP (1 << 24) -#define LCCR3_4BPP (2 << 24) -#define LCCR3_8BPP (3 << 24) -#define LCCR3_16BPP (4 << 24) - -#define LCCR3_PDFOR_0 (0 << 30) -#define LCCR3_PDFOR_1 (1 << 30) -#define LCCR3_PDFOR_2 (2 << 30) -#define LCCR3_PDFOR_3 (3 << 30) - -#define LCCR4_PAL_FOR_0 (0 << 15) -#define LCCR4_PAL_FOR_1 (1 << 15) -#define LCCR4_PAL_FOR_2 (2 << 15) -#define LCCR4_PAL_FOR_MASK (3 << 15) - -#define FDADR0 (0x200) /* DMA Channel 0 Frame Descriptor Address Register */ -#define FSADR0 (0x204) /* DMA Channel 0 Frame Source Address Register */ -#define FIDR0 (0x208) /* DMA Channel 0 Frame ID Register */ -#define LDCMD0 (0x20C) /* DMA Channel 0 Command Register */ -#define FDADR1 (0x210) /* DMA Channel 1 Frame Descriptor Address Register */ -#define FSADR1 (0x214) /* DMA Channel 1 Frame Source Address Register */ -#define FIDR1 (0x218) /* DMA Channel 1 Frame ID Register */ -#define LDCMD1 (0x21C) /* DMA Channel 1 Command Register */ -#define FDADR6 (0x260) /* DMA Channel 6 Frame Descriptor Address Register */ -#define FSADR6 (0x264) /* DMA Channel 6 Frame Source Address Register */ -#define FIDR6 (0x268) /* DMA Channel 6 Frame ID Register */ - -#define LCCR0_ENB (1 << 0) /* LCD Controller enable */ -#define LCCR0_CMS (1 << 1) /* Color/Monochrome Display Select */ -#define LCCR0_Color (LCCR0_CMS*0) /* Color display */ -#define LCCR0_Mono (LCCR0_CMS*1) /* Monochrome display */ -#define LCCR0_SDS (1 << 2) /* Single/Dual Panel Display Select */ -#define LCCR0_Sngl (LCCR0_SDS*0) /* Single panel display */ -#define LCCR0_Dual (LCCR0_SDS*1) /* Dual panel display */ - -#define LCCR0_LDM (1 << 3) /* LCD Disable Done Mask */ -#define LCCR0_SFM (1 << 4) /* Start of frame mask */ -#define LCCR0_IUM (1 << 5) /* Input FIFO underrun mask */ -#define LCCR0_EFM (1 << 6) /* End of Frame mask */ -#define LCCR0_PAS (1 << 7) /* Passive/Active display Select */ -#define LCCR0_Pas (LCCR0_PAS*0) /* Passive display (STN) */ -#define LCCR0_Act (LCCR0_PAS*1) /* Active display (TFT) */ -#define LCCR0_DPD (1 << 9) /* Double Pixel Data (monochrome) */ -#define LCCR0_4PixMono (LCCR0_DPD*0) /* 4-Pixel/clock Monochrome display */ -#define LCCR0_8PixMono (LCCR0_DPD*1) /* 8-Pixel/clock Monochrome display */ -#define LCCR0_DIS (1 << 10) /* LCD Disable */ -#define LCCR0_QDM (1 << 11) /* LCD Quick Disable mask */ -#define LCCR0_PDD (0xff << 12) /* Palette DMA request delay */ -#define LCCR0_PDD_S 12 -#define LCCR0_BM (1 << 20) /* Branch mask */ -#define LCCR0_OUM (1 << 21) /* Output FIFO underrun mask */ -#define LCCR0_LCDT (1 << 22) /* LCD panel type */ -#define LCCR0_RDSTM (1 << 23) /* Read status interrupt mask */ -#define LCCR0_CMDIM (1 << 24) /* Command interrupt mask */ -#define LCCR0_OUC (1 << 25) /* Overlay Underlay control bit */ -#define LCCR0_LDDALT (1 << 26) /* LDD alternate mapping control */ - -#define LCCR1_PPL Fld (10, 0) /* Pixels Per Line - 1 */ -#define LCCR1_DisWdth(Pixel) (((Pixel) - 1) << FShft (LCCR1_PPL)) - -#define LCCR1_HSW Fld (6, 10) /* Horizontal Synchronization */ -#define LCCR1_HorSnchWdth(Tpix) (((Tpix) - 1) << FShft (LCCR1_HSW)) - -#define LCCR1_ELW Fld (8, 16) /* End-of-Line pixel clock Wait - 1 */ -#define LCCR1_EndLnDel(Tpix) (((Tpix) - 1) << FShft (LCCR1_ELW)) - -#define LCCR1_BLW Fld (8, 24) /* Beginning-of-Line pixel clock */ -#define LCCR1_BegLnDel(Tpix) (((Tpix) - 1) << FShft (LCCR1_BLW)) - -#define LCCR2_LPP Fld (10, 0) /* Line Per Panel - 1 */ -#define LCCR2_DisHght(Line) (((Line) - 1) << FShft (LCCR2_LPP)) - -#define LCCR2_VSW Fld (6, 10) /* Vertical Synchronization pulse - 1 */ -#define LCCR2_VrtSnchWdth(Tln) (((Tln) - 1) << FShft (LCCR2_VSW)) - -#define LCCR2_EFW Fld (8, 16) /* End-of-Frame line clock Wait */ -#define LCCR2_EndFrmDel(Tln) ((Tln) << FShft (LCCR2_EFW)) - -#define LCCR2_BFW Fld (8, 24) /* Beginning-of-Frame line clock */ -#define LCCR2_BegFrmDel(Tln) ((Tln) << FShft (LCCR2_BFW)) - -#define LCCR3_API (0xf << 16) /* AC Bias pin trasitions per interrupt */ -#define LCCR3_API_S 16 -#define LCCR3_VSP (1 << 20) /* vertical sync polarity */ -#define LCCR3_HSP (1 << 21) /* horizontal sync polarity */ -#define LCCR3_PCP (1 << 22) /* Pixel Clock Polarity (L_PCLK) */ -#define LCCR3_PixRsEdg (LCCR3_PCP*0) /* Pixel clock Rising-Edge */ -#define LCCR3_PixFlEdg (LCCR3_PCP*1) /* Pixel clock Falling-Edge */ - -#define LCCR3_OEP (1 << 23) /* Output Enable Polarity */ -#define LCCR3_OutEnH (LCCR3_OEP*0) /* Output Enable active High */ -#define LCCR3_OutEnL (LCCR3_OEP*1) /* Output Enable active Low */ - -#define LCCR3_DPC (1 << 27) /* double pixel clock mode */ -#define LCCR3_PCD Fld (8, 0) /* Pixel Clock Divisor */ -#define LCCR3_PixClkDiv(Div) (((Div) << FShft (LCCR3_PCD))) - -#define LCCR3_BPP Fld (3, 24) /* Bit Per Pixel */ -#define LCCR3_Bpp(Bpp) (((Bpp) << FShft (LCCR3_BPP))) - -#define LCCR3_ACB Fld (8, 8) /* AC Bias */ -#define LCCR3_Acb(Acb) (((Acb) << FShft (LCCR3_ACB))) - -#define LCCR3_HorSnchH (LCCR3_HSP*0) /* HSP Active High */ -#define LCCR3_HorSnchL (LCCR3_HSP*1) /* HSP Active Low */ - -#define LCCR3_VrtSnchH (LCCR3_VSP*0) /* VSP Active High */ -#define LCCR3_VrtSnchL (LCCR3_VSP*1) /* VSP Active Low */ - -#define LCCR5_IUM(x) (1 << ((x) + 23)) /* input underrun mask */ -#define LCCR5_BSM(x) (1 << ((x) + 15)) /* branch mask */ -#define LCCR5_EOFM(x) (1 << ((x) + 7)) /* end of frame mask */ -#define LCCR5_SOFM(x) (1 << ((x) + 0)) /* start of frame mask */ - -#define LCSR_LDD (1 << 0) /* LCD Disable Done */ -#define LCSR_SOF (1 << 1) /* Start of frame */ -#define LCSR_BER (1 << 2) /* Bus error */ -#define LCSR_ABC (1 << 3) /* AC Bias count */ -#define LCSR_IUL (1 << 4) /* input FIFO underrun Lower panel */ -#define LCSR_IUU (1 << 5) /* input FIFO underrun Upper panel */ -#define LCSR_OU (1 << 6) /* output FIFO underrun */ -#define LCSR_QD (1 << 7) /* quick disable */ -#define LCSR_EOF (1 << 8) /* end of frame */ -#define LCSR_BS (1 << 9) /* branch status */ -#define LCSR_SINT (1 << 10) /* subsequent interrupt */ -#define LCSR_RD_ST (1 << 11) /* read status */ -#define LCSR_CMD_INT (1 << 12) /* command interrupt */ - -#define LDCMD_PAL (1 << 26) /* instructs DMA to load palette buffer */ - -/* smartpanel related */ -#define PRSR_DATA(x) ((x) & 0xff) /* Panel Data */ -#define PRSR_A0 (1 << 8) /* Read Data Source */ -#define PRSR_ST_OK (1 << 9) /* Status OK */ -#define PRSR_CON_NT (1 << 10) /* Continue to Next Command */ - -#define SMART_CMD_A0 (0x1 << 8) -#define SMART_CMD_READ_STATUS_REG (0x0 << 9) -#define SMART_CMD_READ_FRAME_BUFFER ((0x0 << 9) | SMART_CMD_A0) -#define SMART_CMD_WRITE_COMMAND (0x1 << 9) -#define SMART_CMD_WRITE_DATA ((0x1 << 9) | SMART_CMD_A0) -#define SMART_CMD_WRITE_FRAME ((0x2 << 9) | SMART_CMD_A0) -#define SMART_CMD_WAIT_FOR_VSYNC (0x3 << 9) -#define SMART_CMD_NOOP (0x4 << 9) -#define SMART_CMD_INTERRUPT (0x5 << 9) - -#define SMART_CMD(x) (SMART_CMD_WRITE_COMMAND | ((x) & 0xff)) -#define SMART_DAT(x) (SMART_CMD_WRITE_DATA | ((x) & 0xff)) -#endif /* __ASM_ARCH_REGS_LCD_H */ diff --git a/trunk/include/asm-generic/bitops.h b/trunk/include/asm-generic/bitops.h index c9f369c4bd7e..15e6f253dda4 100644 --- a/trunk/include/asm-generic/bitops.h +++ b/trunk/include/asm-generic/bitops.h @@ -17,6 +17,8 @@ #include #include +#ifdef __KERNEL__ + #ifndef _LINUX_BITOPS_H #error only can be included directly #endif @@ -30,4 +32,6 @@ #include #include +#endif /* __KERNEL__ */ + #endif /* _ASM_GENERIC_BITOPS_H */ diff --git a/trunk/include/asm-generic/futex.h b/trunk/include/asm-generic/futex.h index 3c2344f48136..f422df0956a2 100644 --- a/trunk/include/asm-generic/futex.h +++ b/trunk/include/asm-generic/futex.h @@ -1,9 +1,11 @@ #ifndef _ASM_GENERIC_FUTEX_H #define _ASM_GENERIC_FUTEX_H +#ifdef __KERNEL__ + #include -#include #include +#include static inline int futex_atomic_op_inuser (int encoded_op, int __user *uaddr) @@ -54,3 +56,4 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval) } #endif +#endif diff --git a/trunk/include/asm-generic/memory_model.h b/trunk/include/asm-generic/memory_model.h index ae060c62aff1..52226e14bd7d 100644 --- a/trunk/include/asm-generic/memory_model.h +++ b/trunk/include/asm-generic/memory_model.h @@ -1,6 +1,7 @@ #ifndef __ASM_MEMORY_MODEL_H #define __ASM_MEMORY_MODEL_H +#ifdef __KERNEL__ #ifndef __ASSEMBLY__ #if defined(CONFIG_FLATMEM) @@ -80,5 +81,6 @@ extern unsigned long page_to_pfn(struct page *page); #endif /* CONFIG_OUT_OF_LINE_PFN_TO_PAGE */ #endif /* __ASSEMBLY__ */ +#endif /* __KERNEL__ */ #endif diff --git a/trunk/include/asm-generic/page.h b/trunk/include/asm-generic/page.h index 14db733b8e68..a96b5d986b6e 100644 --- a/trunk/include/asm-generic/page.h +++ b/trunk/include/asm-generic/page.h @@ -1,6 +1,7 @@ #ifndef _ASM_GENERIC_PAGE_H #define _ASM_GENERIC_PAGE_H +#ifdef __KERNEL__ #ifndef __ASSEMBLY__ #include @@ -20,5 +21,6 @@ static __inline__ __attribute_const__ int get_order(unsigned long size) } #endif /* __ASSEMBLY__ */ +#endif /* __KERNEL__ */ #endif /* _ASM_GENERIC_PAGE_H */ diff --git a/trunk/include/asm-generic/rtc.h b/trunk/include/asm-generic/rtc.h index be4af0029ac0..dd1bed860e64 100644 --- a/trunk/include/asm-generic/rtc.h +++ b/trunk/include/asm-generic/rtc.h @@ -12,6 +12,8 @@ #ifndef __ASM_RTC_H__ #define __ASM_RTC_H__ +#ifdef __KERNEL__ + #include #include #include @@ -211,4 +213,5 @@ static inline int set_rtc_pll(struct rtc_pll_info *pll) return -EINVAL; } +#endif /* __KERNEL__ */ #endif /* __ASM_RTC_H__ */ diff --git a/trunk/include/asm-ia64/futex.h b/trunk/include/asm-ia64/futex.h index c7f0f062239c..8a98a2654139 100644 --- a/trunk/include/asm-ia64/futex.h +++ b/trunk/include/asm-ia64/futex.h @@ -2,9 +2,9 @@ #define _ASM_FUTEX_H #include -#include #include #include +#include #define __futex_atomic_op1(insn, ret, oldval, uaddr, oparg) \ do { \ diff --git a/trunk/include/asm-ia64/thread_info.h b/trunk/include/asm-ia64/thread_info.h index f30e05583869..6da8069a0f77 100644 --- a/trunk/include/asm-ia64/thread_info.h +++ b/trunk/include/asm-ia64/thread_info.h @@ -101,6 +101,7 @@ extern void tsk_clear_notify_resume(struct task_struct *tsk); #define TIF_SYSCALL_TRACE 2 /* syscall trace active */ #define TIF_SYSCALL_AUDIT 3 /* syscall auditing active */ #define TIF_SINGLESTEP 4 /* restore singlestep on return to user mode */ +#define TIF_RESTORE_SIGMASK 5 /* restore signal mask in do_signal() */ #define TIF_NOTIFY_RESUME 6 /* resumption notification requested */ #define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */ #define TIF_MEMDIE 17 @@ -108,7 +109,6 @@ extern void tsk_clear_notify_resume(struct task_struct *tsk); #define TIF_DB_DISABLED 19 /* debug trap disabled for fsyscall */ #define TIF_FREEZE 20 /* is freezing for suspend */ #define TIF_RESTORE_RSE 21 /* user RBS is newer than kernel RBS */ -#define TIF_RESTORE_SIGMASK 22 /* restore signal mask in do_signal() */ #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) @@ -126,7 +126,8 @@ extern void tsk_clear_notify_resume(struct task_struct *tsk); /* "work to do on user-return" bits */ #define TIF_ALLWORK_MASK (_TIF_SIGPENDING|_TIF_NOTIFY_RESUME|_TIF_SYSCALL_AUDIT|\ - _TIF_NEED_RESCHED|_TIF_SYSCALL_TRACE) + _TIF_NEED_RESCHED| _TIF_SYSCALL_TRACE|\ + _TIF_RESTORE_SIGMASK) /* like TIF_ALLWORK_BITS but sans TIF_SYSCALL_TRACE or TIF_SYSCALL_AUDIT */ #define TIF_WORK_MASK (TIF_ALLWORK_MASK&~(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT)) diff --git a/trunk/include/asm-mips/futex.h b/trunk/include/asm-mips/futex.h index b9cce90346cf..17f082cfea85 100644 --- a/trunk/include/asm-mips/futex.h +++ b/trunk/include/asm-mips/futex.h @@ -11,9 +11,9 @@ #ifdef __KERNEL__ #include -#include #include #include +#include #include #define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \ diff --git a/trunk/include/asm-parisc/futex.h b/trunk/include/asm-parisc/futex.h index 0c705c3a55ef..fdc6d055ef7f 100644 --- a/trunk/include/asm-parisc/futex.h +++ b/trunk/include/asm-parisc/futex.h @@ -4,8 +4,8 @@ #ifdef __KERNEL__ #include -#include #include +#include static inline int futex_atomic_op_inuser (int encoded_op, int __user *uaddr) diff --git a/trunk/include/asm-powerpc/futex.h b/trunk/include/asm-powerpc/futex.h index 6d406c5c5de4..3f3673fd3ff3 100644 --- a/trunk/include/asm-powerpc/futex.h +++ b/trunk/include/asm-powerpc/futex.h @@ -4,9 +4,9 @@ #ifdef __KERNEL__ #include -#include #include #include +#include #include #define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \ diff --git a/trunk/include/asm-s390/thread_info.h b/trunk/include/asm-s390/thread_info.h index 99bbed99a3b2..0a518915bf90 100644 --- a/trunk/include/asm-s390/thread_info.h +++ b/trunk/include/asm-s390/thread_info.h @@ -89,6 +89,7 @@ static inline struct thread_info *current_thread_info(void) * thread information flags bit numbers */ #define TIF_SYSCALL_TRACE 0 /* syscall trace active */ +#define TIF_RESTORE_SIGMASK 1 /* restore signal mask in do_signal() */ #define TIF_SIGPENDING 2 /* signal pending */ #define TIF_NEED_RESCHED 3 /* rescheduling necessary */ #define TIF_RESTART_SVC 4 /* restart svc with new svc number */ @@ -100,7 +101,6 @@ static inline struct thread_info *current_thread_info(void) TIF_NEED_RESCHED */ #define TIF_31BIT 18 /* 32bit process */ #define TIF_MEMDIE 19 -#define TIF_RESTORE_SIGMASK 20 /* restore signal mask in do_signal() */ #define _TIF_SYSCALL_TRACE (1< -#include #include +#include /* XXX: UP variants, fix for SH-4A and SMP.. */ #include diff --git a/trunk/include/asm-sparc64/futex.h b/trunk/include/asm-sparc64/futex.h index d8378935ae90..df1097d6ffbe 100644 --- a/trunk/include/asm-sparc64/futex.h +++ b/trunk/include/asm-sparc64/futex.h @@ -2,9 +2,9 @@ #define _SPARC64_FUTEX_H #include -#include #include #include +#include #define __futex_cas_op(insn, ret, oldval, uaddr, oparg) \ __asm__ __volatile__( \ diff --git a/trunk/include/asm-x86/futex.h b/trunk/include/asm-x86/futex.h index e7a76b37b333..ac0fbf24d722 100644 --- a/trunk/include/asm-x86/futex.h +++ b/trunk/include/asm-x86/futex.h @@ -4,12 +4,12 @@ #ifdef __KERNEL__ #include -#include #include #include #include #include +#include #define __futex_atomic_op1(insn, ret, oldval, uaddr, oparg) \ asm volatile("1:\t" insn "\n" \ diff --git a/trunk/include/asm-x86/thread_info_32.h b/trunk/include/asm-x86/thread_info_32.h index b6338829d1a8..531859962096 100644 --- a/trunk/include/asm-x86/thread_info_32.h +++ b/trunk/include/asm-x86/thread_info_32.h @@ -131,6 +131,7 @@ static inline struct thread_info *current_thread_info(void) #define TIF_SYSCALL_EMU 5 /* syscall emulation active */ #define TIF_SYSCALL_AUDIT 6 /* syscall auditing active */ #define TIF_SECCOMP 7 /* secure computing */ +#define TIF_RESTORE_SIGMASK 8 /* restore signal mask in do_signal() */ #define TIF_HRTICK_RESCHED 9 /* reprogram hrtick timer */ #define TIF_MEMDIE 16 #define TIF_DEBUG 17 /* uses debug registers */ @@ -150,6 +151,7 @@ static inline struct thread_info *current_thread_info(void) #define _TIF_SYSCALL_EMU (1 << TIF_SYSCALL_EMU) #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) #define _TIF_SECCOMP (1 << TIF_SECCOMP) +#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK) #define _TIF_HRTICK_RESCHED (1 << TIF_HRTICK_RESCHED) #define _TIF_DEBUG (1 << TIF_DEBUG) #define _TIF_IO_BITMAP (1 << TIF_IO_BITMAP) @@ -186,20 +188,9 @@ static inline struct thread_info *current_thread_info(void) this quantum (SMP) */ #define TS_POLLING 0x0002 /* True if in idle loop and not sleeping */ -#define TS_RESTORE_SIGMASK 0x0004 /* restore signal mask in do_signal() */ #define tsk_is_polling(t) (task_thread_info(t)->status & TS_POLLING) -#ifndef __ASSEMBLY__ -#define HAVE_SET_RESTORE_SIGMASK 1 -static inline void set_restore_sigmask(void) -{ - struct thread_info *ti = current_thread_info(); - ti->status |= TS_RESTORE_SIGMASK; - set_bit(TIF_SIGPENDING, &ti->flags); -} -#endif /* !__ASSEMBLY__ */ - #endif /* __KERNEL__ */ #endif /* _ASM_THREAD_INFO_H */ diff --git a/trunk/include/asm-x86/thread_info_64.h b/trunk/include/asm-x86/thread_info_64.h index cb69f70abba1..ed664e874dec 100644 --- a/trunk/include/asm-x86/thread_info_64.h +++ b/trunk/include/asm-x86/thread_info_64.h @@ -109,6 +109,7 @@ static inline struct thread_info *stack_thread_info(void) #define TIF_IRET 5 /* force IRET */ #define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */ #define TIF_SECCOMP 8 /* secure computing */ +#define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal */ #define TIF_MCE_NOTIFY 10 /* notify userspace of an MCE */ #define TIF_HRTICK_RESCHED 11 /* reprogram hrtick timer */ /* 16 free */ @@ -132,6 +133,7 @@ static inline struct thread_info *stack_thread_info(void) #define _TIF_IRET (1 << TIF_IRET) #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) #define _TIF_SECCOMP (1 << TIF_SECCOMP) +#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK) #define _TIF_MCE_NOTIFY (1 << TIF_MCE_NOTIFY) #define _TIF_HRTICK_RESCHED (1 << TIF_HRTICK_RESCHED) #define _TIF_IA32 (1 << TIF_IA32) @@ -176,20 +178,9 @@ static inline struct thread_info *stack_thread_info(void) #define TS_COMPAT 0x0002 /* 32bit syscall active */ #define TS_POLLING 0x0004 /* true if in idle loop and not sleeping */ -#define TS_RESTORE_SIGMASK 0x0008 /* restore signal mask in do_signal() */ #define tsk_is_polling(t) (task_thread_info(t)->status & TS_POLLING) -#ifndef __ASSEMBLY__ -#define HAVE_SET_RESTORE_SIGMASK 1 -static inline void set_restore_sigmask(void) -{ - struct thread_info *ti = current_thread_info(); - ti->status |= TS_RESTORE_SIGMASK; - set_bit(TIF_SIGPENDING, &ti->flags); -} -#endif /* !__ASSEMBLY__ */ - #endif /* __KERNEL__ */ #endif /* _ASM_THREAD_INFO_H */ diff --git a/trunk/include/linux/agp_backend.h b/trunk/include/linux/agp_backend.h index 661d90d6cf7c..03e34547d489 100644 --- a/trunk/include/linux/agp_backend.h +++ b/trunk/include/linux/agp_backend.h @@ -30,6 +30,8 @@ #ifndef _AGP_BACKEND_H #define _AGP_BACKEND_H 1 +#ifdef __KERNEL__ + #ifndef TRUE #define TRUE 1 #endif @@ -109,4 +111,5 @@ extern struct agp_bridge_data *agp_backend_acquire(struct pci_dev *); extern void agp_backend_release(struct agp_bridge_data *); extern void agp_flush_chipset(struct agp_bridge_data *); +#endif /* __KERNEL__ */ #endif /* _AGP_BACKEND_H */ diff --git a/trunk/include/linux/backing-dev.h b/trunk/include/linux/backing-dev.h index 0a24d5550eb3..b66fa2bdfd9c 100644 --- a/trunk/include/linux/backing-dev.h +++ b/trunk/include/linux/backing-dev.h @@ -11,13 +11,9 @@ #include #include #include -#include -#include #include struct page; -struct device; -struct dentry; /* * Bits in backing_dev_info.state @@ -52,26 +48,11 @@ struct backing_dev_info { struct prop_local_percpu completions; int dirty_exceeded; - - unsigned int min_ratio; - unsigned int max_ratio, max_prop_frac; - - struct device *dev; - -#ifdef CONFIG_DEBUG_FS - struct dentry *debug_dir; - struct dentry *debug_stats; -#endif }; int bdi_init(struct backing_dev_info *bdi); void bdi_destroy(struct backing_dev_info *bdi); -int bdi_register(struct backing_dev_info *bdi, struct device *parent, - const char *fmt, ...); -int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev); -void bdi_unregister(struct backing_dev_info *bdi); - static inline void __add_bdi_stat(struct backing_dev_info *bdi, enum bdi_stat_item item, s64 amount) { @@ -135,8 +116,6 @@ static inline s64 bdi_stat_sum(struct backing_dev_info *bdi, return sum; } -extern void bdi_writeout_inc(struct backing_dev_info *bdi); - /* * maximal error of a stat counter. */ @@ -149,48 +128,24 @@ static inline unsigned long bdi_stat_error(struct backing_dev_info *bdi) #endif } -int bdi_set_min_ratio(struct backing_dev_info *bdi, unsigned int min_ratio); -int bdi_set_max_ratio(struct backing_dev_info *bdi, unsigned int max_ratio); - /* * Flags in backing_dev_info::capability - * - * The first three flags control whether dirty pages will contribute to the - * VM's accounting and whether writepages() should be called for dirty pages - * (something that would not, for example, be appropriate for ramfs) - * - * WARNING: these flags are closely related and should not normally be - * used separately. The BDI_CAP_NO_ACCT_AND_WRITEBACK combines these - * three flags into a single convenience macro. - * - * BDI_CAP_NO_ACCT_DIRTY: Dirty pages shouldn't contribute to accounting - * BDI_CAP_NO_WRITEBACK: Don't write pages back - * BDI_CAP_NO_ACCT_WB: Don't automatically account writeback pages - * - * These flags let !MMU mmap() govern direct device mapping vs immediate - * copying more easily for MAP_PRIVATE, especially for ROM filesystems. - * - * BDI_CAP_MAP_COPY: Copy can be mapped (MAP_PRIVATE) - * BDI_CAP_MAP_DIRECT: Can be mapped directly (MAP_SHARED) - * BDI_CAP_READ_MAP: Can be mapped for reading - * BDI_CAP_WRITE_MAP: Can be mapped for writing - * BDI_CAP_EXEC_MAP: Can be mapped for execution + * - The first two flags control whether dirty pages will contribute to the + * VM's accounting and whether writepages() should be called for dirty pages + * (something that would not, for example, be appropriate for ramfs) + * - These flags let !MMU mmap() govern direct device mapping vs immediate + * copying more easily for MAP_PRIVATE, especially for ROM filesystems */ -#define BDI_CAP_NO_ACCT_DIRTY 0x00000001 -#define BDI_CAP_NO_WRITEBACK 0x00000002 -#define BDI_CAP_MAP_COPY 0x00000004 -#define BDI_CAP_MAP_DIRECT 0x00000008 -#define BDI_CAP_READ_MAP 0x00000010 -#define BDI_CAP_WRITE_MAP 0x00000020 -#define BDI_CAP_EXEC_MAP 0x00000040 -#define BDI_CAP_NO_ACCT_WB 0x00000080 - +#define BDI_CAP_NO_ACCT_DIRTY 0x00000001 /* Dirty pages shouldn't contribute to accounting */ +#define BDI_CAP_NO_WRITEBACK 0x00000002 /* Don't write pages back */ +#define BDI_CAP_MAP_COPY 0x00000004 /* Copy can be mapped (MAP_PRIVATE) */ +#define BDI_CAP_MAP_DIRECT 0x00000008 /* Can be mapped directly (MAP_SHARED) */ +#define BDI_CAP_READ_MAP 0x00000010 /* Can be mapped for reading */ +#define BDI_CAP_WRITE_MAP 0x00000020 /* Can be mapped for writing */ +#define BDI_CAP_EXEC_MAP 0x00000040 /* Can be mapped for execution */ #define BDI_CAP_VMFLAGS \ (BDI_CAP_READ_MAP | BDI_CAP_WRITE_MAP | BDI_CAP_EXEC_MAP) -#define BDI_CAP_NO_ACCT_AND_WRITEBACK \ - (BDI_CAP_NO_WRITEBACK | BDI_CAP_NO_ACCT_DIRTY | BDI_CAP_NO_ACCT_WB) - #if defined(VM_MAYREAD) && \ (BDI_CAP_READ_MAP != VM_MAYREAD || \ BDI_CAP_WRITE_MAP != VM_MAYWRITE || \ @@ -230,32 +185,17 @@ void clear_bdi_congested(struct backing_dev_info *bdi, int rw); void set_bdi_congested(struct backing_dev_info *bdi, int rw); long congestion_wait(int rw, long timeout); +#define bdi_cap_writeback_dirty(bdi) \ + (!((bdi)->capabilities & BDI_CAP_NO_WRITEBACK)) -static inline bool bdi_cap_writeback_dirty(struct backing_dev_info *bdi) -{ - return !(bdi->capabilities & BDI_CAP_NO_WRITEBACK); -} - -static inline bool bdi_cap_account_dirty(struct backing_dev_info *bdi) -{ - return !(bdi->capabilities & BDI_CAP_NO_ACCT_DIRTY); -} +#define bdi_cap_account_dirty(bdi) \ + (!((bdi)->capabilities & BDI_CAP_NO_ACCT_DIRTY)) -static inline bool bdi_cap_account_writeback(struct backing_dev_info *bdi) -{ - /* Paranoia: BDI_CAP_NO_WRITEBACK implies BDI_CAP_NO_ACCT_WB */ - return !(bdi->capabilities & (BDI_CAP_NO_ACCT_WB | - BDI_CAP_NO_WRITEBACK)); -} +#define mapping_cap_writeback_dirty(mapping) \ + bdi_cap_writeback_dirty((mapping)->backing_dev_info) -static inline bool mapping_cap_writeback_dirty(struct address_space *mapping) -{ - return bdi_cap_writeback_dirty(mapping->backing_dev_info); -} +#define mapping_cap_account_dirty(mapping) \ + bdi_cap_account_dirty((mapping)->backing_dev_info) -static inline bool mapping_cap_account_dirty(struct address_space *mapping) -{ - return bdi_cap_account_dirty(mapping->backing_dev_info); -} #endif /* _LINUX_BACKING_DEV_H */ diff --git a/trunk/include/linux/byteorder/Kbuild b/trunk/include/linux/byteorder/Kbuild index 1133d5f9d818..79bedddfd9ca 100644 --- a/trunk/include/linux/byteorder/Kbuild +++ b/trunk/include/linux/byteorder/Kbuild @@ -1,3 +1,5 @@ -unifdef-y += big_endian.h -unifdef-y += little_endian.h +header-y += big_endian.h +header-y += little_endian.h + +unifdef-y += generic.h unifdef-y += swab.h diff --git a/trunk/include/linux/byteorder/big_endian.h b/trunk/include/linux/byteorder/big_endian.h index 961ed4b48d8e..bef87891cb24 100644 --- a/trunk/include/linux/byteorder/big_endian.h +++ b/trunk/include/linux/byteorder/big_endian.h @@ -101,8 +101,6 @@ static inline __u16 __be16_to_cpup(const __be16 *p) #define __cpu_to_be16s(x) do {} while (0) #define __be16_to_cpus(x) do {} while (0) -#ifdef __KERNEL__ #include -#endif #endif /* _LINUX_BYTEORDER_BIG_ENDIAN_H */ diff --git a/trunk/include/linux/byteorder/generic.h b/trunk/include/linux/byteorder/generic.h index 0846e6b931ce..d3771551fdd9 100644 --- a/trunk/include/linux/byteorder/generic.h +++ b/trunk/include/linux/byteorder/generic.h @@ -82,6 +82,12 @@ * */ + +#if defined(__KERNEL__) +/* + * inside the kernel, we can use nicknames; + * outside of it, we must avoid POSIX namespace pollution... + */ #define cpu_to_le64 __cpu_to_le64 #define le64_to_cpu __le64_to_cpu #define cpu_to_le32 __cpu_to_le32 @@ -170,4 +176,6 @@ static inline void be64_add_cpu(__be64 *var, u64 val) *var = cpu_to_be64(be64_to_cpu(*var) + val); } +#endif /* KERNEL */ + #endif /* _LINUX_BYTEORDER_GENERIC_H */ diff --git a/trunk/include/linux/byteorder/little_endian.h b/trunk/include/linux/byteorder/little_endian.h index 05dc7c35b3b2..86e62b750176 100644 --- a/trunk/include/linux/byteorder/little_endian.h +++ b/trunk/include/linux/byteorder/little_endian.h @@ -101,8 +101,6 @@ static inline __u16 __be16_to_cpup(const __be16 *p) #define __cpu_to_be16s(x) __swab16s((x)) #define __be16_to_cpus(x) __swab16s((x)) -#ifdef __KERNEL__ #include -#endif #endif /* _LINUX_BYTEORDER_LITTLE_ENDIAN_H */ diff --git a/trunk/include/linux/cdev.h b/trunk/include/linux/cdev.h index fb4591977b03..1e29b13d0062 100644 --- a/trunk/include/linux/cdev.h +++ b/trunk/include/linux/cdev.h @@ -1,5 +1,6 @@ #ifndef _LINUX_CDEV_H #define _LINUX_CDEV_H +#ifdef __KERNEL__ #include #include @@ -33,3 +34,4 @@ void cd_forget(struct inode *); extern struct backing_dev_info directly_mappable_cdev_bdi; #endif +#endif diff --git a/trunk/include/linux/coda_fs_i.h b/trunk/include/linux/coda_fs_i.h index b3ef0c461578..424fe9cf02c4 100644 --- a/trunk/include/linux/coda_fs_i.h +++ b/trunk/include/linux/coda_fs_i.h @@ -8,6 +8,7 @@ #ifndef _LINUX_CODA_FS_I #define _LINUX_CODA_FS_I +#ifdef __KERNEL__ #include #include #include @@ -51,3 +52,4 @@ struct inode *coda_fid_to_inode(struct CodaFid *fid, struct super_block *sb); void coda_replace_fid(struct inode *, struct CodaFid *, struct CodaFid *); #endif +#endif diff --git a/trunk/include/linux/concap.h b/trunk/include/linux/concap.h index 977acb3d1fb2..27304651d700 100644 --- a/trunk/include/linux/concap.h +++ b/trunk/include/linux/concap.h @@ -8,7 +8,7 @@ #ifndef _LINUX_CONCAP_H #define _LINUX_CONCAP_H - +#ifdef __KERNEL__ #include #include @@ -110,3 +110,4 @@ extern int concap_nop(struct concap_proto *cprot); */ extern int concap_drop_skb(struct concap_proto *cprot, struct sk_buff *skb); #endif +#endif diff --git a/trunk/include/linux/configfs.h b/trunk/include/linux/configfs.h index 3ae65b1bf90f..4b287ad9371a 100644 --- a/trunk/include/linux/configfs.h +++ b/trunk/include/linux/configfs.h @@ -35,6 +35,8 @@ #ifndef _CONFIGFS_H_ #define _CONFIGFS_H_ +#ifdef __KERNEL__ + #include #include #include @@ -192,4 +194,6 @@ void configfs_unregister_subsystem(struct configfs_subsystem *subsys); int configfs_depend_item(struct configfs_subsystem *subsys, struct config_item *target); void configfs_undepend_item(struct configfs_subsystem *subsys, struct config_item *target); +#endif /* __KERNEL__ */ + #endif /* _CONFIGFS_H_ */ diff --git a/trunk/include/linux/console.h b/trunk/include/linux/console.h index a4f27fbdf549..a5f88a6a259d 100644 --- a/trunk/include/linux/console.h +++ b/trunk/include/linux/console.h @@ -91,7 +91,6 @@ void give_up_console(const struct consw *sw); #define CON_ENABLED (4) #define CON_BOOT (8) #define CON_ANYTIME (16) /* Safe to call when cpu is offline */ -#define CON_BRL (32) /* Used for a braille device */ struct console { char name[16]; @@ -122,9 +121,6 @@ extern struct tty_driver *console_device(int *); extern void console_stop(struct console *); extern void console_start(struct console *); extern int is_console_locked(void); -extern int braille_register_console(struct console *, int index, - char *console_options, char *braille_options); -extern int braille_unregister_console(struct console *); extern int console_suspend_enabled; diff --git a/trunk/include/linux/crc-ccitt.h b/trunk/include/linux/crc-ccitt.h index f52696a1ff0d..90037617da8f 100644 --- a/trunk/include/linux/crc-ccitt.h +++ b/trunk/include/linux/crc-ccitt.h @@ -1,5 +1,6 @@ #ifndef _LINUX_CRC_CCITT_H #define _LINUX_CRC_CCITT_H +#ifdef __KERNEL__ #include @@ -12,4 +13,5 @@ static inline u16 crc_ccitt_byte(u16 crc, const u8 c) return (crc >> 8) ^ crc_ccitt_table[(crc ^ c) & 0xff]; } +#endif /* __KERNEL__ */ #endif /* _LINUX_CRC_CCITT_H */ diff --git a/trunk/include/linux/dcache.h b/trunk/include/linux/dcache.h index 2a6639407c80..cfb1627ac51c 100644 --- a/trunk/include/linux/dcache.h +++ b/trunk/include/linux/dcache.h @@ -1,6 +1,8 @@ #ifndef __LINUX_DCACHE_H #define __LINUX_DCACHE_H +#ifdef __KERNEL__ + #include #include #include @@ -363,4 +365,6 @@ extern struct dentry *lookup_create(struct nameidata *nd, int is_dir); extern int sysctl_vfs_cache_pressure; +#endif /* __KERNEL__ */ + #endif /* __LINUX_DCACHE_H */ diff --git a/trunk/include/linux/debugobjects.h b/trunk/include/linux/debugobjects.h deleted file mode 100644 index 8c243aaa86a7..000000000000 --- a/trunk/include/linux/debugobjects.h +++ /dev/null @@ -1,90 +0,0 @@ -#ifndef _LINUX_DEBUGOBJECTS_H -#define _LINUX_DEBUGOBJECTS_H - -#include -#include - -enum debug_obj_state { - ODEBUG_STATE_NONE, - ODEBUG_STATE_INIT, - ODEBUG_STATE_INACTIVE, - ODEBUG_STATE_ACTIVE, - ODEBUG_STATE_DESTROYED, - ODEBUG_STATE_NOTAVAILABLE, - ODEBUG_STATE_MAX, -}; - -struct debug_obj_descr; - -/** - * struct debug_obj - representaion of an tracked object - * @node: hlist node to link the object into the tracker list - * @state: tracked object state - * @object: pointer to the real object - * @descr: pointer to an object type specific debug description structure - */ -struct debug_obj { - struct hlist_node node; - enum debug_obj_state state; - void *object; - struct debug_obj_descr *descr; -}; - -/** - * struct debug_obj_descr - object type specific debug description structure - * @name: name of the object typee - * @fixup_init: fixup function, which is called when the init check - * fails - * @fixup_activate: fixup function, which is called when the activate check - * fails - * @fixup_destroy: fixup function, which is called when the destroy check - * fails - * @fixup_free: fixup function, which is called when the free check - * fails - */ -struct debug_obj_descr { - const char *name; - - int (*fixup_init) (void *addr, enum debug_obj_state state); - int (*fixup_activate) (void *addr, enum debug_obj_state state); - int (*fixup_destroy) (void *addr, enum debug_obj_state state); - int (*fixup_free) (void *addr, enum debug_obj_state state); -}; - -#ifdef CONFIG_DEBUG_OBJECTS -extern void debug_object_init (void *addr, struct debug_obj_descr *descr); -extern void -debug_object_init_on_stack(void *addr, struct debug_obj_descr *descr); -extern void debug_object_activate (void *addr, struct debug_obj_descr *descr); -extern void debug_object_deactivate(void *addr, struct debug_obj_descr *descr); -extern void debug_object_destroy (void *addr, struct debug_obj_descr *descr); -extern void debug_object_free (void *addr, struct debug_obj_descr *descr); - -extern void debug_objects_early_init(void); -extern void debug_objects_mem_init(void); -#else -static inline void -debug_object_init (void *addr, struct debug_obj_descr *descr) { } -static inline void -debug_object_init_on_stack(void *addr, struct debug_obj_descr *descr) { } -static inline void -debug_object_activate (void *addr, struct debug_obj_descr *descr) { } -static inline void -debug_object_deactivate(void *addr, struct debug_obj_descr *descr) { } -static inline void -debug_object_destroy (void *addr, struct debug_obj_descr *descr) { } -static inline void -debug_object_free (void *addr, struct debug_obj_descr *descr) { } - -static inline void debug_objects_early_init(void) { } -static inline void debug_objects_mem_init(void) { } -#endif - -#ifdef CONFIG_DEBUG_OBJECTS_FREE -extern void debug_check_no_obj_freed(const void *address, unsigned long size); -#else -static inline void -debug_check_no_obj_freed(const void *address, unsigned long size) { } -#endif - -#endif diff --git a/trunk/include/linux/device-mapper.h b/trunk/include/linux/device-mapper.h index 0d8d419d191a..ad3b787479a4 100644 --- a/trunk/include/linux/device-mapper.h +++ b/trunk/include/linux/device-mapper.h @@ -8,6 +8,8 @@ #ifndef _LINUX_DEVICE_MAPPER_H #define _LINUX_DEVICE_MAPPER_H +#ifdef __KERNEL__ + #include struct dm_target; @@ -342,4 +344,5 @@ static inline unsigned long to_bytes(sector_t n) return (n << SECTOR_SHIFT); } +#endif /* __KERNEL__ */ #endif /* _LINUX_DEVICE_MAPPER_H */ diff --git a/trunk/include/linux/devpts_fs.h b/trunk/include/linux/devpts_fs.h index 154769cad3f3..b672ddc00735 100644 --- a/trunk/include/linux/devpts_fs.h +++ b/trunk/include/linux/devpts_fs.h @@ -17,8 +17,6 @@ #ifdef CONFIG_UNIX98_PTYS -int devpts_new_index(void); -void devpts_kill_index(int idx); int devpts_pty_new(struct tty_struct *tty); /* mknod in devpts */ struct tty_struct *devpts_get_tty(int number); /* get tty structure */ void devpts_pty_kill(int number); /* unlink */ @@ -26,8 +24,6 @@ void devpts_pty_kill(int number); /* unlink */ #else /* Dummy stubs in the no-pty case */ -static inline int devpts_new_index(void) { return -EINVAL; } -static inline void devpts_kill_index(int idx) { } static inline int devpts_pty_new(struct tty_struct *tty) { return -EINVAL; } static inline struct tty_struct *devpts_get_tty(int number) { return NULL; } static inline void devpts_pty_kill(int number) { } diff --git a/trunk/include/linux/eventfd.h b/trunk/include/linux/eventfd.h index a701399b7fed..b489fc6d0b62 100644 --- a/trunk/include/linux/eventfd.h +++ b/trunk/include/linux/eventfd.h @@ -8,6 +8,9 @@ #ifndef _LINUX_EVENTFD_H #define _LINUX_EVENTFD_H + +#ifdef __KERNEL__ + #ifdef CONFIG_EVENTFD struct file *eventfd_fget(int fd); @@ -21,5 +24,7 @@ static inline int eventfd_signal(struct file *file, int n) #endif /* CONFIG_EVENTFD */ +#endif /* __KERNEL__ */ + #endif /* _LINUX_EVENTFD_H */ diff --git a/trunk/include/linux/fsl_devices.h b/trunk/include/linux/fsl_devices.h index c415a496de3a..2cad5c67397e 100644 --- a/trunk/include/linux/fsl_devices.h +++ b/trunk/include/linux/fsl_devices.h @@ -14,6 +14,7 @@ * option) any later version. */ +#ifdef __KERNEL__ #ifndef _FSL_DEVICE_H_ #define _FSL_DEVICE_H_ @@ -126,3 +127,4 @@ struct mpc8xx_pcmcia_ops { }; #endif /* _FSL_DEVICE_H_ */ +#endif /* __KERNEL__ */ diff --git a/trunk/include/linux/fsnotify.h b/trunk/include/linux/fsnotify.h index a89513188ce7..d4b7c4ac72e6 100644 --- a/trunk/include/linux/fsnotify.h +++ b/trunk/include/linux/fsnotify.h @@ -11,6 +11,8 @@ * (C) Copyright 2005 Robert Love */ +#ifdef __KERNEL__ + #include #include #include @@ -294,4 +296,6 @@ static inline void fsnotify_oldname_free(const char *old_name) #endif /* ! CONFIG_INOTIFY */ +#endif /* __KERNEL__ */ + #endif /* _LINUX_FS_NOTIFY_H */ diff --git a/trunk/include/linux/generic_serial.h b/trunk/include/linux/generic_serial.h index 110833666e37..5412da28fa47 100644 --- a/trunk/include/linux/generic_serial.h +++ b/trunk/include/linux/generic_serial.h @@ -78,7 +78,7 @@ struct gs_port { #define GS_DEBUG_WRITE 0x00000040 #ifdef __KERNEL__ -int gs_put_char(struct tty_struct *tty, unsigned char ch); +void gs_put_char(struct tty_struct *tty, unsigned char ch); int gs_write(struct tty_struct *tty, const unsigned char *buf, int count); int gs_write_room(struct tty_struct *tty); diff --git a/trunk/include/linux/hrtimer.h b/trunk/include/linux/hrtimer.h index 31a4d653389f..56f3236da829 100644 --- a/trunk/include/linux/hrtimer.h +++ b/trunk/include/linux/hrtimer.h @@ -266,21 +266,6 @@ extern ktime_t ktime_get_real(void); extern void hrtimer_init(struct hrtimer *timer, clockid_t which_clock, enum hrtimer_mode mode); -#ifdef CONFIG_DEBUG_OBJECTS_TIMERS -extern void hrtimer_init_on_stack(struct hrtimer *timer, clockid_t which_clock, - enum hrtimer_mode mode); - -extern void destroy_hrtimer_on_stack(struct hrtimer *timer); -#else -static inline void hrtimer_init_on_stack(struct hrtimer *timer, - clockid_t which_clock, - enum hrtimer_mode mode) -{ - hrtimer_init(timer, which_clock, mode); -} -static inline void destroy_hrtimer_on_stack(struct hrtimer *timer) { } -#endif - /* Basic timer operations: */ extern int hrtimer_start(struct hrtimer *timer, ktime_t tim, const enum hrtimer_mode mode); diff --git a/trunk/include/linux/hw_random.h b/trunk/include/linux/hw_random.h index 7244456e7e65..85d11916e9ea 100644 --- a/trunk/include/linux/hw_random.h +++ b/trunk/include/linux/hw_random.h @@ -11,6 +11,7 @@ #ifndef LINUX_HWRANDOM_H_ #define LINUX_HWRANDOM_H_ +#ifdef __KERNEL__ #include #include @@ -45,4 +46,5 @@ extern int hwrng_register(struct hwrng *rng); /** Unregister a Hardware Random Number Generator driver. */ extern void hwrng_unregister(struct hwrng *rng); +#endif /* __KERNEL__ */ #endif /* LINUX_HWRANDOM_H_ */ diff --git a/trunk/include/linux/i2o.h b/trunk/include/linux/i2o.h index 7d51cbca49ab..f65e58a1d925 100644 --- a/trunk/include/linux/i2o.h +++ b/trunk/include/linux/i2o.h @@ -18,6 +18,8 @@ #ifndef _I2O_H #define _I2O_H +#ifdef __KERNEL__ /* This file to be included by kernel only */ + #include /* How many different OSM's are we allowing */ @@ -1253,4 +1255,5 @@ extern void i2o_dump_message(struct i2o_message *); extern void i2o_dump_hrt(struct i2o_controller *c); extern void i2o_debug_state(struct i2o_controller *c); +#endif /* __KERNEL__ */ #endif /* _I2O_H */ diff --git a/trunk/include/linux/if_macvlan.h b/trunk/include/linux/if_macvlan.h index 5f200bac3749..0d9d7ea2c1cc 100644 --- a/trunk/include/linux/if_macvlan.h +++ b/trunk/include/linux/if_macvlan.h @@ -1,6 +1,9 @@ #ifndef _LINUX_IF_MACVLAN_H #define _LINUX_IF_MACVLAN_H +#ifdef __KERNEL__ + extern struct sk_buff *(*macvlan_handle_frame_hook)(struct sk_buff *); +#endif /* __KERNEL__ */ #endif /* _LINUX_IF_MACVLAN_H */ diff --git a/trunk/include/linux/inet.h b/trunk/include/linux/inet.h index 1354080cf8cf..675a7dbe86f8 100644 --- a/trunk/include/linux/inet.h +++ b/trunk/include/linux/inet.h @@ -42,9 +42,11 @@ #ifndef _LINUX_INET_H #define _LINUX_INET_H +#ifdef __KERNEL__ #include extern __be32 in_aton(const char *str); extern int in4_pton(const char *src, int srclen, u8 *dst, int delim, const char **end); extern int in6_pton(const char *src, int srclen, u8 *dst, int delim, const char **end); +#endif #endif /* _LINUX_INET_H */ diff --git a/trunk/include/linux/isicom.h b/trunk/include/linux/isicom.h index bbd42197298f..8f4c71759d73 100644 --- a/trunk/include/linux/isicom.h +++ b/trunk/include/linux/isicom.h @@ -1,6 +1,11 @@ #ifndef _LINUX_ISICOM_H #define _LINUX_ISICOM_H +/*#define ISICOM_DEBUG*/ +/*#define ISICOM_DEBUG_DTR_RTS*/ + +#ifdef __KERNEL__ + #define YES 1 #define NO 0 @@ -80,4 +85,6 @@ #define ISI_TXOK 0x0001 +#endif /* __KERNEL__ */ + #endif /* ISICOM_H */ diff --git a/trunk/include/linux/kernel.h b/trunk/include/linux/kernel.h index 4d46e299afb5..53839ba265ec 100644 --- a/trunk/include/linux/kernel.h +++ b/trunk/include/linux/kernel.h @@ -338,90 +338,33 @@ extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, #endif /* __LITTLE_ENDIAN */ /* - * min()/max()/clamp() macros that also do + * min()/max() macros that also do * strict type-checking.. See the * "unnecessary" pointer comparison. */ -#define min(x, y) ({ \ - typeof(x) _min1 = (x); \ - typeof(y) _min2 = (y); \ - (void) (&_min1 == &_min2); \ - _min1 < _min2 ? _min1 : _min2; }) - -#define max(x, y) ({ \ - typeof(x) _max1 = (x); \ - typeof(y) _max2 = (y); \ - (void) (&_max1 == &_max2); \ - _max1 > _max2 ? _max1 : _max2; }) - -/** - * clamp - return a value clamped to a given range with strict typechecking - * @val: current value - * @min: minimum allowable value - * @max: maximum allowable value - * - * This macro does strict typechecking of min/max to make sure they are of the - * same type as val. See the unnecessary pointer comparisons. - */ -#define clamp(val, min, max) ({ \ - typeof(val) __val = (val); \ - typeof(min) __min = (min); \ - typeof(max) __max = (max); \ - (void) (&__val == &__min); \ - (void) (&__val == &__max); \ - __val = __val < __min ? __min: __val; \ - __val > __max ? __max: __val; }) +#define min(x,y) ({ \ + typeof(x) _x = (x); \ + typeof(y) _y = (y); \ + (void) (&_x == &_y); \ + _x < _y ? _x : _y; }) + +#define max(x,y) ({ \ + typeof(x) _x = (x); \ + typeof(y) _y = (y); \ + (void) (&_x == &_y); \ + _x > _y ? _x : _y; }) /* * ..and if you can't take the strict * types, you can specify one yourself. * - * Or not use min/max/clamp at all, of course. - */ -#define min_t(type, x, y) ({ \ - type __min1 = (x); \ - type __min2 = (y); \ - __min1 < __min2 ? __min1: __min2; }) - -#define max_t(type, x, y) ({ \ - type __max1 = (x); \ - type __max2 = (y); \ - __max1 > __max2 ? __max1: __max2; }) - -/** - * clamp_t - return a value clamped to a given range using a given type - * @type: the type of variable to use - * @val: current value - * @min: minimum allowable value - * @max: maximum allowable value - * - * This macro does no typechecking and uses temporary variables of type - * 'type' to make all the comparisons. + * Or not use min/max at all, of course. */ -#define clamp_t(type, val, min, max) ({ \ - type __val = (val); \ - type __min = (min); \ - type __max = (max); \ - __val = __val < __min ? __min: __val; \ - __val > __max ? __max: __val; }) +#define min_t(type,x,y) \ + ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; }) +#define max_t(type,x,y) \ + ({ type __x = (x); type __y = (y); __x > __y ? __x: __y; }) -/** - * clamp_val - return a value clamped to a given range using val's type - * @val: current value - * @min: minimum allowable value - * @max: maximum allowable value - * - * This macro does no typechecking and uses temporary variables of whatever - * type the input argument 'val' is. This is useful when val is an unsigned - * type and min and max are literals that will otherwise be assigned a signed - * integer type. - */ -#define clamp_val(val, min, max) ({ \ - typeof(val) __val = (val); \ - typeof(val) __min = (min); \ - typeof(val) __max = (max); \ - __val = __val < __min ? __min: __val; \ - __val > __max ? __max: __val; }) /** * container_of - cast a member of a structure out to the containing structure diff --git a/trunk/include/linux/kfifo.h b/trunk/include/linux/kfifo.h index 29f62e1733ff..404f4464cb1a 100644 --- a/trunk/include/linux/kfifo.h +++ b/trunk/include/linux/kfifo.h @@ -21,6 +21,8 @@ #ifndef _LINUX_KFIFO_H #define _LINUX_KFIFO_H +#ifdef __KERNEL__ + #include #include @@ -149,4 +151,7 @@ static inline unsigned int kfifo_len(struct kfifo *fifo) return ret; } +#else +#warning "don't include kernel headers in userspace" +#endif /* __KERNEL__ */ #endif diff --git a/trunk/include/linux/kobj_map.h b/trunk/include/linux/kobj_map.h index 73717ed9ea79..bafe178a381f 100644 --- a/trunk/include/linux/kobj_map.h +++ b/trunk/include/linux/kobj_map.h @@ -1,3 +1,5 @@ +#ifdef __KERNEL__ + #include typedef struct kobject *kobj_probe_t(dev_t, int *, void *); @@ -8,3 +10,5 @@ int kobj_map(struct kobj_map *, dev_t, unsigned long, struct module *, void kobj_unmap(struct kobj_map *, dev_t, unsigned long); struct kobject *kobj_lookup(struct kobj_map *, dev_t, int *); struct kobj_map *kobj_map_init(kobj_probe_t *, struct mutex *); + +#endif diff --git a/trunk/include/linux/kobject.h b/trunk/include/linux/kobject.h index 39e709f88aa0..caa3f411f15d 100644 --- a/trunk/include/linux/kobject.h +++ b/trunk/include/linux/kobject.h @@ -16,6 +16,8 @@ #ifndef _KOBJECT_H_ #define _KOBJECT_H_ +#ifdef __KERNEL__ + #include #include #include @@ -222,4 +224,5 @@ static inline int kobject_action_type(const char *buf, size_t count, { return -EINVAL; } #endif +#endif /* __KERNEL__ */ #endif /* _KOBJECT_H_ */ diff --git a/trunk/include/linux/kref.h b/trunk/include/linux/kref.h index 0cef6badd6fb..5d185635786e 100644 --- a/trunk/include/linux/kref.h +++ b/trunk/include/linux/kref.h @@ -15,6 +15,8 @@ #ifndef _KREF_H_ #define _KREF_H_ +#ifdef __KERNEL__ + #include #include @@ -27,4 +29,5 @@ void kref_init(struct kref *kref); void kref_get(struct kref *kref); int kref_put(struct kref *kref, void (*release) (struct kref *kref)); +#endif /* __KERNEL__ */ #endif /* _KREF_H_ */ diff --git a/trunk/include/linux/list.h b/trunk/include/linux/list.h index 08cf4f651889..7627508f1b74 100644 --- a/trunk/include/linux/list.h +++ b/trunk/include/linux/list.h @@ -1,6 +1,8 @@ #ifndef _LINUX_LIST_H #define _LINUX_LIST_H +#ifdef __KERNEL__ + #include #include #include @@ -981,4 +983,7 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev, ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ pos = rcu_dereference(pos->next)) +#else +#warning "don't include kernel headers in userspace" +#endif /* __KERNEL__ */ #endif diff --git a/trunk/include/linux/mmzone.h b/trunk/include/linux/mmzone.h index c463cd8a15a4..aad98003176f 100644 --- a/trunk/include/linux/mmzone.h +++ b/trunk/include/linux/mmzone.h @@ -1,6 +1,7 @@ #ifndef _LINUX_MMZONE_H #define _LINUX_MMZONE_H +#ifdef __KERNEL__ #ifndef __ASSEMBLY__ #ifndef __GENERATING_BOUNDS_H @@ -96,7 +97,6 @@ enum zone_stat_item { NR_UNSTABLE_NFS, /* NFS unstable pages */ NR_BOUNCE, NR_VMSCAN_WRITE, - NR_WRITEBACK_TEMP, /* Writeback using temporary buffers */ #ifdef CONFIG_NUMA NUMA_HIT, /* allocated in intended node */ NUMA_MISS, /* allocated in non intended node */ @@ -1004,4 +1004,5 @@ unsigned long __init node_memmap_size_bytes(int, unsigned long, unsigned long); #endif /* !__GENERATING_BOUNDS.H */ #endif /* !__ASSEMBLY__ */ +#endif /* __KERNEL__ */ #endif /* _LINUX_MMZONE_H */ diff --git a/trunk/include/linux/mount.h b/trunk/include/linux/mount.h index 4374d1adeb4b..b4836d58f428 100644 --- a/trunk/include/linux/mount.h +++ b/trunk/include/linux/mount.h @@ -10,6 +10,7 @@ */ #ifndef _LINUX_MOUNT_H #define _LINUX_MOUNT_H +#ifdef __KERNEL__ #include #include @@ -113,4 +114,5 @@ extern void mark_mounts_for_expiry(struct list_head *mounts); extern spinlock_t vfsmount_lock; extern dev_t name_to_dev_t(char *name); +#endif #endif /* _LINUX_MOUNT_H */ diff --git a/trunk/include/linux/ncp_fs_i.h b/trunk/include/linux/ncp_fs_i.h index 4b0bec477846..bdb4c8ae6924 100644 --- a/trunk/include/linux/ncp_fs_i.h +++ b/trunk/include/linux/ncp_fs_i.h @@ -8,6 +8,8 @@ #ifndef _LINUX_NCP_FS_I #define _LINUX_NCP_FS_I +#ifdef __KERNEL__ + /* * This is the ncpfs part of the inode structure. This must contain * all the information we need to work with an inode after creation. @@ -26,4 +28,6 @@ struct ncp_inode_info { struct inode vfs_inode; }; +#endif /* __KERNEL__ */ + #endif /* _LINUX_NCP_FS_I */ diff --git a/trunk/include/linux/of_device.h b/trunk/include/linux/of_device.h index afe338217d91..6dc11959770c 100644 --- a/trunk/include/linux/of_device.h +++ b/trunk/include/linux/of_device.h @@ -1,5 +1,6 @@ #ifndef _LINUX_OF_DEVICE_H #define _LINUX_OF_DEVICE_H +#ifdef __KERNEL__ #include #include @@ -24,4 +25,5 @@ static inline void of_device_free(struct of_device *dev) of_release_dev(&dev->dev); } +#endif /* __KERNEL__ */ #endif /* _LINUX_OF_DEVICE_H */ diff --git a/trunk/include/linux/pid.h b/trunk/include/linux/pid.h index c21c7e8124a7..c7980810eb09 100644 --- a/trunk/include/linux/pid.h +++ b/trunk/include/linux/pid.h @@ -60,7 +60,7 @@ struct pid /* lists of tasks that use this pid */ struct hlist_head tasks[PIDTYPE_MAX]; struct rcu_head rcu; - unsigned int level; + int level; struct upid numbers[1]; }; @@ -89,11 +89,9 @@ extern struct pid *get_task_pid(struct task_struct *task, enum pid_type type); * attach_pid() and detach_pid() must be called with the tasklist_lock * write-held. */ -extern void attach_pid(struct task_struct *task, enum pid_type type, - struct pid *pid); +extern int attach_pid(struct task_struct *task, enum pid_type type, + struct pid *pid); extern void detach_pid(struct task_struct *task, enum pid_type); -extern void change_pid(struct task_struct *task, enum pid_type, - struct pid *pid); extern void transfer_pid(struct task_struct *old, struct task_struct *new, enum pid_type); diff --git a/trunk/include/linux/pid_namespace.h b/trunk/include/linux/pid_namespace.h index caff5283d15c..fcd61fa2c833 100644 --- a/trunk/include/linux/pid_namespace.h +++ b/trunk/include/linux/pid_namespace.h @@ -20,7 +20,7 @@ struct pid_namespace { int last_pid; struct task_struct *child_reaper; struct kmem_cache *pid_cachep; - unsigned int level; + int level; struct pid_namespace *parent; #ifdef CONFIG_PROC_FS struct vfsmount *proc_mnt; diff --git a/trunk/include/linux/pm.h b/trunk/include/linux/pm.h index 39a7ee859b67..1de72cbbe0d1 100644 --- a/trunk/include/linux/pm.h +++ b/trunk/include/linux/pm.h @@ -21,6 +21,8 @@ #ifndef _LINUX_PM_H #define _LINUX_PM_H +#ifdef __KERNEL__ + #include #include #include @@ -223,4 +225,6 @@ extern unsigned int pm_flags; #define PM_APM 1 #define PM_ACPI 2 +#endif /* __KERNEL__ */ + #endif /* _LINUX_PM_H */ diff --git a/trunk/include/linux/pnp.h b/trunk/include/linux/pnp.h index 2f3bcf73052c..b2f05c230f4b 100644 --- a/trunk/include/linux/pnp.h +++ b/trunk/include/linux/pnp.h @@ -6,6 +6,8 @@ #ifndef _LINUX_PNP_H #define _LINUX_PNP_H +#ifdef __KERNEL__ + #include #include #include @@ -464,4 +466,6 @@ static inline void pnp_unregister_driver(struct pnp_driver *drv) { } #define pnp_dbg(format, arg...) do {} while (0) #endif +#endif /* __KERNEL__ */ + #endif /* _LINUX_PNP_H */ diff --git a/trunk/include/linux/poison.h b/trunk/include/linux/poison.h index 9f31683728fd..a9c31be7052c 100644 --- a/trunk/include/linux/poison.h +++ b/trunk/include/linux/poison.h @@ -10,13 +10,6 @@ #define LIST_POISON1 ((void *) 0x00100100) #define LIST_POISON2 ((void *) 0x00200200) -/********** include/linux/timer.h **********/ -/* - * Magic number "tsta" to indicate a static timer initializer - * for the object debugging code. - */ -#define TIMER_ENTRY_STATIC ((void *) 0x74737461) - /********** mm/slab.c **********/ /* * Magic nums for obj red zoning. diff --git a/trunk/include/linux/profile.h b/trunk/include/linux/profile.h index 05c1cc736937..ff576d1db67d 100644 --- a/trunk/include/linux/profile.h +++ b/trunk/include/linux/profile.h @@ -1,6 +1,8 @@ #ifndef _LINUX_PROFILE_H #define _LINUX_PROFILE_H +#ifdef __KERNEL__ + #include #include #include @@ -116,4 +118,6 @@ static inline void unregister_timer_hook(int (*hook)(struct pt_regs *)) #endif /* CONFIG_PROFILING */ +#endif /* __KERNEL__ */ + #endif /* _LINUX_PROFILE_H */ diff --git a/trunk/include/linux/proportions.h b/trunk/include/linux/proportions.h index 5afc1b23346d..2c3b3cad92be 100644 --- a/trunk/include/linux/proportions.h +++ b/trunk/include/linux/proportions.h @@ -77,19 +77,6 @@ void prop_inc_percpu(struct prop_descriptor *pd, struct prop_local_percpu *pl) local_irq_restore(flags); } -/* - * Limit the time part in order to ensure there are some bits left for the - * cycle counter and fraction multiply. - */ -#define PROP_MAX_SHIFT (3*BITS_PER_LONG/4) - -#define PROP_FRAC_SHIFT (BITS_PER_LONG - PROP_MAX_SHIFT - 1) -#define PROP_FRAC_BASE (1UL << PROP_FRAC_SHIFT) - -void __prop_inc_percpu_max(struct prop_descriptor *pd, - struct prop_local_percpu *pl, long frac); - - /* * ----- SINGLE ------ */ diff --git a/trunk/include/linux/ptrace.h b/trunk/include/linux/ptrace.h index f98501ba557e..ebe0c17039cf 100644 --- a/trunk/include/linux/ptrace.h +++ b/trunk/include/linux/ptrace.h @@ -98,10 +98,6 @@ extern void ptrace_untrace(struct task_struct *child); extern int ptrace_may_attach(struct task_struct *task); extern int __ptrace_may_attach(struct task_struct *task); -static inline int ptrace_reparented(struct task_struct *child) -{ - return child->real_parent != child->parent; -} static inline void ptrace_link(struct task_struct *child, struct task_struct *new_parent) { diff --git a/trunk/include/linux/raid/md.h b/trunk/include/linux/raid/md.h index 81a1a02d4566..8ab630b67fcc 100644 --- a/trunk/include/linux/raid/md.h +++ b/trunk/include/linux/raid/md.h @@ -94,7 +94,6 @@ extern int sync_page_io(struct block_device *bdev, sector_t sector, int size, extern void md_do_sync(mddev_t *mddev); extern void md_new_event(mddev_t *mddev); extern void md_allow_write(mddev_t *mddev); -extern void md_wait_for_blocked_rdev(mdk_rdev_t *rdev, mddev_t *mddev); #endif /* CONFIG_MD */ #endif diff --git a/trunk/include/linux/raid/md_k.h b/trunk/include/linux/raid/md_k.h index 812ffa590cff..7bb6d1abf71e 100644 --- a/trunk/include/linux/raid/md_k.h +++ b/trunk/include/linux/raid/md_k.h @@ -84,10 +84,6 @@ struct mdk_rdev_s #define AllReserved 6 /* If whole device is reserved for * one array */ #define AutoDetected 7 /* added by auto-detect */ -#define Blocked 8 /* An error occured on an externally - * managed array, don't allow writes - * until it is cleared */ - wait_queue_head_t blocked_wait; int desc_nr; /* descriptor index in the superblock */ int raid_disk; /* role of device in array */ diff --git a/trunk/include/linux/rcuclassic.h b/trunk/include/linux/rcuclassic.h index b3aa05baab8a..b3dccd68629e 100644 --- a/trunk/include/linux/rcuclassic.h +++ b/trunk/include/linux/rcuclassic.h @@ -33,6 +33,8 @@ #ifndef __LINUX_RCUCLASSIC_H #define __LINUX_RCUCLASSIC_H +#ifdef __KERNEL__ + #include #include #include @@ -161,4 +163,5 @@ extern long rcu_batches_completed_bh(void); #define rcu_enter_nohz() do { } while (0) #define rcu_exit_nohz() do { } while (0) +#endif /* __KERNEL__ */ #endif /* __LINUX_RCUCLASSIC_H */ diff --git a/trunk/include/linux/rcupdate.h b/trunk/include/linux/rcupdate.h index 8082d6587a0f..37a642c54871 100644 --- a/trunk/include/linux/rcupdate.h +++ b/trunk/include/linux/rcupdate.h @@ -33,6 +33,8 @@ #ifndef __LINUX_RCUPDATE_H #define __LINUX_RCUPDATE_H +#ifdef __KERNEL__ + #include #include #include @@ -243,4 +245,5 @@ extern long rcu_batches_completed_bh(void); extern void rcu_init(void); extern int rcu_needs_cpu(int cpu); +#endif /* __KERNEL__ */ #endif /* __LINUX_RCUPDATE_H */ diff --git a/trunk/include/linux/rcupreempt.h b/trunk/include/linux/rcupreempt.h index 8a05c7e20bc4..d038aa6e5ee1 100644 --- a/trunk/include/linux/rcupreempt.h +++ b/trunk/include/linux/rcupreempt.h @@ -33,6 +33,8 @@ #ifndef __LINUX_RCUPREEMPT_H #define __LINUX_RCUPREEMPT_H +#ifdef __KERNEL__ + #include #include #include @@ -102,4 +104,5 @@ static inline void rcu_exit_nohz(void) #define rcu_exit_nohz() do { } while (0) #endif /* CONFIG_NO_HZ */ +#endif /* __KERNEL__ */ #endif /* __LINUX_RCUPREEMPT_H */ diff --git a/trunk/include/linux/rcupreempt_trace.h b/trunk/include/linux/rcupreempt_trace.h index b99ae073192a..21cd6b2a5c42 100644 --- a/trunk/include/linux/rcupreempt_trace.h +++ b/trunk/include/linux/rcupreempt_trace.h @@ -32,6 +32,7 @@ #ifndef __LINUX_RCUPREEMPT_TRACE_H #define __LINUX_RCUPREEMPT_TRACE_H +#ifdef __KERNEL__ #include #include @@ -94,4 +95,5 @@ extern void rcupreempt_trace_done_remove(struct rcupreempt_trace *trace); extern void rcupreempt_trace_invoke(struct rcupreempt_trace *trace); extern void rcupreempt_trace_next_add(struct rcupreempt_trace *trace); +#endif /* __KERNEL__ */ #endif /* __LINUX_RCUPREEMPT_TRACE_H */ diff --git a/trunk/include/linux/reiserfs_fs_sb.h b/trunk/include/linux/reiserfs_fs_sb.h index 336ee43ed7d8..db5ef9b83c3f 100644 --- a/trunk/include/linux/reiserfs_fs_sb.h +++ b/trunk/include/linux/reiserfs_fs_sb.h @@ -177,6 +177,7 @@ struct reiserfs_journal { struct reiserfs_journal_cnode *j_last; /* newest journal block */ struct reiserfs_journal_cnode *j_first; /* oldest journal block. start here for traverse */ + struct file *j_dev_file; struct block_device *j_dev_bd; int j_1st_reserved_block; /* first block on s_dev of reserved area journal */ diff --git a/trunk/include/linux/rio.h b/trunk/include/linux/rio.h index c1c99c9643d3..cfb66bbc0f27 100644 --- a/trunk/include/linux/rio.h +++ b/trunk/include/linux/rio.h @@ -14,6 +14,8 @@ #ifndef LINUX_RIO_H #define LINUX_RIO_H +#ifdef __KERNEL__ + #include #include #include @@ -329,4 +331,5 @@ extern void rio_close_inb_mbox(struct rio_mport *, int); extern int rio_open_outb_mbox(struct rio_mport *, void *, int, int); extern void rio_close_outb_mbox(struct rio_mport *, int); +#endif /* __KERNEL__ */ #endif /* LINUX_RIO_H */ diff --git a/trunk/include/linux/rio_drv.h b/trunk/include/linux/rio_drv.h index 90987b7bcc1b..7adb2a1aac92 100644 --- a/trunk/include/linux/rio_drv.h +++ b/trunk/include/linux/rio_drv.h @@ -13,6 +13,8 @@ #ifndef LINUX_RIO_DRV_H #define LINUX_RIO_DRV_H +#ifdef __KERNEL__ + #include #include #include @@ -463,4 +465,5 @@ extern struct rio_dev *rio_get_device(u16 vid, u16 did, struct rio_dev *from); extern struct rio_dev *rio_get_asm(u16 vid, u16 did, u16 asm_vid, u16 asm_did, struct rio_dev *from); +#endif /* __KERNEL__ */ #endif /* LINUX_RIO_DRV_H */ diff --git a/trunk/include/linux/rwsem.h b/trunk/include/linux/rwsem.h index efd348fe8ca7..7b524b4109a0 100644 --- a/trunk/include/linux/rwsem.h +++ b/trunk/include/linux/rwsem.h @@ -9,6 +9,8 @@ #include +#ifdef __KERNEL__ + #include #include #include @@ -88,4 +90,5 @@ extern void up_read_non_owner(struct rw_semaphore *sem); # define up_read_non_owner(sem) up_read(sem) #endif +#endif /* __KERNEL__ */ #endif /* _LINUX_RWSEM_H */ diff --git a/trunk/include/linux/sched.h b/trunk/include/linux/sched.h index 03c238088aee..1d02babdb2c7 100644 --- a/trunk/include/linux/sched.h +++ b/trunk/include/linux/sched.h @@ -554,14 +554,6 @@ struct signal_struct { #define SIGNAL_STOP_DEQUEUED 0x00000002 /* stop signal dequeued */ #define SIGNAL_STOP_CONTINUED 0x00000004 /* SIGCONT since WCONTINUED reap */ #define SIGNAL_GROUP_EXIT 0x00000008 /* group exit in progress */ -/* - * Pending notifications to parent. - */ -#define SIGNAL_CLD_STOPPED 0x00000010 -#define SIGNAL_CLD_CONTINUED 0x00000020 -#define SIGNAL_CLD_MASK (SIGNAL_CLD_STOPPED|SIGNAL_CLD_CONTINUED) - -#define SIGNAL_UNKILLABLE 0x00000040 /* for init: ignore fatal signals */ /* If true, all threads except ->group_exit_task have pending SIGKILL */ static inline int signal_group_exit(const struct signal_struct *sig) @@ -1175,7 +1167,7 @@ struct task_struct { struct sighand_struct *sighand; sigset_t blocked, real_blocked; - sigset_t saved_sigmask; /* restored if set_restore_sigmask() was used */ + sigset_t saved_sigmask; /* To be restored with TIF_RESTORE_SIGMASK */ struct sigpending pending; unsigned long sas_ss_sp; @@ -1677,10 +1669,7 @@ extern struct pid_namespace init_pid_ns; extern struct task_struct *find_task_by_pid_type_ns(int type, int pid, struct pid_namespace *ns); -static inline struct task_struct *__deprecated find_task_by_pid(pid_t nr) -{ - return find_task_by_pid_type_ns(PIDTYPE_PID, nr, &init_pid_ns); -} +extern struct task_struct *find_task_by_pid(pid_t nr); extern struct task_struct *find_task_by_vpid(pid_t nr); extern struct task_struct *find_task_by_pid_ns(pid_t nr, struct pid_namespace *ns); @@ -1756,7 +1745,8 @@ extern void zap_other_threads(struct task_struct *p); extern int kill_proc(pid_t, int, int); extern struct sigqueue *sigqueue_alloc(void); extern void sigqueue_free(struct sigqueue *); -extern int send_sigqueue(struct sigqueue *, struct task_struct *, int group); +extern int send_sigqueue(int, struct sigqueue *, struct task_struct *); +extern int send_group_sigqueue(int, struct sigqueue *, struct task_struct *); extern int do_sigaction(int, struct k_sigaction *, struct k_sigaction *); extern int do_sigaltstack(const stack_t __user *, stack_t __user *, unsigned long); diff --git a/trunk/include/linux/seq_file.h b/trunk/include/linux/seq_file.h index a66304a09955..5b5369c3c209 100644 --- a/trunk/include/linux/seq_file.h +++ b/trunk/include/linux/seq_file.h @@ -1,5 +1,6 @@ #ifndef _LINUX_SEQ_FILE_H #define _LINUX_SEQ_FILE_H +#ifdef __KERNEL__ #include #include @@ -68,3 +69,4 @@ extern struct list_head *seq_list_next(void *v, struct list_head *head, loff_t *ppos); #endif +#endif diff --git a/trunk/include/linux/serial_core.h b/trunk/include/linux/serial_core.h index d32123ae08ad..7cb094a82456 100644 --- a/trunk/include/linux/serial_core.h +++ b/trunk/include/linux/serial_core.h @@ -149,15 +149,13 @@ /* Freescale ColdFire */ #define PORT_MCF 78 -/* Blackfin SPORT */ -#define PORT_BFIN_SPORT 79 +#define PORT_SC26XX 79 + /* MN10300 on-chip UART numbers */ #define PORT_MN10300 80 #define PORT_MN10300_CTS 81 -#define PORT_SC26XX 82 - #ifdef __KERNEL__ #include diff --git a/trunk/include/linux/signal.h b/trunk/include/linux/signal.h index 84f997f8aa53..42d2e0a948f4 100644 --- a/trunk/include/linux/signal.h +++ b/trunk/include/linux/signal.h @@ -362,6 +362,8 @@ int unhandled_signal(struct task_struct *tsk, int sig); #define sig_kernel_stop(sig) \ (((sig) < SIGRTMIN) && siginmask(sig, SIG_KERNEL_STOP_MASK)) +#define sig_needs_tasklist(sig) ((sig) == SIGCONT) + #define sig_user_defined(t, signr) \ (((t)->sighand->action[(signr)-1].sa.sa_handler != SIG_DFL) && \ ((t)->sighand->action[(signr)-1].sa.sa_handler != SIG_IGN)) diff --git a/trunk/include/linux/slab.h b/trunk/include/linux/slab.h index 805ed4b92f9a..f62caaad94e0 100644 --- a/trunk/include/linux/slab.h +++ b/trunk/include/linux/slab.h @@ -9,6 +9,8 @@ #ifndef _LINUX_SLAB_H #define _LINUX_SLAB_H +#ifdef __KERNEL__ + #include #include @@ -27,13 +29,6 @@ #define SLAB_MEM_SPREAD 0x00100000UL /* Spread some memory over cpuset */ #define SLAB_TRACE 0x00200000UL /* Trace allocations and frees */ -/* Flag to prevent checks on free */ -#ifdef CONFIG_DEBUG_OBJECTS -# define SLAB_DEBUG_OBJECTS 0x00400000UL -#else -# define SLAB_DEBUG_OBJECTS 0x00000000UL -#endif - /* The following flags affect the page allocator grouping pages by mobility */ #define SLAB_RECLAIM_ACCOUNT 0x00020000UL /* Objects are reclaimable */ #define SLAB_TEMPORARY SLAB_RECLAIM_ACCOUNT /* Objects are short-lived */ @@ -281,4 +276,5 @@ extern const struct seq_operations slabinfo_op; ssize_t slabinfo_write(struct file *, const char __user *, size_t, loff_t *); #endif +#endif /* __KERNEL__ */ #endif /* _LINUX_SLAB_H */ diff --git a/trunk/include/linux/smb_fs_i.h b/trunk/include/linux/smb_fs_i.h index 8ccf4eca2c3d..8516954a5141 100644 --- a/trunk/include/linux/smb_fs_i.h +++ b/trunk/include/linux/smb_fs_i.h @@ -9,6 +9,7 @@ #ifndef _LINUX_SMB_FS_I #define _LINUX_SMB_FS_I +#ifdef __KERNEL__ #include #include @@ -35,3 +36,4 @@ struct smb_inode_info { }; #endif +#endif diff --git a/trunk/include/linux/smb_fs_sb.h b/trunk/include/linux/smb_fs_sb.h index 8a060a7040d8..3aa97aa4277f 100644 --- a/trunk/include/linux/smb_fs_sb.h +++ b/trunk/include/linux/smb_fs_sb.h @@ -9,6 +9,8 @@ #ifndef _SMB_FS_SB #define _SMB_FS_SB +#ifdef __KERNEL__ + #include #include @@ -94,4 +96,6 @@ smb_unlock_server(struct smb_sb_info *server) up(&(server->sem)); } +#endif /* __KERNEL__ */ + #endif diff --git a/trunk/include/linux/svga.h b/trunk/include/linux/svga.h index c59a51a2b0e7..13ad0b82ac28 100644 --- a/trunk/include/linux/svga.h +++ b/trunk/include/linux/svga.h @@ -1,6 +1,8 @@ #ifndef _LINUX_SVGA_H #define _LINUX_SVGA_H +#ifdef __KERNEL__ + #include #include