···125125126126 /* more shared queuing code would be good; it should support127127 * smarter scheduling, handle transaction translators, etc;128128- * input size of periodic table to an interrupt scheduler. 128128+ * input size of periodic table to an interrupt scheduler.129129 * (ohci 32, uhci 1024, ehci 256/512/1024).130130 */131131···133133 * this structure.134134 */135135 unsigned long hcd_priv[0]136136- __attribute__ ((aligned (sizeof(unsigned long))));136136+ __attribute__ ((aligned(sizeof(unsigned long))));137137};138138139139/* 2.4 does this a bit differently ... */140140-static inline struct usb_bus *hcd_to_bus (struct usb_hcd *hcd)140140+static inline struct usb_bus *hcd_to_bus(struct usb_hcd *hcd)141141{142142 return &hcd->self;143143}144144145145-static inline struct usb_hcd *bus_to_hcd (struct usb_bus *bus)145145+static inline struct usb_hcd *bus_to_hcd(struct usb_bus *bus)146146{147147 return container_of(bus, struct usb_hcd, self);148148}···202202 struct usb_host_endpoint *ep);203203204204 /* root hub support */205205- int (*hub_status_data) (struct usb_hcd *hcd, char *buf);206206- int (*hub_control) (struct usb_hcd *hcd,205205+ int (*hub_status_data) (struct usb_hcd *hcd, char *buf);206206+ int (*hub_control) (struct usb_hcd *hcd,207207 u16 typeReq, u16 wValue, u16 wIndex,208208 char *buf, u16 wLength);209209- int (*bus_suspend)(struct usb_hcd *);210210- int (*bus_resume)(struct usb_hcd *);211211- int (*start_port_reset)(struct usb_hcd *, unsigned port_num);212212- void (*hub_irq_enable)(struct usb_hcd *);209209+ int (*bus_suspend)(struct usb_hcd *);210210+ int (*bus_resume)(struct usb_hcd *);211211+ int (*start_port_reset)(struct usb_hcd *, unsigned port_num);212212+ void (*hub_irq_enable)(struct usb_hcd *);213213 /* Needed only if port-change IRQs are level-triggered */214214215215 /* force handover of high-speed port to full-speed companion */216216- void (*relinquish_port)(struct usb_hcd *, int);216216+ void (*relinquish_port)(struct usb_hcd *, int);217217};218218219219extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb);···221221 int status);222222extern void usb_hcd_unlink_urb_from_ep(struct usb_hcd *hcd, struct urb *urb);223223224224-extern int usb_hcd_submit_urb (struct urb *urb, gfp_t mem_flags);225225-extern int usb_hcd_unlink_urb (struct urb *urb, int status);224224+extern int usb_hcd_submit_urb(struct urb *urb, gfp_t mem_flags);225225+extern int usb_hcd_unlink_urb(struct urb *urb, int status);226226extern void usb_hcd_giveback_urb(struct usb_hcd *hcd, struct urb *urb,227227 int status);228228extern void usb_hcd_flush_endpoint(struct usb_device *udev,229229 struct usb_host_endpoint *ep);230230extern void usb_hcd_disable_endpoint(struct usb_device *udev,231231 struct usb_host_endpoint *ep);232232-extern int usb_hcd_get_frame_number (struct usb_device *udev);232232+extern int usb_hcd_get_frame_number(struct usb_device *udev);233233234234-extern struct usb_hcd *usb_create_hcd (const struct hc_driver *driver,234234+extern struct usb_hcd *usb_create_hcd(const struct hc_driver *driver,235235 struct device *dev, char *bus_name);236236-extern struct usb_hcd *usb_get_hcd (struct usb_hcd *hcd);237237-extern void usb_put_hcd (struct usb_hcd *hcd);236236+extern struct usb_hcd *usb_get_hcd(struct usb_hcd *hcd);237237+extern void usb_put_hcd(struct usb_hcd *hcd);238238extern int usb_add_hcd(struct usb_hcd *hcd,239239 unsigned int irqnum, unsigned long irqflags);240240extern void usb_remove_hcd(struct usb_hcd *hcd);241241242242struct platform_device;243243-extern void usb_hcd_platform_shutdown(struct platform_device* dev);243243+extern void usb_hcd_platform_shutdown(struct platform_device *dev);244244245245#ifdef CONFIG_PCI246246struct pci_dev;247247struct pci_device_id;248248-extern int usb_hcd_pci_probe (struct pci_dev *dev,248248+extern int usb_hcd_pci_probe(struct pci_dev *dev,249249 const struct pci_device_id *id);250250-extern void usb_hcd_pci_remove (struct pci_dev *dev);250250+extern void usb_hcd_pci_remove(struct pci_dev *dev);251251252252#ifdef CONFIG_PM253253-extern int usb_hcd_pci_suspend (struct pci_dev *dev, pm_message_t state);254254-extern int usb_hcd_pci_resume (struct pci_dev *dev);253253+extern int usb_hcd_pci_suspend(struct pci_dev *dev, pm_message_t state);254254+extern int usb_hcd_pci_resume(struct pci_dev *dev);255255#endif /* CONFIG_PM */256256257257-extern void usb_hcd_pci_shutdown (struct pci_dev *dev);257257+extern void usb_hcd_pci_shutdown(struct pci_dev *dev);258258259259#endif /* CONFIG_PCI */260260261261/* pci-ish (pdev null is ok) buffer alloc/mapping support */262262-int hcd_buffer_create (struct usb_hcd *hcd);263263-void hcd_buffer_destroy (struct usb_hcd *hcd);262262+int hcd_buffer_create(struct usb_hcd *hcd);263263+void hcd_buffer_destroy(struct usb_hcd *hcd);264264265265-void *hcd_buffer_alloc (struct usb_bus *bus, size_t size,265265+void *hcd_buffer_alloc(struct usb_bus *bus, size_t size,266266 gfp_t mem_flags, dma_addr_t *dma);267267-void hcd_buffer_free (struct usb_bus *bus, size_t size,267267+void hcd_buffer_free(struct usb_bus *bus, size_t size,268268 void *addr, dma_addr_t dma);269269270270/* generic bus glue, needed for host controllers that don't use PCI */271271-extern irqreturn_t usb_hcd_irq (int irq, void *__hcd);271271+extern irqreturn_t usb_hcd_irq(int irq, void *__hcd);272272273273-extern void usb_hc_died (struct usb_hcd *hcd);273273+extern void usb_hc_died(struct usb_hcd *hcd);274274extern void usb_hcd_poll_rh_status(struct usb_hcd *hcd);275275276276/* -------------------------------------------------------------------------- */···323323 * Generic bandwidth allocation constants/support324324 */325325#define FRAME_TIME_USECS 1000L326326-#define BitTime(bytecount) (7 * 8 * bytecount / 6) /* with integer truncation */326326+#define BitTime(bytecount) (7 * 8 * bytecount / 6) /* with integer truncation */327327 /* Trying not to use worst-case bit-stuffing328328- of (7/6 * 8 * bytecount) = 9.33 * bytecount */328328+ * of (7/6 * 8 * bytecount) = 9.33 * bytecount */329329 /* bytecount = data payload byte count */330330331331#define NS_TO_US(ns) ((ns + 500L) / 1000L)···337337 */338338#define BW_HOST_DELAY 1000L /* nanoseconds */339339#define BW_HUB_LS_SETUP 333L /* nanoseconds */340340- /* 4 full-speed bit times (est.) */340340+ /* 4 full-speed bit times (est.) */341341342342-#define FRAME_TIME_BITS 12000L /* frame = 1 millisecond */342342+#define FRAME_TIME_BITS 12000L /* frame = 1 millisecond */343343#define FRAME_TIME_MAX_BITS_ALLOC (90L * FRAME_TIME_BITS / 100L)344344#define FRAME_TIME_MAX_USECS_ALLOC (90L * FRAME_TIME_USECS / 100L)345345···349349 * to preallocate bandwidth)350350 */351351#define USB2_HOST_DELAY 5 /* nsec, guess */352352-#define HS_NSECS(bytes) ( ((55 * 8 * 2083) \352352+#define HS_NSECS(bytes) (((55 * 8 * 2083) \353353 + (2083UL * (3 + BitTime(bytes))))/1000 \354354 + USB2_HOST_DELAY)355355-#define HS_NSECS_ISO(bytes) ( ((38 * 8 * 2083) \355355+#define HS_NSECS_ISO(bytes) (((38 * 8 * 2083) \356356 + (2083UL * (3 + BitTime(bytes))))/1000 \357357 + USB2_HOST_DELAY)358358#define HS_USECS(bytes) NS_TO_US (HS_NSECS(bytes))359359#define HS_USECS_ISO(bytes) NS_TO_US (HS_NSECS_ISO(bytes))360360361361-extern long usb_calc_bus_time (int speed, int is_input,361361+extern long usb_calc_bus_time(int speed, int is_input,362362 int isoc, int bytecount);363363364364/*-------------------------------------------------------------------------*/···374374extern struct mutex usb_bus_list_lock;375375extern wait_queue_head_t usb_kill_urb_queue;376376377377-extern void usb_enable_root_hub_irq (struct usb_bus *bus);377377+extern void usb_enable_root_hub_irq(struct usb_bus *bus);378378379379-extern int usb_find_interface_driver (struct usb_device *dev,379379+extern int usb_find_interface_driver(struct usb_device *dev,380380 struct usb_interface *interface);381381382382#define usb_endpoint_out(ep_dir) (!((ep_dir) & USB_DIR_IN))383383384384#ifdef CONFIG_PM385385-extern void usb_hcd_resume_root_hub (struct usb_hcd *hcd);386386-extern void usb_root_hub_lost_power (struct usb_device *rhdev);385385+extern void usb_hcd_resume_root_hub(struct usb_hcd *hcd);386386+extern void usb_root_hub_lost_power(struct usb_device *rhdev);387387extern int hcd_bus_suspend(struct usb_device *rhdev);388388extern int hcd_bus_resume(struct usb_device *rhdev);389389#else···403403 * these are expected to be called from the USB core/hub thread404404 * with the kernel lock held405405 */406406-extern void usbfs_update_special (void);406406+extern void usbfs_update_special(void);407407extern int usbfs_init(void);408408extern void usbfs_cleanup(void);409409410410#else /* CONFIG_USB_DEVICEFS */411411412412-static inline void usbfs_update_special (void) {}412412+static inline void usbfs_update_special(void) {}413413static inline int usbfs_init(void) { return 0; }414414static inline void usbfs_cleanup(void) { }415415···464464/*-------------------------------------------------------------------------*/465465466466/* hub.h ... DeviceRemovable in 2.4.2-ac11, gone in 2.4.10 */467467-// bleech -- resurfaced in 2.4.11 or 2.4.12467467+/* bleech -- resurfaced in 2.4.11 or 2.4.12 */468468#define bitmap DeviceRemovable469469470470···472472473473/* random stuff */474474475475-#define RUN_CONTEXT (in_irq () ? "in_irq" \476476- : (in_interrupt () ? "in_interrupt" : "can sleep"))475475+#define RUN_CONTEXT (in_irq() ? "in_irq" \476476+ : (in_interrupt() ? "in_interrupt" : "can sleep"))477477478478479479/* This rwsem is for use only by the hub driver and ehci-hcd.
+9-9
drivers/usb/core/hub.h
···5555#define USB_PORT_FEAT_TEST 215656#define USB_PORT_FEAT_INDICATOR 2257575858-/* 5858+/*5959 * Hub Status and Hub Change results6060 * See USB 2.0 spec Table 11-19 and Table 11-206161 */6262struct usb_port_status {6363 __le16 wPortStatus;6464- __le16 wPortChange; 6464+ __le16 wPortChange;6565} __attribute__ ((packed));66666767-/* 6767+/*6868 * wPortStatus bit field6969 * See USB 2.0 spec Table 11-217070 */···8181#define USB_PORT_STAT_INDICATOR 0x10008282/* bits 13 to 15 are reserved */83838484-/* 8484+/*8585 * wPortChange bit field8686 * See USB 2.0 spec Table 11-228787 * Bits 0 to 4 shown, bits 5 to 15 are reserved···9393#define USB_PORT_STAT_C_RESET 0x001094949595/*9696- * wHubCharacteristics (masks) 9696+ * wHubCharacteristics (masks)9797 * See USB 2.0 spec Table 11-13, offset 39898 */9999#define HUB_CHAR_LPSM 0x0003 /* D1 .. D0 */···119119#define HUB_CHANGE_OVERCURRENT 0x0002120120121121122122-/* 123123- * Hub descriptor 122122+/*123123+ * Hub descriptor124124 * See USB 2.0 spec Table 11-13125125 */126126···134134 __le16 wHubCharacteristics;135135 __u8 bPwrOn2PwrGood;136136 __u8 bHubContrCurrent;137137- /* add 1 bit for hub status change; round to bytes */137137+ /* add 1 bit for hub status change; round to bytes */138138 __u8 DeviceRemovable[(USB_MAXCHILDREN + 1 + 7) / 8];139139 __u8 PortPwrCtrlMask[(USB_MAXCHILDREN + 1 + 7) / 8];140140} __attribute__ ((packed));···190190 u16 devinfo;191191};192192193193-extern void usb_hub_tt_clear_buffer (struct usb_device *dev, int pipe);193193+extern void usb_hub_tt_clear_buffer(struct usb_device *dev, int pipe);194194195195#endif /* __LINUX_HUB_H */
+3-3
drivers/usb/core/otg_whitelist.h
···1414 * mostly use of USB_DEVICE() or USB_DEVICE_VER() entries..1515 *1616 * YOU _SHOULD_ CHANGE THIS LIST TO MATCH YOUR PRODUCT AND ITS TESTING!1717- */ 1717+ */18181919static struct usb_device_id whitelist_table [] = {2020···5555 return 1;56565757 /* HNP test device is _never_ targeted (see OTG spec 6.6.6) */5858- if ((le16_to_cpu(dev->descriptor.idVendor) == 0x1a0a && 5858+ if ((le16_to_cpu(dev->descriptor.idVendor) == 0x1a0a &&5959 le16_to_cpu(dev->descriptor.idProduct) == 0xbadd))6060 return 0;6161···8686 continue;87878888 if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_SUBCLASS) &&8989- (id->bDeviceSubClass!= dev->descriptor.bDeviceSubClass))8989+ (id->bDeviceSubClass != dev->descriptor.bDeviceSubClass))9090 continue;91919292 if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_PROTOCOL) &&
+11-10
drivers/usb/core/usb.h
···11/* Functions local to drivers/usb/core/ */2233-extern int usb_create_sysfs_dev_files (struct usb_device *dev);44-extern void usb_remove_sysfs_dev_files (struct usb_device *dev);55-extern int usb_create_sysfs_intf_files (struct usb_interface *intf);66-extern void usb_remove_sysfs_intf_files (struct usb_interface *intf);77-extern int usb_create_ep_files(struct device *parent, struct usb_host_endpoint *endpoint,33+extern int usb_create_sysfs_dev_files(struct usb_device *dev);44+extern void usb_remove_sysfs_dev_files(struct usb_device *dev);55+extern int usb_create_sysfs_intf_files(struct usb_interface *intf);66+extern void usb_remove_sysfs_intf_files(struct usb_interface *intf);77+extern int usb_create_ep_files(struct device *parent,88+ struct usb_host_endpoint *endpoint,89 struct usb_device *udev);910extern void usb_remove_ep_files(struct usb_host_endpoint *endpoint);10111112extern void usb_enable_endpoint(struct usb_device *dev,1213 struct usb_host_endpoint *ep);1313-extern void usb_disable_endpoint (struct usb_device *dev, unsigned int epaddr);1414-extern void usb_disable_interface (struct usb_device *dev,1414+extern void usb_disable_endpoint(struct usb_device *dev, unsigned int epaddr);1515+extern void usb_disable_interface(struct usb_device *dev,1516 struct usb_interface *intf);1617extern void usb_release_interface_cache(struct kref *ref);1717-extern void usb_disable_device (struct usb_device *dev, int skip_ep0);1818-extern int usb_deauthorize_device (struct usb_device *);1919-extern int usb_authorize_device (struct usb_device *);1818+extern void usb_disable_device(struct usb_device *dev, int skip_ep0);1919+extern int usb_deauthorize_device(struct usb_device *);2020+extern int usb_authorize_device(struct usb_device *);2021extern void usb_detect_quirks(struct usb_device *udev);21222223extern int usb_get_device_descriptor(struct usb_device *dev,