From fec2be706dfb1f2f70ffd04319841ec0dfc546b2 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 20 Jan 2011 09:13:14 -0800 Subject: Staging: remove unintended Module.symvers file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit a82ad05ecd9dbd909509a332d3aa5f4ac439a054 (staging: vme: tsi148: fix warning in free_irq) accidentally added a Module.symvers file to the git tree. This patch removes it, sorry about that. Reported-by: Toralf Förster Cc: Emilio G. Cota Signed-off-by: Greg Kroah-Hartman --- drivers/staging/vme/bridges/Module.symvers | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 drivers/staging/vme/bridges/Module.symvers diff --git a/drivers/staging/vme/bridges/Module.symvers b/drivers/staging/vme/bridges/Module.symvers deleted file mode 100644 index e69de29bb2d1..000000000000 -- cgit v1.2.3 From 268eff909afaca93188d2d14554cbf824f6a0e41 Mon Sep 17 00:00:00 2001 From: Ky Srinivasan Date: Thu, 16 Dec 2010 18:59:19 -0700 Subject: Staging: hv: fix sysfs symlink on hv block device The block device does not create the proper symlink in sysfs because we forgot to set up the gendisk structure properly. This patch fixes the issue. Signed-off-by: K. Y. Srinivasan Cc: Hank Janssen Cc: Haiyang Zhang Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers/staging/hv/blkvsc_drv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c index b3d05fcfe6d2..4fb809485d9e 100644 --- a/drivers/staging/hv/blkvsc_drv.c +++ b/drivers/staging/hv/blkvsc_drv.c @@ -368,6 +368,7 @@ static int blkvsc_probe(struct device *device) blkdev->gd->first_minor = 0; blkdev->gd->fops = &block_ops; blkdev->gd->private_data = blkdev; + blkdev->gd->driverfs_dev = &(blkdev->device_ctx->device); sprintf(blkdev->gd->disk_name, "hd%c", 'a' + devnum); blkvsc_do_inquiry(blkdev); -- cgit v1.2.3 From d70c673153d42e8aefd5ac296c8159ef222d076b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Fri, 17 Dec 2010 11:40:24 +0200 Subject: staging: hv: fix netvsc sleeping while atomic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The channel callbacks are called directly from vmbus_event_dpc which runs in tasklet context. These callbacks need to use GFP_ATOMIC. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=16701 Cc: Hank Janssen Cc: Haiyang Zhang Signed-off-by: Timo Teräs Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers/staging/hv/netvsc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c index df9cd131e953..0edbe7483a4c 100644 --- a/drivers/staging/hv/netvsc.c +++ b/drivers/staging/hv/netvsc.c @@ -1279,7 +1279,7 @@ static void netvsc_channel_cb(void *context) /* ASSERT(device); */ packet = kzalloc(NETVSC_PACKET_SIZE * sizeof(unsigned char), - GFP_KERNEL); + GFP_ATOMIC); if (!packet) return; buffer = packet; -- cgit v1.2.3 From a786f915274ba446865a996515c7790a930f04dd Mon Sep 17 00:00:00 2001 From: Hank Janssen Date: Fri, 7 Jan 2011 09:25:39 -0800 Subject: staging: hv: Removed unneeded call to netif_stop_queue() in hv_netvsc Removed the call to netif_stop_queue() in netvsc_probe() as the queue is not initialized at that point and further call to it after queue initialization is really not necessary. This change was prompted after an upstream change went into 2.6.37 (netif_tx_stop_queue) that now checks if netif_stop_queue is called before register with netdev is done. This will eliminate the warning message to the log when hv_netvsc driver starts up. Signed-off-by: Abhishek Kane Signed-off-by: Haiyang Zhang Signed-off-by: Hank Janssen Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers/staging/hv/netvsc_drv.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c index 0147b407512c..54706a16dc0a 100644 --- a/drivers/staging/hv/netvsc_drv.c +++ b/drivers/staging/hv/netvsc_drv.c @@ -358,7 +358,6 @@ static int netvsc_probe(struct device *device) /* Set initial state */ netif_carrier_off(net); - netif_stop_queue(net); net_device_ctx = netdev_priv(net); net_device_ctx->device_ctx = device_ctx; -- cgit v1.2.3 From 64911e4b133ff633563d6dd2b021fa1ca0608992 Mon Sep 17 00:00:00 2001 From: Phillip Simbwa Date: Wed, 29 Dec 2010 12:01:16 -0800 Subject: Staging: ath6kl: fix potential buffer overflow Off by one Signed-off-by: Phillip Simbwa Signed-off-by: Vipin Mehta Signed-off-by: Greg Kroah-Hartman --- drivers/staging/ath6kl/miscdrv/ar3kps/ar3kpsconfig.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/ath6kl/miscdrv/ar3kps/ar3kpsconfig.c b/drivers/staging/ath6kl/miscdrv/ar3kps/ar3kpsconfig.c index 0e298dba9fc8..29b8ab44ea47 100644 --- a/drivers/staging/ath6kl/miscdrv/ar3kps/ar3kpsconfig.c +++ b/drivers/staging/ath6kl/miscdrv/ar3kps/ar3kpsconfig.c @@ -360,8 +360,8 @@ int PSSendOps(void *arg) status = 1; goto complete; } - len = (firmware->size > MAX_BDADDR_FORMAT_LENGTH)? MAX_BDADDR_FORMAT_LENGTH: firmware->size; - memcpy(config_bdaddr, firmware->data,len); + len = min(firmware->size, MAX_BDADDR_FORMAT_LENGTH - 1); + memcpy(config_bdaddr, firmware->data, len); config_bdaddr[len] = '\0'; write_bdaddr(hdev,config_bdaddr,BDADDR_TYPE_STRING); A_RELEASE_FIRMWARE(firmware); -- cgit v1.2.3 From f32b8453e5a5587ae112ba478ae0bbad74e83d22 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 23 Dec 2010 00:07:33 +0300 Subject: Staging: ste_rmi4: use after input_unregister_device() The original code called input_free_device(rmi4_data->input_dev) after input_unregister_device(rmi4_data->input_dev) and that's a double free. This is described in the comments to input_unregister_device(). The normal way to handle this is to make input_register_device() the last function in the probe which can fail. That way you can avoid the call to input_unregister_device() entirely. Signed-off-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman --- drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c index e8f047e86a32..80183a7e6624 100644 --- a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c +++ b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c @@ -986,12 +986,6 @@ static int __devinit synaptics_rmi4_probe input_set_abs_params(rmi4_data->input_dev, ABS_MT_TOUCH_MAJOR, 0, MAX_TOUCH_MAJOR, 0, 0); - retval = input_register_device(rmi4_data->input_dev); - if (retval) { - dev_err(&client->dev, "%s:input register failed\n", __func__); - goto err_input_register; - } - /* Clear interrupts */ synaptics_rmi4_i2c_block_read(rmi4_data, rmi4_data->fn01_data_base_addr + 1, intr_status, @@ -1003,15 +997,20 @@ static int __devinit synaptics_rmi4_probe if (retval) { dev_err(&client->dev, "%s:Unable to get attn irq %d\n", __func__, platformdata->irq_number); - goto err_request_irq; + goto err_unset_clientdata; + } + + retval = input_register_device(rmi4_data->input_dev); + if (retval) { + dev_err(&client->dev, "%s:input register failed\n", __func__); + goto err_free_irq; } return retval; -err_request_irq: +err_free_irq: free_irq(platformdata->irq_number, rmi4_data); - input_unregister_device(rmi4_data->input_dev); -err_input_register: +err_unset_clientdata: i2c_set_clientdata(client, NULL); err_query_dev: if (platformdata->regulator_en) { -- cgit v1.2.3 From a65fd09ac5490133b09d08be91c31ae2f2fa5cad Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Tue, 4 Jan 2011 09:02:27 +0300 Subject: Staging: xgfib: put parenthesis in the right place In the original code the parenthesis are in the wrong position, so the conditions are always true. Signed-off-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman --- drivers/staging/xgifb/vb_setmode.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c index 7016fdd2509f..e19b932492e1 100644 --- a/drivers/staging/xgifb/vb_setmode.c +++ b/drivers/staging/xgifb/vb_setmode.c @@ -3954,8 +3954,8 @@ void XGI_GetCRT2ResInfo(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned char XGI_IsLCDDualLink(struct vb_device_info *pVBInfo) { - if ((((pVBInfo->VBInfo & SetCRT2ToLCD) | SetCRT2ToLCDA)) - && (pVBInfo->LCDInfo & SetLCDDualLink)) /* shampoo0129 */ + if ((pVBInfo->VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) && + (pVBInfo->LCDInfo & SetLCDDualLink)) /* shampoo0129 */ return 1; return 0; @@ -8773,7 +8773,7 @@ unsigned short XGI_GetVCLK2Ptr(unsigned short ModeNo, if (pVBInfo->IF_DEF_LVDS == 0) { CRT2Index = CRT2Index >> 6; /* for LCD */ - if (((pVBInfo->VBInfo & SetCRT2ToLCD) | SetCRT2ToLCDA)) { /*301b*/ + if (pVBInfo->VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { /*301b*/ if (pVBInfo->LCDResInfo != Panel1024x768) VCLKIndex = LCDXlat2VCLK[CRT2Index]; else -- cgit v1.2.3 From 27c82819a5a42f08fc0f787ab1b0c129cbdda801 Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Wed, 12 Jan 2011 22:24:28 -0600 Subject: staging: rt2870sta: Add ID for Linksys WUSB100v2 This device was tested with rt2870sta by setting new_id. Signed-off-by: Larry Finger Tested-by: Brian Ormond Cc: Stable Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rt2860/usb_main_dev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/rt2860/usb_main_dev.c b/drivers/staging/rt2860/usb_main_dev.c index ee68d51caa4e..322bf49ee906 100644 --- a/drivers/staging/rt2860/usb_main_dev.c +++ b/drivers/staging/rt2860/usb_main_dev.c @@ -106,6 +106,7 @@ struct usb_device_id rtusb_usb_id[] = { {USB_DEVICE(0x0411, 0x016f)}, /* MelCo.,Inc. WLI-UC-G301N */ {USB_DEVICE(0x1737, 0x0070)}, /* Linksys WUSB100 */ {USB_DEVICE(0x1737, 0x0071)}, /* Linksys WUSB600N */ + {USB_DEVICE(0x1737, 0x0078)}, /* Linksys WUSB100v2 */ {USB_DEVICE(0x0411, 0x00e8)}, /* Buffalo WLI-UC-G300N */ {USB_DEVICE(0x050d, 0x815c)}, /* Belkin F5D8053 */ {USB_DEVICE(0x100D, 0x9031)}, /* Motorola 2770 */ -- cgit v1.2.3 From 8e290fd41a15e392af87a33c9c4db3daffcd558b Mon Sep 17 00:00:00 2001 From: "Guzman Lugo, Fernando" Date: Thu, 13 Jan 2011 23:34:52 -0600 Subject: staging: tidspbridge: configure full L1 MMU range IVA MMU can manage up to 4GB of address space through its page tables, given that it's L1 is divided into 1MB sections it requires at least 16KB for its table which represents 4096 entries of 32 bits each. Previously, only 1GB was being handled by setting the page table size to 4KB, any virtual address beyond of the L1 size used, would fall into memory that does not belong to L1 translation tables, leading to unpredictable results. So, set the L1 table size to cover the entire MMU range (4GB) whether is meant to be used or not. Reported-by: Felipe Contreras Signed-off-by: Fernando Guzman Lugo Signed-off-by: Felipe Contreras Signed-off-by: Omar Ramirez Luna Signed-off-by: Greg Kroah-Hartman --- drivers/staging/tidspbridge/core/tiomap3430.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/tidspbridge/core/tiomap3430.c b/drivers/staging/tidspbridge/core/tiomap3430.c index a3b0a183d570..c3126e2e23f0 100644 --- a/drivers/staging/tidspbridge/core/tiomap3430.c +++ b/drivers/staging/tidspbridge/core/tiomap3430.c @@ -786,10 +786,7 @@ static int bridge_dev_create(struct bridge_dev_context pt_attrs = kzalloc(sizeof(struct pg_table_attrs), GFP_KERNEL); if (pt_attrs != NULL) { - /* Assuming that we use only DSP's memory map - * until 0x4000:0000 , we would need only 1024 - * L1 enties i.e L1 size = 4K */ - pt_attrs->l1_size = 0x1000; + pt_attrs->l1_size = SZ_16K; /* 4096 entries of 32 bits */ align_size = pt_attrs->l1_size; /* Align sizes are expected to be power of 2 */ /* we like to get aligned on L1 table size */ -- cgit v1.2.3 From e375870b9295be40de7372c3c9de6799e254c96a Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Fri, 14 Jan 2011 14:54:08 -0600 Subject: staging: r8712u: Fix memory leak in firmware loading The error path leaks the firmware struct. Signed-off-by: Larry Finger Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8712/hal_init.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8712/hal_init.c b/drivers/staging/rtl8712/hal_init.c index 32088a641eba..84be383abec3 100644 --- a/drivers/staging/rtl8712/hal_init.c +++ b/drivers/staging/rtl8712/hal_init.c @@ -128,12 +128,13 @@ static u8 rtl8712_dl_fw(struct _adapter *padapter) u8 *ptmpchar = NULL, *ppayload, *ptr; struct tx_desc *ptx_desc; u32 txdscp_sz = sizeof(struct tx_desc); + u8 ret = _FAIL; ulfilelength = rtl871x_open_fw(padapter, &phfwfile_hdl, &pmappedfw); if (pmappedfw && (ulfilelength > 0)) { update_fwhdr(&fwhdr, pmappedfw); if (chk_fwhdr(&fwhdr, ulfilelength) == _FAIL) - goto exit_fail; + goto firmware_rel; fill_fwpriv(padapter, &fwhdr.fwpriv); /* firmware check ok */ maxlen = (fwhdr.img_IMEM_size > fwhdr.img_SRAM_size) ? @@ -141,7 +142,7 @@ static u8 rtl8712_dl_fw(struct _adapter *padapter) maxlen += txdscp_sz; ptmpchar = _malloc(maxlen + FWBUFF_ALIGN_SZ); if (ptmpchar == NULL) - return _FAIL; + goto firmware_rel; ptx_desc = (struct tx_desc *)(ptmpchar + FWBUFF_ALIGN_SZ - ((addr_t)(ptmpchar) & (FWBUFF_ALIGN_SZ - 1))); @@ -273,11 +274,13 @@ static u8 rtl8712_dl_fw(struct _adapter *padapter) goto exit_fail; } else goto exit_fail; - return _SUCCESS; + ret = _SUCCESS; exit_fail: kfree(ptmpchar); - return _FAIL; +firmware_rel: + release_firmware((struct firmware *)phfwfile_hdl); + return ret; } uint rtl8712_hal_init(struct _adapter *padapter) -- cgit v1.2.3 From 9c33008412683eba91bce2dc4575f28c728b6bd1 Mon Sep 17 00:00:00 2001 From: Denis Kirjanov Date: Mon, 10 Jan 2011 20:09:30 +0000 Subject: staging: rt2860: Fix incorrect netif_stop_queue usage warning The TX queues are allocated inside register_netdev. It doesn't make any sense to stop the queue before allocation. Signed-off-by: Denis Kirjanov Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rt2860/rt_main_dev.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/rt2860/rt_main_dev.c b/drivers/staging/rt2860/rt_main_dev.c index 701561d6b6fd..236dd36d349a 100644 --- a/drivers/staging/rt2860/rt_main_dev.c +++ b/drivers/staging/rt2860/rt_main_dev.c @@ -484,8 +484,6 @@ struct net_device *RtmpPhyNetDevInit(struct rt_rtmp_adapter *pAd, net_dev->ml_priv = (void *)pAd; pAd->net_dev = net_dev; - netif_stop_queue(net_dev); - return net_dev; } -- cgit v1.2.3 From e71a7fd259943a2c2e11484880c80248ad139fe5 Mon Sep 17 00:00:00 2001 From: Roland Stigge Date: Thu, 13 Jan 2011 18:37:36 +0100 Subject: iio: Fixpoint formatted output bugfix Fix some ADC drivers' _scale interface to correct fixpoint formatted output Signed-off-by: Roland Stigge Acked-by: Jonathan Cameron Acked-by: Michael Hennerich Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers/staging/iio/adc/ad7476_core.c | 2 +- drivers/staging/iio/adc/ad799x_core.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/iio/adc/ad7476_core.c b/drivers/staging/iio/adc/ad7476_core.c index deb68c8a6e18..b8b54da67c63 100644 --- a/drivers/staging/iio/adc/ad7476_core.c +++ b/drivers/staging/iio/adc/ad7476_core.c @@ -68,7 +68,7 @@ static ssize_t ad7476_show_scale(struct device *dev, /* Corresponds to Vref / 2^(bits) */ unsigned int scale_uv = (st->int_vref_mv * 1000) >> st->chip_info->bits; - return sprintf(buf, "%d.%d\n", scale_uv / 1000, scale_uv % 1000); + return sprintf(buf, "%d.%03d\n", scale_uv / 1000, scale_uv % 1000); } static IIO_DEVICE_ATTR(in_scale, S_IRUGO, ad7476_show_scale, NULL, 0); diff --git a/drivers/staging/iio/adc/ad799x_core.c b/drivers/staging/iio/adc/ad799x_core.c index 6309d521a864..89ccf375a188 100644 --- a/drivers/staging/iio/adc/ad799x_core.c +++ b/drivers/staging/iio/adc/ad799x_core.c @@ -432,7 +432,7 @@ static ssize_t ad799x_show_scale(struct device *dev, /* Corresponds to Vref / 2^(bits) */ unsigned int scale_uv = (st->int_vref_mv * 1000) >> st->chip_info->bits; - return sprintf(buf, "%d.%d\n", scale_uv / 1000, scale_uv % 1000); + return sprintf(buf, "%d.%03d\n", scale_uv / 1000, scale_uv % 1000); } static IIO_DEVICE_ATTR(in_scale, S_IRUGO, ad799x_show_scale, NULL, 0); -- cgit v1.2.3 From e7bf352fcd85c33b0805da891fc97fea8b5e996e Mon Sep 17 00:00:00 2001 From: roel kluin Date: Mon, 3 Jan 2011 11:59:48 -0800 Subject: Staging: speakup: &&/|| confusion in silent_store() Fix test: the branch is always taken. Signed-off-by: Roel Kluin Cc: Andrew Morton Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers/staging/speakup/kobjects.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/speakup/kobjects.c b/drivers/staging/speakup/kobjects.c index 408bb9b3303e..07a7f5432597 100644 --- a/drivers/staging/speakup/kobjects.c +++ b/drivers/staging/speakup/kobjects.c @@ -332,7 +332,7 @@ static ssize_t silent_store(struct kobject *kobj, struct kobj_attribute *attr, unsigned long flags; len = strlen(buf); - if (len > 0 || len < 3) { + if (len > 0 && len < 3) { ch = buf[0]; if (ch == '\n') ch = '0'; -- cgit v1.2.3 From d1ce318496f5943d2cc5e20171fc383a59a1421f Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Wed, 19 Jan 2011 11:48:44 +0000 Subject: staging: comedi: ni_labpc: Use shared IRQ for PCMCIA card The ni_labpc driver module only requests a shared IRQ for PCI devices, requesting a non-shared IRQ for non-PCI devices. As this module is also used by the ni_labpc_cs module for certain National Instruments PCMCIA cards, it also needs to request a shared IRQ for PCMCIA devices, otherwise you get a IRQ mismatch with the CardBus controller. Signed-off-by: Ian Abbott Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_labpc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/ni_labpc.c b/drivers/staging/comedi/drivers/ni_labpc.c index 4d1868d04bac..0728c3c0cb0e 100644 --- a/drivers/staging/comedi/drivers/ni_labpc.c +++ b/drivers/staging/comedi/drivers/ni_labpc.c @@ -575,7 +575,8 @@ int labpc_common_attach(struct comedi_device *dev, unsigned long iobase, /* grab our IRQ */ if (irq) { isr_flags = 0; - if (thisboard->bustype == pci_bustype) + if (thisboard->bustype == pci_bustype + || thisboard->bustype == pcmcia_bustype) isr_flags |= IRQF_SHARED; if (request_irq(irq, labpc_interrupt, isr_flags, driver_labpc.driver_name, dev)) { -- cgit v1.2.3 From 85d139c977dd13cd1ca5cb3b9d8e39cb477eaf0c Mon Sep 17 00:00:00 2001 From: Omar Ramirez Luna Date: Fri, 14 Jan 2011 17:49:51 -0600 Subject: staging: tidspbridge: replace mbox callback with notifier_call Lately, mailbox callbacks have been replaced by notifier block call chains, this needs to be changed in the users of mailbox, otherwise compilation will break due to missing parameters. For this new change to work, io_mbox_msg needs to be compatible with the notifier_call definition. Reported-by: Hari Kanigeri Signed-off-by: Omar Ramirez Luna Signed-off-by: Greg Kroah-Hartman --- drivers/staging/tidspbridge/core/io_sm.c | 8 ++++---- drivers/staging/tidspbridge/core/tiomap3430.c | 10 ++++++---- .../staging/tidspbridge/include/dspbridge/io_sm.h | 21 ++++++++------------- 3 files changed, 18 insertions(+), 21 deletions(-) diff --git a/drivers/staging/tidspbridge/core/io_sm.c b/drivers/staging/tidspbridge/core/io_sm.c index 571864555ddd..27e0aa81a584 100644 --- a/drivers/staging/tidspbridge/core/io_sm.c +++ b/drivers/staging/tidspbridge/core/io_sm.c @@ -949,7 +949,7 @@ func_end: * Calls the Bridge's CHNL_ISR to determine if this interrupt is ours, then * schedules a DPC to dispatch I/O. */ -void io_mbox_msg(u32 msg) +int io_mbox_msg(struct notifier_block *self, unsigned long len, void *msg) { struct io_mgr *pio_mgr; struct dev_object *dev_obj; @@ -959,9 +959,9 @@ void io_mbox_msg(u32 msg) dev_get_io_mgr(dev_obj, &pio_mgr); if (!pio_mgr) - return; + return NOTIFY_BAD; - pio_mgr->intr_val = (u16)msg; + pio_mgr->intr_val = (u16)((u32)msg); if (pio_mgr->intr_val & MBX_PM_CLASS) io_dispatch_pm(pio_mgr); @@ -973,7 +973,7 @@ void io_mbox_msg(u32 msg) spin_unlock_irqrestore(&pio_mgr->dpc_lock, flags); tasklet_schedule(&pio_mgr->dpc_tasklet); } - return; + return NOTIFY_OK; } /* diff --git a/drivers/staging/tidspbridge/core/tiomap3430.c b/drivers/staging/tidspbridge/core/tiomap3430.c index c3126e2e23f0..a3f69f6f505f 100644 --- a/drivers/staging/tidspbridge/core/tiomap3430.c +++ b/drivers/staging/tidspbridge/core/tiomap3430.c @@ -223,6 +223,10 @@ static struct bridge_drv_interface drv_interface_fxns = { bridge_msg_set_queue_id, }; +static struct notifier_block dsp_mbox_notifier = { + .notifier_call = io_mbox_msg, +}; + static inline void flush_all(struct bridge_dev_context *dev_context) { if (dev_context->dw_brd_state == BRD_DSP_HIBERNATION || @@ -553,7 +557,7 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt, * Enable Mailbox events and also drain any pending * stale messages. */ - dev_context->mbox = omap_mbox_get("dsp"); + dev_context->mbox = omap_mbox_get("dsp", &dsp_mbox_notifier); if (IS_ERR(dev_context->mbox)) { dev_context->mbox = NULL; pr_err("%s: Failed to get dsp mailbox handle\n", @@ -563,8 +567,6 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt, } if (!status) { - dev_context->mbox->rxq->callback = (int (*)(void *))io_mbox_msg; - /*PM_IVA2GRPSEL_PER = 0xC0;*/ temp = readl(resources->dw_per_pm_base + 0xA8); temp = (temp & 0xFFFFFF30) | 0xC0; @@ -685,7 +687,7 @@ static int bridge_brd_stop(struct bridge_dev_context *dev_ctxt) /* Disable the mailbox interrupts */ if (dev_context->mbox) { omap_mbox_disable_irq(dev_context->mbox, IRQ_RX); - omap_mbox_put(dev_context->mbox); + omap_mbox_put(dev_context->mbox, &dsp_mbox_notifier); dev_context->mbox = NULL; } /* Reset IVA2 clocks*/ diff --git a/drivers/staging/tidspbridge/include/dspbridge/io_sm.h b/drivers/staging/tidspbridge/include/dspbridge/io_sm.h index 18aec55d8647..8242c70e09dd 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/io_sm.h +++ b/drivers/staging/tidspbridge/include/dspbridge/io_sm.h @@ -72,22 +72,17 @@ extern void io_dpc(unsigned long ref_data); /* * ======== io_mbox_msg ======== * Purpose: - * Main interrupt handler for the shared memory Bridge channel manager. - * Calls the Bridge's chnlsm_isr to determine if this interrupt is ours, - * then schedules a DPC to dispatch I/O. + * Main message handler for the shared memory Bridge channel manager. + * Determine if this message is ours, then schedules a DPC to + * dispatch I/O. * Parameters: - * ref_data: Pointer to the channel manager object for this board. - * Set in an initial call to ISR_Install(). + * self: Pointer to its own notifier_block struct. + * len: Length of message. + * msg: Message code received. * Returns: - * TRUE if interrupt handled; FALSE otherwise. - * Requires: - * Must be in locked memory if executing in kernel mode. - * Must only call functions which are in locked memory if Kernel mode. - * Must only call asynchronous services. - * Interrupts are disabled and EOI for this interrupt has been sent. - * Ensures: + * NOTIFY_OK if handled; NOTIFY_BAD otherwise. */ -void io_mbox_msg(u32 msg); +int io_mbox_msg(struct notifier_block *self, unsigned long len, void *msg); /* * ======== io_request_chnl ======== -- cgit v1.2.3 From 2d8f4595d1f275f424a8920bb2563fc547661213 Mon Sep 17 00:00:00 2001 From: Max Vozeler Date: Wed, 12 Jan 2011 15:01:59 +0200 Subject: staging: usbip: stub: update refcounts for devices and interfaces The stub driver expects to access the usb interface and usb device structures even if the device has been disconnected in the meantime. This change gets a reference to them in the stub probe function using usb_get_intf()/usb_get_dev() and drops them in the disconnect function. This fixes an oops observed with a Logic Controls Line display (0fa8:a030) which disconnects itself when it is reset: [ 1348.562274] BUG: unable to handle kernel paging request at 5f7433e5 [ 1348.562327] IP: [] usb_lock_device_for_reset+0x22/0xd0 [ 1348.562374] *pde = 00000000 [ 1348.562397] Oops: 0000 [#1] [ 1348.562418] last sysfs file: /sys/devices/pci0000:00/0000:00:10.2/usb4/4-1/bConfigurationValue [ 1348.562454] Modules linked in: usbip vhci_hcd usbip_common_mod fbcon tileblit font bitblit softcursor serio_raw uvesafb pcspkr via_rng snd_via82xx gameport snd_ac97_codec ac97_bus snd_pcm_oss snd_mixer_oss snd_pcm snd_page_alloc snd_mpu401_uart snd_rawmidi snd_seq_oss snd_seq_midi_event snd_seq snd_timer snd_seq_device snd usbhid hid via_rhine soundcore mii igel_flash aufs pata_via [ 1348.562649] [ 1348.562670] Pid: 2855, comm: usbip_eh Not tainted (2.6.32 #23.37-ud-r113) M300C [ 1348.562704] EIP: 0060:[] EFLAGS: 00010216 CPU: 0 [ 1348.562734] EIP is at usb_lock_device_for_reset+0x22/0xd0 [ 1348.562762] EAX: 5f7433cd EBX: 5f7433cd ECX: de293a5c EDX: dd326a00 [ 1348.562793] ESI: 5f7433cd EDI: 000400f6 EBP: cf43ff48 ESP: cf43ff38 [ 1348.562824] DS: 007b ES: 007b FS: 0000 GS: 00e0 SS: 0068 [ 1348.562854] Process usbip_eh (pid: 2855, ti=cf43e000 task=d2c7f230 task.ti=cf43e000) [ 1348.562884] Stack: [ 1348.562900] d6ec9960 de2939cc 5f7433cd 5f743431 cf43ff70 df8fd32f de2939cc d2c7f230 [ 1348.562940] <0> cf43ff70 00000282 00000282 de2939cc d2c7f230 d2c7f230 cf43ffa8 df84416d [ 1348.562987] <0> cf43ff88 d2c7f230 de293a24 d2c7f230 00000000 d2c7f230 c014e760 cf43ff94 [ 1348.563042] Call Trace: [ 1348.563073] [] ? stub_device_reset+0x3f/0x110 [usbip] [ 1348.563114] [] ? event_handler_loop+0xcd/0xe8 [usbip_common_mod] [ 1348.563156] [] ? autoremove_wake_function+0x0/0x50 [ 1348.563193] [] ? usbip_thread+0x0/0x60 [usbip_common_mod] [ 1348.563230] [] ? usbip_thread+0x51/0x60 [usbip_common_mod] [ 1348.563265] [] ? kthread+0x74/0x80 [ 1348.563294] [] ? kthread+0x0/0x80 [ 1348.563326] [] ? kernel_thread_helper+0x7/0x10 [ 1348.563351] Code: 00 e8 73 4d 00 00 5d c3 90 55 89 e5 83 ec 10 89 5d f4 89 75 f8 89 7d fc 0f 1f 44 00 00 8b 3d c0 2e 67 c0 81 c7 fa 00 00 00 89 c3 <8b> 40 18 89 d6 85 c0 75 15 b8 ed ff ff ff 8b 5d f4 8b 75 f8 8b [ 1348.563528] EIP: [] usb_lock_device_for_reset+0x22/0xd0 SS:ESP 0068:cf43ff38 [ 1348.563570] CR2: 000000005f7433e5 [ 1348.563593] ---[ end trace 9c3f1e3a2e5299d9 ]--- Signed-off-by: Max Vozeler Tested-by: Mark Wehby Tested-by: Steven Harms Signed-off-by: Greg Kroah-Hartman --- drivers/staging/usbip/stub.h | 1 + drivers/staging/usbip/stub_dev.c | 18 ++++++++++++++---- drivers/staging/usbip/stub_rx.c | 4 ++-- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/drivers/staging/usbip/stub.h b/drivers/staging/usbip/stub.h index 30dbfb6d16f2..d73267961ef4 100644 --- a/drivers/staging/usbip/stub.h +++ b/drivers/staging/usbip/stub.h @@ -32,6 +32,7 @@ struct stub_device { struct usb_interface *interface; + struct usb_device *udev; struct list_head list; struct usbip_device ud; diff --git a/drivers/staging/usbip/stub_dev.c b/drivers/staging/usbip/stub_dev.c index b186b5fed2b9..a7ce51cc8909 100644 --- a/drivers/staging/usbip/stub_dev.c +++ b/drivers/staging/usbip/stub_dev.c @@ -258,10 +258,11 @@ static void stub_shutdown_connection(struct usbip_device *ud) static void stub_device_reset(struct usbip_device *ud) { struct stub_device *sdev = container_of(ud, struct stub_device, ud); - struct usb_device *udev = interface_to_usbdev(sdev->interface); + struct usb_device *udev = sdev->udev; int ret; usbip_udbg("device reset"); + ret = usb_lock_device_for_reset(udev, sdev->interface); if (ret < 0) { dev_err(&udev->dev, "lock for reset\n"); @@ -309,7 +310,8 @@ static void stub_device_unusable(struct usbip_device *ud) * * Allocates and initializes a new stub_device struct. */ -static struct stub_device *stub_device_alloc(struct usb_interface *interface) +static struct stub_device *stub_device_alloc(struct usb_device *udev, + struct usb_interface *interface) { struct stub_device *sdev; int busnum = interface_to_busnum(interface); @@ -324,7 +326,8 @@ static struct stub_device *stub_device_alloc(struct usb_interface *interface) return NULL; } - sdev->interface = interface; + sdev->interface = usb_get_intf(interface); + sdev->udev = usb_get_dev(udev); /* * devid is defined with devnum when this driver is first allocated. @@ -450,11 +453,12 @@ static int stub_probe(struct usb_interface *interface, return err; } + usb_get_intf(interface); return 0; } /* ok. this is my device. */ - sdev = stub_device_alloc(interface); + sdev = stub_device_alloc(udev, interface); if (!sdev) return -ENOMEM; @@ -476,6 +480,8 @@ static int stub_probe(struct usb_interface *interface, dev_err(&interface->dev, "create sysfs files for %s\n", udev_busid); usb_set_intfdata(interface, NULL); + usb_put_intf(interface); + busid_priv->interf_count = 0; busid_priv->sdev = NULL; @@ -545,6 +551,7 @@ static void stub_disconnect(struct usb_interface *interface) if (busid_priv->interf_count > 1) { busid_priv->interf_count--; shutdown_busid(busid_priv); + usb_put_intf(interface); return; } @@ -554,6 +561,9 @@ static void stub_disconnect(struct usb_interface *interface) /* 1. shutdown the current connection */ shutdown_busid(busid_priv); + usb_put_dev(sdev->udev); + usb_put_intf(interface); + /* 3. free sdev */ busid_priv->sdev = NULL; stub_device_free(sdev); diff --git a/drivers/staging/usbip/stub_rx.c b/drivers/staging/usbip/stub_rx.c index 3de6fd2539dc..ae6ac82754a4 100644 --- a/drivers/staging/usbip/stub_rx.c +++ b/drivers/staging/usbip/stub_rx.c @@ -364,7 +364,7 @@ static struct stub_priv *stub_priv_alloc(struct stub_device *sdev, static int get_pipe(struct stub_device *sdev, int epnum, int dir) { - struct usb_device *udev = interface_to_usbdev(sdev->interface); + struct usb_device *udev = sdev->udev; struct usb_host_endpoint *ep; struct usb_endpoint_descriptor *epd = NULL; @@ -484,7 +484,7 @@ static void stub_recv_cmd_submit(struct stub_device *sdev, int ret; struct stub_priv *priv; struct usbip_device *ud = &sdev->ud; - struct usb_device *udev = interface_to_usbdev(sdev->interface); + struct usb_device *udev = sdev->udev; int pipe = get_pipe(sdev, pdu->base.ep, pdu->base.direction); -- cgit v1.2.3 From 7606ee8aa33287dd3e6eb44c78541b87a413a325 Mon Sep 17 00:00:00 2001 From: Max Vozeler Date: Wed, 12 Jan 2011 15:02:00 +0200 Subject: staging: usbip: vhci: update reference count for usb_device This fixes an oops observed when reading status during removal of a device: [ 1706.648285] general protection fault: 0000 [#1] SMP [ 1706.648294] last sysfs file: /sys/devices/platform/vhci_hcd/status [ 1706.648297] CPU 1 [ 1706.648300] Modules linked in: binfmt_misc microcode fuse loop vhci_hcd(N) usbip(N) usbcore usbip_common_mod(N) rtc_core rtc_lib joydev dm_mirror dm_region_hash dm_log linear dm_snapshot xennet dm_mod ext3 mbcache jbd processor thermal_sys hwmon xenblk cdrom [ 1706.648324] Supported: Yes [ 1706.648327] Pid: 10422, comm: usbip Tainted: G N 2.6.32.12-0.7-xen #1 [ 1706.648330] RIP: e030:[] [] strnlen+0x5/0x40 [ 1706.648340] RSP: e02b:ffff8800a994dd30 EFLAGS: 00010286 [ 1706.648343] RAX: ffffffff80481ec1 RBX: 0000000000000000 RCX: 0000000000000002 [ 1706.648347] RDX: 00200d1d4f1c001c RSI: ffffffffffffffff RDI: 00200d1d4f1c001c [ 1706.648350] RBP: ffff880129a1c0aa R08: ffffffffa01901c4 R09: 0000000000000006 [ 1706.648353] R10: 0000000000000000 R11: 0000000000000000 R12: ffff8800a9a1c0ab [ 1706.648357] R13: 00200d1d4f1c001c R14: 00000000ffffffff R15: ffff880129a1c0aa [ 1706.648363] FS: 00007f2f2e9ca700(0000) GS:ffff880001018000(0000) knlGS:0000000000000000 [ 1706.648367] CS: e033 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 1706.648370] CR2: 000000000071b048 CR3: 00000000b4b68000 CR4: 0000000000002660 [ 1706.648374] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 1706.648378] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 [ 1706.648381] Process usbip (pid: 10422, threadinfo ffff8800a994c000, task ffff88007b170200) [ 1706.648385] Stack: [ 1706.648387] ffffffff801b28c9 0000000000000002 ffffffffa01901c4 ffff8800a9a1c0ab [ 1706.648391] <0> ffffffffa01901c6 ffff8800a994de08 ffffffff801b339b 0000000000000004 [ 1706.648397] <0> 0000000affffffff ffffffffffffffff 00000000000067c0 0000000000000000 [ 1706.648404] Call Trace: [ 1706.648413] [] string+0x39/0xe0 [ 1706.648419] [] vsnprintf+0x1eb/0x620 [ 1706.648423] [] sprintf+0x43/0x50 [ 1706.648429] [] show_status+0x1b9/0x220 [vhci_hcd] [ 1706.648438] [] dev_attr_show+0x27/0x60 [ 1706.648445] [] sysfs_read_file+0x101/0x1d0 [ 1706.648451] [] vfs_read+0xc7/0x130 [ 1706.648457] [] sys_read+0x53/0xa0 [ 1706.648462] [] system_call_fastpath+0x16/0x1b [ 1706.648468] [<00007f2f2de40f30>] 0x7f2f2de40f30 [ 1706.648470] Code: 66 0f 1f 44 00 00 48 83 c2 01 80 3a 00 75 f7 48 89 d0 48 29 f8 f3 c3 66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 48 85 f6 74 29 <80> 3f 00 74 24 48 8d 56 ff 48 89 f8 eb 0e 0f 1f 44 00 00 48 83 [ 1706.648507] RIP [] strnlen+0x5/0x40 [ 1706.648511] RSP [ 1706.649575] ---[ end trace b4eb72bf2e149593 ]--- Signed-off-by: Max Vozeler Tested-by: Mark Wehby Signed-off-by: Greg Kroah-Hartman --- drivers/staging/usbip/vhci_hcd.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/staging/usbip/vhci_hcd.c b/drivers/staging/usbip/vhci_hcd.c index 08bd26a245d5..5f1e2b0a628a 100644 --- a/drivers/staging/usbip/vhci_hcd.c +++ b/drivers/staging/usbip/vhci_hcd.c @@ -607,7 +607,9 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, dev_info(dev, "SetAddress Request (%d) to port %d\n", ctrlreq->wValue, vdev->rhport); - vdev->udev = urb->dev; + if (vdev->udev) + usb_put_dev(vdev->udev); + vdev->udev = usb_get_dev(urb->dev); spin_lock(&vdev->ud.lock); vdev->ud.status = VDEV_ST_USED; @@ -627,8 +629,9 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, "Get_Descriptor to device 0 " "(get max pipe size)\n"); - /* FIXME: reference count? (usb_get_dev()) */ - vdev->udev = urb->dev; + if (vdev->udev) + usb_put_dev(vdev->udev); + vdev->udev = usb_get_dev(urb->dev); goto out; default: @@ -887,6 +890,10 @@ static void vhci_device_reset(struct usbip_device *ud) vdev->speed = 0; vdev->devid = 0; + if (vdev->udev) + usb_put_dev(vdev->udev); + vdev->udev = NULL; + ud->tcp_socket = NULL; ud->status = VDEV_ST_NULL; -- cgit v1.2.3 From b92a5e23737172c52656a090977408a80d7f06d1 Mon Sep 17 00:00:00 2001 From: Max Vozeler Date: Wed, 12 Jan 2011 15:02:01 +0200 Subject: staging: usbip: vhci: give back URBs from in-flight unlink requests If we never received a RET_UNLINK because the TCP connection broke the pending URBs still need to be unlinked and given back. Previously processes would be stuck trying to kill the URB even after the device was detached. Signed-off-by: Max Vozeler Tested-by: Mark Wehby Signed-off-by: Greg Kroah-Hartman --- drivers/staging/usbip/vhci.h | 3 +++ drivers/staging/usbip/vhci_hcd.c | 24 +++++++++++++++++++++++- drivers/staging/usbip/vhci_rx.c | 15 +++++++++------ 3 files changed, 35 insertions(+), 7 deletions(-) diff --git a/drivers/staging/usbip/vhci.h b/drivers/staging/usbip/vhci.h index 41a1fe5138f4..2cfd00ec1164 100644 --- a/drivers/staging/usbip/vhci.h +++ b/drivers/staging/usbip/vhci.h @@ -119,6 +119,9 @@ void rh_port_disconnect(int rhport); void vhci_rx_loop(struct usbip_task *ut); void vhci_tx_loop(struct usbip_task *ut); +struct urb *pickup_urb_and_free_priv(struct vhci_device *vdev, + __u32 seqnum); + #define hardware (&the_controller->pdev.dev) static inline struct vhci_device *port_to_vdev(__u32 port) diff --git a/drivers/staging/usbip/vhci_hcd.c b/drivers/staging/usbip/vhci_hcd.c index 5f1e2b0a628a..3a22f65b66d0 100644 --- a/drivers/staging/usbip/vhci_hcd.c +++ b/drivers/staging/usbip/vhci_hcd.c @@ -808,7 +808,6 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status) return 0; } - static void vhci_device_unlink_cleanup(struct vhci_device *vdev) { struct vhci_unlink *unlink, *tmp; @@ -816,11 +815,34 @@ static void vhci_device_unlink_cleanup(struct vhci_device *vdev) spin_lock(&vdev->priv_lock); list_for_each_entry_safe(unlink, tmp, &vdev->unlink_tx, list) { + usbip_uinfo("unlink cleanup tx %lu\n", unlink->unlink_seqnum); list_del(&unlink->list); kfree(unlink); } list_for_each_entry_safe(unlink, tmp, &vdev->unlink_rx, list) { + struct urb *urb; + + /* give back URB of unanswered unlink request */ + usbip_uinfo("unlink cleanup rx %lu\n", unlink->unlink_seqnum); + + urb = pickup_urb_and_free_priv(vdev, unlink->unlink_seqnum); + if (!urb) { + usbip_uinfo("the urb (seqnum %lu) was already given back\n", + unlink->unlink_seqnum); + list_del(&unlink->list); + kfree(unlink); + continue; + } + + urb->status = -ENODEV; + + spin_lock(&the_controller->lock); + usb_hcd_unlink_urb_from_ep(vhci_to_hcd(the_controller), urb); + spin_unlock(&the_controller->lock); + + usb_hcd_giveback_urb(vhci_to_hcd(the_controller), urb, urb->status); + list_del(&unlink->list); kfree(unlink); } diff --git a/drivers/staging/usbip/vhci_rx.c b/drivers/staging/usbip/vhci_rx.c index 8147d7202b2d..bdbedd256903 100644 --- a/drivers/staging/usbip/vhci_rx.c +++ b/drivers/staging/usbip/vhci_rx.c @@ -23,16 +23,14 @@ #include "vhci.h" -/* get URB from transmitted urb queue */ -static struct urb *pickup_urb_and_free_priv(struct vhci_device *vdev, +/* get URB from transmitted urb queue. caller must hold vdev->priv_lock */ +struct urb *pickup_urb_and_free_priv(struct vhci_device *vdev, __u32 seqnum) { struct vhci_priv *priv, *tmp; struct urb *urb = NULL; int status; - spin_lock(&vdev->priv_lock); - list_for_each_entry_safe(priv, tmp, &vdev->priv_rx, list) { if (priv->seqnum == seqnum) { urb = priv->urb; @@ -63,8 +61,6 @@ static struct urb *pickup_urb_and_free_priv(struct vhci_device *vdev, } } - spin_unlock(&vdev->priv_lock); - return urb; } @@ -74,9 +70,11 @@ static void vhci_recv_ret_submit(struct vhci_device *vdev, struct usbip_device *ud = &vdev->ud; struct urb *urb; + spin_lock(&vdev->priv_lock); urb = pickup_urb_and_free_priv(vdev, pdu->base.seqnum); + spin_unlock(&vdev->priv_lock); if (!urb) { usbip_uerr("cannot find a urb of seqnum %u\n", @@ -161,7 +159,12 @@ static void vhci_recv_ret_unlink(struct vhci_device *vdev, return; } + spin_lock(&vdev->priv_lock); + urb = pickup_urb_and_free_priv(vdev, unlink->unlink_seqnum); + + spin_unlock(&vdev->priv_lock); + if (!urb) { /* * I get the result of a unlink request. But, it seems that I -- cgit v1.2.3 From 6d212153a838354078cc7d96f9bb23b7d1fd3d1b Mon Sep 17 00:00:00 2001 From: Max Vozeler Date: Wed, 12 Jan 2011 15:02:02 +0200 Subject: staging: usbip: vhci: refuse to enqueue for dead connections There can be requests to enqueue URBs while we are shutting down a connection. Signed-off-by: Max Vozeler Tested-by: Mark Wehby Signed-off-by: Greg Kroah-Hartman --- drivers/staging/usbip/vhci_hcd.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/staging/usbip/vhci_hcd.c b/drivers/staging/usbip/vhci_hcd.c index 3a22f65b66d0..22b1ad9ebd56 100644 --- a/drivers/staging/usbip/vhci_hcd.c +++ b/drivers/staging/usbip/vhci_hcd.c @@ -559,6 +559,7 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, struct device *dev = &urb->dev->dev; int ret = 0; unsigned long flags; + struct vhci_device *vdev; usbip_dbg_vhci_hc("enter, usb_hcd %p urb %p mem_flags %d\n", hcd, urb, mem_flags); @@ -574,6 +575,18 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, return urb->status; } + vdev = port_to_vdev(the_controller->pending_port); + + /* refuse enqueue for dead connection */ + spin_lock(&vdev->ud.lock); + if (vdev->ud.status == VDEV_ST_NULL || vdev->ud.status == VDEV_ST_ERROR) { + usbip_uerr("enqueue for inactive port %d\n", vdev->rhport); + spin_unlock(&vdev->ud.lock); + spin_unlock_irqrestore(&the_controller->lock, flags); + return -ENODEV; + } + spin_unlock(&vdev->ud.lock); + ret = usb_hcd_link_urb_to_ep(hcd, urb); if (ret) goto no_need_unlink; @@ -592,8 +605,6 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, __u8 type = usb_pipetype(urb->pipe); struct usb_ctrlrequest *ctrlreq = (struct usb_ctrlrequest *) urb->setup_packet; - struct vhci_device *vdev = - port_to_vdev(the_controller->pending_port); if (type != PIPE_CONTROL || !ctrlreq) { dev_err(dev, "invalid request to devnum 0\n"); -- cgit v1.2.3 From 7e249c8b0737429bbf534515f81aded93504f449 Mon Sep 17 00:00:00 2001 From: Max Vozeler Date: Wed, 12 Jan 2011 15:02:03 +0200 Subject: staging: usbip: vhci: friendly log messages for connection errors Also changes the event on connection close to be VDEV_EVENT_DOWN - no functional change. Signed-off-by: Max Vozeler Signed-off-by: Greg Kroah-Hartman --- drivers/staging/usbip/vhci_rx.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/staging/usbip/vhci_rx.c b/drivers/staging/usbip/vhci_rx.c index bdbedd256903..ac15cea75396 100644 --- a/drivers/staging/usbip/vhci_rx.c +++ b/drivers/staging/usbip/vhci_rx.c @@ -205,11 +205,23 @@ static void vhci_rx_pdu(struct usbip_device *ud) memset(&pdu, 0, sizeof(pdu)); - /* 1. receive a pdu header */ ret = usbip_xmit(0, ud->tcp_socket, (char *) &pdu, sizeof(pdu), 0); + if (ret < 0) { + if (ret == -ECONNRESET) + usbip_uinfo("connection reset by peer\n"); + else if (ret != -ERESTARTSYS) + usbip_uinfo("xmit failed %d\n", ret); + usbip_event_add(ud, VDEV_EVENT_ERROR_TCP); + return; + } + if (ret == 0) { + usbip_uinfo("connection closed"); + usbip_event_add(ud, VDEV_EVENT_DOWN); + return; + } if (ret != sizeof(pdu)) { - usbip_uerr("receiving pdu failed! size is %d, should be %d\n", + usbip_uerr("received pdu size is %d, should be %d\n", ret, (unsigned int)sizeof(pdu)); usbip_event_add(ud, VDEV_EVENT_ERROR_TCP); return; -- cgit v1.2.3 From bd65f6233f6bc3233e7910752689fe3a45dc2e0c Mon Sep 17 00:00:00 2001 From: Max Vozeler Date: Wed, 12 Jan 2011 15:02:04 +0200 Subject: staging: usbip: vhci: handle EAGAIN from SO_RCVTIMEO If there is a receive timeout without any active requests, we can tell the connection was idle and ignore the timeout. If there are active requests for which we expect to receive a reply we close the connection. This makes it possible to set an upper bound on the time a usbip device may be unresponsive. This is a workaround for the lack of heart-beat messages in the USBIP protocol. Extending the protocol would break compatibility with all previous stub versions, so this seems like the lesser evil. Signed-off-by: Max Vozeler Tested-by: Mark Wehby Signed-off-by: Greg Kroah-Hartman --- drivers/staging/usbip/vhci_rx.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/staging/usbip/vhci_rx.c b/drivers/staging/usbip/vhci_rx.c index ac15cea75396..bf6991470941 100644 --- a/drivers/staging/usbip/vhci_rx.c +++ b/drivers/staging/usbip/vhci_rx.c @@ -193,6 +193,19 @@ static void vhci_recv_ret_unlink(struct vhci_device *vdev, return; } +static int vhci_priv_tx_empty(struct vhci_device *vdev) +{ + int empty = 0; + + spin_lock(&vdev->priv_lock); + + empty = list_empty(&vdev->priv_rx); + + spin_unlock(&vdev->priv_lock); + + return empty; +} + /* recv a pdu */ static void vhci_rx_pdu(struct usbip_device *ud) { @@ -210,8 +223,14 @@ static void vhci_rx_pdu(struct usbip_device *ud) if (ret < 0) { if (ret == -ECONNRESET) usbip_uinfo("connection reset by peer\n"); - else if (ret != -ERESTARTSYS) + else if (ret == -EAGAIN) { + /* ignore if connection was idle */ + if (vhci_priv_tx_empty(vdev)) + return; + usbip_uinfo("connection timed out with pending urbs\n"); + } else if (ret != -ERESTARTSYS) usbip_uinfo("xmit failed %d\n", ret); + usbip_event_add(ud, VDEV_EVENT_ERROR_TCP); return; } -- cgit v1.2.3 From 01446ef5af4e8802369bf4d257806e24345a9371 Mon Sep 17 00:00:00 2001 From: Max Vozeler Date: Wed, 12 Jan 2011 15:02:05 +0200 Subject: staging: usbip: vhci: use urb->dev->portnum to find port The access to pending_port was racy when two devices were being attached at the same time. Signed-off-by: Max Vozeler Tested-by: Mark Wehby Signed-off-by: Greg Kroah-Hartman --- drivers/staging/usbip/vhci.h | 3 --- drivers/staging/usbip/vhci_hcd.c | 4 +--- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/staging/usbip/vhci.h b/drivers/staging/usbip/vhci.h index 2cfd00ec1164..afc3b1a71881 100644 --- a/drivers/staging/usbip/vhci.h +++ b/drivers/staging/usbip/vhci.h @@ -100,9 +100,6 @@ struct vhci_hcd { * But, the index of this array begins from 0. */ struct vhci_device vdev[VHCI_NPORTS]; - - /* vhci_device which has not been assiged its address yet */ - int pending_port; }; diff --git a/drivers/staging/usbip/vhci_hcd.c b/drivers/staging/usbip/vhci_hcd.c index 22b1ad9ebd56..a35fe61268de 100644 --- a/drivers/staging/usbip/vhci_hcd.c +++ b/drivers/staging/usbip/vhci_hcd.c @@ -138,8 +138,6 @@ void rh_port_connect(int rhport, enum usb_device_speed speed) * the_controller->vdev[rhport].ud.status = VDEV_CONNECT; * spin_unlock(&the_controller->vdev[rhport].ud.lock); */ - the_controller->pending_port = rhport; - spin_unlock_irqrestore(&the_controller->lock, flags); usb_hcd_poll_rh_status(vhci_to_hcd(the_controller)); @@ -575,7 +573,7 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, return urb->status; } - vdev = port_to_vdev(the_controller->pending_port); + vdev = port_to_vdev(urb->dev->portnum-1); /* refuse enqueue for dead connection */ spin_lock(&vdev->ud.lock); -- cgit v1.2.3 From 41135b1ca228b6ea1a0ab9d903dd54396ebd485d Mon Sep 17 00:00:00 2001 From: Roland Stigge Date: Fri, 21 Jan 2011 09:57:28 +0100 Subject: Staging: iio: Aditional fixpoint formatted output bugfix iio: Additional fixpoint formatted output bugfixes Fix some ADC/DAC drivers' _scale interface to correct fixpoint formatted output This patch adds the fixes to ad7887_core.c and ad5446.c Signed-off-by: Roland Stigge Signed-off-by: Greg Kroah-Hartman --- drivers/staging/iio/adc/ad7887_core.c | 2 +- drivers/staging/iio/dac/ad5446.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/iio/adc/ad7887_core.c b/drivers/staging/iio/adc/ad7887_core.c index 685908995d49..5d85efab658c 100644 --- a/drivers/staging/iio/adc/ad7887_core.c +++ b/drivers/staging/iio/adc/ad7887_core.c @@ -68,7 +68,7 @@ static ssize_t ad7887_show_scale(struct device *dev, /* Corresponds to Vref / 2^(bits) */ unsigned int scale_uv = (st->int_vref_mv * 1000) >> st->chip_info->bits; - return sprintf(buf, "%d.%d\n", scale_uv / 1000, scale_uv % 1000); + return sprintf(buf, "%d.%03d\n", scale_uv / 1000, scale_uv % 1000); } static IIO_DEVICE_ATTR(in_scale, S_IRUGO, ad7887_show_scale, NULL, 0); diff --git a/drivers/staging/iio/dac/ad5446.c b/drivers/staging/iio/dac/ad5446.c index e3387cd31145..0f87ecac82fc 100644 --- a/drivers/staging/iio/dac/ad5446.c +++ b/drivers/staging/iio/dac/ad5446.c @@ -87,7 +87,7 @@ static ssize_t ad5446_show_scale(struct device *dev, /* Corresponds to Vref / 2^(bits) */ unsigned int scale_uv = (st->vref_mv * 1000) >> st->chip_info->bits; - return sprintf(buf, "%d.%d\n", scale_uv / 1000, scale_uv % 1000); + return sprintf(buf, "%d.%03d\n", scale_uv / 1000, scale_uv % 1000); } static IIO_DEVICE_ATTR(out_scale, S_IRUGO, ad5446_show_scale, NULL, 0); -- cgit v1.2.3 From d062d44a8386c82c06e483f0c0d1124ba3cab2c8 Mon Sep 17 00:00:00 2001 From: Arend van Spriel Date: Fri, 21 Jan 2011 13:34:15 +0100 Subject: staging: brcm80211: remove assert to avoid panic since 2.6.37 kernel The driver assumed it would receive skb packets from MAC80211 which are not cloned. To guard this assumption an assert was placed in the transmit routine. As of kernel 2.6.37 it turns out MAC80211 does pass skb packets that are cloned. The assert is also not needed as it does not lead to a failure state in our driver when the packet is cloned. Therefore the assert can safely be removed. > commit f8a0a781488ec7288d1049e5d2022850aa98f7b6 > Author: Felix Fietkau > Date: Sat Dec 18 19:30:50 2010 +0100 > > mac80211: fix potentially redundant skb data copying > > When an skb is shared, it needs to be duplicated, along with its data > If the skb does not have enough headroom, using skb_copy might cause t > buffer to be copied twice (once by skb_copy and once by pskb_expand_he > Fix this by using skb_clone initially and letting ieee80211_skb_resize > out the rest. > > Signed-off-by: Felix Fietkau > Signed-off-by: John W. Linville > Acked-by: Brett Rudley Signed-off-by: Arend van Spriel Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers/staging/brcm80211/sys/wlc_mac80211.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/brcm80211/sys/wlc_mac80211.c b/drivers/staging/brcm80211/sys/wlc_mac80211.c index 1d5d01ac0a9b..a1303863686c 100644 --- a/drivers/staging/brcm80211/sys/wlc_mac80211.c +++ b/drivers/staging/brcm80211/sys/wlc_mac80211.c @@ -5126,7 +5126,6 @@ wlc_sendpkt_mac80211(struct wlc_info *wlc, struct sk_buff *sdu, fifo = prio2fifo[prio]; ASSERT((uint) skb_headroom(sdu) >= TXOFF); - ASSERT(!(sdu->cloned)); ASSERT(!(sdu->next)); ASSERT(!(sdu->prev)); ASSERT(fifo < NFIFO); -- cgit v1.2.3 From 4032ec639af9b735fdd903fab09de567bd73eaa0 Mon Sep 17 00:00:00 2001 From: Arend van Spriel Date: Fri, 21 Jan 2011 13:36:44 +0100 Subject: staging: brcm80211: fix suspend/resume issue in brcmsmac PCI PM suspend callback took down the interface and resume brought it back up. In the mac80211 context this is done in subsequent calls. Rework implementation so that suspend only stores config, and sets PCI power state. The resume return to full power state (D0), restores the config, and brings hardware back up. Full bringup is done by subsequent mac80211 calls. Reviewed-by: Brett Rudley Signed-off-by: Arend van Spriel Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers/staging/brcm80211/sys/wl_mac80211.c | 45 +++++++++++++++-------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/drivers/staging/brcm80211/sys/wl_mac80211.c b/drivers/staging/brcm80211/sys/wl_mac80211.c index bdd629d72a75..f1235884cc5d 100644 --- a/drivers/staging/brcm80211/sys/wl_mac80211.c +++ b/drivers/staging/brcm80211/sys/wl_mac80211.c @@ -209,11 +209,8 @@ static void wl_ops_stop(struct ieee80211_hw *hw) struct wl_info *wl = hw->priv; ASSERT(wl); WL_LOCK(wl); - wl_down(wl); ieee80211_stop_queues(hw); WL_UNLOCK(wl); - - return; } static int @@ -246,7 +243,14 @@ wl_ops_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) static void wl_ops_remove_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) { - return; + struct wl_info *wl; + + wl = HW_TO_WL(hw); + + /* put driver in down state */ + WL_LOCK(wl); + wl_down(wl); + WL_UNLOCK(wl); } static int @@ -779,7 +783,7 @@ static struct wl_info *wl_attach(u16 vendor, u16 device, unsigned long regs, wl_found++; return wl; - fail: +fail: wl_free(wl); fail1: return NULL; @@ -1090,7 +1094,6 @@ wl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) return 0; } -#ifdef LINUXSTA_PS static int wl_suspend(struct pci_dev *pdev, pm_message_t state) { struct wl_info *wl; @@ -1105,11 +1108,12 @@ static int wl_suspend(struct pci_dev *pdev, pm_message_t state) return -ENODEV; } + /* only need to flag hw is down for proper resume */ WL_LOCK(wl); - wl_down(wl); wl->pub->hw_up = false; WL_UNLOCK(wl); - pci_save_state(pdev, wl->pci_psstate); + + pci_save_state(pdev); pci_disable_device(pdev); return pci_set_power_state(pdev, PCI_D3hot); } @@ -1133,7 +1137,7 @@ static int wl_resume(struct pci_dev *pdev) if (err) return err; - pci_restore_state(pdev, wl->pci_psstate); + pci_restore_state(pdev); err = pci_enable_device(pdev); if (err) @@ -1145,13 +1149,12 @@ static int wl_resume(struct pci_dev *pdev) if ((val & 0x0000ff00) != 0) pci_write_config_dword(pdev, 0x40, val & 0xffff00ff); - WL_LOCK(wl); - err = wl_up(wl); - WL_UNLOCK(wl); - + /* + * done. driver will be put in up state + * in wl_ops_add_interface() call. + */ return err; } -#endif /* LINUXSTA_PS */ static void wl_remove(struct pci_dev *pdev) { @@ -1184,14 +1187,12 @@ static void wl_remove(struct pci_dev *pdev) } static struct pci_driver wl_pci_driver = { - .name = "brcm80211", - .probe = wl_pci_probe, -#ifdef LINUXSTA_PS - .suspend = wl_suspend, - .resume = wl_resume, -#endif /* LINUXSTA_PS */ - .remove = __devexit_p(wl_remove), - .id_table = wl_id_table, + .name = "brcm80211", + .probe = wl_pci_probe, + .suspend = wl_suspend, + .resume = wl_resume, + .remove = __devexit_p(wl_remove), + .id_table = wl_id_table, }; /** -- cgit v1.2.3 From 6b28405395f7ec492ea69f541cc774adcb9e00ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20K=C3=B6llhofer?= Date: Sat, 22 Jan 2011 14:33:50 -0600 Subject: staging: r8712u: Add new device IDs This patch adds several new device ids to the r8712u staging driver. The new ids were retrieved from latest vendor driver (v2.6.6.0.20101111) downloadable from www.realtek.com.tw Signed-off-by: Axel Koellhofer Signed-off-by: Larry Finger Cc: Stable [2.6.37] Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8712/usb_intf.c | 145 +++++++++++++++++++++++++++++-------- 1 file changed, 113 insertions(+), 32 deletions(-) diff --git a/drivers/staging/rtl8712/usb_intf.c b/drivers/staging/rtl8712/usb_intf.c index a692ee88b9e9..21ce2af447b5 100644 --- a/drivers/staging/rtl8712/usb_intf.c +++ b/drivers/staging/rtl8712/usb_intf.c @@ -47,54 +47,123 @@ static int r871xu_drv_init(struct usb_interface *pusb_intf, static void r871xu_dev_remove(struct usb_interface *pusb_intf); static struct usb_device_id rtl871x_usb_id_tbl[] = { - /*92SU - * Realtek */ - {USB_DEVICE(0x0bda, 0x8171)}, - {USB_DEVICE(0x0bda, 0x8172)}, + +/* RTL8188SU */ + /* Realtek */ + {USB_DEVICE(0x0BDA, 0x8171)}, {USB_DEVICE(0x0bda, 0x8173)}, - {USB_DEVICE(0x0bda, 0x8174)}, {USB_DEVICE(0x0bda, 0x8712)}, {USB_DEVICE(0x0bda, 0x8713)}, {USB_DEVICE(0x0bda, 0xC512)}, - /* Abocom */ + /* Abocom */ {USB_DEVICE(0x07B8, 0x8188)}, + /* ASUS */ + {USB_DEVICE(0x0B05, 0x1786)}, + {USB_DEVICE(0x0B05, 0x1791)}, /* 11n mode disable */ + /* Belkin */ + {USB_DEVICE(0x050D, 0x945A)}, /* Corega */ - {USB_DEVICE(0x07aa, 0x0047)}, - /* Dlink */ - {USB_DEVICE(0x07d1, 0x3303)}, - {USB_DEVICE(0x07d1, 0x3302)}, - {USB_DEVICE(0x07d1, 0x3300)}, - /* Dlink for Skyworth */ - {USB_DEVICE(0x14b2, 0x3300)}, - {USB_DEVICE(0x14b2, 0x3301)}, - {USB_DEVICE(0x14b2, 0x3302)}, + {USB_DEVICE(0x07AA, 0x0047)}, + /* D-Link */ + {USB_DEVICE(0x2001, 0x3306)}, + {USB_DEVICE(0x07D1, 0x3306)}, /* 11n mode disable */ + /* Edimax */ + {USB_DEVICE(0x7392, 0x7611)}, /* EnGenius */ {USB_DEVICE(0x1740, 0x9603)}, - {USB_DEVICE(0x1740, 0x9605)}, + /* Hawking */ + {USB_DEVICE(0x0E66, 0x0016)}, + /* Hercules */ + {USB_DEVICE(0x06F8, 0xE034)}, + {USB_DEVICE(0x06F8, 0xE032)}, + /* Logitec */ + {USB_DEVICE(0x0789, 0x0167)}, + /* PCI */ + {USB_DEVICE(0x2019, 0xAB28)}, + {USB_DEVICE(0x2019, 0xED16)}, + /* Sitecom */ + {USB_DEVICE(0x0DF6, 0x0057)}, + {USB_DEVICE(0x0DF6, 0x0045)}, + {USB_DEVICE(0x0DF6, 0x0059)}, /* 11n mode disable */ + {USB_DEVICE(0x0DF6, 0x004B)}, + {USB_DEVICE(0x0DF6, 0x0063)}, + /* Sweex */ + {USB_DEVICE(0x177F, 0x0154)}, + /* Thinkware */ + {USB_DEVICE(0x0BDA, 0x5077)}, + /* Toshiba */ + {USB_DEVICE(0x1690, 0x0752)}, + /* - */ + {USB_DEVICE(0x20F4, 0x646B)}, + {USB_DEVICE(0x083A, 0xC512)}, + +/* RTL8191SU */ + /* Realtek */ + {USB_DEVICE(0x0BDA, 0x8172)}, + /* Amigo */ + {USB_DEVICE(0x0EB0, 0x9061)}, + /* ASUS/EKB */ + {USB_DEVICE(0x0BDA, 0x8172)}, + {USB_DEVICE(0x13D3, 0x3323)}, + {USB_DEVICE(0x13D3, 0x3311)}, /* 11n mode disable */ + {USB_DEVICE(0x13D3, 0x3342)}, + /* ASUS/EKBLenovo */ + {USB_DEVICE(0x13D3, 0x3333)}, + {USB_DEVICE(0x13D3, 0x3334)}, + {USB_DEVICE(0x13D3, 0x3335)}, /* 11n mode disable */ + {USB_DEVICE(0x13D3, 0x3336)}, /* 11n mode disable */ + /* ASUS/Media BOX */ + {USB_DEVICE(0x13D3, 0x3309)}, /* Belkin */ - {USB_DEVICE(0x050d, 0x815F)}, - {USB_DEVICE(0x050d, 0x945A)}, - {USB_DEVICE(0x050d, 0x845A)}, - /* Guillemot */ - {USB_DEVICE(0x06f8, 0xe031)}, + {USB_DEVICE(0x050D, 0x815F)}, + /* D-Link */ + {USB_DEVICE(0x07D1, 0x3302)}, + {USB_DEVICE(0x07D1, 0x3300)}, + {USB_DEVICE(0x07D1, 0x3303)}, /* Edimax */ - {USB_DEVICE(0x7392, 0x7611)}, {USB_DEVICE(0x7392, 0x7612)}, - {USB_DEVICE(0x7392, 0x7622)}, - /* Sitecom */ - {USB_DEVICE(0x0DF6, 0x0045)}, + /* EnGenius */ + {USB_DEVICE(0x1740, 0x9605)}, + /* Guillemot */ + {USB_DEVICE(0x06F8, 0xE031)}, /* Hawking */ {USB_DEVICE(0x0E66, 0x0015)}, - {USB_DEVICE(0x0E66, 0x0016)}, - {USB_DEVICE(0x0b05, 0x1786)}, - {USB_DEVICE(0x0b05, 0x1791)}, /* 11n mode disable */ - + /* Mediao */ {USB_DEVICE(0x13D3, 0x3306)}, - {USB_DEVICE(0x13D3, 0x3309)}, + /* PCI */ + {USB_DEVICE(0x2019, 0xED18)}, + {USB_DEVICE(0x2019, 0x4901)}, + /* Sitecom */ + {USB_DEVICE(0x0DF6, 0x0058)}, + {USB_DEVICE(0x0DF6, 0x0049)}, + {USB_DEVICE(0x0DF6, 0x004C)}, + {USB_DEVICE(0x0DF6, 0x0064)}, + /* Skyworth */ + {USB_DEVICE(0x14b2, 0x3300)}, + {USB_DEVICE(0x14b2, 0x3301)}, + {USB_DEVICE(0x14B2, 0x3302)}, + /* - */ + {USB_DEVICE(0x04F2, 0xAFF2)}, + {USB_DEVICE(0x04F2, 0xAFF5)}, + {USB_DEVICE(0x04F2, 0xAFF6)}, + {USB_DEVICE(0x13D3, 0x3339)}, + {USB_DEVICE(0x13D3, 0x3340)}, /* 11n mode disable */ + {USB_DEVICE(0x13D3, 0x3341)}, /* 11n mode disable */ {USB_DEVICE(0x13D3, 0x3310)}, - {USB_DEVICE(0x13D3, 0x3311)}, /* 11n mode disable */ {USB_DEVICE(0x13D3, 0x3325)}, - {USB_DEVICE(0x083A, 0xC512)}, + +/* RTL8192SU */ + /* Realtek */ + {USB_DEVICE(0x0BDA, 0x8174)}, + {USB_DEVICE(0x0BDA, 0x8174)}, + /* Belkin */ + {USB_DEVICE(0x050D, 0x845A)}, + /* Corega */ + {USB_DEVICE(0x07AA, 0x0051)}, + /* Edimax */ + {USB_DEVICE(0x7392, 0x7622)}, + /* NEC */ + {USB_DEVICE(0x0409, 0x02B6)}, {} }; @@ -103,8 +172,20 @@ MODULE_DEVICE_TABLE(usb, rtl871x_usb_id_tbl); static struct specific_device_id specific_device_id_tbl[] = { {.idVendor = 0x0b05, .idProduct = 0x1791, .flags = SPEC_DEV_ID_DISABLE_HT}, + {.idVendor = 0x0df6, .idProduct = 0x0059, + .flags = SPEC_DEV_ID_DISABLE_HT}, + {.idVendor = 0x13d3, .idProduct = 0x3306, + .flags = SPEC_DEV_ID_DISABLE_HT}, {.idVendor = 0x13D3, .idProduct = 0x3311, .flags = SPEC_DEV_ID_DISABLE_HT}, + {.idVendor = 0x13d3, .idProduct = 0x3335, + .flags = SPEC_DEV_ID_DISABLE_HT}, + {.idVendor = 0x13d3, .idProduct = 0x3336, + .flags = SPEC_DEV_ID_DISABLE_HT}, + {.idVendor = 0x13d3, .idProduct = 0x3340, + .flags = SPEC_DEV_ID_DISABLE_HT}, + {.idVendor = 0x13d3, .idProduct = 0x3341, + .flags = SPEC_DEV_ID_DISABLE_HT}, {} }; -- cgit v1.2.3