···1128}11291130#ifdef CONFIG_PM1131-/* Power management suspend, so power off the transmitter/receiver */1132-static int stir_suspend(struct usb_interface *intf, u32 state)1133{1134 struct stir_cb *stir = usb_get_intfdata(intf);1135
···1128}11291130#ifdef CONFIG_PM1131+/* USB suspend, so power off the transmitter/receiver */1132+static int stir_suspend(struct usb_interface *intf, pm_message_t message)1133{1134 struct stir_cb *stir = usb_get_intfdata(intf);1135
+16-32
drivers/usb/class/audio.c
···649 }650 }651 set_current_state(TASK_RUNNING);652- if (u->durb[0].urb->transfer_buffer)653- kfree(u->durb[0].urb->transfer_buffer);654- if (u->durb[1].urb->transfer_buffer)655- kfree(u->durb[1].urb->transfer_buffer);656- if (u->surb[0].urb->transfer_buffer)657- kfree(u->surb[0].urb->transfer_buffer);658- if (u->surb[1].urb->transfer_buffer)659- kfree(u->surb[1].urb->transfer_buffer);660 u->durb[0].urb->transfer_buffer = u->durb[1].urb->transfer_buffer = 661 u->surb[0].urb->transfer_buffer = u->surb[1].urb->transfer_buffer = NULL;662}···1005 u->phase = 0;1006 maxsze = (u->freqmax + 0x3fff) >> (14 - AFMT_BYTESSHIFT(u->format));1007 bufsz = DESCFRAMES * maxsze;1008- if (u->durb[0].urb->transfer_buffer)1009- kfree(u->durb[0].urb->transfer_buffer);1010 u->durb[0].urb->transfer_buffer = kmalloc(bufsz, GFP_KERNEL);1011 u->durb[0].urb->transfer_buffer_length = bufsz;1012- if (u->durb[1].urb->transfer_buffer)1013- kfree(u->durb[1].urb->transfer_buffer);1014 u->durb[1].urb->transfer_buffer = kmalloc(bufsz, GFP_KERNEL);1015 u->durb[1].urb->transfer_buffer_length = bufsz;1016 if (u->syncpipe) {1017- if (u->surb[0].urb->transfer_buffer)1018- kfree(u->surb[0].urb->transfer_buffer);1019 u->surb[0].urb->transfer_buffer = kmalloc(3*SYNCFRAMES, GFP_KERNEL);1020 u->surb[0].urb->transfer_buffer_length = 3*SYNCFRAMES;1021- if (u->surb[1].urb->transfer_buffer)1022- kfree(u->surb[1].urb->transfer_buffer);1023 u->surb[1].urb->transfer_buffer = kmalloc(3*SYNCFRAMES, GFP_KERNEL);1024 u->surb[1].urb->transfer_buffer_length = 3*SYNCFRAMES;1025 }···1120 }1121 }1122 set_current_state(TASK_RUNNING);1123- if (u->durb[0].urb->transfer_buffer)1124- kfree(u->durb[0].urb->transfer_buffer);1125- if (u->durb[1].urb->transfer_buffer)1126- kfree(u->durb[1].urb->transfer_buffer);1127- if (u->surb[0].urb->transfer_buffer)1128- kfree(u->surb[0].urb->transfer_buffer);1129- if (u->surb[1].urb->transfer_buffer)1130- kfree(u->surb[1].urb->transfer_buffer);1131 u->durb[0].urb->transfer_buffer = u->durb[1].urb->transfer_buffer = 1132 u->surb[0].urb->transfer_buffer = u->surb[1].urb->transfer_buffer = NULL;1133}···1364 u->phase = 0;1365 maxsze = (u->freqmax + 0x3fff) >> (14 - AFMT_BYTESSHIFT(u->format));1366 bufsz = DESCFRAMES * maxsze;1367- if (u->durb[0].urb->transfer_buffer)1368- kfree(u->durb[0].urb->transfer_buffer);1369 u->durb[0].urb->transfer_buffer = kmalloc(bufsz, GFP_KERNEL);1370 u->durb[0].urb->transfer_buffer_length = bufsz;1371- if (u->durb[1].urb->transfer_buffer)1372- kfree(u->durb[1].urb->transfer_buffer);1373 u->durb[1].urb->transfer_buffer = kmalloc(bufsz, GFP_KERNEL);1374 u->durb[1].urb->transfer_buffer_length = bufsz;1375 if (u->syncpipe) {1376- if (u->surb[0].urb->transfer_buffer)1377- kfree(u->surb[0].urb->transfer_buffer);1378 u->surb[0].urb->transfer_buffer = kmalloc(3*SYNCFRAMES, GFP_KERNEL);1379 u->surb[0].urb->transfer_buffer_length = 3*SYNCFRAMES;1380- if (u->surb[1].urb->transfer_buffer)1381- kfree(u->surb[1].urb->transfer_buffer);1382 u->surb[1].urb->transfer_buffer = kmalloc(3*SYNCFRAMES, GFP_KERNEL);1383 u->surb[1].urb->transfer_buffer_length = 3*SYNCFRAMES;1384 }
···33#include "hcd.h"343536-/* PCI-based HCs are normal, but custom bus glue should be ok */373839/*-------------------------------------------------------------------------*/···6768 if (pci_enable_device (dev) < 0)69 return -ENODEV;70- dev->current_state = 0;71- dev->dev.power.power_state = 0;7273 if (!dev->irq) {74 dev_err (&dev->dev,···186187#ifdef CONFIG_PM188189-static char __attribute_used__ *pci_state(u32 state)190-{191- switch (state) {192- case 0: return "D0";193- case 1: return "D1";194- case 2: return "D2";195- case 3: return "D3hot";196- case 4: return "D3cold";197- }198- return NULL;199-}200-201/**202 * usb_hcd_pci_suspend - power management suspend of a PCI-based HCD203 * @dev: USB Host Controller being suspended204- * @state: state that the controller is going into205 *206 * Store this function in the HCD's struct pci_driver as suspend().207 */208-int usb_hcd_pci_suspend (struct pci_dev *dev, u32 state)209{210 struct usb_hcd *hcd;211 int retval = 0;···201202 hcd = pci_get_drvdata(dev);203000000000000204 /* even when the PCI layer rejects some of the PCI calls205 * below, HCs can try global suspend and reduce DMA traffic.206 * PM-sensitive HCDs may already have done this.207 */208 has_pci_pm = pci_find_capability(dev, PCI_CAP_ID_PM);209- if (state > 4)210- state = 4;211212 switch (hcd->state) {213···226 */227 case HC_STATE_RUNNING:228 hcd->state = HC_STATE_QUIESCING;229- retval = hcd->driver->suspend (hcd, state);230 if (retval) {231 dev_dbg (hcd->self.controller, 232 "suspend fail, retval %d\n",···244 * have been called, otherwise root hub timers still run ...245 */246 case HC_STATE_SUSPENDED:247- if (state <= dev->current_state)248- break;249-250- /* no DMA or IRQs except in D0 */251- if (!dev->current_state) {252 pci_save_state (dev);253 pci_disable_device (dev);254- free_irq (hcd->irq, hcd);255 }256257 if (!has_pci_pm) {···256 break;257 }258259- /* POLICY: ignore D1/D2/D3hot differences;260- * we know D3hot will always work.00261 */262- retval = pci_set_power_state (dev, state);263- if (retval < 0 && state < 3) {264- retval = pci_set_power_state (dev, 3);265- if (retval == 0)266- state = 3;267- }268 if (retval == 0) {269- dev_dbg (hcd->self.controller, "--> PCI %s\n",270- pci_state(dev->current_state));271-#ifdef CONFIG_USB_SUSPEND272- pci_enable_wake (dev, state, hcd->remote_wakeup);273- pci_enable_wake (dev, 4, hcd->remote_wakeup);274-#endif275 } else if (retval < 0) {276- dev_dbg (&dev->dev, "PCI %s suspend fail, %d\n",277- pci_state(state), retval);278 (void) usb_hcd_pci_resume (dev);279 break;280 }···276 default:277 dev_dbg (hcd->self.controller, "hcd state %d; not suspended\n",278 hcd->state);0279 retval = -EINVAL;280 break;281 }282283 /* update power_state **ONLY** to make sysfs happier */284 if (retval == 0)285- dev->dev.power.power_state = state;286 return retval;287}288EXPORT_SYMBOL (usb_hcd_pci_suspend);···298{299 struct usb_hcd *hcd;300 int retval;301- int has_pci_pm;302303 hcd = pci_get_drvdata(dev);304 if (hcd->state != HC_STATE_SUSPENDED) {···305 "can't resume, not suspended!\n");306 return 0;307 }308- has_pci_pm = pci_find_capability(dev, PCI_CAP_ID_PM);309310- /* D3cold resume isn't usually reported this way... */311- dev_dbg(hcd->self.controller, "resume from PCI %s%s\n",312- pci_state(dev->current_state),313- has_pci_pm ? "" : " (legacy)");000000000000000000000000000000000000000000000000000314315 hcd->state = HC_STATE_RESUMING;316-317- if (has_pci_pm)318- pci_set_power_state (dev, 0);319- dev->dev.power.power_state = 0;320 retval = request_irq (dev->irq, usb_hcd_irq, SA_SHIRQ,321- hcd->driver->description, hcd);322 if (retval < 0) {323 dev_err (hcd->self.controller,324 "can't restore IRQ after resume!\n");0325 return retval;326 }327- hcd->saw_irq = 0;328- pci_restore_state (dev);329-#ifdef CONFIG_USB_SUSPEND330- pci_enable_wake (dev, dev->current_state, 0);331- pci_enable_wake (dev, 4, 0);332-#endif333334 retval = hcd->driver->resume (hcd);335 if (!HC_IS_RUNNING (hcd->state)) {
···33#include "hcd.h"343536+/* PCI-based HCs are common, but plenty of non-PCI HCs are used too */373839/*-------------------------------------------------------------------------*/···6768 if (pci_enable_device (dev) < 0)69 return -ENODEV;70+ dev->current_state = PCI_D0;71+ dev->dev.power.power_state = PMSG_ON;7273 if (!dev->irq) {74 dev_err (&dev->dev,···186187#ifdef CONFIG_PM188000000000000189/**190 * usb_hcd_pci_suspend - power management suspend of a PCI-based HCD191 * @dev: USB Host Controller being suspended192+ * @message: semantics in flux193 *194 * Store this function in the HCD's struct pci_driver as suspend().195 */196+int usb_hcd_pci_suspend (struct pci_dev *dev, pm_message_t message)197{198 struct usb_hcd *hcd;199 int retval = 0;···213214 hcd = pci_get_drvdata(dev);215216+ /* FIXME until the generic PM interfaces change a lot more, this217+ * can't use PCI D1 and D2 states. For example, the confusion218+ * between messages and states will need to vanish, and messages219+ * will need to provide a target system state again.220+ *221+ * It'll be important to learn characteristics of the target state,222+ * especially on embedded hardware where the HCD will often be in223+ * charge of an external VBUS power supply and one or more clocks.224+ * Some target system states will leave them active; others won't.225+ * (With PCI, that's often handled by platform BIOS code.)226+ */227+228 /* even when the PCI layer rejects some of the PCI calls229 * below, HCs can try global suspend and reduce DMA traffic.230 * PM-sensitive HCDs may already have done this.231 */232 has_pci_pm = pci_find_capability(dev, PCI_CAP_ID_PM);00233234 switch (hcd->state) {235···228 */229 case HC_STATE_RUNNING:230 hcd->state = HC_STATE_QUIESCING;231+ retval = hcd->driver->suspend (hcd, message);232 if (retval) {233 dev_dbg (hcd->self.controller, 234 "suspend fail, retval %d\n",···246 * have been called, otherwise root hub timers still run ...247 */248 case HC_STATE_SUSPENDED:249+ /* no DMA or IRQs except when HC is active */250+ if (dev->current_state == PCI_D0) {251+ free_irq (hcd->irq, hcd);00252 pci_save_state (dev);253 pci_disable_device (dev);0254 }255256 if (!has_pci_pm) {···261 break;262 }263264+ /* NOTE: dev->current_state becomes nonzero only here, and265+ * only for devices that support PCI PM. Also, exiting266+ * PCI_D3 (but not PCI_D1 or PCI_D2) is allowed to reset267+ * some device state (e.g. as part of clock reinit).268 */269+ retval = pci_set_power_state (dev, PCI_D3hot);00000270 if (retval == 0) {271+ dev_dbg (hcd->self.controller, "--> PCI D3\n");272+ pci_enable_wake (dev, PCI_D3hot, hcd->remote_wakeup);273+ pci_enable_wake (dev, PCI_D3cold, hcd->remote_wakeup);000274 } else if (retval < 0) {275+ dev_dbg (&dev->dev, "PCI D3 suspend fail, %d\n",276+ retval);277 (void) usb_hcd_pci_resume (dev);278 break;279 }···287 default:288 dev_dbg (hcd->self.controller, "hcd state %d; not suspended\n",289 hcd->state);290+ WARN_ON(1);291 retval = -EINVAL;292 break;293 }294295 /* update power_state **ONLY** to make sysfs happier */296 if (retval == 0)297+ dev->dev.power.power_state = message;298 return retval;299}300EXPORT_SYMBOL (usb_hcd_pci_suspend);···308{309 struct usb_hcd *hcd;310 int retval;0311312 hcd = pci_get_drvdata(dev);313 if (hcd->state != HC_STATE_SUSPENDED) {···316 "can't resume, not suspended!\n");317 return 0;318 }0319320+ /* NOTE: chip docs cover clean "real suspend" cases (what Linux321+ * calls "standby", "suspend to RAM", and so on). There are also322+ * dirty cases when swsusp fakes a suspend in "shutdown" mode.323+ */324+ if (dev->current_state != PCI_D0) {325+#ifdef DEBUG326+ int pci_pm;327+ u16 pmcr;328+329+ pci_pm = pci_find_capability(dev, PCI_CAP_ID_PM);330+ pci_read_config_word(dev, pci_pm + PCI_PM_CTRL, &pmcr);331+ pmcr &= PCI_PM_CTRL_STATE_MASK;332+ if (pmcr) {333+ /* Clean case: power to USB and to HC registers was334+ * maintained; remote wakeup is easy.335+ */336+ dev_dbg(hcd->self.controller, "resume from PCI D%d\n",337+ pmcr);338+ } else {339+ /* Clean: HC lost Vcc power, D0 uninitialized340+ * + Vaux may have preserved port and transceiver341+ * state ... for remote wakeup from D3cold342+ * + or not; HCD must reinit + re-enumerate343+ *344+ * Dirty: D0 semi-initialized cases with swsusp345+ * + after BIOS init346+ * + after Linux init (HCD statically linked)347+ */348+ dev_dbg(hcd->self.controller,349+ "PCI D0, from previous PCI D%d\n",350+ dev->current_state);351+ }352+#endif353+ pci_enable_wake (dev, dev->current_state, 0);354+ pci_enable_wake (dev, PCI_D3cold, 0);355+ } else {356+ /* Same basic cases: clean (powered/not), dirty */357+ dev_dbg(hcd->self.controller, "PCI legacy resume\n");358+ }359+360+ /* NOTE: the PCI API itself is asymmetric here. We don't need to361+ * pci_set_power_state(PCI_D0) since that's part of re-enabling;362+ * but that won't re-enable bus mastering. Yet pci_disable_device()363+ * explicitly disables bus mastering...364+ */365+ retval = pci_enable_device (dev);366+ if (retval < 0) {367+ dev_err (hcd->self.controller,368+ "can't re-enable after resume, %d!\n", retval);369+ return retval;370+ }371+ pci_set_master (dev);372+ pci_restore_state (dev);373+374+ dev->dev.power.power_state = PMSG_ON;375376 hcd->state = HC_STATE_RESUMING;377+ hcd->saw_irq = 0;000378 retval = request_irq (dev->irq, usb_hcd_irq, SA_SHIRQ,379+ hcd->irq_descr, hcd);380 if (retval < 0) {381 dev_err (hcd->self.controller,382 "can't restore IRQ after resume!\n");383+ usb_hc_died (hcd);384 return retval;385 }000000386387 retval = hcd->driver->resume (hcd);388 if (!HC_IS_RUNNING (hcd->state)) {
+2-2
drivers/usb/core/hcd.h
···177 * a whole, not just the root hub; they're for bus glue.178 */179 /* called after all devices were suspended */180- int (*suspend) (struct usb_hcd *hcd, u32 state);181182 /* called before any devices get resumed */183 int (*resume) (struct usb_hcd *hcd);···226extern void usb_hcd_pci_remove (struct pci_dev *dev);227228#ifdef CONFIG_PM229-extern int usb_hcd_pci_suspend (struct pci_dev *dev, u32 state);230extern int usb_hcd_pci_resume (struct pci_dev *dev);231#endif /* CONFIG_PM */232
···177 * a whole, not just the root hub; they're for bus glue.178 */179 /* called after all devices were suspended */180+ int (*suspend) (struct usb_hcd *hcd, pm_message_t message);181182 /* called before any devices get resumed */183 int (*resume) (struct usb_hcd *hcd);···226extern void usb_hcd_pci_remove (struct pci_dev *dev);227228#ifdef CONFIG_PM229+extern int usb_hcd_pci_suspend (struct pci_dev *dev, pm_message_t state);230extern int usb_hcd_pci_resume (struct pci_dev *dev);231#endif /* CONFIG_PM */232
+10-14
drivers/usb/core/hub.c
···381 dev_err (&hdev->dev,382 "clear tt %d (%04x) error %d\n",383 clear->tt, clear->devinfo, status);384- kfree (clear);385 }386 spin_unlock_irqrestore (&hub->tt.lock, flags);387}···728 list_del_init(&hub->event_list);729 spin_unlock_irq(&hub_event_lock);730731- if (hub->descriptor) {732- kfree(hub->descriptor);733- hub->descriptor = NULL;734- }735736- if (hub->status) {737- kfree(hub->status);738- hub->status = NULL;739- }740741 if (hub->buffer) {742 usb_buffer_free(hdev, sizeof(*hub->buffer), hub->buffer,···1452 /* FIXME let caller ask to power down the port:1453 * - some devices won't enumerate without a VBUS power cycle1454 * - SRP saves power that way1455- * - usb_suspend_device(dev,PM_SUSPEND_DISK)1456 * That's easy if this hub can switch power per-port, and1457 * khubd reactivates the port later (timer, SRP, etc).1458 * Powerdown must be optional, because of reset/DFU.···15271528/*1529 * Devices on USB hub ports have only one "suspend" state, corresponding1530- * to ACPI D2 (PM_SUSPEND_MEM), "may cause the device to lose some context".1531 * State transitions include:1532 *1533 * - suspend, resume ... when the VBUS power link stays live···1727 struct usb_driver *driver;17281729 intf = udev->actconfig->interface[i];1730- if (intf->dev.power.power_state == PM_SUSPEND_ON)1731 continue;1732 if (!intf->dev.driver) {1733 /* FIXME maybe force to alt 0 */···17411742 /* can we do better than just logging errors? */1743 status = driver->resume(intf);1744- if (intf->dev.power.power_state != PM_SUSPEND_ON1745 || status)1746 dev_dbg(&intf->dev,1747 "resume fail, state %d code %d\n",···2350 schedule_work (&hub->leds);2351 }2352 }2353- kfree (qual);2354}23552356static unsigned
···381 dev_err (&hdev->dev,382 "clear tt %d (%04x) error %d\n",383 clear->tt, clear->devinfo, status);384+ kfree(clear);385 }386 spin_unlock_irqrestore (&hub->tt.lock, flags);387}···728 list_del_init(&hub->event_list);729 spin_unlock_irq(&hub_event_lock);730731+ kfree(hub->descriptor);732+ hub->descriptor = NULL;00733734+ kfree(hub->status);735+ hub->status = NULL;00736737 if (hub->buffer) {738 usb_buffer_free(hdev, sizeof(*hub->buffer), hub->buffer,···1456 /* FIXME let caller ask to power down the port:1457 * - some devices won't enumerate without a VBUS power cycle1458 * - SRP saves power that way1459+ * - usb_suspend_device(dev, PMSG_SUSPEND)1460 * That's easy if this hub can switch power per-port, and1461 * khubd reactivates the port later (timer, SRP, etc).1462 * Powerdown must be optional, because of reset/DFU.···15311532/*1533 * Devices on USB hub ports have only one "suspend" state, corresponding1534+ * to ACPI D2, "may cause the device to lose some context".1535 * State transitions include:1536 *1537 * - suspend, resume ... when the VBUS power link stays live···1731 struct usb_driver *driver;17321733 intf = udev->actconfig->interface[i];1734+ if (intf->dev.power.power_state == PMSG_SUSPEND)1735 continue;1736 if (!intf->dev.driver) {1737 /* FIXME maybe force to alt 0 */···17451746 /* can we do better than just logging errors? */1747 status = driver->resume(intf);1748+ if (intf->dev.power.power_state != PMSG_ON1749 || status)1750 dev_dbg(&intf->dev,1751 "resume fail, state %d code %d\n",···2354 schedule_work (&hub->leds);2355 }2356 }2357+ kfree(qual);2358}23592360static unsigned
···1133 /* prevent submissions using previous endpoint settings */1134 usb_disable_interface(dev, iface);11351136- /* 9.1.1.5 says:1137- *1138- * Configuring a device or changing an alternate setting1139- * causes all of the status and configuration values1140- * associated with endpoints in the affected interfaces to1141- * be set to their default values. This includes setting1142- * the data toggle of any endpoint using data toggles to1143- * the value DATA0.1144- *1145- * Some devices take this too literally and don't reset the data1146- * toggles if the new altsetting is the same as the old one (the1147- * command isn't "changing" an alternate setting). We will manually1148- * reset the toggles when the new and old altsettings are the same.1149- * Most devices won't need this, but fortunately it doesn't happen1150- * often.1151- */1152- if (iface->cur_altsetting == alt)1153- manual = 1;1154 iface->cur_altsetting = alt;11551156 /* If the interface only has one altsetting and the device didn't1157- * accept the request (or whenever the old altsetting is the same1158- * as the new one), we attempt to carry out the equivalent action1159 * by manually clearing the HALT feature for each endpoint in the1160 * new altsetting.1161 */···1183 *1184 * Because this affects multiple interfaces, avoid using this with composite1185 * (multi-interface) devices. Instead, the driver for each interface may1186- * use usb_set_interface() on the interfaces it claims. Resetting the whole001187 * configuration would affect other drivers' interfaces.1188 *1189 * The caller must own the device lock.
···1133 /* prevent submissions using previous endpoint settings */1134 usb_disable_interface(dev, iface);11350000000000000000001136 iface->cur_altsetting = alt;11371138 /* If the interface only has one altsetting and the device didn't1139+ * accept the request, we attempt to carry out the equivalent action01140 * by manually clearing the HALT feature for each endpoint in the1141 * new altsetting.1142 */···1202 *1203 * Because this affects multiple interfaces, avoid using this with composite1204 * (multi-interface) devices. Instead, the driver for each interface may1205+ * use usb_set_interface() on the interfaces it claims. Be careful though;1206+ * some devices don't support the SET_INTERFACE request, and others won't1207+ * reset all the interface state (notably data toggles). Resetting the whole1208 * configuration would affect other drivers' interfaces.1209 *1210 * The caller must own the device lock.
+10-6
drivers/usb/core/urb.c
···420 *421 * Host Controller Drivers (HCDs) place all the URBs for a particular422 * endpoint in a queue. Normally the queue advances as the controller423- * hardware processes each request. But when an URB terminates with any424- * fault (such as an error, or being unlinked) its queue stops, at least425- * until that URB's completion routine returns. It is guaranteed that426- * the queue will not restart until all its unlinked URBs have been fully427- * retired, with their completion routines run, even if that's not until428- * some time after the original completion handler returns.0000429 *430 * This means that USB device drivers can safely build deep queues for431 * large or complex transfers, and clean them up reliably after any sort
···420 *421 * Host Controller Drivers (HCDs) place all the URBs for a particular422 * endpoint in a queue. Normally the queue advances as the controller423+ * hardware processes each request. But when an URB terminates with an424+ * error its queue stops, at least until that URB's completion routine425+ * returns. It is guaranteed that the queue will not restart until all426+ * its unlinked URBs have been fully retired, with their completion427+ * routines run, even if that's not until some time after the original428+ * completion handler returns. Normally the same behavior and guarantees429+ * apply when an URB terminates because it was unlinked; however if an430+ * URB is unlinked before the hardware has started to execute it, then431+ * its queue is not guaranteed to stop until all the preceding URBs have432+ * completed.433 *434 * This means that USB device drivers can safely build deep queues for435 * large or complex transfers, and clean them up reliably after any sort
+3-10
drivers/usb/core/usb.c
···50#include "hcd.h"51#include "usb.h"5253-extern int usb_hub_init(void);54-extern void usb_hub_cleanup(void);55-extern int usb_major_init(void);56-extern void usb_major_cleanup(void);57-extern int usb_host_init(void);58-extern void usb_host_cleanup(void);59-6061const char *usbcore_name = "usbcore";62···1375 usb_pipein (pipe) ? DMA_FROM_DEVICE : DMA_TO_DEVICE);1376}13771378-static int usb_generic_suspend(struct device *dev, u32 state)1379{1380 struct usb_interface *intf;1381 struct usb_driver *driver;13821383 if (dev->driver == &usb_generic_driver)1384- return usb_suspend_device (to_usb_device(dev), state);13851386 if ((dev->driver == NULL) ||1387 (dev->driver_data == &usb_generic_driver_data))···1395 return 0;13961397 if (driver->suspend)1398- return driver->suspend(intf, state);1399 return 0;1400}1401
···394 mark = ' ';395 if (hw_curr == td->qtd_dma)396 mark = '*';397- else if (qh->hw_qtd_next == td->qtd_dma)398 mark = '+';399 else if (QTD_LENGTH (scratch)) {400 if (td->hw_alt_next == ehci->async->hw_alt_next)
···394 mark = ' ';395 if (hw_curr == td->qtd_dma)396 mark = '*';397+ else if (qh->hw_qtd_next == cpu_to_le32(td->qtd_dma))398 mark = '+';399 else if (QTD_LENGTH (scratch)) {400 if (td->hw_alt_next == ehci->async->hw_alt_next)
+2-2
drivers/usb/host/ehci-hcd.c
···721 * the right sort of wakeup. 722 */723724-static int ehci_suspend (struct usb_hcd *hcd, u32 state)725{726 struct ehci_hcd *ehci = hcd_to_ehci (hcd);727···729 msleep (100);730731#ifdef CONFIG_USB_SUSPEND732- (void) usb_suspend_device (hcd->self.root_hub, state);733#else734 usb_lock_device (hcd->self.root_hub);735 (void) ehci_hub_suspend (hcd);
···721 * the right sort of wakeup. 722 */723724+static int ehci_suspend (struct usb_hcd *hcd, pm_message_t message)725{726 struct ehci_hcd *ehci = hcd_to_ehci (hcd);727···729 msleep (100);730731#ifdef CONFIG_USB_SUSPEND732+ (void) usb_suspend_device (hcd->self.root_hub, message);733#else734 usb_lock_device (hcd->self.root_hub);735 (void) ehci_hub_suspend (hcd);
···310311 for (i = qh->start; i < ehci->periodic_size; i += period) {312 union ehci_shadow *prev = &ehci->pshadow [i];313- u32 *hw_p = &ehci->periodic [i];314 union ehci_shadow here = *prev;315- u32 type = 0;316317 /* skip the iso nodes at list head */318 while (here.ptr) {
···310311 for (i = qh->start; i < ehci->periodic_size; i += period) {312 union ehci_shadow *prev = &ehci->pshadow [i];313+ __le32 *hw_p = &ehci->periodic [i];314 union ehci_shadow here = *prev;315+ __le32 type = 0;316317 /* skip the iso nodes at list head */318 while (here.ptr) {
···458459/* states match PCI usage, always suspending the root hub except that460 * 4 ~= D3cold (ACPI D3) with clock off (resume sees reset).00461 */462463-static int ohci_omap_suspend(struct device *dev, u32 state, u32 level)464{465 struct ohci_hcd *ohci = hcd_to_ohci(dev_get_drvdata(dev));466 int status = -EINVAL;
···458459/* states match PCI usage, always suspending the root hub except that460 * 4 ~= D3cold (ACPI D3) with clock off (resume sees reset).461+ *462+ * FIXME: above comment is not right, and code is wrong, too :-(.463 */464465+static int ohci_omap_suspend(struct device *dev, pm_message_t state, u32 level)466{467 struct ohci_hcd *ohci = hcd_to_ohci(dev_get_drvdata(dev));468 int status = -EINVAL;
···10211022 if (ohci->ed_controltail) {1023 command |= OHCI_CLF;001024 if (!(ohci->hc_control & OHCI_CTRL_CLE)) {1025 control |= OHCI_CTRL_CLE;1026 ohci_writel (ohci, 0,···1031 }1032 if (ohci->ed_bulktail) {1033 command |= OHCI_BLF;001034 if (!(ohci->hc_control & OHCI_CTRL_BLE)) {1035 control |= OHCI_CTRL_BLE;1036 ohci_writel (ohci, 0,···1043 /* CLE/BLE to enable, CLF/BLF to (maybe) kickstart */1044 if (control) {1045 ohci->hc_control |= control;001046 ohci_writel (ohci, ohci->hc_control,1047 &ohci->regs->control); 1048 }1049- if (command)001050 ohci_writel (ohci, command, &ohci->regs->cmdstatus); 1051- }01052}10531054
···10211022 if (ohci->ed_controltail) {1023 command |= OHCI_CLF;1024+ if (ohci->flags & OHCI_QUIRK_ZFMICRO)1025+ mdelay(1);1026 if (!(ohci->hc_control & OHCI_CTRL_CLE)) {1027 control |= OHCI_CTRL_CLE;1028 ohci_writel (ohci, 0,···1029 }1030 if (ohci->ed_bulktail) {1031 command |= OHCI_BLF;1032+ if (ohci->flags & OHCI_QUIRK_ZFMICRO)1033+ mdelay(1);1034 if (!(ohci->hc_control & OHCI_CTRL_BLE)) {1035 control |= OHCI_CTRL_BLE;1036 ohci_writel (ohci, 0,···1039 /* CLE/BLE to enable, CLF/BLF to (maybe) kickstart */1040 if (control) {1041 ohci->hc_control |= control;1042+ if (ohci->flags & OHCI_QUIRK_ZFMICRO)1043+ mdelay(1);1044 ohci_writel (ohci, ohci->hc_control,1045 &ohci->regs->control); 1046 }1047+ if (command) {1048+ if (ohci->flags & OHCI_QUIRK_ZFMICRO)1049+ mdelay(1);1050 ohci_writel (ohci, command, &ohci->regs->cmdstatus); 1051+ }1052+ }1053}10541055
+1
drivers/usb/host/ohci.h
···396#define OHCI_QUIRK_SUPERIO 0x02 /* natsemi */397#define OHCI_QUIRK_INITRESET 0x04 /* SiS, OPTi, ... */398#define OHCI_BIG_ENDIAN 0x08 /* big endian HC */0399 // there are also chip quirks/bugs in init logic400401};
···396#define OHCI_QUIRK_SUPERIO 0x02 /* natsemi */397#define OHCI_QUIRK_INITRESET 0x04 /* SiS, OPTi, ... */398#define OHCI_BIG_ENDIAN 0x08 /* big endian HC */399+#define OHCI_QUIRK_ZFMICRO 0x10 /* Compaq ZFMicro chipset*/400 // there are also chip quirks/bugs in init logic401402};
+3-6
drivers/usb/host/uhci-hcd.c
···716}717718#ifdef CONFIG_PM719-static int uhci_suspend(struct usb_hcd *hcd, u32 state)720{721 struct uhci_hcd *uhci = hcd_to_uhci(hcd);722···890 debugfs_remove(uhci_debugfs_root);891892debug_failed:893- if (errbuf)894- kfree(errbuf);895896errbuf_failed:897···905 warn("not all urb_priv's were freed!");906907 debugfs_remove(uhci_debugfs_root);908-909- if (errbuf)910- kfree(errbuf);911}912913module_init(uhci_hcd_init);
···716}717718#ifdef CONFIG_PM719+static int uhci_suspend(struct usb_hcd *hcd, pm_message_t message)720{721 struct uhci_hcd *uhci = hcd_to_uhci(hcd);722···890 debugfs_remove(uhci_debugfs_root);891892debug_failed:893+ kfree(errbuf);0894895errbuf_failed:896···906 warn("not all urb_priv's were freed!");907908 debugfs_remove(uhci_debugfs_root);909+ kfree(errbuf);00910}911912module_init(uhci_hcd_init);
···3915 ov->tempfbuf = NULL;39163917 for (i = 0; i < OV511_NUMSBUF; i++) {3918- if (ov->sbuf[i].data) {3919- kfree(ov->sbuf[i].data);3920- ov->sbuf[i].data = NULL;3921- }3922 }39233924 for (i = 0; i < OV511_NUMFRAMES; i++) {···5952 up(&ov->cbuf_lock);5953 }59545955- if (ov) {5956- kfree(ov);5957- ov = NULL;5958- }59595960error_out:5961 err("Camera initialization failed");
···3915 ov->tempfbuf = NULL;39163917 for (i = 0; i < OV511_NUMSBUF; i++) {3918+ kfree(ov->sbuf[i].data);3919+ ov->sbuf[i].data = NULL;003920 }39213922 for (i = 0; i < OV511_NUMFRAMES; i++) {···5954 up(&ov->cbuf_lock);5955 }59565957+ kfree(ov);5958+ ov = NULL;0059595960error_out:5961 err("Camera initialization failed");
+8-7
drivers/usb/media/se401.c
···868869 se401->dev = NULL;870871- for (i=0; i<SE401_NUMSBUF; i++) if (se401->urb[i]) {872- usb_kill_urb(se401->urb[i]);873- usb_free_urb(se401->urb[i]);874- se401->urb[i] = NULL;875- kfree(se401->sbuf[i].data);876- }877- for (i=0; i<SE401_NUMSCRATCH; i++) if (se401->scratch[i].data) {0878 kfree(se401->scratch[i].data);879 }880 if (se401->inturb) {
···868869 se401->dev = NULL;870871+ for (i=0; i<SE401_NUMSBUF; i++)872+ if (se401->urb[i]) {873+ usb_kill_urb(se401->urb[i]);874+ usb_free_urb(se401->urb[i]);875+ se401->urb[i] = NULL;876+ kfree(se401->sbuf[i].data);877+ }878+ for (i=0; i<SE401_NUMSCRATCH; i++) {879 kfree(se401->scratch[i].data);880 }881 if (se401->inturb) {
+2-4
drivers/usb/media/usbvideo.c
···1169 }1170 RingQueue_Free(&uvd->dp);1171 for (i=0; i < USBVIDEO_NUMSBUF; i++) {1172- if (uvd->sbuf[i].data != NULL) {1173- kfree (uvd->sbuf[i].data);1174- uvd->sbuf[i].data = NULL;1175- }1176 }1177 }1178 }
···1169 }1170 RingQueue_Free(&uvd->dp);1171 for (i=0; i < USBVIDEO_NUMSBUF; i++) {1172+ kfree(uvd->sbuf[i].data);1173+ uvd->sbuf[i].data = NULL;001174 }1175 }1176 }
+2-4
drivers/usb/media/w9968cf.c
···3624 return 0;36253626fail: /* Free unused memory */3627- if (cam->control_buffer)3628- kfree(cam->control_buffer);3629- if (cam->data_buffer)3630- kfree(cam->data_buffer);3631 if (cam->v4ldev)3632 video_device_release(cam->v4ldev);3633 up(&cam->dev_sem);
···705/* free a single auerbuf */706static void auerbuf_free (pauerbuf_t bp)707{708- if (bp->bufp) {709- kfree (bp->bufp);710- }711- if (bp->dr) {712- kfree (bp->dr);713- }714 if (bp->urbp) {715- usb_free_urb (bp->urbp);716 }717- kfree (bp);718}719720/* free the buffers from an auerbuf list */···1089*/1090static void auerswald_int_free (pauerswald_t cp)1091{1092- if (cp->inturbp) {1093- usb_free_urb (cp->inturbp);1094- cp->inturbp = NULL;1095- }1096- if (cp->intbufp) {1097- kfree (cp->intbufp);1098- cp->intbufp = NULL;1099- }1100}11011102/* This function is called to activate the interrupt
···705/* free a single auerbuf */706static void auerbuf_free (pauerbuf_t bp)707{708+ kfree(bp->bufp);709+ kfree(bp->dr);0000710 if (bp->urbp) {711+ usb_free_urb(bp->urbp);712 }713+ kfree(bp);714}715716/* free the buffers from an auerbuf list */···1093*/1094static void auerswald_int_free (pauerswald_t cp)1095{1096+ if (cp->inturbp) {1097+ usb_free_urb(cp->inturbp);1098+ cp->inturbp = NULL;1099+ }1100+ kfree(cp->intbufp);1101+ cp->intbufp = NULL;001102}11031104/* This function is called to activate the interrupt
···202 for (i=0; i < serial->num_ports; ++i) {203 /* My special items, the standard routines free my urbs */204 priv = usb_get_serial_port_data(serial->port[i]);205- if (priv)206- kfree(priv);207 }208}209
···202 for (i=0; i < serial->num_ports; ++i) {203 /* My special items, the standard routines free my urbs */204 priv = usb_get_serial_port_data(serial->port[i]);205+ kfree(priv);0206 }207}208
+2-3
drivers/usb/serial/cypress_m8.c
···13401341static void cypress_buf_free(struct cypress_buf *cb)1342{1343- if (cb != NULL) {1344- if (cb->buf_buf != NULL)1345- kfree(cb->buf_buf);1346 kfree(cb);1347 }1348}
···568* and the sleep. In other words, spin_unlock_irqrestore and569* interruptible_sleep_on_timeout are "atomic" with respect to570* wake ups. This is used to implement condition variables.000571*/572573static inline long cond_wait_interruptible_timeout_irqrestore(···579{580 DEFINE_WAIT(wait);581582- prepare_to_wait(q, &wait, TASK_UNINTERRUPTIBLE);583 spin_unlock_irqrestore(lock, flags);584 timeout = schedule_timeout(timeout);585 finish_wait(q, &wait);586587 return timeout;588-589}590591···1598 dbg( "digi_close: write oob failed, ret=%d", ret );15991600 /* wait for final commands on oob port to complete */1601- prepare_to_wait(&priv->dp_flush_wait, &wait, TASK_UNINTERRUPTIBLE);1602 schedule_timeout(DIGI_CLOSE_TIMEOUT);1603 finish_wait(&priv->dp_flush_wait, &wait);1604···19971998 } else if( opcode == DIGI_CMD_IFLUSH_FIFO ) {19992000- wake_up( &priv->dp_flush_wait );20012002 }2003
···568* and the sleep. In other words, spin_unlock_irqrestore and569* interruptible_sleep_on_timeout are "atomic" with respect to570* wake ups. This is used to implement condition variables.571+*572+* interruptible_sleep_on_timeout is deprecated and has been replaced573+* with the equivalent code.574*/575576static inline long cond_wait_interruptible_timeout_irqrestore(···576{577 DEFINE_WAIT(wait);578579+ prepare_to_wait(q, &wait, TASK_INTERRUPTIBLE);580 spin_unlock_irqrestore(lock, flags);581 timeout = schedule_timeout(timeout);582 finish_wait(q, &wait);583584 return timeout;0585}586587···1596 dbg( "digi_close: write oob failed, ret=%d", ret );15971598 /* wait for final commands on oob port to complete */1599+ prepare_to_wait(&priv->dp_flush_wait, &wait, TASK_INTERRUPTIBLE);1600 schedule_timeout(DIGI_CLOSE_TIMEOUT);1601 finish_wait(&priv->dp_flush_wait, &wait);1602···19951996 } else if( opcode == DIGI_CMD_IFLUSH_FIFO ) {19971998+ wake_up_interruptible( &priv->dp_flush_wait );19992000 }2001
+2-4
drivers/usb/serial/empeg.c
···550failed_usb_serial_register:551 for (i = 0; i < NUM_URBS; ++i) {552 if (write_urb_pool[i]) {553- if (write_urb_pool[i]->transfer_buffer)554- kfree(write_urb_pool[i]->transfer_buffer);555 usb_free_urb(write_urb_pool[i]);556 }557 }···574 * the host controllers get fixed to set urb->dev = NULL after575 * the urb is finished. Otherwise this call oopses. */576 /* usb_kill_urb(write_urb_pool[i]); */577- if (write_urb_pool[i]->transfer_buffer)578- kfree(write_urb_pool[i]->transfer_buffer);579 usb_free_urb (write_urb_pool[i]);580 }581 }
···550failed_usb_serial_register:551 for (i = 0; i < NUM_URBS; ++i) {552 if (write_urb_pool[i]) {553+ kfree(write_urb_pool[i]->transfer_buffer);0554 usb_free_urb(write_urb_pool[i]);555 }556 }···575 * the host controllers get fixed to set urb->dev = NULL after576 * the urb is finished. Otherwise this call oopses. */577 /* usb_kill_urb(write_urb_pool[i]); */578+ kfree(write_urb_pool[i]->transfer_buffer);0579 usb_free_urb (write_urb_pool[i]);580 }581 }
+3-7
drivers/usb/serial/ftdi_sio.c
···1347 priv->flags = ASYNC_LOW_LATENCY;13481349 /* Increase the size of read buffers */1350- if (port->bulk_in_buffer) {1351- kfree (port->bulk_in_buffer);1352- }1353 port->bulk_in_buffer = kmalloc (BUFSZ, GFP_KERNEL);1354 if (!port->bulk_in_buffer) {1355 kfree (priv);···1363 usb_free_urb (port->write_urb);1364 port->write_urb = NULL;1365 }1366- if (port->bulk_out_buffer) {1367- kfree (port->bulk_out_buffer);1368- port->bulk_out_buffer = NULL;1369- }13701371 usb_set_serial_port_data(serial->port[0], priv);1372
···951952953 /* clean up the transfer buffer */954- if (urb->transfer_buffer != NULL) {955- kfree(urb->transfer_buffer);956- }957958 /* Free the command urb */959 usb_free_urb (urb);···12641265 if (edge_port->write_urb) {1266 /* if this urb had a transfer buffer already (old transfer) free it */1267- if (edge_port->write_urb->transfer_buffer != NULL) {1268- kfree(edge_port->write_urb->transfer_buffer);1269- }1270- usb_free_urb (edge_port->write_urb);1271 edge_port->write_urb = NULL;1272 }1273- if (edge_port->txfifo.fifo) {1274- kfree(edge_port->txfifo.fifo);1275- edge_port->txfifo.fifo = NULL;1276- }12771278 dbg("%s exited", __FUNCTION__);1279} ···1413 // get a pointer to the write_urb1414 urb = edge_port->write_urb;14151416- /* if this urb had a transfer buffer already (old transfer) free it */1417- if (urb->transfer_buffer != NULL) {1418- kfree(urb->transfer_buffer);1419- urb->transfer_buffer = NULL;1420- }14211422 /* build the data header for the buffer and port that we are about to send out */1423 count = fifo->count;
···951952953 /* clean up the transfer buffer */954+ kfree(urb->transfer_buffer);00955956 /* Free the command urb */957 usb_free_urb (urb);···12661267 if (edge_port->write_urb) {1268 /* if this urb had a transfer buffer already (old transfer) free it */1269+ kfree(edge_port->write_urb->transfer_buffer);1270+ usb_free_urb(edge_port->write_urb);001271 edge_port->write_urb = NULL;1272 }1273+ kfree(edge_port->txfifo.fifo);1274+ edge_port->txfifo.fifo = NULL;0012751276 dbg("%s exited", __FUNCTION__);1277} ···1419 // get a pointer to the write_urb1420 urb = edge_port->write_urb;14211422+ /* make sure transfer buffer is freed */1423+ kfree(urb->transfer_buffer);1424+ urb->transfer_buffer = NULL;0014251426 /* build the data header for the buffer and port that we are about to send out */1427 count = fifo->count;
+2-3
drivers/usb/serial/io_ti.c
···28452846void edge_buf_free(struct edge_buf *eb)2847{2848- if (eb != NULL) {2849- if (eb->buf_buf != NULL)2850- kfree(eb->buf_buf);2851 kfree(eb);2852 }2853}
···119 /* expect to get short transfer if no card fitted */120 if (result == USB_STOR_XFER_SHORT || result == USB_STOR_XFER_STALLED) {121 /* had a short transfer, no card inserted, free map memory */122- if (info->lba_to_pba)123- kfree(info->lba_to_pba);124- if (info->pba_to_lba)125- kfree(info->pba_to_lba);126 info->lba_to_pba = NULL;127 info->pba_to_lba = NULL;128···647 return -1;648 }649650- if (info->lba_to_pba)651- kfree(info->lba_to_pba);652- if (info->pba_to_lba)653- kfree(info->pba_to_lba);654 info->lba_to_pba = kmalloc(numblocks*sizeof(int), GFP_NOIO);655 info->pba_to_lba = kmalloc(numblocks*sizeof(int), GFP_NOIO);656657 if (info->lba_to_pba == NULL || info->pba_to_lba == NULL) {658- if (info->lba_to_pba != NULL)659- kfree(info->lba_to_pba);660- if (info->pba_to_lba != NULL)661- kfree(info->pba_to_lba);662 info->lba_to_pba = NULL;663 info->pba_to_lba = NULL;664 kfree(buffer);···722 if (!extra)723 return;724725- if (info->lba_to_pba)726- kfree(info->lba_to_pba);727- if (info->pba_to_lba)728- kfree(info->pba_to_lba);729}730731
···119 /* expect to get short transfer if no card fitted */120 if (result == USB_STOR_XFER_SHORT || result == USB_STOR_XFER_STALLED) {121 /* had a short transfer, no card inserted, free map memory */122+ kfree(info->lba_to_pba);123+ kfree(info->pba_to_lba);00124 info->lba_to_pba = NULL;125 info->pba_to_lba = NULL;126···649 return -1;650 }651652+ kfree(info->lba_to_pba);653+ kfree(info->pba_to_lba);00654 info->lba_to_pba = kmalloc(numblocks*sizeof(int), GFP_NOIO);655 info->pba_to_lba = kmalloc(numblocks*sizeof(int), GFP_NOIO);656657 if (info->lba_to_pba == NULL || info->pba_to_lba == NULL) {658+ kfree(info->lba_to_pba);659+ kfree(info->pba_to_lba);00660 info->lba_to_pba = NULL;661 info->pba_to_lba = NULL;662 kfree(buffer);···728 if (!extra)729 return;730731+ kfree(info->lba_to_pba);732+ kfree(info->pba_to_lba);00733}734735
+1-1
drivers/usb/storage/transport.c
···996 * command phase and the data phase. Some devices need a little997 * more than that, probably because of clock rate inaccuracies. */998 if (unlikely(us->flags & US_FL_GO_SLOW))999- udelay(110);10001001 if (transfer_length) {1002 unsigned int pipe = srb->sc_data_direction == DMA_FROM_DEVICE ?
···996 * command phase and the data phase. Some devices need a little997 * more than that, probably because of clock rate inaccuracies. */998 if (unlikely(us->flags & US_FL_GO_SLOW))999+ udelay(125);10001001 if (transfer_length) {1002 unsigned int pipe = srb->sc_data_direction == DMA_FROM_DEVICE ?
+13
drivers/usb/storage/unusual_devs.h
···763 US_FL_SINGLE_LUN ),764#endif7650000000000000766/* Datafab KECF-USB / Sagatek DCS-CF / Simpletech Flashlink UCF-100767 * Only revision 1.13 tested (same for all of the above devices,768 * based on the Datafab DF-UG-07 chip). Needed for US_FL_FIX_INQUIRY.
···763 US_FL_SINGLE_LUN ),764#endif765766+#ifdef CONFIG_USB_STORAGE_DATAFAB767+/* Reported by Felix Moeller <felix@derklecks.de>768+ * in Germany this is sold by Hama with the productnumber 46952769+ * as "DualSlot CompactFlash(TM) & MStick Drive USB"770+ */771+UNUSUAL_DEV( 0x07c4, 0xa10b, 0x0000, 0xffff,772+ "DataFab Systems Inc.",773+ "USB CF+MS",774+ US_SC_SCSI, US_PR_DATAFAB, NULL,775+ 0 ),776+777+#endif778+779/* Datafab KECF-USB / Sagatek DCS-CF / Simpletech Flashlink UCF-100780 * Only revision 1.13 tested (same for all of the above devices,781 * based on the Datafab DF-UG-07 chip). Needed for US_FL_FIX_INQUIRY.
+2-2
include/linux/usb.h
···558559 int (*ioctl) (struct usb_interface *intf, unsigned int code, void *buf);560561- int (*suspend) (struct usb_interface *intf, u32 state);562 int (*resume) (struct usb_interface *intf);563564 const struct usb_device_id *id_table;···977 int timeout);978979/* selective suspend/resume */980-extern int usb_suspend_device(struct usb_device *dev, u32 state);981extern int usb_resume_device(struct usb_device *dev);982983
···558559 int (*ioctl) (struct usb_interface *intf, unsigned int code, void *buf);560561+ int (*suspend) (struct usb_interface *intf, pm_message_t message);562 int (*resume) (struct usb_interface *intf);563564 const struct usb_device_id *id_table;···977 int timeout);978979/* selective suspend/resume */980+extern int usb_suspend_device(struct usb_device *dev, pm_message_t message);981extern int usb_resume_device(struct usb_device *dev);982983
+1-1
include/linux/usb_cdc.h
···114115 /* type is associated with mdlm_desc.bGUID */116 __u8 bGuidDescriptorType;117- __u8 bDetailData[];118} __attribute__ ((packed));119120/*-------------------------------------------------------------------------*/
···114115 /* type is associated with mdlm_desc.bGUID */116 __u8 bGuidDescriptorType;117+ __u8 bDetailData[0];118} __attribute__ ((packed));119120/*-------------------------------------------------------------------------*/