USB: fix codingstyle issues in include/linux/usb/

Fixes a number of coding style issues in the USB public header files.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

+219 -204
+7 -7
include/linux/usb/audio.h
··· 27 27 28 28 /* 4.3.2 Class-Specific AC Interface Descriptor */ 29 29 struct usb_ac_header_descriptor { 30 - __u8 bLength; // 8+n 31 - __u8 bDescriptorType; // USB_DT_CS_INTERFACE 32 - __u8 bDescriptorSubtype; // USB_MS_HEADER 33 - __le16 bcdADC; // 0x0100 34 - __le16 wTotalLength; // includes Unit and Terminal desc. 35 - __u8 bInCollection; // n 36 - __u8 baInterfaceNr[]; // [n] 30 + __u8 bLength; /* 8+n */ 31 + __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ 32 + __u8 bDescriptorSubtype; /* USB_MS_HEADER */ 33 + __le16 bcdADC; /* 0x0100 */ 34 + __le16 wTotalLength; /* includes Unit and Terminal desc. */ 35 + __u8 bInCollection; /* n */ 36 + __u8 baInterfaceNr[]; /* [n] */ 37 37 } __attribute__ ((packed)); 38 38 39 39 #define USB_DT_AC_HEADER_SIZE(n) (8+(n))
+8 -8
include/linux/usb/cdc.h
··· 29 29 * Class-Specific descriptors ... there are a couple dozen of them 30 30 */ 31 31 32 - #define USB_CDC_HEADER_TYPE 0x00 /* header_desc */ 33 - #define USB_CDC_CALL_MANAGEMENT_TYPE 0x01 /* call_mgmt_descriptor */ 34 - #define USB_CDC_ACM_TYPE 0x02 /* acm_descriptor */ 35 - #define USB_CDC_UNION_TYPE 0x06 /* union_desc */ 32 + #define USB_CDC_HEADER_TYPE 0x00 /* header_desc */ 33 + #define USB_CDC_CALL_MANAGEMENT_TYPE 0x01 /* call_mgmt_descriptor */ 34 + #define USB_CDC_ACM_TYPE 0x02 /* acm_descriptor */ 35 + #define USB_CDC_UNION_TYPE 0x06 /* union_desc */ 36 36 #define USB_CDC_COUNTRY_TYPE 0x07 37 - #define USB_CDC_NETWORK_TERMINAL_TYPE 0x0a /* network_terminal_desc */ 38 - #define USB_CDC_ETHERNET_TYPE 0x0f /* ether_desc */ 37 + #define USB_CDC_NETWORK_TERMINAL_TYPE 0x0a /* network_terminal_desc */ 38 + #define USB_CDC_ETHERNET_TYPE 0x0f /* ether_desc */ 39 39 #define USB_CDC_WHCM_TYPE 0x11 40 - #define USB_CDC_MDLM_TYPE 0x12 /* mdlm_desc */ 41 - #define USB_CDC_MDLM_DETAIL_TYPE 0x13 /* mdlm_detail_desc */ 40 + #define USB_CDC_MDLM_TYPE 0x12 /* mdlm_desc */ 41 + #define USB_CDC_MDLM_DETAIL_TYPE 0x13 /* mdlm_detail_desc */ 42 42 #define USB_CDC_DMM_TYPE 0x14 43 43 #define USB_CDC_OBEX_TYPE 0x15 44 44
+55 -68
include/linux/usb/gadget.h
··· 70 70 * 71 71 * Bulk endpoints can use any size buffers, and can also be used for interrupt 72 72 * transfers. interrupt-only endpoints can be much less functional. 73 + * 74 + * NOTE: this is analagous to 'struct urb' on the host side, except that 75 + * it's thinner and promotes more pre-allocation. 73 76 */ 74 - // NOTE this is analagous to 'struct urb' on the host side, 75 - // except that it's thinner and promotes more pre-allocation. 76 77 77 78 struct usb_request { 78 79 void *buf; ··· 169 168 * 170 169 * returns zero, or a negative error code. 171 170 */ 172 - static inline int 173 - usb_ep_enable (struct usb_ep *ep, const struct usb_endpoint_descriptor *desc) 171 + static inline int usb_ep_enable(struct usb_ep *ep, 172 + const struct usb_endpoint_descriptor *desc) 174 173 { 175 - return ep->ops->enable (ep, desc); 174 + return ep->ops->enable(ep, desc); 176 175 } 177 176 178 177 /** ··· 187 186 * 188 187 * returns zero, or a negative error code. 189 188 */ 190 - static inline int 191 - usb_ep_disable (struct usb_ep *ep) 189 + static inline int usb_ep_disable(struct usb_ep *ep) 192 190 { 193 - return ep->ops->disable (ep); 191 + return ep->ops->disable(ep); 194 192 } 195 193 196 194 /** ··· 206 206 * 207 207 * Returns the request, or null if one could not be allocated. 208 208 */ 209 - static inline struct usb_request * 210 - usb_ep_alloc_request (struct usb_ep *ep, gfp_t gfp_flags) 209 + static inline struct usb_request *usb_ep_alloc_request(struct usb_ep *ep, 210 + gfp_t gfp_flags) 211 211 { 212 - return ep->ops->alloc_request (ep, gfp_flags); 212 + return ep->ops->alloc_request(ep, gfp_flags); 213 213 } 214 214 215 215 /** ··· 221 221 * Caller guarantees the request is not queued, and that it will 222 222 * no longer be requeued (or otherwise used). 223 223 */ 224 - static inline void 225 - usb_ep_free_request (struct usb_ep *ep, struct usb_request *req) 224 + static inline void usb_ep_free_request(struct usb_ep *ep, 225 + struct usb_request *req) 226 226 { 227 - ep->ops->free_request (ep, req); 227 + ep->ops->free_request(ep, req); 228 228 } 229 229 230 230 /** ··· 281 281 * report errors; errors will also be 282 282 * reported when the usb peripheral is disconnected. 283 283 */ 284 - static inline int 285 - usb_ep_queue (struct usb_ep *ep, struct usb_request *req, gfp_t gfp_flags) 284 + static inline int usb_ep_queue(struct usb_ep *ep, 285 + struct usb_request *req, gfp_t gfp_flags) 286 286 { 287 - return ep->ops->queue (ep, req, gfp_flags); 287 + return ep->ops->queue(ep, req, gfp_flags); 288 288 } 289 289 290 290 /** ··· 301 301 * restrictions prevent drivers from supporting configuration changes, 302 302 * even to configuration zero (a "chapter 9" requirement). 303 303 */ 304 - static inline int usb_ep_dequeue (struct usb_ep *ep, struct usb_request *req) 304 + static inline int usb_ep_dequeue(struct usb_ep *ep, struct usb_request *req) 305 305 { 306 - return ep->ops->dequeue (ep, req); 306 + return ep->ops->dequeue(ep, req); 307 307 } 308 308 309 309 /** ··· 327 327 * transfer requests are still queued, or if the controller hardware 328 328 * (usually a FIFO) still holds bytes that the host hasn't collected. 329 329 */ 330 - static inline int 331 - usb_ep_set_halt (struct usb_ep *ep) 330 + static inline int usb_ep_set_halt(struct usb_ep *ep) 332 331 { 333 - return ep->ops->set_halt (ep, 1); 332 + return ep->ops->set_halt(ep, 1); 334 333 } 335 334 336 335 /** ··· 345 346 * Note that some hardware can't support this request (like pxa2xx_udc), 346 347 * and accordingly can't correctly implement interface altsettings. 347 348 */ 348 - static inline int 349 - usb_ep_clear_halt (struct usb_ep *ep) 349 + static inline int usb_ep_clear_halt(struct usb_ep *ep) 350 350 { 351 - return ep->ops->set_halt (ep, 0); 351 + return ep->ops->set_halt(ep, 0); 352 352 } 353 353 354 354 /** ··· 365 367 * errno if the endpoint doesn't use a FIFO or doesn't support such 366 368 * precise handling. 367 369 */ 368 - static inline int 369 - usb_ep_fifo_status (struct usb_ep *ep) 370 + static inline int usb_ep_fifo_status(struct usb_ep *ep) 370 371 { 371 372 if (ep->ops->fifo_status) 372 - return ep->ops->fifo_status (ep); 373 + return ep->ops->fifo_status(ep); 373 374 else 374 375 return -EOPNOTSUPP; 375 376 } ··· 382 385 * must never be used except when endpoint is not being used for any 383 386 * protocol translation. 384 387 */ 385 - static inline void 386 - usb_ep_fifo_flush (struct usb_ep *ep) 388 + static inline void usb_ep_fifo_flush(struct usb_ep *ep) 387 389 { 388 390 if (ep->ops->fifo_flush) 389 - ep->ops->fifo_flush (ep); 391 + ep->ops->fifo_flush(ep); 390 392 } 391 393 392 394 ··· 465 469 struct device dev; 466 470 }; 467 471 468 - static inline void set_gadget_data (struct usb_gadget *gadget, void *data) 469 - { dev_set_drvdata (&gadget->dev, data); } 470 - static inline void *get_gadget_data (struct usb_gadget *gadget) 471 - { return dev_get_drvdata (&gadget->dev); } 472 + static inline void set_gadget_data(struct usb_gadget *gadget, void *data) 473 + { dev_set_drvdata(&gadget->dev, data); } 474 + static inline void *get_gadget_data(struct usb_gadget *gadget) 475 + { return dev_get_drvdata(&gadget->dev); } 472 476 473 477 /* iterates the non-control endpoints; 'tmp' is a struct usb_ep pointer */ 474 478 #define gadget_for_each_ep(tmp,gadget) \ ··· 507 511 #endif 508 512 } 509 513 510 - 511 514 /** 512 515 * usb_gadget_frame_number - returns the current frame number 513 516 * @gadget: controller that reports the frame number ··· 514 519 * Returns the usb frame number, normally eleven bits from a SOF packet, 515 520 * or negative errno if this device doesn't support this capability. 516 521 */ 517 - static inline int usb_gadget_frame_number (struct usb_gadget *gadget) 522 + static inline int usb_gadget_frame_number(struct usb_gadget *gadget) 518 523 { 519 - return gadget->ops->get_frame (gadget); 524 + return gadget->ops->get_frame(gadget); 520 525 } 521 526 522 527 /** ··· 532 537 * even if OTG isn't otherwise in use. OTG devices may also start 533 538 * remote wakeup even when hosts don't explicitly enable it. 534 539 */ 535 - static inline int usb_gadget_wakeup (struct usb_gadget *gadget) 540 + static inline int usb_gadget_wakeup(struct usb_gadget *gadget) 536 541 { 537 542 if (!gadget->ops->wakeup) 538 543 return -EOPNOTSUPP; 539 - return gadget->ops->wakeup (gadget); 544 + return gadget->ops->wakeup(gadget); 540 545 } 541 546 542 547 /** ··· 548 553 * 549 554 * returns zero on success, else negative errno. 550 555 */ 551 - static inline int 552 - usb_gadget_set_selfpowered (struct usb_gadget *gadget) 556 + static inline int usb_gadget_set_selfpowered(struct usb_gadget *gadget) 553 557 { 554 558 if (!gadget->ops->set_selfpowered) 555 559 return -EOPNOTSUPP; 556 - return gadget->ops->set_selfpowered (gadget, 1); 560 + return gadget->ops->set_selfpowered(gadget, 1); 557 561 } 558 562 559 563 /** ··· 565 571 * 566 572 * returns zero on success, else negative errno. 567 573 */ 568 - static inline int 569 - usb_gadget_clear_selfpowered (struct usb_gadget *gadget) 574 + static inline int usb_gadget_clear_selfpowered(struct usb_gadget *gadget) 570 575 { 571 576 if (!gadget->ops->set_selfpowered) 572 577 return -EOPNOTSUPP; 573 - return gadget->ops->set_selfpowered (gadget, 0); 578 + return gadget->ops->set_selfpowered(gadget, 0); 574 579 } 575 580 576 581 /** ··· 584 591 * 585 592 * Returns zero on success, else negative errno. 586 593 */ 587 - static inline int 588 - usb_gadget_vbus_connect(struct usb_gadget *gadget) 594 + static inline int usb_gadget_vbus_connect(struct usb_gadget *gadget) 589 595 { 590 596 if (!gadget->ops->vbus_session) 591 597 return -EOPNOTSUPP; 592 - return gadget->ops->vbus_session (gadget, 1); 598 + return gadget->ops->vbus_session(gadget, 1); 593 599 } 594 600 595 601 /** ··· 603 611 * 604 612 * Returns zero on success, else negative errno. 605 613 */ 606 - static inline int 607 - usb_gadget_vbus_draw(struct usb_gadget *gadget, unsigned mA) 614 + static inline int usb_gadget_vbus_draw(struct usb_gadget *gadget, unsigned mA) 608 615 { 609 616 if (!gadget->ops->vbus_draw) 610 617 return -EOPNOTSUPP; 611 - return gadget->ops->vbus_draw (gadget, mA); 618 + return gadget->ops->vbus_draw(gadget, mA); 612 619 } 613 620 614 621 /** ··· 620 629 * 621 630 * Returns zero on success, else negative errno. 622 631 */ 623 - static inline int 624 - usb_gadget_vbus_disconnect(struct usb_gadget *gadget) 632 + static inline int usb_gadget_vbus_disconnect(struct usb_gadget *gadget) 625 633 { 626 634 if (!gadget->ops->vbus_session) 627 635 return -EOPNOTSUPP; 628 - return gadget->ops->vbus_session (gadget, 0); 636 + return gadget->ops->vbus_session(gadget, 0); 629 637 } 630 638 631 639 /** ··· 638 648 * 639 649 * Returns zero on success, else negative errno. 640 650 */ 641 - static inline int 642 - usb_gadget_connect (struct usb_gadget *gadget) 651 + static inline int usb_gadget_connect(struct usb_gadget *gadget) 643 652 { 644 653 if (!gadget->ops->pullup) 645 654 return -EOPNOTSUPP; 646 - return gadget->ops->pullup (gadget, 1); 655 + return gadget->ops->pullup(gadget, 1); 647 656 } 648 657 649 658 /** ··· 660 671 * 661 672 * Returns zero on success, else negative errno. 662 673 */ 663 - static inline int 664 - usb_gadget_disconnect (struct usb_gadget *gadget) 674 + static inline int usb_gadget_disconnect(struct usb_gadget *gadget) 665 675 { 666 676 if (!gadget->ops->pullup) 667 677 return -EOPNOTSUPP; 668 - return gadget->ops->pullup (gadget, 0); 678 + return gadget->ops->pullup(gadget, 0); 669 679 } 670 - 671 680 672 681 673 682 /*-------------------------------------------------------------------------*/ ··· 751 764 void (*suspend)(struct usb_gadget *); 752 765 void (*resume)(struct usb_gadget *); 753 766 754 - // FIXME support safe rmmod 767 + /* FIXME support safe rmmod */ 755 768 struct device_driver driver; 756 769 }; 757 770 ··· 777 790 * the bind() functions will be in init sections. 778 791 * This function must be called in a context that can sleep. 779 792 */ 780 - int usb_gadget_register_driver (struct usb_gadget_driver *driver); 793 + int usb_gadget_register_driver(struct usb_gadget_driver *driver); 781 794 782 795 /** 783 796 * usb_gadget_unregister_driver - unregister a gadget driver ··· 792 805 * will in in exit sections, so may not be linked in some kernels. 793 806 * This function must be called in a context that can sleep. 794 807 */ 795 - int usb_gadget_unregister_driver (struct usb_gadget_driver *driver); 808 + int usb_gadget_unregister_driver(struct usb_gadget_driver *driver); 796 809 797 810 /*-------------------------------------------------------------------------*/ 798 811 ··· 825 838 }; 826 839 827 840 /* put descriptor for string with that id into buf (buflen >= 256) */ 828 - int usb_gadget_get_string (struct usb_gadget_strings *table, int id, u8 *buf); 841 + int usb_gadget_get_string(struct usb_gadget_strings *table, int id, u8 *buf); 829 842 830 843 /*-------------------------------------------------------------------------*/ 831 844 ··· 843 856 844 857 /* utility wrapping a simple endpoint selection policy */ 845 858 846 - extern struct usb_ep *usb_ep_autoconfig (struct usb_gadget *, 859 + extern struct usb_ep *usb_ep_autoconfig(struct usb_gadget *, 847 860 struct usb_endpoint_descriptor *) __devinit; 848 861 849 - extern void usb_ep_autoconfig_reset (struct usb_gadget *) __devinit; 862 + extern void usb_ep_autoconfig_reset(struct usb_gadget *) __devinit; 850 863 851 864 #endif /* __KERNEL__ */ 852 865
+12 -10
include/linux/usb/gadgetfs.h
··· 36 36 GADGETFS_DISCONNECT, 37 37 GADGETFS_SETUP, 38 38 GADGETFS_SUSPEND, 39 - // and likely more ! 39 + /* and likely more ! */ 40 40 }; 41 41 42 42 /* NOTE: this structure must stay the same size and layout on ··· 44 44 */ 45 45 struct usb_gadgetfs_event { 46 46 union { 47 - // NOP, DISCONNECT, SUSPEND: nothing 48 - // ... some hardware can't report disconnection 47 + /* NOP, DISCONNECT, SUSPEND: nothing 48 + * ... some hardware can't report disconnection 49 + */ 49 50 50 - // CONNECT: just the speed 51 + /* CONNECT: just the speed */ 51 52 enum usb_device_speed speed; 52 53 53 - // SETUP: packet; DATA phase i/o precedes next event 54 - // (setup.bmRequestType & USB_DIR_IN) flags direction 55 - // ... includes SET_CONFIGURATION, SET_INTERFACE 54 + /* SETUP: packet; DATA phase i/o precedes next event 55 + *(setup.bmRequestType & USB_DIR_IN) flags direction 56 + * ... includes SET_CONFIGURATION, SET_INTERFACE 57 + */ 56 58 struct usb_ctrlrequest setup; 57 59 } u; 58 60 enum usb_gadgetfs_event_type type; ··· 75 73 * THIS returns how many bytes are "unclaimed" in the endpoint fifo 76 74 * (needed for precise fault handling, when the hardware allows it) 77 75 */ 78 - #define GADGETFS_FIFO_STATUS _IO('g',1) 76 + #define GADGETFS_FIFO_STATUS _IO('g', 1) 79 77 80 78 /* discards any unclaimed data in the fifo. */ 81 - #define GADGETFS_FIFO_FLUSH _IO('g',2) 79 + #define GADGETFS_FIFO_FLUSH _IO('g', 2) 82 80 83 81 /* resets endpoint halt+toggle; used to implement set_interface. 84 82 * some hardware (like pxa2xx) can't support this. 85 83 */ 86 - #define GADGETFS_CLEAR_HALT _IO('g',3) 84 + #define GADGETFS_CLEAR_HALT _IO('g', 3) 87 85 88 86 #endif /* __LINUX_USB_GADGETFS_H */
+17 -8
include/linux/usb/iowarrior.h
··· 14 14 this information. 15 15 */ 16 16 struct iowarrior_info { 17 - __u32 vendor; /* vendor id : supposed to be USB_VENDOR_ID_CODEMERCS in all cases */ 18 - __u32 product; /* product id : depends on type of chip (USB_DEVICE_ID_CODEMERCS_XXXXX) */ 19 - __u8 serial[9]; /* the serial number of our chip (if a serial-number is not available this is empty string) */ 20 - __u32 revision; /* revision number of the chip */ 21 - __u32 speed; /* USB-speed of the device (0=UNKNOWN, 1=LOW, 2=FULL 3=HIGH) */ 22 - __u32 power; /* power consumption of the device in mA */ 23 - __u32 if_num; /* the number of the endpoint */ 24 - __u32 report_size; /* size of the data-packets on this interface */ 17 + /* vendor id : supposed to be USB_VENDOR_ID_CODEMERCS in all cases */ 18 + __u32 vendor; 19 + /* product id : depends on type of chip (USB_DEVICE_ID_CODEMERCS_X) */ 20 + __u32 product; 21 + /* the serial number of our chip (if a serial-number is not available 22 + * this is empty string) */ 23 + __u8 serial[9]; 24 + /* revision number of the chip */ 25 + __u32 revision; 26 + /* USB-speed of the device (0=UNKNOWN, 1=LOW, 2=FULL 3=HIGH) */ 27 + __u32 speed; 28 + /* power consumption of the device in mA */ 29 + __u32 power; 30 + /* the number of the endpoint */ 31 + __u32 if_num; 32 + /* size of the data-packets on this interface */ 33 + __u32 report_size; 25 34 }; 26 35 27 36 /*
+1 -1
include/linux/usb/isp116x.h
··· 25 25 300ns delay between access to ADDR_REG and DATA_REG 26 26 OE, WE MUST NOT be changed during these intervals 27 27 */ 28 - void (*delay) (struct device * dev, int delay); 28 + void (*delay) (struct device *dev, int delay); 29 29 };
+13 -13
include/linux/usb/midi.h
··· 47 47 /* 6.1.2.2 MIDI IN Jack Descriptor */ 48 48 struct usb_midi_in_jack_descriptor { 49 49 __u8 bLength; 50 - __u8 bDescriptorType; // USB_DT_CS_INTERFACE 51 - __u8 bDescriptorSubtype; // USB_MS_MIDI_IN_JACK 52 - __u8 bJackType; // USB_MS_EMBEDDED/EXTERNAL 50 + __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ 51 + __u8 bDescriptorSubtype; /* USB_MS_MIDI_IN_JACK */ 52 + __u8 bJackType; /* USB_MS_EMBEDDED/EXTERNAL */ 53 53 __u8 bJackID; 54 54 __u8 iJack; 55 55 } __attribute__ ((packed)); ··· 64 64 /* 6.1.2.3 MIDI OUT Jack Descriptor */ 65 65 struct usb_midi_out_jack_descriptor { 66 66 __u8 bLength; 67 - __u8 bDescriptorType; // USB_DT_CS_INTERFACE 68 - __u8 bDescriptorSubtype; // USB_MS_MIDI_OUT_JACK 69 - __u8 bJackType; // USB_MS_EMBEDDED/EXTERNAL 67 + __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ 68 + __u8 bDescriptorSubtype; /* USB_MS_MIDI_OUT_JACK */ 69 + __u8 bJackType; /* USB_MS_EMBEDDED/EXTERNAL */ 70 70 __u8 bJackID; 71 - __u8 bNrInputPins; // p 72 - struct usb_midi_source_pin pins[]; // [p] 71 + __u8 bNrInputPins; /* p */ 72 + struct usb_midi_source_pin pins[]; /* [p] */ 73 73 /*__u8 iJack; -- ommitted due to variable-sized pins[] */ 74 74 } __attribute__ ((packed)); 75 75 ··· 90 90 91 91 /* 6.2.2 Class-Specific MS Bulk Data Endpoint Descriptor */ 92 92 struct usb_ms_endpoint_descriptor { 93 - __u8 bLength; // 4+n 94 - __u8 bDescriptorType; // USB_DT_CS_ENDPOINT 95 - __u8 bDescriptorSubtype; // USB_MS_GENERAL 96 - __u8 bNumEmbMIDIJack; // n 97 - __u8 baAssocJackID[]; // [n] 93 + __u8 bLength; /* 4+n */ 94 + __u8 bDescriptorType; /* USB_DT_CS_ENDPOINT */ 95 + __u8 bDescriptorSubtype; /* USB_MS_GENERAL */ 96 + __u8 bNumEmbMIDIJack; /* n */ 97 + __u8 baAssocJackID[]; /* [n] */ 98 98 } __attribute__ ((packed)); 99 99 100 100 #define USB_DT_MS_ENDPOINT_SIZE(n) (4 + (n))
+16 -16
include/linux/usb/net2280.h
··· 37 37 38 38 /* main registers, BAR0 + 0x0000 */ 39 39 struct net2280_regs { 40 - // offset 0x0000 40 + /* offset 0x0000 */ 41 41 u32 devinit; 42 42 #define LOCAL_CLOCK_FREQUENCY 8 43 43 #define FORCE_PCI_RESET 7 ··· 61 61 #define EEPROM_WRITE_DATA 0 62 62 u32 eeclkfreq; 63 63 u32 _unused0; 64 - // offset 0x0010 64 + /* offset 0x0010 */ 65 65 66 66 u32 pciirqenb0; /* interrupt PCI master ... */ 67 67 #define SETUP_PACKET_INTERRUPT_ENABLE 7 ··· 131 131 #define RESUME_INTERRUPT_ENABLE 1 132 132 #define SOF_INTERRUPT_ENABLE 0 133 133 134 - // offset 0x0020 134 + /* offset 0x0020 */ 135 135 u32 _unused1; 136 136 u32 usbirqenb1; 137 137 #define USB_INTERRUPT_ENABLE 31 ··· 195 195 #define SUSPEND_REQUEST_CHANGE_INTERRUPT 2 196 196 #define RESUME_INTERRUPT 1 197 197 #define SOF_INTERRUPT 0 198 - // offset 0x0030 198 + /* offset 0x0030 */ 199 199 u32 idxaddr; 200 200 u32 idxdata; 201 201 u32 fifoctl; ··· 204 204 #define PCI_BASE2_SELECT 2 205 205 #define FIFO_CONFIGURATION_SELECT 0 206 206 u32 _unused2; 207 - // offset 0x0040 207 + /* offset 0x0040 */ 208 208 u32 memaddr; 209 209 #define START 28 210 210 #define DIRECTION 27 ··· 213 213 u32 memdata0; 214 214 u32 memdata1; 215 215 u32 _unused3; 216 - // offset 0x0050 216 + /* offset 0x0050 */ 217 217 u32 gpioctl; 218 218 #define GPIO3_LED_SELECT 12 219 219 #define GPIO3_INTERRUPT_ENABLE 11 ··· 237 237 238 238 /* usb control, BAR0 + 0x0080 */ 239 239 struct net2280_usb_regs { 240 - // offset 0x0080 240 + /* offset 0x0080 */ 241 241 u32 stdrsp; 242 242 #define STALL_UNSUPPORTED_REQUESTS 31 243 243 #define SET_TEST_MODE 16 ··· 275 275 #define PME_WAKEUP_ENABLE 2 276 276 #define DEVICE_REMOTE_WAKEUP_ENABLE 1 277 277 #define SELF_POWERED_STATUS 0 278 - // offset 0x0090 278 + /* offset 0x0090 */ 279 279 u32 usbstat; 280 280 #define HIGH_SPEED 7 281 281 #define FULL_SPEED 6 ··· 291 291 #define TERMINATION_SELECT 0 292 292 u32 setup0123; 293 293 u32 setup4567; 294 - // offset 0x0090 294 + /* offset 0x0090 */ 295 295 u32 _unused0; 296 296 u32 ouraddr; 297 297 #define FORCE_IMMEDIATE 7 ··· 301 301 302 302 /* pci control, BAR0 + 0x0100 */ 303 303 struct net2280_pci_regs { 304 - // offset 0x0100 304 + /* offset 0x0100 */ 305 305 u32 pcimstctl; 306 306 #define PCI_ARBITER_PARK_SELECT 13 307 307 #define PCI_MULTI LEVEL_ARBITER 12 ··· 331 331 * that can be loaded into some of these registers. 332 332 */ 333 333 struct net2280_dma_regs { /* [11.7] */ 334 - // offset 0x0180, 0x01a0, 0x01c0, 0x01e0, 334 + /* offset 0x0180, 0x01a0, 0x01c0, 0x01e0, */ 335 335 u32 dmactl; 336 336 #define DMA_SCATTER_GATHER_DONE_INTERRUPT_ENABLE 25 337 337 #define DMA_CLEAR_COUNT_ENABLE 21 ··· 355 355 #define DMA_ABORT 1 356 356 #define DMA_START 0 357 357 u32 _unused0 [2]; 358 - // offset 0x0190, 0x01b0, 0x01d0, 0x01f0, 358 + /* offset 0x0190, 0x01b0, 0x01d0, 0x01f0, */ 359 359 u32 dmacount; 360 360 #define VALID_BIT 31 361 361 #define DMA_DIRECTION 30 ··· 371 371 /* dedicated endpoint registers, BAR0 + 0x0200 */ 372 372 373 373 struct net2280_dep_regs { /* [11.8] */ 374 - // offset 0x0200, 0x0210, 0x220, 0x230, 0x240 374 + /* offset 0x0200, 0x0210, 0x220, 0x230, 0x240 */ 375 375 u32 dep_cfg; 376 - // offset 0x0204, 0x0214, 0x224, 0x234, 0x244 376 + /* offset 0x0204, 0x0214, 0x224, 0x234, 0x244 */ 377 377 u32 dep_rsp; 378 378 u32 _unused [2]; 379 379 } __attribute__ ((packed)); ··· 383 383 * ep0 reserved for control; E and F have only 64 bytes of fifo 384 384 */ 385 385 struct net2280_ep_regs { /* [11.9] */ 386 - // offset 0x0300, 0x0320, 0x0340, 0x0360, 0x0380, 0x03a0, 0x03c0 386 + /* offset 0x0300, 0x0320, 0x0340, 0x0360, 0x0380, 0x03a0, 0x03c0 */ 387 387 u32 ep_cfg; 388 388 #define ENDPOINT_BYTE_COUNT 16 389 389 #define ENDPOINT_ENABLE 10 ··· 435 435 #define DATA_PACKET_TRANSMITTED_INTERRUPT 2 436 436 #define DATA_OUT_PING_TOKEN_INTERRUPT 1 437 437 #define DATA_IN_TOKEN_INTERRUPT 0 438 - // offset 0x0310, 0x0330, 0x0350, 0x0370, 0x0390, 0x03b0, 0x03d0 438 + /* offset 0x0310, 0x0330, 0x0350, 0x0370, 0x0390, 0x03b0, 0x03d0 */ 439 439 u32 ep_avail; 440 440 u32 ep_data; 441 441 u32 _unused0 [2];
+1 -1
include/linux/usb/otg.h
··· 1 - // include/linux/usb/otg.h 1 + /* USB OTG (On The Go) defines */ 2 2 3 3 /* 4 4 * These APIs may be used between USB controllers. USB device drivers
+86 -69
include/linux/usb/serial.h
··· 20 20 #define SERIAL_TTY_MAJOR 188 /* Nice legal number now */ 21 21 #define SERIAL_TTY_MINORS 255 /* loads of devices :) */ 22 22 23 - #define MAX_NUM_PORTS 8 /* The maximum number of ports one device can grab at once */ 23 + /* The maximum number of ports one device can grab at once */ 24 + #define MAX_NUM_PORTS 8 24 25 25 26 /* parity check flag */ 26 27 #define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK)) ··· 62 61 * ports of a device. 63 62 */ 64 63 struct usb_serial_port { 65 - struct usb_serial * serial; 66 - struct tty_struct * tty; 64 + struct usb_serial *serial; 65 + struct tty_struct *tty; 67 66 spinlock_t lock; 68 67 struct mutex mutex; 69 68 unsigned char number; 70 69 71 - unsigned char * interrupt_in_buffer; 72 - struct urb * interrupt_in_urb; 70 + unsigned char *interrupt_in_buffer; 71 + struct urb *interrupt_in_urb; 73 72 __u8 interrupt_in_endpointAddress; 74 73 75 - unsigned char * interrupt_out_buffer; 74 + unsigned char *interrupt_out_buffer; 76 75 int interrupt_out_size; 77 - struct urb * interrupt_out_urb; 76 + struct urb *interrupt_out_urb; 78 77 __u8 interrupt_out_endpointAddress; 79 78 80 - unsigned char * bulk_in_buffer; 79 + unsigned char *bulk_in_buffer; 81 80 int bulk_in_size; 82 - struct urb * read_urb; 81 + struct urb *read_urb; 83 82 __u8 bulk_in_endpointAddress; 84 83 85 - unsigned char * bulk_out_buffer; 84 + unsigned char *bulk_out_buffer; 86 85 int bulk_out_size; 87 - struct urb * write_urb; 86 + struct urb *write_urb; 88 87 int write_urb_busy; 89 88 __u8 bulk_out_endpointAddress; 90 89 ··· 99 98 #define to_usb_serial_port(d) container_of(d, struct usb_serial_port, dev) 100 99 101 100 /* get and set the port private data pointer helper functions */ 102 - static inline void *usb_get_serial_port_data (struct usb_serial_port *port) 101 + static inline void *usb_get_serial_port_data(struct usb_serial_port *port) 103 102 { 104 103 return dev_get_drvdata(&port->dev); 105 104 } 106 105 107 - static inline void usb_set_serial_port_data (struct usb_serial_port *port, void *data) 106 + static inline void usb_set_serial_port_data(struct usb_serial_port *port, 107 + void *data) 108 108 { 109 109 dev_set_drvdata(&port->dev, data); 110 110 } ··· 128 126 * usb_set_serial_data() to access this. 129 127 */ 130 128 struct usb_serial { 131 - struct usb_device * dev; 132 - struct usb_serial_driver * type; 133 - struct usb_interface * interface; 129 + struct usb_device *dev; 130 + struct usb_serial_driver *type; 131 + struct usb_interface *interface; 134 132 unsigned char disconnected; 135 133 unsigned char minor; 136 134 unsigned char num_ports; ··· 139 137 char num_interrupt_out; 140 138 char num_bulk_in; 141 139 char num_bulk_out; 142 - struct usb_serial_port * port[MAX_NUM_PORTS]; 140 + struct usb_serial_port *port[MAX_NUM_PORTS]; 143 141 struct kref kref; 144 142 struct mutex disc_mutex; 145 - void * private; 143 + void *private; 146 144 }; 147 145 #define to_usb_serial(d) container_of(d, struct usb_serial, kref) 148 146 149 147 #define NUM_DONT_CARE 99 150 148 151 149 /* get and set the serial private data pointer helper functions */ 152 - static inline void *usb_get_serial_data (struct usb_serial *serial) 150 + static inline void *usb_get_serial_data(struct usb_serial *serial) 153 151 { 154 152 return serial->private; 155 153 } 156 154 157 - static inline void usb_set_serial_data (struct usb_serial *serial, void *data) 155 + static inline void usb_set_serial_data(struct usb_serial *serial, void *data) 158 156 { 159 157 serial->private = data; 160 158 } 161 159 162 160 /** 163 161 * usb_serial_driver - describes a usb serial driver 164 - * @description: pointer to a string that describes this driver. This string used 165 - * in the syslog messages when a device is inserted or removed. 162 + * @description: pointer to a string that describes this driver. This string 163 + * used in the syslog messages when a device is inserted or removed. 166 164 * @id_table: pointer to a list of usb_device_id structures that define all 167 165 * of the devices this structure can support. 168 166 * @num_interrupt_in: If a device doesn't have this many interrupt-in ··· 223 221 struct usb_driver *usb_driver; 224 222 struct usb_dynids dynids; 225 223 226 - int (*probe) (struct usb_serial *serial, const struct usb_device_id *id); 227 - int (*attach) (struct usb_serial *serial); 224 + int (*probe)(struct usb_serial *serial, const struct usb_device_id *id); 225 + int (*attach)(struct usb_serial *serial); 228 226 int (*calc_num_ports) (struct usb_serial *serial); 229 227 230 - void (*shutdown) (struct usb_serial *serial); 228 + void (*shutdown)(struct usb_serial *serial); 231 229 232 - int (*port_probe) (struct usb_serial_port *port); 233 - int (*port_remove) (struct usb_serial_port *port); 230 + int (*port_probe)(struct usb_serial_port *port); 231 + int (*port_remove)(struct usb_serial_port *port); 234 232 235 - int (*suspend) (struct usb_serial *serial, pm_message_t message); 236 - int (*resume) (struct usb_serial *serial); 233 + int (*suspend)(struct usb_serial *serial, pm_message_t message); 234 + int (*resume)(struct usb_serial *serial); 237 235 238 236 /* serial function calls */ 239 - int (*open) (struct usb_serial_port *port, struct file * filp); 240 - void (*close) (struct usb_serial_port *port, struct file * filp); 241 - int (*write) (struct usb_serial_port *port, const unsigned char *buf, int count); 242 - int (*write_room) (struct usb_serial_port *port); 243 - int (*ioctl) (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg); 244 - void (*set_termios) (struct usb_serial_port *port, struct ktermios * old); 245 - void (*break_ctl) (struct usb_serial_port *port, int break_state); 246 - int (*chars_in_buffer) (struct usb_serial_port *port); 247 - void (*throttle) (struct usb_serial_port *port); 248 - void (*unthrottle) (struct usb_serial_port *port); 249 - int (*tiocmget) (struct usb_serial_port *port, struct file *file); 250 - int (*tiocmset) (struct usb_serial_port *port, struct file *file, unsigned int set, unsigned int clear); 237 + int (*open)(struct usb_serial_port *port, struct file *filp); 238 + void (*close)(struct usb_serial_port *port, struct file *filp); 239 + int (*write)(struct usb_serial_port *port, const unsigned char *buf, 240 + int count); 241 + int (*write_room)(struct usb_serial_port *port); 242 + int (*ioctl)(struct usb_serial_port *port, struct file *file, 243 + unsigned int cmd, unsigned long arg); 244 + void (*set_termios)(struct usb_serial_port *port, struct ktermios *old); 245 + void (*break_ctl)(struct usb_serial_port *port, int break_state); 246 + int (*chars_in_buffer)(struct usb_serial_port *port); 247 + void (*throttle)(struct usb_serial_port *port); 248 + void (*unthrottle)(struct usb_serial_port *port); 249 + int (*tiocmget)(struct usb_serial_port *port, struct file *file); 250 + int (*tiocmset)(struct usb_serial_port *port, struct file *file, 251 + unsigned int set, unsigned int clear); 251 252 252 253 void (*read_int_callback)(struct urb *urb); 253 254 void (*write_int_callback)(struct urb *urb); 254 255 void (*read_bulk_callback)(struct urb *urb); 255 256 void (*write_bulk_callback)(struct urb *urb); 256 257 }; 257 - #define to_usb_serial_driver(d) container_of(d, struct usb_serial_driver, driver) 258 + #define to_usb_serial_driver(d) \ 259 + container_of(d, struct usb_serial_driver, driver) 258 260 259 261 extern int usb_serial_register(struct usb_serial_driver *driver); 260 262 extern void usb_serial_deregister(struct usb_serial_driver *driver); 261 263 extern void usb_serial_port_softint(struct usb_serial_port *port); 262 264 263 - extern int usb_serial_probe(struct usb_interface *iface, const struct usb_device_id *id); 265 + extern int usb_serial_probe(struct usb_interface *iface, 266 + const struct usb_device_id *id); 264 267 extern void usb_serial_disconnect(struct usb_interface *iface); 265 268 266 269 extern int usb_serial_suspend(struct usb_interface *intf, pm_message_t message); 267 270 extern int usb_serial_resume(struct usb_interface *intf); 268 271 269 - extern int ezusb_writememory (struct usb_serial *serial, int address, unsigned char *data, int length, __u8 bRequest); 270 - extern int ezusb_set_reset (struct usb_serial *serial, unsigned char reset_bit); 272 + extern int ezusb_writememory(struct usb_serial *serial, int address, 273 + unsigned char *data, int length, __u8 bRequest); 274 + extern int ezusb_set_reset(struct usb_serial *serial, unsigned char reset_bit); 271 275 272 276 /* USB Serial console functions */ 273 277 #ifdef CONFIG_USB_SERIAL_CONSOLE 274 - extern void usb_serial_console_init (int debug, int minor); 275 - extern void usb_serial_console_exit (void); 278 + extern void usb_serial_console_init(int debug, int minor); 279 + extern void usb_serial_console_exit(void); 276 280 extern void usb_serial_console_disconnect(struct usb_serial *serial); 277 281 #else 278 - static inline void usb_serial_console_init (int debug, int minor) { } 279 - static inline void usb_serial_console_exit (void) { } 282 + static inline void usb_serial_console_init(int debug, int minor) { } 283 + static inline void usb_serial_console_exit(void) { } 280 284 static inline void usb_serial_console_disconnect(struct usb_serial *serial) {} 281 285 #endif 282 286 283 287 /* Functions needed by other parts of the usbserial core */ 284 - extern struct usb_serial *usb_serial_get_by_index (unsigned int minor); 288 + extern struct usb_serial *usb_serial_get_by_index(unsigned int minor); 285 289 extern void usb_serial_put(struct usb_serial *serial); 286 - extern int usb_serial_generic_open (struct usb_serial_port *port, struct file *filp); 287 - extern int usb_serial_generic_write (struct usb_serial_port *port, const unsigned char *buf, int count); 288 - extern void usb_serial_generic_close (struct usb_serial_port *port, struct file *filp); 289 - extern int usb_serial_generic_resume (struct usb_serial *serial); 290 - extern int usb_serial_generic_write_room (struct usb_serial_port *port); 291 - extern int usb_serial_generic_chars_in_buffer (struct usb_serial_port *port); 292 - extern void usb_serial_generic_read_bulk_callback (struct urb *urb); 293 - extern void usb_serial_generic_write_bulk_callback (struct urb *urb); 294 - extern void usb_serial_generic_throttle (struct usb_serial_port *port); 295 - extern void usb_serial_generic_unthrottle (struct usb_serial_port *port); 296 - extern void usb_serial_generic_shutdown (struct usb_serial *serial); 297 - extern int usb_serial_generic_register (int debug); 298 - extern void usb_serial_generic_deregister (void); 290 + extern int usb_serial_generic_open(struct usb_serial_port *port, 291 + struct file *filp); 292 + extern int usb_serial_generic_write(struct usb_serial_port *port, 293 + const unsigned char *buf, int count); 294 + extern void usb_serial_generic_close(struct usb_serial_port *port, 295 + struct file *filp); 296 + extern int usb_serial_generic_resume(struct usb_serial *serial); 297 + extern int usb_serial_generic_write_room(struct usb_serial_port *port); 298 + extern int usb_serial_generic_chars_in_buffer(struct usb_serial_port *port); 299 + extern void usb_serial_generic_read_bulk_callback(struct urb *urb); 300 + extern void usb_serial_generic_write_bulk_callback(struct urb *urb); 301 + extern void usb_serial_generic_throttle(struct usb_serial_port *port); 302 + extern void usb_serial_generic_unthrottle(struct usb_serial_port *port); 303 + extern void usb_serial_generic_shutdown(struct usb_serial *serial); 304 + extern int usb_serial_generic_register(int debug); 305 + extern void usb_serial_generic_deregister(void); 299 306 300 - extern int usb_serial_bus_register (struct usb_serial_driver *device); 301 - extern void usb_serial_bus_deregister (struct usb_serial_driver *device); 307 + extern int usb_serial_bus_register(struct usb_serial_driver *device); 308 + extern void usb_serial_bus_deregister(struct usb_serial_driver *device); 302 309 303 310 extern struct usb_serial_driver usb_serial_generic_device; 304 311 extern struct bus_type usb_serial_bus_type; ··· 321 310 int i; 322 311 323 312 if (debug) { 324 - dev_printk(KERN_DEBUG, dev, "%s - length = %d, data = ", function, size); 313 + dev_printk(KERN_DEBUG, dev, "%s - length = %d, data = ", 314 + function, size); 325 315 for (i = 0; i < size; ++i) 326 - printk ("%.2x ", data[i]); 327 - printk ("\n"); 316 + printk("%.2x ", data[i]); 317 + printk("\n"); 328 318 } 329 319 } 330 320 331 321 /* Use our own dbg macro */ 332 322 #undef dbg 333 - #define dbg(format, arg...) do { if (debug) printk(KERN_DEBUG "%s: " format "\n" , __FILE__ , ## arg); } while (0) 323 + #define dbg(format, arg...) \ 324 + do { \ 325 + if (debug) \ 326 + printk(KERN_DEBUG "%s: " format "\n" , __FILE__ , \ 327 + ## arg); \ 328 + } while (0) 334 329 335 330 336 331
+3 -3
include/linux/usb/sl811.h
··· 19 19 /* pulse sl811 nRST (probably with a GPIO) */ 20 20 void (*reset)(struct device *dev); 21 21 22 - // some boards need something like these: 23 - // int (*check_overcurrent)(struct device *dev); 24 - // void (*clock_enable)(struct device *dev, int is_on); 22 + /* some boards need something like these: */ 23 + /* int (*check_overcurrent)(struct device *dev); */ 24 + /* void (*clock_enable)(struct device *dev, int is_on); */ 25 25 }; 26 26