Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: Move private hub declarations out of public header file

This patch (as809b) moves the declaration of the hub driver's private
data structure from hub.h into the hub.c source file. Lots of other
files import hub.h; they have no need to know about the details of the
hub driver's private data.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Alan Stern and committed by
Greg Kroah-Hartman
1bb5f66b b4ee4a23

+42 -41
+42
drivers/usb/core/hub.c
··· 31 31 #include "hcd.h" 32 32 #include "hub.h" 33 33 34 + struct usb_hub { 35 + struct device *intfdev; /* the "interface" device */ 36 + struct usb_device *hdev; 37 + struct urb *urb; /* for interrupt polling pipe */ 38 + 39 + /* buffer for urb ... with extra space in case of babble */ 40 + char (*buffer)[8]; 41 + dma_addr_t buffer_dma; /* DMA address for buffer */ 42 + union { 43 + struct usb_hub_status hub; 44 + struct usb_port_status port; 45 + } *status; /* buffer for status reports */ 46 + 47 + int error; /* last reported error */ 48 + int nerrors; /* track consecutive errors */ 49 + 50 + struct list_head event_list; /* hubs w/data or errs ready */ 51 + unsigned long event_bits[1]; /* status change bitmask */ 52 + unsigned long change_bits[1]; /* ports with logical connect 53 + status change */ 54 + unsigned long busy_bits[1]; /* ports being reset or 55 + resumed */ 56 + #if USB_MAXCHILDREN > 31 /* 8*sizeof(unsigned long) - 1 */ 57 + #error event_bits[] is too short! 58 + #endif 59 + 60 + struct usb_hub_descriptor *descriptor; /* class descriptor */ 61 + struct usb_tt tt; /* Transaction Translator */ 62 + 63 + unsigned mA_per_port; /* current for each child */ 64 + 65 + unsigned limited_power:1; 66 + unsigned quiescing:1; 67 + unsigned activating:1; 68 + unsigned resume_root_hub:1; 69 + 70 + unsigned has_indicators:1; 71 + u8 indicator[USB_MAXCHILDREN]; 72 + struct work_struct leds; 73 + }; 74 + 75 + 34 76 /* Protect struct usb_device->state and ->children members 35 77 * Note: Both are also protected by ->dev.sem, except that ->state can 36 78 * change to USB_STATE_NOTATTACHED even when the semaphore isn't held. */
-41
drivers/usb/core/hub.h
··· 192 192 193 193 extern void usb_hub_tt_clear_buffer (struct usb_device *dev, int pipe); 194 194 195 - struct usb_hub { 196 - struct device *intfdev; /* the "interface" device */ 197 - struct usb_device *hdev; 198 - struct urb *urb; /* for interrupt polling pipe */ 199 - 200 - /* buffer for urb ... with extra space in case of babble */ 201 - char (*buffer)[8]; 202 - dma_addr_t buffer_dma; /* DMA address for buffer */ 203 - union { 204 - struct usb_hub_status hub; 205 - struct usb_port_status port; 206 - } *status; /* buffer for status reports */ 207 - 208 - int error; /* last reported error */ 209 - int nerrors; /* track consecutive errors */ 210 - 211 - struct list_head event_list; /* hubs w/data or errs ready */ 212 - unsigned long event_bits[1]; /* status change bitmask */ 213 - unsigned long change_bits[1]; /* ports with logical connect 214 - status change */ 215 - unsigned long busy_bits[1]; /* ports being reset or 216 - resumed */ 217 - #if USB_MAXCHILDREN > 31 /* 8*sizeof(unsigned long) - 1 */ 218 - #error event_bits[] is too short! 219 - #endif 220 - 221 - struct usb_hub_descriptor *descriptor; /* class descriptor */ 222 - struct usb_tt tt; /* Transaction Translator */ 223 - 224 - unsigned mA_per_port; /* current for each child */ 225 - 226 - unsigned limited_power:1; 227 - unsigned quiescing:1; 228 - unsigned activating:1; 229 - unsigned resume_root_hub:1; 230 - 231 - unsigned has_indicators:1; 232 - u8 indicator[USB_MAXCHILDREN]; 233 - struct work_struct leds; 234 - }; 235 - 236 195 #endif /* __LINUX_HUB_H */