diff options
| author | Greg Kroah-Hartman <gregkh@suse.de> | 2010-01-14 16:37:28 -0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-01-14 16:37:28 -0800 |
| commit | a98ef66c6d23dd766add36dd61b1932df918e3ff (patch) | |
| tree | 9ea7035a8fe0b48ce1d0b2f5a77217302ad0f70d | |
| parent | 11292ee984869853ed5b86a032f6ef4ad2ae2a85 (diff) | |
| download | patches-a98ef66c6d23dd766add36dd61b1932df918e3ff.tar.gz | |
usb build fix and staging patches
25 files changed, 2820 insertions, 1 deletions
@@ -34,6 +34,7 @@ usb.current/usb-add-speed-values-for-usb-3.0-and-wireless-controllers.patch ################################# staging.current/staging-asus_oled-fix-oops-in-2.6.32.2.patch staging.current/staging-hv-fix-smp-problems-in-the-hyperv-core-code.patch +staging.current/staging-et131x-fix-2.6.33rc1-regression-in-et131x.patch ##################################################################### @@ -254,3 +255,27 @@ staging/staging-hv-remove-unneeded-onhostreset-callback.patch staging/staging-hv-remove-unneeded-onopen-callback.patch staging/staging-hv-remove-unneeded-onclose-callback.patch +staging/staging-dt3155-use-pci_get_device.patch +staging/staging-rt2870-rtusb_probe-should-be-in-section-__devinit.patch +staging/staging-rt2870-remove-unnecessary-forward-declarations.patch +staging/staging-rtl8192e-print-the-elements-of-tx_pn-and-rx_pn-not-the-arrays-themselves.patch +staging/staging-rtl8192e-remove-some-functions-from-the-__exit-section.patch +staging/staging-rtl8192su-rtl8192u-use-min_t-in-store_debug_level.patch +staging/staging-dt3155-remove-compat-code.patch +staging/staging-ramzswap-minor-spelling-fixes.patch +staging/staging-comedi-off-by-one-in-dodevconfig.patch +staging/staging-comedi-reorder-check-in-pcmmio_attach.patch +staging/staging-cx25821-fix-double-unlock-in-medusa_video_init.patch +staging/staging-cx25821-off-by-one-in-cx25821_enum_input.patch +staging/staging-otus-off-by-one-in-usbdrvwext_siwessid.patch +staging/staging-et131x_netdev.c-use-pm-to-shown-mac-address.patch +staging/staging-r8192e_core.c-use-pm-to-shown-mac-address.patch +staging/r8192u_core.c-use-pm-to-shown-mac-address.patch +staging/staging-vt6655-device_main.c-use-pm-to-shown-mac-address.patch +staging/staging-rtl8192su-buffer-overflow-in-r8192u_core.c.patch +staging/staging-rar-fix-all-coding-style-issues.patch +staging/staging-otus-80211core-fix-confusion.patch +staging/staging-sep-fix-build-problems-from-header-changes.patch +staging/staging-sep-fix-use-of-legacy-ioctl-fop.patch + + diff --git a/staging.current/staging-et131x-fix-2.6.33rc1-regression-in-et131x.patch b/staging.current/staging-et131x-fix-2.6.33rc1-regression-in-et131x.patch new file mode 100644 index 00000000000000..223193ab1775ac --- /dev/null +++ b/staging.current/staging-et131x-fix-2.6.33rc1-regression-in-et131x.patch @@ -0,0 +1,76 @@ +From alan@lxorguk.ukuu.org.uk Thu Jan 14 16:29:50 2010 +From: Alan Cox <alan@lxorguk.ukuu.org.uk> +Date: Wed, 6 Jan 2010 14:01:26 +0000 +Subject: Staging: et131x: Fix 2.6.33rc1 regression in et131x +To: torvalds@linux-foundation.org, netdev@vger.kernel.org, greg@kroah.com +Message-ID: <20100106140126.6f26ddde@lxorguk.ukuu.org.uk> + + + + +et131x: Fix 12bit wrapping + +From: Alan Cox <alan@linux.intel.com> + +The 12bit wrap logic conversion is wrong and this shows up for some +memory sizes and layouts of card. Patch it up for now, once the kernel +view of status is cleaned up it'll become two variables and a lot saner. + +Signed-off-by: Alan Cox <alan@linux.intel.com> +Cc: stable <stable@kernel.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/et131x/et1310_address_map.h | 16 ++++++++++++---- + drivers/staging/et131x/et1310_rx.c | 6 +++--- + 2 files changed, 15 insertions(+), 7 deletions(-) + +--- a/drivers/staging/et131x/et1310_address_map.h ++++ b/drivers/staging/et131x/et1310_address_map.h +@@ -203,11 +203,14 @@ typedef struct _GLOBAL_t { /* Location + * 9-0: pr ndes + */ + +-#define ET_DMA10_MASK 0x3FF /* 10 bit mask for DMA10W types */ +-#define ET_DMA10_WRAP 0x400 +-#define ET_DMA4_MASK 0x00F /* 4 bit mask for DMA4W types */ +-#define ET_DMA4_WRAP 0x010 ++#define ET_DMA12_MASK 0x0FFF /* 12 bit mask for DMA12W types */ ++#define ET_DMA12_WRAP 0x1000 ++#define ET_DMA10_MASK 0x03FF /* 10 bit mask for DMA10W types */ ++#define ET_DMA10_WRAP 0x0400 ++#define ET_DMA4_MASK 0x000F /* 4 bit mask for DMA4W types */ ++#define ET_DMA4_WRAP 0x0010 + ++#define INDEX12(x) ((x) & ET_DMA12_MASK) + #define INDEX10(x) ((x) & ET_DMA10_MASK) + #define INDEX4(x) ((x) & ET_DMA4_MASK) + +@@ -216,6 +219,11 @@ extern inline void add_10bit(u32 *v, int + *v = INDEX10(*v + n) | (*v & ET_DMA10_WRAP); + } + ++extern inline void add_12bit(u32 *v, int n) ++{ ++ *v = INDEX12(*v + n) | (*v & ET_DMA12_WRAP); ++} ++ + /* + * 10bit DMA with wrap + * txdma tx queue write address reg in txdma address map at 0x1010 +--- a/drivers/staging/et131x/et1310_rx.c ++++ b/drivers/staging/et131x/et1310_rx.c +@@ -831,10 +831,10 @@ PMP_RFD nic_rx_pkts(struct et131x_adapte + + /* Indicate that we have used this PSR entry. */ + /* FIXME wrap 12 */ +- rx_local->local_psr_full = (rx_local->local_psr_full + 1) & 0xFFF; +- if (rx_local->local_psr_full > rx_local->PsrNumEntries - 1) { ++ add_12bit(&rx_local->local_psr_full, 1); ++ if ((rx_local->local_psr_full & 0xFFF) > rx_local->PsrNumEntries - 1) { + /* Clear psr full and toggle the wrap bit */ +- rx_local->local_psr_full &= 0xFFF; ++ rx_local->local_psr_full &= ~0xFFF; + rx_local->local_psr_full ^= 0x1000; + } + diff --git a/staging/r8192u_core.c-use-pm-to-shown-mac-address.patch b/staging/r8192u_core.c-use-pm-to-shown-mac-address.patch new file mode 100644 index 00000000000000..2d81e6b2bb0821 --- /dev/null +++ b/staging/r8192u_core.c-use-pm-to-shown-mac-address.patch @@ -0,0 +1,47 @@ +From hartleys@visionengravers.com Thu Jan 14 16:26:38 2010 +From: "H Hartley Sweeten" <hartleys@visionengravers.com> +Date: Mon, 28 Dec 2009 19:33:17 -0500 +Subject: [PATCH] r8192U_core.c: use %pM to shown MAC address +To: <gregkh@suse.de> +Message-ID: <BD79186B4FD85F4B8E60E381CAEE19090200F4D6@mi8nycmail19.Mi8.com> + + +Trivial, use the %pM kernel extension to display the MAC address. + +Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/rtl8192su/r8192U_core.c | 14 ++++++-------- + 1 file changed, 6 insertions(+), 8 deletions(-) + +--- a/drivers/staging/rtl8192su/r8192U_core.c ++++ b/drivers/staging/rtl8192su/r8192U_core.c +@@ -3426,10 +3426,9 @@ rtl8192SU_ConfigAdapterInfo8192SForAutoL + write_nic_dword(dev, IDR0, ((u32*)dev->dev_addr)[0]); + write_nic_word(dev, IDR4, ((u16*)(dev->dev_addr + 4))[0]); + +- RT_TRACE(COMP_INIT, "ReadAdapterInfo8192SEFuse(), Permanent Address = %02x-%02x-%02x-%02x-%02x-%02x\n", +- dev->dev_addr[0], dev->dev_addr[1], +- dev->dev_addr[2], dev->dev_addr[3], +- dev->dev_addr[4], dev->dev_addr[5]); ++ RT_TRACE(COMP_INIT, ++ "ReadAdapterInfo8192SEFuse(), Permanent Address = %pM\n", ++ dev->dev_addr); + + priv->EEPROMBoardType = EEPROM_Default_BoardType; + priv->rf_type = RF_1T2R; //RF_2T2R +@@ -3767,10 +3766,9 @@ rtl8192SU_ReadAdapterInfo8192SUsb(struct + write_nic_dword(dev, IDR0, ((u32*)dev->dev_addr)[0]); + write_nic_word(dev, IDR4, ((u16*)(dev->dev_addr + 4))[0]); + +- RT_TRACE(COMP_INIT, "ReadAdapterInfo8192SEFuse(), Permanent Address = %02x-%02x-%02x-%02x-%02x-%02x\n", +- dev->dev_addr[0], dev->dev_addr[1], +- dev->dev_addr[2], dev->dev_addr[3], +- dev->dev_addr[4], dev->dev_addr[5]); ++ RT_TRACE(COMP_INIT, ++ "ReadAdapterInfo8192SEFuse(), Permanent Address = %pM\n", ++ dev->dev_addr); + + // + // Get CustomerID(Boad Type) diff --git a/staging/staging-comedi-off-by-one-in-dodevconfig.patch b/staging/staging-comedi-off-by-one-in-dodevconfig.patch new file mode 100644 index 00000000000000..bfc458c7be8a4f --- /dev/null +++ b/staging/staging-comedi-off-by-one-in-dodevconfig.patch @@ -0,0 +1,30 @@ +From error27@gmail.com Thu Jan 14 16:25:09 2010 +From: Dan Carpenter <error27@gmail.com> +Date: Mon, 28 Dec 2009 18:57:51 +0200 +Subject: Staging: comedi: off by one in doDevConfig() +To: Greg Kroah-Hartman <gregkh@suse.de> +Cc: devel@driverdev.osuosl.org, Ian Abbott <abbotti@mev.co.uk>, Frank Mori Hess <fmhess@users.sourceforge.net> +Message-ID: <20091228165751.GB17645@bicker> +Content-Disposition: inline + + +Changed > to >= to avoid array overflow. + +Signed-off-by: Dan Carpenter <error27@gmail.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/comedi/drivers/comedi_bond.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/staging/comedi/drivers/comedi_bond.c ++++ b/drivers/staging/comedi/drivers/comedi_bond.c +@@ -417,7 +417,7 @@ static int doDevConfig(struct comedi_dev + int sdev = -1, nchans, tmp; + struct BondedDevice *bdev = NULL; + +- if (minor < 0 || minor > COMEDI_NUM_BOARD_MINORS) { ++ if (minor < 0 || minor >= COMEDI_NUM_BOARD_MINORS) { + ERROR("Minor %d is invalid!\n", minor); + return 0; + } diff --git a/staging/staging-comedi-reorder-check-in-pcmmio_attach.patch b/staging/staging-comedi-reorder-check-in-pcmmio_attach.patch new file mode 100644 index 00000000000000..9964bc207bdcdf --- /dev/null +++ b/staging/staging-comedi-reorder-check-in-pcmmio_attach.patch @@ -0,0 +1,31 @@ +From error27@gmail.com Thu Jan 14 16:25:22 2010 +From: Dan Carpenter <error27@gmail.com> +Date: Mon, 28 Dec 2009 18:59:01 +0200 +Subject: Staging: comedi: reorder check in pcmmio_attach() +To: Greg Kroah-Hartman <gregkh@suse.de> +Cc: devel@driverdev.osuosl.org, Ian Abbott <abbotti@mev.co.uk>, Frank Mori Hess <fmhess@users.sourceforge.net> +Message-ID: <20091228165901.GC17645@bicker> +Content-Disposition: inline + + +The check for dio_num_asics is used to determine if there is more than 1 irq. +If it is false then irq[1] is past the end of the array. + +Signed-off-by: Dan Carpenter <error27@gmail.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/comedi/drivers/pcmmio.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/staging/comedi/drivers/pcmmio.c ++++ b/drivers/staging/comedi/drivers/pcmmio.c +@@ -550,7 +550,7 @@ static int pcmmio_attach(struct comedi_d + + if (irq[0]) { + printk("irq: %u ", irq[0]); +- if (irq[1] && thisboard->dio_num_asics == 2) ++ if (thisboard->dio_num_asics == 2 && irq[1]) + printk("second ASIC irq: %u ", irq[1]); + } else { + printk("(IRQ mode disabled) "); diff --git a/staging/staging-cx25821-fix-double-unlock-in-medusa_video_init.patch b/staging/staging-cx25821-fix-double-unlock-in-medusa_video_init.patch new file mode 100644 index 00000000000000..5842ea608d8b90 --- /dev/null +++ b/staging/staging-cx25821-fix-double-unlock-in-medusa_video_init.patch @@ -0,0 +1,36 @@ +From error27@gmail.com Thu Jan 14 16:25:32 2010 +From: Dan Carpenter <error27@gmail.com> +Date: Mon, 28 Dec 2009 18:59:46 +0200 +Subject: Staging: cx25821: fix double unlock in medusa_video_init() +To: linux-media@vger.kernel.org, devel@driverdev.osuosl.org +Cc: Greg Kroah-Hartman <gregkh@suse.de> +Message-ID: <20091228165946.GD17645@bicker> +Content-Disposition: inline + + +medusa_set_videostandard() takes the lock but it always drops it before +returning. + +This was found with a static checker and compile tested only. :/ + +Signed-off-by: Dan Carpenter <error27@gmail.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/cx25821/cx25821-medusa-video.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +--- a/drivers/staging/cx25821/cx25821-medusa-video.c ++++ b/drivers/staging/cx25821/cx25821-medusa-video.c +@@ -860,10 +860,8 @@ int medusa_video_init(struct cx25821_dev + + ret_val = medusa_set_videostandard(dev); + +- if (ret_val < 0) { +- mutex_unlock(&dev->lock); ++ if (ret_val < 0) + return -EINVAL; +- } + + return 1; + } diff --git a/staging/staging-cx25821-off-by-one-in-cx25821_enum_input.patch b/staging/staging-cx25821-off-by-one-in-cx25821_enum_input.patch new file mode 100644 index 00000000000000..204e133df34c1a --- /dev/null +++ b/staging/staging-cx25821-off-by-one-in-cx25821_enum_input.patch @@ -0,0 +1,30 @@ +From error27@gmail.com Thu Jan 14 16:25:47 2010 +From: Dan Carpenter <error27@gmail.com> +Date: Mon, 28 Dec 2009 19:00:24 +0200 +Subject: Staging: cx25821: off by one in cx25821_enum_input() +To: linuux-media@vger.kernel.org +Cc: devel@driverdev.osuosl.org, Greg Kroah-Hartman <gregkh@suse.de> +Message-ID: <20091228170024.GE17645@bicker> +Content-Disposition: inline + + +The INPUT(n) macro indexes an array of size 2. + +Signed-off-by: Dan Carpenter <error27@gmail.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/cx25821/cx25821-video.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/staging/cx25821/cx25821-video.c ++++ b/drivers/staging/cx25821/cx25821-video.c +@@ -876,7 +876,7 @@ int cx25821_enum_input(struct cx25821_de + dprintk(1, "%s()\n", __func__); + + n = i->index; +- if (n > 2) ++ if (n >= 2) + return -EINVAL; + + if (0 == INPUT(n)->type) diff --git a/staging/staging-dt3155-remove-compat-code.patch b/staging/staging-dt3155-remove-compat-code.patch new file mode 100644 index 00000000000000..2f8f5240ce513c --- /dev/null +++ b/staging/staging-dt3155-remove-compat-code.patch @@ -0,0 +1,1317 @@ +From horms@verge.net.au Thu Jan 14 16:22:06 2010 +From: Simon Horman <horms@verge.net.au> +Date: Thu, 24 Dec 2009 22:42:31 +1100 +Subject: Staging: dt3155: remove compat code +To: Greg Kroah-Hartman <gregkh@suse.de> +Message-ID: <20091224114231.GB7320@verge.net.au> + + +Remove compatibility code as this is not an older version of the kernel. + +Signed-off-by: Simon Horman <horms@verge.net.au> +Cc: Scott Smedley <ss@aao.gov.au> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + + +--- + drivers/staging/dt3155/allocator.c | 3 + drivers/staging/dt3155/dt3155_drv.c | 115 ----- + drivers/staging/dt3155/dt3155_drv.h | 5 + drivers/staging/dt3155/dt3155_isr.c | 41 - + drivers/staging/dt3155/pci-compat.h | 97 ---- + drivers/staging/dt3155/sysdep.h | 820 ------------------------------------ + 6 files changed, 8 insertions(+), 1073 deletions(-) + +--- a/drivers/staging/dt3155/allocator.c ++++ b/drivers/staging/dt3155/allocator.c +@@ -54,11 +54,10 @@ + #include <linux/errno.h> + #include <linux/types.h> + #include <linux/mm.h> /* PAGE_ALIGN() */ ++#include <linux/io.h> + + #include <asm/page.h> + +-#include "sysdep.h" +- + /*#define ALL_DEBUG*/ + #define ALL_MSG "allocator: " + +--- a/drivers/staging/dt3155/dt3155_drv.c ++++ b/drivers/staging/dt3155/dt3155_drv.c +@@ -59,13 +59,10 @@ extern void printques(int); + + #ifdef MODULE + #include <linux/module.h> +-#include <linux/version.h> + #include <linux/interrupt.h> + + +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,10) + MODULE_LICENSE("GPL"); +-#endif + + #endif + +@@ -105,11 +102,7 @@ int dt3155_errno = 0; + #endif + + /* wait queue for interrupts */ +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,1) + wait_queue_head_t dt3155_read_wait_queue[ MAXBOARDS ]; +-#else +-struct wait_queue *dt3155_read_wait_queue[ MAXBOARDS ]; +-#endif + + #define DT_3155_SUCCESS 0 + #define DT_3155_FAILURE -EIO +@@ -186,11 +179,7 @@ static inline void dt3155_isr( int irq, + { + int minor = -1; + int index; +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) + unsigned long flags; +-#else +- int flags; +-#endif + u_long buffer_addr; + + /* find out who issued the interrupt */ +@@ -264,21 +253,12 @@ static inline void dt3155_isr( int irq, + buffer_addr = dt3155_fbuffer[ minor ]-> + frame_info[ dt3155_fbuffer[ minor ]->active_buf ].addr + + (DT3155_MAX_ROWS / 2) * stride; +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) + local_save_flags(flags); + local_irq_disable(); +-#else +- save_flags( flags ); +- cli(); +-#endif + wake_up_interruptible( &dt3155_read_wait_queue[ minor ] ); + + /* Set up the DMA address for the next field */ +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) + local_irq_restore(flags); +-#else +- restore_flags( flags ); +-#endif + WriteMReg((dt3155_lbase[ minor ] + ODD_DMA_START), buffer_addr); + } + +@@ -350,13 +330,8 @@ static inline void dt3155_isr( int irq, + DT3155_STATE_FLD ) + { + +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) + local_save_flags(flags); + local_irq_disable(); +-#else +- save_flags( flags ); +- cli(); +-#endif + + #ifdef DEBUG_QUES_B + printques( minor ); +@@ -412,11 +387,7 @@ static inline void dt3155_isr( int irq, + + wake_up_interruptible( &dt3155_read_wait_queue[ minor ] ); + +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) + local_irq_restore(flags); +-#else +- restore_flags( flags ); +-#endif + } + + +@@ -675,11 +646,6 @@ static int dt3155_mmap (struct file * fi + /* which device are we mmapping? */ + int minor = MINOR(file->f_dentry->d_inode->i_rdev); + unsigned long offset; +- +- /* not actually sure when vm_area_struct changed, +- but it was in 2.3 sometime */ +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,20) +- + offset = vma->vm_pgoff << PAGE_SHIFT; + + if (offset >= __pa(high_memory) || (file->f_flags & O_SYNC)) +@@ -688,34 +654,17 @@ static int dt3155_mmap (struct file * fi + /* Don't try to swap out physical pages.. */ + vma->vm_flags |= VM_RESERVED; + +-#else +- +- if (vma->vm_offset & ~PAGE_MASK) +- return -ENXIO; +- +- offset = vma->vm_offset; +- +-#endif +- + /* they are mapping the registers or the buffer */ + if ((offset == dt3155_status[minor].reg_addr && + vma->vm_end - vma->vm_start == PCI_PAGE_SIZE) || + (offset == dt3155_status[minor].mem_addr && + vma->vm_end - vma->vm_start == dt3155_status[minor].mem_size)) + { +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) + if (remap_pfn_range(vma, + vma->vm_start, + offset >> PAGE_SHIFT, + vma->vm_end - vma->vm_start, +- vma->vm_page_prot)) +-#else +- if (remap_page_range(vma->vm_start, +- offset, +- vma->vm_end - vma->vm_start, +- vma->vm_page_prot)) +-#endif +- { ++ vma->vm_page_prot)) { + printk("DT3155: remap_page_range() failed.\n"); + return -EAGAIN; + } +@@ -761,9 +710,6 @@ static int dt3155_open( struct inode* in + printk("DT3155: Device opened.\n"); + + dt3155_dev_open[ minor ] = 1 ; +-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) +- MOD_INC_USE_COUNT; +-#endif + + dt3155_flush( minor ); + +@@ -771,11 +717,7 @@ static int dt3155_open( struct inode* in + int_csr_r.reg = 0; + WriteMReg( (dt3155_lbase[ minor ] + INT_CSR), int_csr_r.reg ); + +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,1) + init_waitqueue_head(&(dt3155_read_wait_queue[minor])); +-#else +- dt3155_read_wait_queue[minor] = NULL; +-#endif + + return 0; + } +@@ -798,9 +740,6 @@ static int dt3155_close( struct inode *i + } + else + { +-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) +- MOD_DEC_USE_COUNT; +-#endif + dt3155_dev_open[ minor ] = 0; + + if (dt3155_status[ minor ].state != DT3155_STATE_IDLE) +@@ -846,8 +785,6 @@ static int dt3155_read ( + /* if (dt3155_status[minor].state == DT3155_STATE_IDLE)*/ + /* return -EBUSY;*/ + +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,1) +- + /* non-blocking reads should return if no data */ + if (filep->f_flags & O_NDELAY) + { +@@ -877,34 +814,6 @@ static int dt3155_read ( + } + } + +-#else +- while ((frame_index = dt3155_get_ready_buffer(minor)) < 0 ) +- { +- int index; +- if (filep->f_flags & O_NDELAY) +- return 0; +- +- /* sleep till data arrives , or we get interrupted */ +- interruptible_sleep_on(&dt3155_read_wait_queue[minor]); +- for (index = 0; index < _NSIG_WORDS; index++) +- { +- /* +- * Changing the next line of code below to this: +- * if (current->pending.signal.sig[index] & +- * ~current->blocked.sig[index]) +- * would also work on a 2.4 kernel, however, the above +- * method is preferred & more portable. +- */ +- if (current->signal.sig[index] & ~current->blocked.sig[index]) +- { +- printk ("DT3155: read: interrupted\n"); +- return -EINTR; +- } +- } +- } +- +-#endif +- + frame_info_p = &dt3155_status[minor].fbuffer.frame_info[frame_index]; + + /* make this an offset */ +@@ -1046,12 +955,6 @@ int init_module(void) + int rcode = 0; + char *devname[ MAXBOARDS ]; + +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,1) +-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) +- SET_MODULE_OWNER(&dt3155_fops); +-#endif +-#endif +- + devname[ 0 ] = "dt3155a"; + #if MAXBOARDS == 2 + devname[ 1 ] = "dt3155b"; +@@ -1091,17 +994,6 @@ int init_module(void) + + /* Now let's find the hardware. find_PCI() will set ndevices to the + * number of cards found in this machine. */ +-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) +- if ( !(pcibios_present()) ) +- { +- printk("DT3155: Error: No PCI bios on this machine \n"); +- if( unregister_chrdev( dt3155_major, "dt3155" ) != 0 ) +- printk("DT3155: cleanup_module failed\n"); +- +- return DT_3155_FAILURE; +- } +- else +-#endif + { + if ( (rcode = find_PCI()) != DT_3155_SUCCESS ) + { +@@ -1199,10 +1091,5 @@ void cleanup_module(void) + free_irq( dt3155_status[ index ].irq, (void*)&dt3155_status[index] ); + } + } +- +-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) +- if (MOD_IN_USE) +- printk("DT3155: device busy, remove delayed\n"); +-#endif + } + +--- a/drivers/staging/dt3155/dt3155_drv.h ++++ b/drivers/staging/dt3155/dt3155_drv.h +@@ -33,13 +33,8 @@ extern u_char *dt3155_bbase; + #ifdef __KERNEL__ + #include <linux/wait.h> + +-#include <linux/version.h> /* need access to LINUX_VERSION_CODE */ + /* wait queue for reads */ +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 1) + extern wait_queue_head_t dt3155_read_wait_queue[MAXBOARDS]; +-#else +-extern struct wait_queue *dt3155_read_wait_queue[MAXBOARDS]; +-#endif + #endif + + /* number of devices */ +--- a/drivers/staging/dt3155/dt3155_isr.c ++++ b/drivers/staging/dt3155/dt3155_isr.c +@@ -435,20 +435,11 @@ static inline void internal_release_lock + *****************************************************/ + inline void dt3155_release_locked_buffer( int m ) + { +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) + unsigned long int flags; + local_save_flags(flags); + local_irq_disable(); + internal_release_locked_buffer(m); + local_irq_restore(flags); +-#else +- int flags; +- +- save_flags( flags ); +- cli(); +- internal_release_locked_buffer( m ); +- restore_flags( flags ); +-#endif + } + + +@@ -460,15 +451,9 @@ inline void dt3155_release_locked_buffer + inline int dt3155_flush( int m ) + { + int index; +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) +- unsigned long int flags; +- local_save_flags(flags); +- local_irq_disable(); +-#else +- int flags; +- save_flags( flags ); +- cli(); +-#endif ++ unsigned long int flags; ++ local_save_flags(flags); ++ local_irq_disable(); + + internal_release_locked_buffer( m ); + dt3155_fbuffer[ m ]->empty_len = 0; +@@ -486,11 +471,7 @@ inline int dt3155_flush( int m ) + dt3155_fbuffer[ m ]->ready_head = 0; + dt3155_fbuffer[ m ]->ready_len = 0; + +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) + local_irq_restore(flags); +-#else +- restore_flags( flags ); +-#endif + + return 0; + } +@@ -507,15 +488,9 @@ inline int dt3155_flush( int m ) + inline int dt3155_get_ready_buffer( int m ) + { + int frame_index; +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) +- unsigned long int flags; +- local_save_flags(flags); +- local_irq_disable(); +-#else +- int flags; +- save_flags( flags ); +- cli(); +-#endif ++ unsigned long int flags; ++ local_save_flags(flags); ++ local_irq_disable(); + + #ifdef DEBUG_QUES_A + printques( m ); +@@ -535,11 +510,7 @@ inline int dt3155_get_ready_buffer( int + printques( m ); + #endif + +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) + local_irq_restore(flags); +-#else +- restore_flags( flags ); +-#endif + + return frame_index; + } +--- a/drivers/staging/dt3155/pci-compat.h ++++ /dev/null +@@ -1,97 +0,0 @@ +- +-/* This header only makes send when included in a 2.0 compile */ +- +-#ifndef _PCI_COMPAT_H_ +-#define _PCI_COMPAT_H_ +- +-#ifdef __KERNEL__ +- +-#include <linux/bios32.h> /* pcibios_* */ +-#include <linux/pci.h> /* pcibios_* */ +-#include <linux/malloc.h> /* kmalloc */ +- +-/* fake the new pci interface based on the old one: encapsulate bus/devfn */ +-struct pci_fake_dev { +- u8 bus; +- u8 devfn; +- int index; +-}; +-#define pci_dev pci_fake_dev /* the other pci_dev is unused by 2.0 drivers */ +- +-extern inline struct pci_dev *pci_find_device(unsigned int vendorid, +- unsigned int devid, +- struct pci_dev *from) +-{ +- struct pci_dev *pptr = kmalloc(sizeof(*pptr), GFP_KERNEL); +- int index = 0; +- int ret; +- +- if (!pptr) return NULL; +- if (from) index = pptr->index + 1; +- ret = pcibios_find_device(vendorid, devid, index, +- &pptr->bus, &pptr->devfn); +- if (ret) { kfree(pptr); return NULL; } +- return pptr; +-} +- +-extern inline struct pci_dev *pci_find_class(unsigned int class, +- struct pci_dev *from) +-{ +- return NULL; /* FIXME */ +-} +- +-extern inline void pci_release_device(struct pci_dev *dev) +-{ +- kfree(dev); +-} +- +-/* struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn); */ +- +-#define pci_present pcibios_present +- +-extern inline int +-pci_read_config_byte(struct pci_dev *dev, u8 where, u8 *val) +-{ +- return pcibios_read_config_byte(dev->bus, dev->devfn, where, val); +-} +- +-extern inline int +-pci_read_config_word(struct pci_dev *dev, u8 where, u16 *val) +-{ +- return pcibios_read_config_word(dev->bus, dev->devfn, where, val); +-} +- +-extern inline int +-pci_read_config_dword(struct pci_dev *dev, u8 where, u32 *val) +-{ +- return pcibios_read_config_dword(dev->bus, dev->devfn, where, val); +-} +- +-extern inline int +-pci_write_config_byte(struct pci_dev *dev, u8 where, u8 val) +-{ +- return pcibios_write_config_byte(dev->bus, dev->devfn, where, val); +-} +- +-extern inline int +-pci_write_config_word(struct pci_dev *dev, u8 where, u16 val) +-{ +- return pcibios_write_config_word(dev->bus, dev->devfn, where, val); +-} +- +-extern inline int +-pci_write_config_dword(struct pci_dev *dev, u8 where, u32 val) +-{ +- return pcibios_write_config_dword(dev->bus, dev->devfn, where, val); +-} +- +-extern inline void pci_set_master(struct pci_dev *dev) +-{ +- u16 cmd; +- pcibios_read_config_word(dev->bus, dev->devfn, PCI_COMMAND, &cmd); +- cmd |= PCI_COMMAND_MASTER; +- pcibios_write_config_word(dev->bus, dev->devfn, PCI_COMMAND, cmd); +-} +- +-#endif /* __KERNEL__ */ +-#endif /* _PCI_COMPAT_H_ */ +--- a/drivers/staging/dt3155/sysdep.h ++++ /dev/null +@@ -1,820 +0,0 @@ +-/* +- * sysdep.h -- centralizing compatibility issues between 2.0, 2.2, 2.4 +- * +- * Copyright (C) 2001 Alessandro Rubini and Jonathan Corbet +- * Copyright (C) 2001 O'Reilly & Associates +- * +- * The source code in this file can be freely used, adapted, +- * and redistributed in source or binary form, so long as an +- * acknowledgment appears in derived source files. The citation +- * should list that the code comes from the book "Linux Device +- * Drivers" by Alessandro Rubini and Jonathan Corbet, published +- * by O'Reilly & Associates. No warranty is attached; +- * we cannot take responsibility for errors or fitness for use. +- * +- * $Id: sysdep.h,v 1.2 2005/08/09 06:08:51 ssmedley Exp $ +- */ +- +- +-#ifndef _SYSDEP_H_ +-#define _SYSDEP_H_ +- +-#ifndef LINUX_VERSION_CODE +-# include <linux/version.h> +-#endif +- +-#ifndef KERNEL_VERSION /* pre-2.1.90 didn't have it */ +-# define KERNEL_VERSION(vers,rel,seq) ( ((vers)<<16) | ((rel)<<8) | (seq) ) +-#endif +- +-/* only allow 2.0.x 2.2.y and 2.4.z */ +- +-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,0,0) /* not < 2.0 */ +-# error "This kernel is too old: not supported by this file" +-#endif +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,7,0) /* not > 2.7, by now */ +-# error "This kernel is too recent: not supported by this file" +-#endif +-#if (LINUX_VERSION_CODE & 0xff00) == 1 /* not 2.1 */ +-# error "Please don't use linux-2.1, use 2.2, 2.4 or 2.6 instead" +-#endif +-#if (LINUX_VERSION_CODE & 0xff00) == 3 /* not 2.3 */ +-# error "Please don't use linux-2.3, use 2.4 or 2.6 instead" +-#endif +- +-/* remember about the current version */ +-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,0) +-# define LINUX_20 +-#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) +-# define LINUX_22 +-#else +-# define LINUX_24 +-#endif +- +-/* we can't support versioning in pre-2.4 because we #define some functions */ +-#if !defined(LINUX_24) && defined(CONFIG_MODVERSIONS) +-# error "This sysdep.h can't support CONFIG_MODVERSIONS" +-# error "and old kernels at the same time." +-# error "Either use 2.4 or avoid using versioning" +-#endif +- +-#ifndef LINUX_20 /* include vmalloc.h if this is 2.2/2.4 */ +-# ifdef VM_READ /* a typical flag defined by mm.h */ +-# include <linux/vmalloc.h> +-# endif +-#endif +- +-#include <linux/sched.h> +- +-/* Modularization issues */ +-#ifdef LINUX_20 +-# define __USE_OLD_SYMTAB__ +-# define EXPORT_NO_SYMBOLS register_symtab(NULL); +-# define REGISTER_SYMTAB(tab) register_symtab(tab) +-#else +-# define REGISTER_SYMTAB(tab) /* nothing */ +-#endif +- +-#ifdef __USE_OLD_SYMTAB__ +-# define __MODULE_STRING(s) /* nothing */ +-# define MODULE_PARM(v,t) /* nothing */ +-# define MODULE_PARM_DESC(v,t) /* nothing */ +-# define MODULE_AUTHOR(n) /* nothing */ +-# define MODULE_DESCRIPTION(d) /* nothing */ +-# define MODULE_SUPPORTED_DEVICE(n) /* nothing */ +-#endif +- +-/* +- * In version 2.2 (up to 2.2.19, at least), the macro for request_module() +- * when no kmod is there is wrong. It's a "do {} while 0" but it shouldbe int +- */ +-#ifdef LINUX_22 +-# ifndef CONFIG_KMOD +-# undef request_module +-# define request_module(name) -ENOSYS +-# endif +-#endif +- +- +-#ifndef LINUX_20 +-# include <linux/init.h> /* module_init/module_exit */ +-#endif +- +-#ifndef module_init +-# define module_init(x) int init_module(void) { return x(); } +-# define module_exit(x) void cleanup_module(void) { x(); } +-#endif +- +-#ifndef SET_MODULE_OWNER +-# define SET_MODULE_OWNER(structure) /* nothing */ +-#endif +- +-/* +- * "select" changed in 2.1.23. The implementation is twin, but this +- * header is new +- * +- */ +-#ifdef LINUX_20 +-# define __USE_OLD_SELECT__ +-#else +-# include <linux/poll.h> +-#endif +- +-#ifdef LINUX_20 +-# define INODE_FROM_F(filp) ((filp)->f_inode) +-#else +-# define INODE_FROM_F(filp) ((filp)->f_dentry->d_inode) +-#endif +- +-/* Other changes in the fops are solved using wrappers */ +- +-/* +- * Wait queues changed with 2.3 +- */ +-#ifndef DECLARE_WAIT_QUEUE_HEAD +-# define DECLARE_WAIT_QUEUE_HEAD(head) struct wait_queue *head = NULL +- typedef struct wait_queue *wait_queue_head_t; +-# define init_waitqueue_head(head) (*(head)) = NULL +- +-/* offer wake_up_sync as an alias for wake_up */ +-# define wake_up_sync(head) wake_up(head) +-# define wake_up_interruptible_sync(head) wake_up_interruptible(head) +- +-/* Pretend we have add_wait_queue_exclusive */ +-# define add_wait_queue_exclusive(q,entry) add_wait_queue ((q), (entry)) +- +-#endif /* no DECLARE_WAIT_QUEUE_HEAD */ +- +-/* +- * Define wait_event for 2.0 kernels. (This ripped off directly from +- * the 2.2.18 sched.h) +- */ +-#ifdef LINUX_20 +- +-#define __wait_event(wq, condition) \ +-do { \ +- struct wait_queue __wait; \ +- \ +- __wait.task = current; \ +- add_wait_queue(&wq, &__wait); \ +- for (;;) { \ +- current->state = TASK_UNINTERRUPTIBLE; \ +- mb(); \ +- if (condition) \ +- break; \ +- schedule(); \ +- } \ +- current->state = TASK_RUNNING; \ +- remove_wait_queue(&wq, &__wait); \ +-} while (0) +- +-#define wait_event(wq, condition) \ +-do { \ +- if (condition) \ +- break; \ +- __wait_event(wq, condition); \ +-} while (0) +- +-#define __wait_event_interruptible(wq, condition, ret) \ +-do { \ +- struct wait_queue __wait; \ +- \ +- __wait.task = current; \ +- add_wait_queue(&wq, &__wait); \ +- for (;;) { \ +- current->state = TASK_INTERRUPTIBLE; \ +- mb(); \ +- if (condition) \ +- break; \ +- if (!signal_pending(current)) { \ +- schedule(); \ +- continue; \ +- } \ +- ret = -ERESTARTSYS; \ +- break; \ +- } \ +- current->state = TASK_RUNNING; \ +- remove_wait_queue(&wq, &__wait); \ +-} while (0) +- +-#define wait_event_interruptible(wq, condition) \ +-({ \ +- int __ret = 0; \ +- if (!(condition)) \ +- __wait_event_interruptible(wq, condition, __ret); \ +- __ret; \ +-}) +-#endif +- +- +-/* +- * 2.3 added tasklets +- */ +-#ifdef LINUX_24 +-# define HAVE_TASKLETS +-#endif +- +- +- +- +-/* FIXME: implement the other versions of wake_up etc */ +- +- +-/* +- * access to user space: use the 2.2 functions, +- * and implement them as macros for 2.0 +- */ +- +-#ifdef LINUX_20 +-# include <asm/segment.h> +-# define access_ok(t,a,sz) (verify_area((t),(void *) (a),(sz)) ? 0 : 1) +-# define verify_area_20 verify_area +-# define copy_to_user(t,f,n) (memcpy_tofs((t), (f), (n)), 0) +-# define copy_from_user(t,f,n) (memcpy_fromfs((t), (f), (n)), 0) +-# define __copy_to_user(t,f,n) copy_to_user((t), (f), (n)) +-# define __copy_from_user(t,f,n) copy_from_user((t), (f), (n)) +- +-# define PUT_USER(val,add) (put_user((val),(add)), 0) +-# define __PUT_USER(val,add) PUT_USER((val),(add)) +- +-# define GET_USER(dest,add) ((dest)=get_user((add)), 0) +-# define __GET_USER(dest,add) GET_USER((dest),(add)) +-#else +-# include <asm/uaccess.h> +-# include <asm/io.h> +-# define verify_area_20(t,a,sz) (0) /* == success */ +-# define PUT_USER put_user +-# define __PUT_USER __put_user +-# define GET_USER get_user +-# define __GET_USER __get_user +-#endif +- +-/* +- * Allocation issues +- */ +-#ifdef GFP_USER /* only if mm.h has been included */ +-# ifdef LINUX_20 +-# define __GFP_DMA GFP_DMA /* 2.0 didn't have the leading __ */ +-# endif +-# ifndef LINUX_24 +-# define __GFP_HIGHMEM 0 /* was not there */ +-# define GFP_HIGHUSER 0 /* idem */ +-# endif +- +-# ifdef LINUX_20 +-# define __get_free_pages(a,b) __get_free_pages((a),(b),0) +-# endif +-# ifndef LINUX_24 +-# define get_zeroed_page get_free_page +-# endif +-#endif +- +-/* ioremap */ +-#if defined(LINUX_20) && defined(_LINUX_MM_H) +-# define ioremap_nocache ioremap +-# ifndef __i386__ +- /* This simple approach works for non-PC platforms. */ +-# define ioremap vremap +-# define iounmap vfree +-# else /* the PC has <expletive> ISA; 2.2 and 2.4 remap it, 2.0 needs not */ +-extern inline void *ioremap(unsigned long phys_addr, unsigned long size) +-{ +- if (phys_addr >= 0xA0000 && phys_addr + size <= 0x100000) +- return (void *)phys_addr; +- return vremap(phys_addr, size); +-} +- +-extern inline void iounmap(void *addr) +-{ +- if ((unsigned long)addr >= 0xA0000 +- && (unsigned long)addr < 0x100000) +- return; +- vfree(addr); +-} +-# endif +-#endif +- +-/* Also, define check_mem_region etc */ +-#ifndef LINUX_24 +-# define check_mem_region(a,b) 0 /* success */ +-# define request_mem_region(a,b,c) /* nothing */ +-# define release_mem_region(a,b) /* nothing */ +-#endif +- +-/* implement capable() for 2.0 */ +-#ifdef LINUX_20 +-# define capable(anything) suser() +-#endif +- +-/* The use_count of exec_domain and binfmt changed in 2.1.23 */ +- +-#ifdef LINUX_20 +-# define INCRCOUNT(p) ((p)->module ? __MOD_INC_USE_COUNT((p)->module) : 0) +-# define DECRCOUNT(p) ((p)->module ? __MOD_DEC_USE_COUNT((p)->module) : 0) +-# define CURRCOUNT(p) ((p)->module && (p)->module->usecount) +-#else +-# define INCRCOUNT(p) ((p)->use_count++) +-# define DECRCOUNT(p) ((p)->use_count--) +-# define CURRCOUNT(p) ((p)->use_count) +-#endif +- +-/* +- * /proc has changed a lot across the versions... +- */ +-#ifdef LINUX_20 +-# define USE_PROC_REGISTER +-#endif +- +- +-/* +- * 2.2 didn't have create_proc_{read|info}_entry yet. +- * And it looks like there are no other "interesting" entry point, as +- * the rest is somehow esotique (mknod, symlink, ...) +- */ +-#ifdef LINUX_22 +-# ifdef PROC_SUPER_MAGIC /* Only if procfs is being used */ +-extern inline struct proc_dir_entry *create_proc_read_entry(const char *name, +- mode_t mode, struct proc_dir_entry *base, +- read_proc_t *read_proc, void * data) +-{ +- struct proc_dir_entry *res=create_proc_entry(name,mode,base); +- if (res) { +- res->read_proc=read_proc; +- res->data=data; +- } +- return res; +-} +- +-# ifndef create_proc_info_entry /* added in 2.2.18 */ +-typedef int (get_info_t)(char *, char **, off_t, int, int); +-extern inline struct proc_dir_entry *create_proc_info_entry(const char *name, +- mode_t mode, struct proc_dir_entry *base, get_info_t *get_info) +-{ +- struct proc_dir_entry *res=create_proc_entry(name,mode,base); +- if (res) res->get_info=get_info; +- return res; +-} +-# endif /* no create_proc_info_entry */ +-# endif +-#endif +- +-#ifdef LINUX_20 +-# define test_and_set_bit(nr,addr) test_bit((nr),(addr)) +-# define test_and_clear_bit(nr,addr) clear_bit((nr),(addr)) +-# define test_and_change_bit(nr,addr) change_bit((nr),(addr)) +-#endif +- +- +-/* 2.0 had no read and write memory barriers, and 2.2 lacks the +- set_ functions */ +-#ifndef LINUX_24 +-# ifdef LINUX_20 +-# define wmb() mb() /* this is a big penalty on non-reordering platfs */ +-# define rmb() mb() /* this is a big penalty on non-reordering platfs */ +-# endif /* LINUX_20 */ +- +-#define set_mb() do { var = value; mb(); } while (0) +-#define set_wmb() do { var = value; wmb(); } while (0) +-#endif /* ! LINUX_24 */ +- +- +- +-/* 2.1.30 removed these functions. Let's define them, just in case */ +-#ifndef LINUX_20 +-# define queue_task_irq queue_task +-# define queue_task_irq_off queue_task +-#endif +- +-/* 2.1.10 and 2.1.43 introduced new functions. They are worth using */ +- +-#ifdef LINUX_20 +- +-# include <asm/byteorder.h> +-# ifdef __LITTLE_ENDIAN +-# define cpu_to_le16(x) (x) +-# define cpu_to_le32(x) (x) +-# define cpu_to_be16(x) htons((x)) +-# define cpu_to_be32(x) htonl((x)) +-# else +-# define cpu_to_be16(x) (x) +-# define cpu_to_be32(x) (x) +- extern inline __u16 cpu_to_le16(__u16 x) { return (x<<8) | (x>>8);} +- extern inline __u32 cpu_to_le32(__u32 x) { return (x>>24) | +- ((x>>8)&0xff00) | ((x<<8)&0xff0000) | (x<<24);} +-# endif +- +-# define le16_to_cpu(x) cpu_to_le16(x) +-# define le32_to_cpu(x) cpu_to_le32(x) +-# define be16_to_cpu(x) cpu_to_be16(x) +-# define be32_to_cpu(x) cpu_to_be32(x) +- +-# define cpu_to_le16p(addr) (cpu_to_le16(*(addr))) +-# define cpu_to_le32p(addr) (cpu_to_le32(*(addr))) +-# define cpu_to_be16p(addr) (cpu_to_be16(*(addr))) +-# define cpu_to_be32p(addr) (cpu_to_be32(*(addr))) +- +- extern inline void cpu_to_le16s(__u16 *a) {*a = cpu_to_le16(*a);} +- extern inline void cpu_to_le32s(__u16 *a) {*a = cpu_to_le32(*a);} +- extern inline void cpu_to_be16s(__u16 *a) {*a = cpu_to_be16(*a);} +- extern inline void cpu_to_be32s(__u16 *a) {*a = cpu_to_be32(*a);} +- +-# define le16_to_cpup(x) cpu_to_le16p(x) +-# define le32_to_cpup(x) cpu_to_le32p(x) +-# define be16_to_cpup(x) cpu_to_be16p(x) +-# define be32_to_cpup(x) cpu_to_be32p(x) +- +-# define le16_to_cpus(x) cpu_to_le16s(x) +-# define le32_to_cpus(x) cpu_to_le32s(x) +-# define be16_to_cpus(x) cpu_to_be16s(x) +-# define be32_to_cpus(x) cpu_to_be32s(x) +- +-#endif +- +-#ifdef LINUX_20 +-# define __USE_OLD_REBUILD_HEADER__ +-#endif +- +-/* +- * 2.0 didn't include sema_init, so we make our own - but only if it +- * looks like semaphore.h got included. +- */ +-#ifdef LINUX_20 +-# ifdef MUTEX_LOCKED /* Only if semaphore.h included */ +- extern inline void sema_init (struct semaphore *sem, int val) +- { +- sem->count = val; +- sem->waking = sem->lock = 0; +- sem->wait = NULL; +- } +-# endif +-#endif /* LINUX_20 */ +- +-/* +- * In 2.0, there is no real need for spinlocks, and they weren't really +- * implemented anyway. +- * +- * XXX the _irqsave variant should be defined eventually to do the +- * right thing. +- */ +-#ifdef LINUX_20 +-typedef int spinlock_t; +-# define spin_lock(lock) +-# define spin_unlock(lock) +-# define spin_lock_init(lock) +- +-# define spin_lock_irqsave(lock,flags) do { \ +- save_flags(flags); cli(); } while (0); +-# define spin_unlock_irqrestore(lock,flags) restore_flags(flags); +-#endif +- +-/* +- * 2.1 stuffed the "flush" method into the middle of the file_operations +- * structure. The FOP_NO_FLUSH symbol is for drivers that do not implement +- * flush (most of them), it can be inserted in initializers for all 2.x +- * kernel versions. +- */ +-#ifdef LINUX_20 +-# define FOP_NO_FLUSH /* nothing */ +-# define TAG_LLSEEK lseek +-# define TAG_POLL select +-#else +-# define FOP_NO_FLUSH NULL, +-# define TAG_LLSEEK llseek +-# define TAG_POLL poll +-#endif +- +- +- +-/* +- * fasync changed in 2.2. +- */ +-#ifdef LINUX_20 +-/* typedef struct inode *fasync_file; */ +-# define fasync_file struct inode * +-#else +- typedef int fasync_file; +-#endif +- +-/* kill_fasync had less arguments, and a different indirection in the first */ +-#ifndef LINUX_24 +-# define kill_fasync(ptrptr,sig,band) kill_fasync(*(ptrptr),(sig)) +-#endif +- +-/* other things that are virtualized: define the new functions for the old k */ +-#ifdef LINUX_20 +-# define in_interrupt() (intr_count!=0) +-# define mdelay(x) udelay((x)*1000) +-# define signal_pending(current) ((current)->signal & ~(current)->blocked) +-#endif +- +-#ifdef LINUX_PCI_H /* only if PCI stuff is being used */ +-# ifdef LINUX_20 +-# include "pci-compat.h" /* a whole set of replacement functions */ +-# else +-# define pci_release_device(d) /* placeholder, used in 2.0 to free stuff */ +-# endif +-#endif +- +- +- +-/* +- * Some task state stuff +- */ +- +-#ifndef set_current_state +-# define set_current_state(s) current->state = (s); +-#endif +- +-#ifdef LINUX_20 +-extern inline void schedule_timeout(int timeout) +-{ +- current->timeout = jiffies + timeout; +- current->state = TASK_INTERRUPTIBLE; +- schedule(); +- current->timeout = 0; +-} +- +-extern inline long sleep_on_timeout(wait_queue_head_t *q, signed long timeout) +-{ +- signed long early = 0; +- +- current->timeout = jiffies + timeout; +- sleep_on (q); +- if (current->timeout > 0) { +- early = current->timeout - jiffies; +- current->timeout = 0; +- } +- return early; +-} +- +- +-extern inline long interruptible_sleep_on_timeout(wait_queue_head_t *q, +- signed long timeout) +-{ +- signed long early = 0; +- +- current->timeout = jiffies + timeout; +- interruptible_sleep_on (q); +- if (current->timeout > 0) { +- early = current->timeout - jiffies; +- current->timeout = 0; +- } +- return early; +-} +- +-#endif /* LINUX_20 */ +- +-/* +- * Schedule_task was a late 2.4 addition. +- */ +-#ifndef LINUX_24 +-extern inline int schedule_task(struct tq_struct *task) +-{ +- queue_task(task, &tq_scheduler); +- return 1; +-} +-#endif +- +- +-/* +- * Timing issues +- */ +-#ifdef LINUX_20 +-# define get_fast_time do_gettimeofday +-#endif +- +-#ifdef _LINUX_DELAY_H /* only if linux/delay.h is included */ +-# ifndef mdelay /* linux-2.0 */ +-# ifndef MAX_UDELAY_MS +-# define MAX_UDELAY_MS 5 +-# endif +-# define mdelay(n) (\ +- (__builtin_constant_p(n) && (n)<=MAX_UDELAY_MS) ? udelay((n)*1000) : \ +- ({unsigned long msec=(n); while (msec--) udelay(1000);})) +-# endif /* mdelay */ +-#endif /* _LINUX_DELAY_H */ +- +- +-/* +- * No del_timer_sync before 2.4 +- */ +-#ifndef LINUX_24 +-# define del_timer_sync(timer) del_timer(timer) /* and hope */ +-#endif +- +-/* +- * mod_timer wasn't present in 2.0 +- */ +-#ifdef LINUX_20 +-static inline int mod_timer(struct timer_list *timer, unsigned long expires) +-{ +- int pending = del_timer(timer); +- if (pending) { +- timer->expires = expires; +- add_timer(timer); +- } +- return pending; +-} +-#endif +-/* +- * Various changes in mmap and friends. +- */ +- +-#ifndef NOPAGE_SIGBUS +-# define NOPAGE_SIGBUS NULL /* return value of the nopage memory method */ +-# define NOPAGE_OOM NULL /* No real equivalent in older kernels */ +-#endif +- +-#ifndef VM_RESERVED /* Added 2.4.0-test10 */ +-# define VM_RESERVED 0 +-#endif +- +-#ifdef LINUX_24 /* use "vm_pgoff" to get an offset */ +-#define VMA_OFFSET(vma) ((vma)->vm_pgoff << PAGE_SHIFT) +-#else /* use "vm_offset" */ +-#define VMA_OFFSET(vma) ((vma)->vm_offset) +-#endif +- +-#ifdef MAP_NR +-#define virt_to_page(page) (mem_map + MAP_NR(page)) +-#endif +- +-#ifndef get_page +-# define get_page(p) atomic_inc(&(p)->count) +-#endif +- +-/* +- * No DMA lock in 2.0. +- */ +-#ifdef LINUX_20 +-static inline unsigned long claim_dma_lock(void) +-{ +- unsigned long flags; +- save_flags(flags); +- cli(); +- return flags; +-} +- +-static inline void release_dma_lock(unsigned long flags) +-{ +- restore_flags(flags); +-} +-#endif +- +- +-/* +- * I/O memory was not managed by ealier kernels, define them as success +- */ +- +-#if 0 /* FIXME: what is the right way to do request_mem_region? */ +-#ifndef LINUX_24 +-# define check_mem_region(start, len) 0 +-# define request_mem_region(start, len, name) 0 +-# define release_mem_region(start, len) 0 +- +- /* +- * Also, request_ and release_ region used to return void. Return 0 instead +- */ +-# define request_region(s, l, n) ({request_region((s),(l),(n));0;}) +-# define release_region(s, l) ({release_region((s),(l));0;}) +- +-#endif /* not LINUX_24 */ +-#endif +- +-/* +- * Block layer stuff. +- */ +-#ifndef LINUX_24 +- +-/* BLK_DEFAULT_QUEUE for use with these macros only!!!! */ +-#define BLK_DEFAULT_QUEUE(major) blk_dev[(major)].request_fn +-#define blk_init_queue(where,request_fn) where = request_fn; +-#define blk_cleanup_queue(where) where = NULL; +- +-/* No QUEUE_EMPTY in older kernels */ +-#ifndef QUEUE_EMPTY /* Driver can redefine it too */ +-# define QUEUE_EMPTY (CURRENT != NULL) +-#endif +- +-#ifdef RO_IOCTLS +-static inline int blk_ioctl(kdev_t dev, unsigned int cmd, unsigned long arg) +-{ +- int err; +- +- switch (cmd) { +- case BLKRAGET: /* return the readahead value */ +- if (!arg) return -EINVAL; +- err = ! access_ok(VERIFY_WRITE, arg, sizeof(long)); +- if (err) return -EFAULT; +- PUT_USER(read_ahead[MAJOR(dev)],(long *) arg); +- return 0; +- +- case BLKRASET: /* set the readahead value */ +- if (!capable(CAP_SYS_ADMIN)) return -EACCES; +- if (arg > 0xff) return -EINVAL; /* limit it */ +- read_ahead[MAJOR(dev)] = arg; +- return 0; +- +- case BLKFLSBUF: /* flush */ +- if (! capable(CAP_SYS_ADMIN)) return -EACCES; /* only root */ +- fsync_dev(dev); +- invalidate_buffers(dev); +- return 0; +- +- RO_IOCTLS(dev, arg); +- } +- return -ENOTTY; +-} +-#endif /* RO_IOCTLS */ +- +-#ifdef LINUX_EXTENDED_PARTITION /* defined in genhd.h */ +-static inline void register_disk(struct gendisk *gdev, kdev_t dev, +- unsigned minors, struct file_operations *ops, long size) +-{ +- if (! gdev) +- return; +- resetup_one_dev(gdev, MINOR(dev) >> gdev->minor_shift); +-} +-#endif /* LINUX_EXTENDED_PARTITION */ +- +- +-#else /* it is Linux 2.4 */ +-#define HAVE_BLKPG_H +-#endif /* LINUX_24 */ +- +- +- +-#ifdef LINUX_20 /* physical and virtual addresses had the same value */ +-# define __pa(a) (a) +-# define __va(a) (a) +-#endif +- +-/* +- * Network driver compatibility +- */ +- +-/* +- * 2.0 dev_kfree_skb had an extra arg. The following is a little dangerous +- * in that it assumes that FREE_WRITE is always wanted. Very few 2.0 drivers +- * use FREE_READ, but the number is *not* zero... +- * +- * Also: implement the non-checking versions of a couple skb functions - +- * but they still check in 2.0. +- */ +-#ifdef LINUX_20 +-# define dev_kfree_skb(skb) dev_kfree_skb((skb), FREE_WRITE); +- +-# define __skb_push(skb, len) skb_push((skb), (len)) +-# define __skb_put(skb, len) skb_put((skb), (len)) +-#endif +- +-/* +- * Softnet changes in 2.4 +- */ +-#ifndef LINUX_24 +-# ifdef _LINUX_NETDEVICE_H /* only if netdevice.h was included */ +-# define netif_start_queue(dev) clear_bit(0, (void *) &(dev)->tbusy); +-# define netif_stop_queue(dev) set_bit(0, (void *) &(dev)->tbusy); +- +-static inline void netif_wake_queue(struct device *dev) +-{ +- clear_bit(0, (void *) &(dev)->tbusy); +- mark_bh(NET_BH); +-} +- +-/* struct device became struct net_device */ +-# define net_device device +-# endif /* netdevice.h */ +-#endif /* ! LINUX_24 */ +- +-/* +- * Memory barrier stuff, define what's missing from older kernel versions +- */ +-#ifdef switch_to /* this is always a macro, defined in <asm/sysstem.h> */ +- +-# ifndef set_mb +-# define set_mb(var, value) do {(var) = (value); mb();} while 0 +-# endif +-# ifndef set_rmb +-# define set_rmb(var, value) do {(var) = (value); rmb();} while 0 +-# endif +-# ifndef set_wmb +-# define set_wmb(var, value) do {(var) = (value); wmb();} while 0 +-# endif +- +-/* The hw barriers are defined as sw barriers. A correct thing if this +- specific kernel/platform is supported but has no specific instruction */ +-# ifndef mb +-# define mb barrier +-# endif +-# ifndef rmb +-# define rmb barrier +-# endif +-# ifndef wmb +-# define wmb barrier +-# endif +- +-#endif /* switch to (i.e. <asm/system.h>) */ +- +- +-#endif /* _SYSDEP_H_ */ diff --git a/staging/staging-dt3155-use-pci_get_device.patch b/staging/staging-dt3155-use-pci_get_device.patch new file mode 100644 index 00000000000000..ba5fb816fdc249 --- /dev/null +++ b/staging/staging-dt3155-use-pci_get_device.patch @@ -0,0 +1,75 @@ +From horms@verge.net.au Thu Jan 14 16:13:50 2010 +From: Simon Horman <horms@verge.net.au> +Date: Thu, 24 Dec 2009 22:41:13 +1100 +Subject: Staging: DT3155: Use pci_get_device() +To: Greg Kroah-Hartman <gregkh@suse.de> +Cc: devel@driverdev.osuosl.org +Message-ID: <20091224114113.GA7320@verge.net.au> +Content-Disposition: inline + +The use of pci_find_device() is deprecated. + +Signed-off-by: Simon Horman <horms@verge.net.au> +Cc: Scott Smedley <ss@aao.gov.au> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/dt3155/dt3155_drv.c | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +--- a/drivers/staging/dt3155/dt3155_drv.c ++++ b/drivers/staging/dt3155/dt3155_drv.c +@@ -963,7 +963,7 @@ static int find_PCI (void) + unsigned long base; + unsigned char irq; + +- while ((pci_dev = pci_find_device ++ while ((pci_dev = pci_get_device + (DT3155_VENDORID, DT3155_DEVICEID, pci_dev)) != NULL) + { + pci_index ++; +@@ -983,7 +983,7 @@ static int find_PCI (void) + "for %d devices\n" + "DT3155: Please change MAXBOARDS in dt3155.h\n", + pci_index, MAXBOARDS); +- return DT_3155_FAILURE; ++ goto err; + } + + /* Now, just go out and make sure that this/these device(s) is/are +@@ -992,7 +992,7 @@ static int find_PCI (void) + (u_int *) &base))) + { + printk("DT3155: Was not able to find device \n"); +- return DT_3155_FAILURE; ++ goto err; + } + + DT_3155_DEBUG_MSG("DT3155: Base address 0 for device is %lx \n", base); +@@ -1007,13 +1007,13 @@ static int find_PCI (void) + if ( !dt3155_lbase[pci_index-1] ) + { + printk("DT3155: Unable to remap control registers\n"); +- return DT_3155_FAILURE; ++ goto err; + } + + if ( (error = pci_read_config_byte( pci_dev, PCI_INTERRUPT_LINE, &irq)) ) + { + printk("DT3155: Was not able to find device \n"); +- return DT_3155_FAILURE; ++ goto err; + } + + DT_3155_DEBUG_MSG("DT3155: IRQ is %d \n",irq); +@@ -1029,6 +1029,10 @@ static int find_PCI (void) + ndevices = pci_index; + + return DT_3155_SUCCESS; ++ ++err: ++ pci_dev_put(pci_dev); ++ return DT_3155_FAILURE; + } + + u_long allocatorAddr = 0; diff --git a/staging/staging-et131x_netdev.c-use-pm-to-shown-mac-address.patch b/staging/staging-et131x_netdev.c-use-pm-to-shown-mac-address.patch new file mode 100644 index 00000000000000..0ab791f0e51cf8 --- /dev/null +++ b/staging/staging-et131x_netdev.c-use-pm-to-shown-mac-address.patch @@ -0,0 +1,36 @@ +From hartleys@visionengravers.com Thu Jan 14 16:26:14 2010 +From: "H Hartley Sweeten" <hartleys@visionengravers.com> +Date: Mon, 28 Dec 2009 19:21:34 -0500 +Subject: Staging: et131x_netdev.c: use %pM to shown MAC address +To: <gregkh@suse.de> +Cc: <o.hartmann@telovital.com> +Message-ID: <BD79186B4FD85F4B8E60E381CAEE19090200F4D3@mi8nycmail19.Mi8.com> + + +Trivial, use the %pM kernel extension to display the MAC address. + +Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> +Cc: Olaf Hartmann <o.hartmann@telovital.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/et131x/et131x_netdev.c | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +--- a/drivers/staging/et131x/et131x_netdev.c ++++ b/drivers/staging/et131x/et131x_netdev.c +@@ -674,12 +674,8 @@ int et131x_set_mac_addr(struct net_devic + + memcpy(netdev->dev_addr, address->sa_data, netdev->addr_len); + +- printk(KERN_INFO +- "%s: Setting MAC address to %02x:%02x:%02x:%02x:%02x:%02x\n", +- netdev->name, +- netdev->dev_addr[0], netdev->dev_addr[1], +- netdev->dev_addr[2], netdev->dev_addr[3], +- netdev->dev_addr[4], netdev->dev_addr[5]); ++ printk(KERN_INFO "%s: Setting MAC address to %pM\n", ++ netdev->name, netdev->dev_addr); + + /* Free Rx DMA memory */ + et131x_adapter_memory_free(adapter); diff --git a/staging/staging-otus-80211core-fix-confusion.patch b/staging/staging-otus-80211core-fix-confusion.patch new file mode 100644 index 00000000000000..d06022e2428b91 --- /dev/null +++ b/staging/staging-otus-80211core-fix-confusion.patch @@ -0,0 +1,28 @@ +From roel.kluin@gmail.com Thu Jan 14 16:28:33 2010 +From: Roel Kluin <roel.kluin@gmail.com> +Date: Thu, 31 Dec 2009 13:28:32 +0100 +Subject: Staging: otus: 80211core: Fix &&/|| confusion +To: Greg Kroah-Hartman <gregkh@suse.de>, devel@driverdev.osuosl.org, Andrew Morton <akpm@linux-foundation.org> +Message-ID: <4B3C98F0.9060309@gmail.com> + + +This always evaluates to true. + +Signed-off-by: Roel Kluin <roel.kluin@gmail.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/otus/80211core/cmmsta.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/staging/otus/80211core/cmmsta.c ++++ b/drivers/staging/otus/80211core/cmmsta.c +@@ -2808,7 +2808,7 @@ void zfStaProcessProbeReq(zdev_t* dev, z + zmw_get_wlan_dev(dev); + + /* check mode : AP/IBSS */ +- if ((wd->wlanMode != ZM_MODE_AP) || (wd->wlanMode != ZM_MODE_IBSS)) ++ if ((wd->wlanMode != ZM_MODE_AP) && (wd->wlanMode != ZM_MODE_IBSS)) + { + zm_msg0_mm(ZM_LV_3, "Ignore probe req"); + return; diff --git a/staging/staging-otus-off-by-one-in-usbdrvwext_siwessid.patch b/staging/staging-otus-off-by-one-in-usbdrvwext_siwessid.patch new file mode 100644 index 00000000000000..0c110fcb522628 --- /dev/null +++ b/staging/staging-otus-off-by-one-in-usbdrvwext_siwessid.patch @@ -0,0 +1,31 @@ +From error27@gmail.com Thu Jan 14 16:25:57 2010 +From: Dan Carpenter <error27@gmail.com> +Date: Mon, 28 Dec 2009 19:01:34 +0200 +Subject: Staging: otus: off by one in usbdrvwext_siwessid() +To: Luis.Rodriguez@Atheros.com +Cc: otus-devel@lists.madwifi-project.org, devel@driverdev.osuosl.org, Greg Kroah-Hartman <gregkh@suse.de> +Message-ID: <20091228170134.GF17645@bicker> +Content-Disposition: inline + + +A 33 char ESSID is too long and it could cause a buffer overflow +a couple lines below when we put a NULL terminator on the end. + +Signed-off-by: Dan Carpenter <error27@gmail.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/otus/ioctl.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/staging/otus/ioctl.c ++++ b/drivers/staging/otus/ioctl.c +@@ -930,7 +930,7 @@ int usbdrvwext_siwessid(struct net_devic + return -EINVAL; + + if (essid->flags == 1) { +- if (essid->length > (IW_ESSID_MAX_SIZE + 1)) ++ if (essid->length > IW_ESSID_MAX_SIZE) + return -E2BIG; + + if (copy_from_user(&EssidBuf, essid->pointer, essid->length)) diff --git a/staging/staging-r8192e_core.c-use-pm-to-shown-mac-address.patch b/staging/staging-r8192e_core.c-use-pm-to-shown-mac-address.patch new file mode 100644 index 00000000000000..2269ec7e5f28ba --- /dev/null +++ b/staging/staging-r8192e_core.c-use-pm-to-shown-mac-address.patch @@ -0,0 +1,31 @@ +From hartleys@visionengravers.com Thu Jan 14 16:26:26 2010 +From: "H Hartley Sweeten" <hartleys@visionengravers.com> +Date: Mon, 28 Dec 2009 19:28:11 -0500 +Subject: Staging: r8192E_core.c: use %pM to shown MAC address +To: <gregkh@suse.de> +Message-ID: <BD79186B4FD85F4B8E60E381CAEE19090200F4D5@mi8nycmail19.Mi8.com> + + +Trivial, use the %pM kernel extension to display the MAC address. + +Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/rtl8192e/r8192E_core.c | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +--- a/drivers/staging/rtl8192e/r8192E_core.c ++++ b/drivers/staging/rtl8192e/r8192E_core.c +@@ -2814,10 +2814,7 @@ static void rtl8192_read_eeprom_info(str + memcpy(dev->dev_addr, bMac_Tmp_Addr, 6); + } + +- RT_TRACE(COMP_INIT, "Permanent Address = %02x-%02x-%02x-%02x-%02x-%02x\n", +- dev->dev_addr[0], dev->dev_addr[1], +- dev->dev_addr[2], dev->dev_addr[3], +- dev->dev_addr[4], dev->dev_addr[5]); ++ RT_TRACE(COMP_INIT, "Permanent Address = %pM\n", dev->dev_addr); + + //2 TX Power Check EEPROM Fail or not + if(priv->card_8192_version > VERSION_8190_BD) { diff --git a/staging/staging-ramzswap-minor-spelling-fixes.patch b/staging/staging-ramzswap-minor-spelling-fixes.patch new file mode 100644 index 00000000000000..e49b7ef1fc7634 --- /dev/null +++ b/staging/staging-ramzswap-minor-spelling-fixes.patch @@ -0,0 +1,129 @@ +From cyp561@gmail.com Thu Jan 14 16:24:36 2010 +From: C yp <cyp561@gmail.com> +Date: Wed, 6 Jan 2010 13:42:00 +0100 +Subject: Staging: ramzswap: Minor spelling fixes +To: Greg KH <greg@kroah.com> +Cc: Nitin Gupta <ngupta@vflare.org> +Message-ID: <bebc5b271001060442s30ad10canc8ae7d7a1a414eb3@mail.gmail.com> + + + +Also removed an extra semicolon. + +Signed-off-by: Cyp <cyp561@gmail.com> +Cc: Nitin Gupta <ngupta@vflare.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/ramzswap/Kconfig | 2 +- + drivers/staging/ramzswap/ramzswap.txt | 6 +++--- + drivers/staging/ramzswap/ramzswap_drv.c | 4 ++-- + drivers/staging/ramzswap/ramzswap_drv.h | 6 +++--- + drivers/staging/ramzswap/ramzswap_ioctl.h | 4 ++-- + drivers/staging/ramzswap/xvmalloc.c | 2 +- + drivers/staging/ramzswap/xvmalloc_int.h | 2 +- + 7 files changed, 13 insertions(+), 13 deletions(-) + +--- a/drivers/staging/ramzswap/Kconfig ++++ b/drivers/staging/ramzswap/Kconfig +@@ -5,7 +5,7 @@ config RAMZSWAP + select LZO_DECOMPRESS + default n + help +- Creates virtual block devices which can be used (only) as a swap ++ Creates virtual block devices which can (only) be used as swap + disks. Pages swapped to these disks are compressed and stored in + memory itself. + +--- a/drivers/staging/ramzswap/ramzswap_drv.c ++++ b/drivers/staging/ramzswap/ramzswap_drv.c +@@ -730,7 +730,7 @@ static int ramzswap_read(struct ramzswap + if (!rzs->table[index].page) + return handle_ramzswap_fault(rzs, bio); + +- /* Page is stored uncompressed since its incompressible */ ++ /* Page is stored uncompressed since it's incompressible */ + if (unlikely(rzs_test_flag(rzs, index, RZS_UNCOMPRESSED))) + return handle_uncompressed_page(rzs, bio); + +@@ -792,7 +792,7 @@ static int ramzswap_write(struct ramzswa + ramzswap_free_page(rzs, index); + + /* +- * No memory ia allocated for zero filled pages. ++ * No memory is allocated for zero filled pages. + * Simply clear zero page flag. + */ + if (rzs_test_flag(rzs, index, RZS_ZERO)) { +--- a/drivers/staging/ramzswap/ramzswap_drv.h ++++ b/drivers/staging/ramzswap/ramzswap_drv.h +@@ -102,7 +102,7 @@ struct table { + u16 offset; + u8 count; /* object ref count (not yet used) */ + u8 flags; +-} __attribute__((aligned(4)));; ++} __attribute__((aligned(4))); + + /* + * Swap extent information in case backing swap is a regular +@@ -121,8 +121,8 @@ struct ramzswap_stats { + #if defined(CONFIG_RAMZSWAP_STATS) + u64 num_reads; /* failed + successful */ + u64 num_writes; /* --do-- */ +- u64 failed_reads; /* can happen when memory is too low */ +- u64 failed_writes; /* should NEVER! happen */ ++ u64 failed_reads; /* should NEVER! happen */ ++ u64 failed_writes; /* can happen when memory is too low */ + u64 invalid_io; /* non-swap I/O requests */ + u32 pages_zero; /* no. of zero filled pages */ + u32 pages_stored; /* no. of pages currently stored */ +--- a/drivers/staging/ramzswap/ramzswap_ioctl.h ++++ b/drivers/staging/ramzswap/ramzswap_ioctl.h +@@ -24,8 +24,8 @@ struct ramzswap_ioctl_stats { + * size (if present) */ + u64 num_reads; /* failed + successful */ + u64 num_writes; /* --do-- */ +- u64 failed_reads; /* can happen when memory is too low */ +- u64 failed_writes; /* should NEVER! happen */ ++ u64 failed_reads; /* should NEVER! happen */ ++ u64 failed_writes; /* can happen when memory is too low */ + u64 invalid_io; /* non-swap I/O requests */ + u32 pages_zero; /* no. of zero filled pages */ + u32 good_compress_pct; /* no. of pages with compression ratio<=50% */ +--- a/drivers/staging/ramzswap/ramzswap.txt ++++ b/drivers/staging/ramzswap/ramzswap.txt +@@ -5,9 +5,9 @@ Project home: http://compcache.googlecod + + * Introduction + +-It creates RAM based block devices which can be used (only) as swap disks. +-Pages swapped to these devices are compressed and stored in memory itself. +-See project home for use cases, performance numbers and a lot more. ++The ramzswap module creates RAM based block devices which can (only) be used as ++swap disks. Pages swapped to these devices are compressed and stored in memory ++itself. See project home for use cases, performance numbers and a lot more. + + Individual ramzswap devices are configured and initialized using rzscontrol + userspace utility as shown in examples below. See rzscontrol man page for more +--- a/drivers/staging/ramzswap/xvmalloc.c ++++ b/drivers/staging/ramzswap/xvmalloc.c +@@ -273,7 +273,7 @@ static void remove_block(struct xv_pool + } + + /* +- * Allocate a page and add it freelist of given pool. ++ * Allocate a page and add it to freelist of given pool. + */ + static int grow_pool(struct xv_pool *pool, gfp_t flags) + { +--- a/drivers/staging/ramzswap/xvmalloc_int.h ++++ b/drivers/staging/ramzswap/xvmalloc_int.h +@@ -62,7 +62,7 @@ struct link_free { + + struct block_header { + union { +- /* This common header must be ALIGN bytes */ ++ /* This common header must be XV_ALIGN bytes */ + u8 common[XV_ALIGN]; + struct { + u16 size; diff --git a/staging/staging-rar-fix-all-coding-style-issues.patch b/staging/staging-rar-fix-all-coding-style-issues.patch new file mode 100644 index 00000000000000..1419888bc6a9bf --- /dev/null +++ b/staging/staging-rar-fix-all-coding-style-issues.patch @@ -0,0 +1,379 @@ +From b.adolphi@googlemail.com Thu Jan 14 16:28:18 2010 +From: Benjamin Adolphi <b.adolphi@googlemail.com> +Date: Thu, 31 Dec 2009 21:54:46 +1300 +Subject: Staging: rar: Fix all coding style issues. +To: Greg Kroah-Hartman <gregkh@suse.de> +Cc: Benjamin Adolphi <b.adolphi@gmail.com> +Message-ID: <1262249686-2642-1-git-send-email-b.adolphi@gmail.com> + + +This fixes all coding style issues and some spelling mistakes. + +Signed-off-by: Benjamin Adolphi <b.adolphi@gmail.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/rar/rar_driver.c | 132 ++++++++++++++++++--------------------- + drivers/staging/rar/rar_driver.h | 68 ++++++++------------ + 2 files changed, 93 insertions(+), 107 deletions(-) + +--- a/drivers/staging/rar/rar_driver.c ++++ b/drivers/staging/rar/rar_driver.c +@@ -68,7 +68,8 @@ static void __exit rar_exit_handler(void + /* + function that is activated on the successfull probe of the RAR device + */ +-static int __devinit rar_probe(struct pci_dev *pdev, const struct pci_device_id *ent); ++static int __devinit rar_probe(struct pci_dev *pdev, ++ const struct pci_device_id *ent); + + static struct pci_device_id rar_pci_id_tbl[] = { + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4110) }, +@@ -86,9 +87,9 @@ static struct pci_driver rar_pci_driver + + /* This function is used to retrieved RAR info using the IPC message + bus interface */ +-static int memrar_get_rar_addr(struct pci_dev* pdev, +- int offset, +- u32 *addr) ++static int memrar_get_rar_addr(struct pci_dev *pdev, ++ int offset, ++ u32 *addr) + { + /* + * ======== The Lincroft Message Bus Interface ======== +@@ -140,29 +141,29 @@ static int memrar_get_rar_addr(struct pc + | (offset << 8) + | (LNC_MESSAGE_BYTE_WRITE_ENABLES << 4); + +- printk(KERN_WARNING "rar- offset to LNC MSG is %x\n",offset); ++ printk(KERN_WARNING "rar- offset to LNC MSG is %x\n", offset); + + if (addr == 0) + return -EINVAL; + + /* Send the control message */ + result = pci_write_config_dword(pdev, +- LNC_MCR_OFFSET, +- message); ++ LNC_MCR_OFFSET, ++ message); + +- printk(KERN_WARNING "rar- result from send ctl register is %x\n" +- ,result); ++ printk(KERN_WARNING "rar- result from send ctl register is %x\n", ++ result); + + if (!result) + result = pci_read_config_dword(pdev, +- LNC_MDR_OFFSET, +- addr); ++ LNC_MDR_OFFSET, ++ addr); + + printk(KERN_WARNING "rar- result from read data register is %x\n", +- result); ++ result); + + printk(KERN_WARNING "rar- value read from data register is %x\n", +- *addr); ++ *addr); + + if (result) + return -1; +@@ -170,9 +171,9 @@ static int memrar_get_rar_addr(struct pc + return 0; + } + +-static int memrar_set_rar_addr(struct pci_dev* pdev, +- int offset, +- u32 addr) ++static int memrar_set_rar_addr(struct pci_dev *pdev, ++ int offset, ++ u32 addr) + { + /* + * ======== The Lincroft Message Bus Interface ======== +@@ -225,29 +226,29 @@ static int memrar_set_rar_addr(struct pc + | (offset << 8) + | (LNC_MESSAGE_BYTE_WRITE_ENABLES << 4); + +- printk(KERN_WARNING "rar- offset to LNC MSG is %x\n",offset); ++ printk(KERN_WARNING "rar- offset to LNC MSG is %x\n", offset); + + if (addr == 0) + return -EINVAL; + + /* Send the control message */ + result = pci_write_config_dword(pdev, +- LNC_MDR_OFFSET, +- addr); ++ LNC_MDR_OFFSET, ++ addr); + +- printk(KERN_WARNING "rar- result from send ctl register is %x\n" +- ,result); ++ printk(KERN_WARNING "rar- result from send ctl register is %x\n", ++ result); + + if (!result) + result = pci_write_config_dword(pdev, +- LNC_MCR_OFFSET, +- message); ++ LNC_MCR_OFFSET, ++ message); + + printk(KERN_WARNING "rar- result from write data register is %x\n", +- result); ++ result); + + printk(KERN_WARNING "rar- value read to data register is %x\n", +- addr); ++ addr); + + if (result) + return -1; +@@ -284,35 +285,36 @@ static int memrar_init_rar_params(struct + /* struct pci_dev *pdev = pci_get_bus_and_slot(0, PCI_DEVFN(0,0)); */ + + if (pdev == NULL) +- return -ENODEV; ++ return -ENODEV; + + for (i = offsets; i != end; ++i, ++n) { +- if (memrar_get_rar_addr (pdev, +- (*i).low, +- &(rar_addr[n].low)) != 0 +- || memrar_get_rar_addr (pdev, +- (*i).high, +- &(rar_addr[n].high)) != 0) { +- result = -1; +- break; +- } ++ if (memrar_get_rar_addr(pdev, ++ (*i).low, ++ &(rar_addr[n].low)) != 0 ++ || memrar_get_rar_addr(pdev, ++ (*i).high, ++ &(rar_addr[n].high)) != 0) { ++ result = -1; ++ break; ++ } + } + + /* Done accessing the device. */ + /* pci_dev_put(pdev); */ + + if (result == 0) { +- if(1) { +- size_t z; +- for (z = 0; z != MRST_NUM_RAR; ++z) { +- printk(KERN_WARNING "rar - BRAR[%Zd] physical address low\n" +- "\tlow: 0x%08x\n" +- "\thigh: 0x%08x\n", +- z, +- rar_addr[z].low, +- rar_addr[z].high); ++ if (1) { ++ size_t z; ++ for (z = 0; z != MRST_NUM_RAR; ++z) { ++ printk(KERN_WARNING ++ "rar - BRAR[%Zd] physical address low\n" ++ "\tlow: 0x%08x\n" ++ "\thigh: 0x%08x\n", ++ z, ++ rar_addr[z].low, ++ rar_addr[z].high); + } +- } ++ } + } + + return result; +@@ -321,7 +323,8 @@ static int memrar_init_rar_params(struct + /* + function that is activated on the successfull probe of the RAR device + */ +-static int __devinit rar_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ++static int __devinit rar_probe(struct pci_dev *pdev, ++ const struct pci_device_id *ent) + { + /* error */ + int error; +@@ -347,7 +350,7 @@ static int __devinit rar_probe(struct pc + + /* Initialize the RAR parameters, which have to be retrieved */ + /* via the message bus service */ +- error=memrar_init_rar_params(rar_dev); ++ error = memrar_init_rar_params(rar_dev); + + if (error) { + DEBUG_PRINT_0(RAR_DEBUG_LEVEL_EXTENDED, +@@ -362,8 +365,8 @@ end_function: + } + + /* +- this function registers th driver to +- the device subsystem( either PCI, USB, etc) ++ this function registers the driver to ++ the device subsystem (either PCI, USB, etc) + */ + static int __init rar_init_handler(void) + { +@@ -396,25 +399,20 @@ MODULE_LICENSE("GPL"); + * The function returns a 0 upon success or a -1 if there is no RAR + * facility on this system. + */ +-int get_rar_address(int rar_index,struct RAR_address_struct *addresses) ++int get_rar_address(int rar_index, struct RAR_address_struct *addresses) + { + if (registered && (rar_index < 3) && (rar_index >= 0)) { +- *addresses=rar_addr[rar_index]; ++ *addresses = rar_addr[rar_index]; + /* strip off lock bit information */ + addresses->low = addresses->low & 0xfffffff0; + addresses->high = addresses->high & 0xfffffff0; + return 0; +- } +- +- else { ++ } else + return -ENODEV; +- } + } +- +- + EXPORT_SYMBOL(get_rar_address); + +-/* The lock_rar function is ued by other device drivers to lock an RAR. ++/* The lock_rar function is used by other device drivers to lock an RAR. + * once an RAR is locked, it stays locked until the next system reboot. + * The function takes one parameter: + * +@@ -429,16 +427,14 @@ int lock_rar(int rar_index) + { + u32 working_addr; + int result; +-if (registered && (rar_index < 3) && (rar_index >= 0)) { +- /* first make sure that lock bits are clear (this does lock) */ +- working_addr=rar_addr[rar_index].low & 0xfffffff0; + +- /* now send that value to the register using the IPC */ +- result=memrar_set_rar_addr(rar_dev,rar_index,working_addr); +- return result; +- } ++ if (registered && (rar_index < 3) && (rar_index >= 0)) { ++ /* first make sure that lock bits are clear (this does lock) */ ++ working_addr = rar_addr[rar_index].low & 0xfffffff0; + +-else { +- return -ENODEV; +- } ++ /* now send that value to the register using the IPC */ ++ result = memrar_set_rar_addr(rar_dev, rar_index, working_addr); ++ return result; ++ } else ++ return -ENODEV; + } +--- a/drivers/staging/rar/rar_driver.h ++++ b/drivers/staging/rar/rar_driver.h +@@ -1,7 +1,7 @@ + /* === RAR Physical Addresses === */ + struct RAR_address_struct { +- u32 low; +- u32 high; ++ u32 low; ++ u32 high; + }; + + /* The get_rar_address function is used by other device drivers +@@ -19,10 +19,10 @@ struct RAR_address_struct { + * The function returns a 0 upon success or a -1 if there is no RAR + * facility on this system. + */ +-int get_rar_address(int rar_index,struct RAR_address_struct *addresses); ++int get_rar_address(int rar_index, struct RAR_address_struct *addresses); + + +-/* The lock_rar function is ued by other device drivers to lock an RAR. ++/* The lock_rar function is used by other device drivers to lock an RAR. + * once an RAR is locked, it stays locked until the next system reboot. + * The function takes one parameter: + * +@@ -49,51 +49,41 @@ int lock_rar(int rar_index); + + /* debug macro without paramaters */ + #define DEBUG_PRINT_0(DEBUG_LEVEL , info) \ +-do \ +-{ \ +- if(DEBUG_LEVEL) \ +- { \ +- printk(KERN_WARNING info); \ +- } \ +-}while(0) ++do { \ ++ if (DEBUG_LEVEL) { \ ++ printk(KERN_WARNING info); \ ++ } \ ++} while (0) + + /* debug macro with 1 paramater */ + #define DEBUG_PRINT_1(DEBUG_LEVEL , info , param1) \ +-do \ +-{ \ +- if(DEBUG_LEVEL) \ +- { \ +- printk(KERN_WARNING info , param1); \ +- } \ +-}while(0) ++do { \ ++ if (DEBUG_LEVEL) { \ ++ printk(KERN_WARNING info , param1); \ ++ } \ ++} while (0) + + /* debug macro with 2 paramaters */ + #define DEBUG_PRINT_2(DEBUG_LEVEL , info , param1, param2) \ +-do \ +-{ \ +- if(DEBUG_LEVEL) \ +- { \ +- printk(KERN_WARNING info , param1, param2); \ +- } \ +-}while(0) ++do { \ ++ if (DEBUG_LEVEL) { \ ++ printk(KERN_WARNING info , param1, param2); \ ++ } \ ++} while (0) + + /* debug macro with 3 paramaters */ + #define DEBUG_PRINT_3(DEBUG_LEVEL , info , param1, param2 , param3) \ +-do \ +-{ \ +- if(DEBUG_LEVEL) \ +- { \ +- printk(KERN_WARNING info , param1, param2 , param3); \ +- } \ +-}while(0) ++do { \ ++ if (DEBUG_LEVEL) { \ ++ printk(KERN_WARNING info , param1, param2 , param3); \ ++ } \ ++} while (0) + + /* debug macro with 4 paramaters */ + #define DEBUG_PRINT_4(DEBUG_LEVEL , info , param1, param2 , param3 , param4) \ +-do \ +-{ \ +- if(DEBUG_LEVEL) \ +- { \ +- printk(KERN_WARNING info , param1, param2 , param3 , param4); \ +- } \ +-}while(0) ++do { \ ++ if (DEBUG_LEVEL) { \ ++ printk(KERN_WARNING info , param1, param2 , param3 , param4); \ ++ } \ ++} while (0) + diff --git a/staging/staging-rt2870-remove-unnecessary-forward-declarations.patch b/staging/staging-rt2870-remove-unnecessary-forward-declarations.patch new file mode 100644 index 00000000000000..451cdee7203f84 --- /dev/null +++ b/staging/staging-rt2870-remove-unnecessary-forward-declarations.patch @@ -0,0 +1,30 @@ +From horms@verge.net.au Thu Jan 14 16:15:28 2010 +From: Simon Horman <horms@verge.net.au> +Date: Wed, 23 Dec 2009 19:54:51 +1100 +Subject: Staging: rt2870: Remove unnecessary forward declarations +To: Greg Kroah-Hartman <gregkh@suse.de> +Message-ID: <20091223085552.509728539@vergenet.net> + + +Remove unnecessary forward declaration of rtusb_probe() and rtusb_disconnect() + +Signed-off-by: Simon Horman <horms@verge.net.au> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/rt2860/usb_main_dev.c | 4 ---- + 1 file changed, 4 deletions(-) + +--- a/drivers/staging/rt2860/usb_main_dev.c ++++ b/drivers/staging/rt2860/usb_main_dev.c +@@ -216,10 +216,6 @@ static int rt2870_suspend(struct usb_int + static int rt2870_resume(struct usb_interface *intf); + #endif /* CONFIG_PM // */ + +-static int rtusb_probe(struct usb_interface *intf, +- const struct usb_device_id *id); +-static void rtusb_disconnect(struct usb_interface *intf); +- + static BOOLEAN USBDevConfigInit(IN struct usb_device *dev, + IN struct usb_interface *intf, + struct rt_rtmp_adapter *pAd) diff --git a/staging/staging-rt2870-rtusb_probe-should-be-in-section-__devinit.patch b/staging/staging-rt2870-rtusb_probe-should-be-in-section-__devinit.patch new file mode 100644 index 00000000000000..25eb690f59ea38 --- /dev/null +++ b/staging/staging-rt2870-rtusb_probe-should-be-in-section-__devinit.patch @@ -0,0 +1,34 @@ +From horms@verge.net.au Thu Jan 14 16:14:41 2010 +From: Simon Horman <horms@verge.net.au> +Date: Wed, 23 Dec 2009 19:54:50 +1100 +Subject: Staging: rt2870: rtusb_probe() should be in section __devinit +To: Greg Kroah-Hartman <gregkh@suse.de> +Message-ID: <20091223085552.225938423@vergenet.net> + + +$ make CONFIG_DEBUG_SECTION_MISMATCH=y +WARNING: drivers/staging/rt2870/rt2870sta.o(.text+0x2f4c5): Section +mismatch in reference from the function rtusb_probe() to the function .devinit.text:rt2870_probe() +The function rtusb_probe() references +the function __devinit rt2870_probe(). +This is often because rtusb_probe lacks a __devinit +annotation or the annotation of rt2870_probe is wrong. + +Signed-off-by: Simon Horman <horms@verge.net.au> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/rt2860/usb_main_dev.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/staging/rt2860/usb_main_dev.c ++++ b/drivers/staging/rt2860/usb_main_dev.c +@@ -296,7 +296,7 @@ static BOOLEAN USBDevConfigInit(IN struc + + } + +-static int rtusb_probe(struct usb_interface *intf, ++static int __devinit rtusb_probe(struct usb_interface *intf, + const struct usb_device_id *id) + { + struct rt_rtmp_adapter *pAd; diff --git a/staging/staging-rtl8192e-print-the-elements-of-tx_pn-and-rx_pn-not-the-arrays-themselves.patch b/staging/staging-rtl8192e-print-the-elements-of-tx_pn-and-rx_pn-not-the-arrays-themselves.patch new file mode 100644 index 00000000000000..d4e0fff6d2b7c2 --- /dev/null +++ b/staging/staging-rtl8192e-print-the-elements-of-tx_pn-and-rx_pn-not-the-arrays-themselves.patch @@ -0,0 +1,44 @@ +From horms@verge.net.au Thu Jan 14 16:15:41 2010 +From: Simon Horman <horms@verge.net.au> +Date: Wed, 23 Dec 2009 19:54:52 +1100 +Subject: Staging: rtl8192e: print the elements of tx_pn and rx_pn not the arrays themselves +To: Greg Kroah-Hartman <gregkh@suse.de> +Message-ID: <20091223085552.784470965@vergenet.net> + + +Signed-off-by: Simon Horman <horms@verge.net.au> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + + +--- + drivers/staging/rtl8192e/ieee80211/ieee80211_crypt_ccmp.c | 19 +++++++++----- + 1 file changed, 13 insertions(+), 6 deletions(-) + +--- a/drivers/staging/rtl8192e/ieee80211/ieee80211_crypt_ccmp.c ++++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_crypt_ccmp.c +@@ -475,12 +475,19 @@ static int ieee80211_ccmp_get_key(void * + static char * ieee80211_ccmp_print_stats(char *p, void *priv) + { + struct ieee80211_ccmp_data *ccmp = priv; +- p += sprintf(p, "key[%d] alg=CCMP key_set=%d " +- "tx_pn=%02x%02x%02x%02x%02x%02x " +- "rx_pn=%02x%02x%02x%02x%02x%02x " +- "format_errors=%d replays=%d decrypt_errors=%d\n", +- ccmp->key_idx, ccmp->key_set, +- ccmp->tx_pn, ccmp->rx_pn, ++ int i; ++ ++ p += sprintf(p, "key[%d] alg=CCMP key_set=%d tx_pn=", ++ ccmp->key_idx, ccmp->key_set); ++ ++ for (i = 0; i < ARRAY_SIZE(ccmp->tx_pn); i++) ++ p += sprintf(p, "%02x", ccmp->tx_pn[i]); ++ ++ sprintf(p, " rx_pn="); ++ for (i = 0; i < ARRAY_SIZE(ccmp->rx_pn); i++) ++ p += sprintf(p, "%02x", ccmp->tx_pn[i]); ++ ++ p += sprintf(p, " format_errors=%d replays=%d decrypt_errors=%d\n", + ccmp->dot11RSNAStatsCCMPFormatErrors, + ccmp->dot11RSNAStatsCCMPReplays, + ccmp->dot11RSNAStatsCCMPDecryptErrors); diff --git a/staging/staging-rtl8192e-remove-some-functions-from-the-__exit-section.patch b/staging/staging-rtl8192e-remove-some-functions-from-the-__exit-section.patch new file mode 100644 index 00000000000000..5e11530bf44f51 --- /dev/null +++ b/staging/staging-rtl8192e-remove-some-functions-from-the-__exit-section.patch @@ -0,0 +1,55 @@ +From horms@verge.net.au Thu Jan 14 16:16:04 2010 +From: Simon Horman <horms@verge.net.au> +Date: Wed, 23 Dec 2009 19:54:53 +1100 +Subject: Staging: rtl8192e: remove some functions from the __exit section +To: Greg Kroah-Hartman <gregkh@suse.de> +Message-ID: <20091223085553.089696530@vergenet.net> + + +ieee80211_crypto_tkip_exit(), ieee80211_crypto_deinit() and +ieee80211_crypto_ccmp_exit() are called by ieee80211_rtl_init() +which are in section __init, so they can't be in section __exit. + +Signed-off-by: Simon Horman <horms@verge.net.au> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + + +--- + drivers/staging/rtl8192e/ieee80211/ieee80211_crypt.c | 2 +- + drivers/staging/rtl8192e/ieee80211/ieee80211_crypt_ccmp.c | 2 +- + drivers/staging/rtl8192e/ieee80211/ieee80211_crypt_tkip.c | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/staging/rtl8192e/ieee80211/ieee80211_crypt.c ++++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_crypt.c +@@ -225,7 +225,7 @@ out: + } + + +-void __exit ieee80211_crypto_deinit(void) ++void ieee80211_crypto_deinit(void) + { + struct list_head *ptr, *n; + +--- a/drivers/staging/rtl8192e/ieee80211/ieee80211_crypt_ccmp.c ++++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_crypt_ccmp.c +@@ -524,7 +524,7 @@ int __init ieee80211_crypto_ccmp_init(vo + } + + +-void __exit ieee80211_crypto_ccmp_exit(void) ++void ieee80211_crypto_ccmp_exit(void) + { + ieee80211_unregister_crypto_ops(&ieee80211_crypt_ccmp); + } +--- a/drivers/staging/rtl8192e/ieee80211/ieee80211_crypt_tkip.c ++++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_crypt_tkip.c +@@ -1012,7 +1012,7 @@ int __init ieee80211_crypto_tkip_init(vo + } + + +-void __exit ieee80211_crypto_tkip_exit(void) ++void ieee80211_crypto_tkip_exit(void) + { + ieee80211_unregister_crypto_ops(&ieee80211_crypt_tkip); + } diff --git a/staging/staging-rtl8192su-buffer-overflow-in-r8192u_core.c.patch b/staging/staging-rtl8192su-buffer-overflow-in-r8192u_core.c.patch new file mode 100644 index 00000000000000..2e53545b479d79 --- /dev/null +++ b/staging/staging-rtl8192su-buffer-overflow-in-r8192u_core.c.patch @@ -0,0 +1,194 @@ +From error27@gmail.com Thu Jan 14 16:27:44 2010 +From: Dan Carpenter <error27@gmail.com> +Date: Wed, 30 Dec 2009 18:10:18 +0200 +Subject: Staging: rtl8192su: buffer overflow in r8192U_core.c +To: Greg KH <gregkh@suse.de> +Cc: Jerry chuang <wlanfae@realtek.com> +Message-ID: <20091230161018.GE29476@bicker> +Content-Disposition: inline + + +There was a buffer overflow in the original code. rf_path was 2 and it should +have been only 0 or 1. + +I don't have the hardware for this, so I can't test it. + +Looking at the code, there are two almost identical sections for updating the +hal variables. The first one was clearly wrong and had the array overflow as +well. The second one looked correct. I decided to use the second section as +is except for whitespace changes. + +The differences between the two original sections: +1) The second one had more debug output. +2) The second one looped over rf_path instead of corrupting data. +3) The second one had these additional assigments. + if (rf_path == 0) { + priv->TxPowerLevelOFDM24G[i] = priv->RfTxPwrLevelOfdm1T[rf_path][i] ; + priv->TxPowerLevelCCK[i] = priv->RfTxPwrLevelCck[rf_path][i]; + } + +Signed-off-by: Dan Carpenter <error27@gmail.com> +Cc: Jerry chuang <wlanfae@realtek.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/rtl8192su/r8192U_core.c | 127 ++++++++++---------------------- + 1 file changed, 43 insertions(+), 84 deletions(-) + +--- a/drivers/staging/rtl8192su/r8192U_core.c ++++ b/drivers/staging/rtl8192su/r8192U_core.c +@@ -3359,6 +3359,46 @@ u8 rtl8192SU_BoardTypeToRFtype(struct ne + return RFtype; + } + ++void update_hal_variables(struct r8192_priv *priv) ++{ ++ int rf_path; ++ int i; ++ u8 index; ++ ++ for (rf_path = 0; rf_path < 2; rf_path++) { ++ for (i = 0; i < 3; i++) { ++ RT_TRACE((COMP_INIT), "CCK RF-%d CHan_Area-%d = 0x%x\n", rf_path, i, priv->RfCckChnlAreaTxPwr[rf_path][i]); ++ RT_TRACE((COMP_INIT), "OFDM-1T RF-%d CHan_Area-%d = 0x%x\n", rf_path, i, priv->RfOfdmChnlAreaTxPwr1T[rf_path][i]); ++ RT_TRACE((COMP_INIT), "OFDM-2T RF-%d CHan_Area-%d = 0x%x\n", rf_path, i, priv->RfOfdmChnlAreaTxPwr2T[rf_path][i]); ++ } ++ /* Assign dedicated channel tx power */ ++ for(i = 0; i < 14; i++) { ++ /* channel 1-3 use the same Tx Power Level. */ ++ if (i < 3) /* Channel 1-3 */ ++ index = 0; ++ else if (i < 9) /* Channel 4-9 */ ++ index = 1; ++ else /* Channel 10-14 */ ++ index = 2; ++ /* Record A & B CCK /OFDM - 1T/2T Channel area tx power */ ++ priv->RfTxPwrLevelCck[rf_path][i] = priv->RfCckChnlAreaTxPwr[rf_path][index]; ++ priv->RfTxPwrLevelOfdm1T[rf_path][i] = priv->RfOfdmChnlAreaTxPwr1T[rf_path][index]; ++ priv->RfTxPwrLevelOfdm2T[rf_path][i] = priv->RfOfdmChnlAreaTxPwr2T[rf_path][index]; ++ if (rf_path == 0) { ++ priv->TxPowerLevelOFDM24G[i] = priv->RfTxPwrLevelOfdm1T[rf_path][i] ; ++ priv->TxPowerLevelCCK[i] = priv->RfTxPwrLevelCck[rf_path][i]; ++ } ++ } ++ for(i = 0; i < 14; i++) { ++ RT_TRACE((COMP_INIT), ++ "Rf-%d TxPwr CH-%d CCK OFDM_1T OFDM_2T= 0x%x/0x%x/0x%x\n", ++ rf_path, i, priv->RfTxPwrLevelCck[rf_path][i], ++ priv->RfTxPwrLevelOfdm1T[rf_path][i] , ++ priv->RfTxPwrLevelOfdm2T[rf_path][i] ); ++ } ++ } ++} ++ + // + // Description: + // Config HW adapter information into initial value. +@@ -3374,7 +3414,7 @@ rtl8192SU_ConfigAdapterInfo8192SForAutoL + struct r8192_priv *priv = ieee80211_priv(dev); + //u16 i,usValue; + //u8 sMacAddr[6] = {0x00, 0xE0, 0x4C, 0x81, 0x92, 0x00}; +- u8 rf_path, index; // For EEPROM/EFUSE After V0.6_1117 ++ u8 rf_path; // For EEPROM/EFUSE After V0.6_1117 + int i; + + RT_TRACE(COMP_INIT, "====> ConfigAdapterInfo8192SForAutoLoadFail\n"); +@@ -3454,42 +3494,7 @@ rtl8192SU_ConfigAdapterInfo8192SForAutoL + } + } + +- for (i = 0; i < 3; i++) +- { +- //RT_TRACE((COMP_EFUSE), "CCK RF-%d CHan_Area-%d = 0x%x\n", rf_path, i, +- //priv->RfCckChnlAreaTxPwr[rf_path][i]); +- //RT_TRACE((COMP_EFUSE), "OFDM-1T RF-%d CHan_Area-%d = 0x%x\n", rf_path, i, +- //priv->RfOfdmChnlAreaTxPwr1T[rf_path][i]); +- //RT_TRACE((COMP_EFUSE), "OFDM-2T RF-%d CHan_Area-%d = 0x%x\n", rf_path, i, +- //priv->RfOfdmChnlAreaTxPwr2T[rf_path][i]); +- } +- +- // Assign dedicated channel tx power +- for(i=0; i<14; i++) // channel 1~3 use the same Tx Power Level. +- { +- if (i < 3) // Cjanel 1-3 +- index = 0; +- else if (i < 9) // Channel 4-9 +- index = 1; +- else // Channel 10-14 +- index = 2; +- +- // Record A & B CCK /OFDM - 1T/2T Channel area tx power +- priv->RfTxPwrLevelCck[rf_path][i] = +- priv->RfCckChnlAreaTxPwr[rf_path][index]; +- priv->RfTxPwrLevelOfdm1T[rf_path][i] = +- priv->RfOfdmChnlAreaTxPwr1T[rf_path][index]; +- priv->RfTxPwrLevelOfdm2T[rf_path][i] = +- priv->RfOfdmChnlAreaTxPwr2T[rf_path][index]; +- } +- +- for(i=0; i<14; i++) +- { +- //RT_TRACE((COMP_EFUSE), "Rf-%d TxPwr CH-%d CCK OFDM_1T OFDM_2T= 0x%x/0x%x/0x%x\n", +- //rf_path, i, priv->RfTxPwrLevelCck[0][i], +- //priv->RfTxPwrLevelOfdm1T[0][i] , +- //priv->RfTxPwrLevelOfdm2T[0][i] ); +- } ++ update_hal_variables(priv); + + // + // Update remained HAL variables. +@@ -3899,53 +3904,7 @@ rtl8192SU_ReadAdapterInfo8192SUsb(struct + } + + } +-// +- // Update Tx Power HAL variables. +-// +- for (rf_path = 0; rf_path < 2; rf_path++) +- { +- for (i = 0; i < 3; i++) +- { +- RT_TRACE((COMP_INIT), "CCK RF-%d CHan_Area-%d = 0x%x\n", rf_path, i, +- priv->RfCckChnlAreaTxPwr[rf_path][i]); +- RT_TRACE((COMP_INIT), "OFDM-1T RF-%d CHan_Area-%d = 0x%x\n", rf_path, i, +- priv->RfOfdmChnlAreaTxPwr1T[rf_path][i]); +- RT_TRACE((COMP_INIT), "OFDM-2T RF-%d CHan_Area-%d = 0x%x\n", rf_path, i, priv->RfOfdmChnlAreaTxPwr2T[rf_path][i]); +- } +- +- // Assign dedicated channel tx power +- for(i=0; i<14; i++) // channel 1~3 use the same Tx Power Level. +- { +- if (i < 3) // Cjanel 1-3 +- index = 0; +- else if (i < 9) // Channel 4-9 +- index = 1; +- else // Channel 10-14 +- index = 2; +- +- // Record A & B CCK /OFDM - 1T/2T Channel area tx power +- priv->RfTxPwrLevelCck[rf_path][i] = +- priv->RfCckChnlAreaTxPwr[rf_path][index]; +- priv->RfTxPwrLevelOfdm1T[rf_path][i] = +- priv->RfOfdmChnlAreaTxPwr1T[rf_path][index]; +- priv->RfTxPwrLevelOfdm2T[rf_path][i] = +- priv->RfOfdmChnlAreaTxPwr2T[rf_path][index]; +- if (rf_path == 0) +- { +- priv->TxPowerLevelOFDM24G[i] = priv->RfTxPwrLevelOfdm1T[rf_path][i] ; +- priv->TxPowerLevelCCK[i] = priv->RfTxPwrLevelCck[rf_path][i]; +- } +- } +- +- for(i=0; i<14; i++) +- { +- RT_TRACE((COMP_INIT), +- "Rf-%d TxPwr CH-%d CCK OFDM_1T OFDM_2T= 0x%x/0x%x/0x%x\n", +- rf_path, i, priv->RfTxPwrLevelCck[rf_path][i], +- priv->RfTxPwrLevelOfdm1T[rf_path][i] , +- priv->RfTxPwrLevelOfdm2T[rf_path][i] ); +- } +- } ++ update_hal_variables(priv); + } + + // diff --git a/staging/staging-rtl8192su-rtl8192u-use-min_t-in-store_debug_level.patch b/staging/staging-rtl8192su-rtl8192u-use-min_t-in-store_debug_level.patch new file mode 100644 index 00000000000000..7ddb01e17cfc11 --- /dev/null +++ b/staging/staging-rtl8192su-rtl8192u-use-min_t-in-store_debug_level.patch @@ -0,0 +1,45 @@ +From horms@verge.net.au Thu Jan 14 16:16:23 2010 +From: Simon Horman <horms@verge.net.au> +Date: Wed, 23 Dec 2009 19:54:54 +1100 +Subject: Staging: rtl8192su, rtl8192u: use min_t() in store_debug_level() +To: Greg Kroah-Hartman <gregkh@suse.de> +Message-ID: <20091223085553.389673883@vergenet.net> + + +sizeof() returns a size_t but the other types involved +are unsigned long, so using min() results in a warning. + +As sizeof() is called on an 11 character buffer defined +immediately above unsigned long is obviously wide enough +for the result. + +Signed-off-by: Simon Horman <horms@verge.net.au> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/rtl8192su/ieee80211/ieee80211_module.c | 2 +- + drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/staging/rtl8192su/ieee80211/ieee80211_module.c ++++ b/drivers/staging/rtl8192su/ieee80211/ieee80211_module.c +@@ -262,7 +262,7 @@ static int store_debug_level(struct file + unsigned long count, void *data) + { + char buf[] = "0x00000000"; +- unsigned long len = min(sizeof(buf) - 1, count); ++ unsigned long len = min_t(unsigned long, sizeof(buf) - 1, count); + char *p = (char *)buf; + unsigned long val; + +--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c ++++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +@@ -260,7 +260,7 @@ static int store_debug_level(struct file + unsigned long count, void *data) + { + char buf[] = "0x00000000"; +- unsigned long len = min(sizeof(buf) - 1, count); ++ unsigned long len = min_t(unsigned long, sizeof(buf) - 1, count); + char *p = (char *)buf; + unsigned long val; + diff --git a/staging/staging-sep-fix-build-problems-from-header-changes.patch b/staging/staging-sep-fix-build-problems-from-header-changes.patch new file mode 100644 index 00000000000000..c96d2c2774cbd5 --- /dev/null +++ b/staging/staging-sep-fix-build-problems-from-header-changes.patch @@ -0,0 +1,45 @@ +From alan@linux.intel.com Thu Jan 14 16:29:17 2010 +From: Alan Cox <alan@linux.intel.com> +Date: Mon, 04 Jan 2010 16:24:47 +0000 +Subject: Staging: sep: Fix build problems from header changes +To: greg@kroah.com +Message-ID: <20100104162443.17074.73219.stgit@localhost.localdomain> + + +Signed-off-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/sep/sep_driver.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +--- a/drivers/staging/sep/sep_driver.c ++++ b/drivers/staging/sep/sep_driver.c +@@ -35,6 +35,7 @@ + #include <linux/cdev.h> + #include <linux/kdev_t.h> + #include <linux/mutex.h> ++#include <linux/sched.h> + #include <linux/mm.h> + #include <linux/poll.h> + #include <linux/wait.h> +@@ -273,8 +274,8 @@ static dma_addr_t sep_shared_virt_to_bus + void *virt_address) + { + dma_addr_t pa = sep->shared_bus + (virt_address - sep->shared_addr); +- edbg("sep: virt to bus b %08llx v %p\n", +- (unsigned long long)pa, virt_address); ++ edbg("sep: virt to bus b %08llx v %p\n", (unsigned long long) pa, ++ virt_address); + return pa; + } + +@@ -1771,7 +1772,7 @@ static struct sep_flow_context_t *sep_fi + static int sep_create_flow_dma_tables_handler(struct sep_device *sep, + unsigned long arg) + { +- int error; ++ int error = -ENOENT; + struct sep_driver_build_flow_table_t command_args; + /* first table - output */ + struct sep_lli_entry_t first_table_data; diff --git a/staging/staging-sep-fix-use-of-legacy-ioctl-fop.patch b/staging/staging-sep-fix-use-of-legacy-ioctl-fop.patch new file mode 100644 index 00000000000000..e4e9f06af7283a --- /dev/null +++ b/staging/staging-sep-fix-use-of-legacy-ioctl-fop.patch @@ -0,0 +1,37 @@ +From alan@linux.intel.com Thu Jan 14 16:29:30 2010 +From: Alan Cox <alan@linux.intel.com> +Date: Mon, 04 Jan 2010 16:25:02 +0000 +Subject: Staging: sep: Fix use of legacy ioctl fop +To: greg@kroah.com +Message-ID: <20100104162452.17074.79254.stgit@localhost.localdomain> + + +SEP doesn't need lock_kernel. + +Signed-off-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/sep/sep_driver.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/staging/sep/sep_driver.c ++++ b/drivers/staging/sep/sep_driver.c +@@ -2233,7 +2233,7 @@ static int sep_set_flow_id_handler(struc + return error; + } + +-static int sep_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg) ++static long sep_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) + { + int error = 0; + struct sep_device *sep = filp->private_data; +@@ -2608,7 +2608,7 @@ static dev_t sep_devno; + /* the files operations structure of the driver */ + static struct file_operations sep_file_operations = { + .owner = THIS_MODULE, +- .ioctl = sep_ioctl, ++ .unlocked_ioctl = sep_ioctl, + .poll = sep_poll, + .open = sep_open, + .release = sep_release, diff --git a/staging/staging-vt6655-device_main.c-use-pm-to-shown-mac-address.patch b/staging/staging-vt6655-device_main.c-use-pm-to-shown-mac-address.patch new file mode 100644 index 00000000000000..7fe01be14894a5 --- /dev/null +++ b/staging/staging-vt6655-device_main.c-use-pm-to-shown-mac-address.patch @@ -0,0 +1,34 @@ +From hartleys@visionengravers.com Thu Jan 14 16:27:19 2010 +From: "H Hartley Sweeten" <hartleys@visionengravers.com> +Date: Mon, 28 Dec 2009 19:38:22 -0500 +Subject: Staging: vt6655/device_main.c: use %pM to shown MAC address +To: <gregkh@suse.de> +Cc: <forest@alittletooquiet.net> +Message-ID: <BD79186B4FD85F4B8E60E381CAEE19090200F4D7@mi8nycmail19.Mi8.com> + + +Trivial, use the %pM kernel extension to display the MAC address. + +Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> +Cc: Forest Bond <forest@alittletooquiet.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + + +--- + drivers/staging/vt6655/device_main.c | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +--- a/drivers/staging/vt6655/device_main.c ++++ b/drivers/staging/vt6655/device_main.c +@@ -1105,10 +1105,7 @@ static void device_print_info(PSDevice p + struct net_device* dev=pDevice->dev; + + DBG_PRT(MSG_LEVEL_INFO, KERN_INFO "%s: %s\n",dev->name, get_chip_name(pDevice->chip_id)); +- DBG_PRT(MSG_LEVEL_INFO, KERN_INFO "%s: MAC=%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X", +- dev->name, +- dev->dev_addr[0],dev->dev_addr[1],dev->dev_addr[2], +- dev->dev_addr[3],dev->dev_addr[4],dev->dev_addr[5]); ++ DBG_PRT(MSG_LEVEL_INFO, KERN_INFO "%s: MAC=%pM", dev->name, dev->dev_addr); + #ifdef IO_MAP + DBG_PRT(MSG_LEVEL_INFO, KERN_INFO" IO=0x%lx ",(ULONG) pDevice->ioaddr); + DBG_PRT(MSG_LEVEL_INFO, KERN_INFO" IRQ=%d \n", pDevice->dev->irq); diff --git a/usb/usb-export-usb_quirk_reset_morphs-through-sysfs.patch b/usb/usb-export-usb_quirk_reset_morphs-through-sysfs.patch index bc79b4e63d708f..67211207724dee 100644 --- a/usb/usb-export-usb_quirk_reset_morphs-through-sysfs.patch +++ b/usb/usb-export-usb_quirk_reset_morphs-through-sysfs.patch @@ -37,7 +37,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + const char *buf, size_t count) +{ + struct usb_device *udev = to_usb_device(dev); -+ int config, value; ++ int config; + + if (sscanf(buf, "%d", &config) != 1 || config < 0 || config > 1) + return -EINVAL; |
