diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2008-01-30 18:20:32 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-02-01 17:35:07 -0500 |
commit | 969ab2ee9d68bd037e2db7ea12ff78baae5d2f94 (patch) | |
tree | f480f6a0ea44bed3ebea2b5cb966343629168465 /include/linux/usb.h | |
parent | 782e70c6fc2290a0395850e8e02583b8b62264d8 (diff) |
USB: fix codingstyle issues in include/linux/usb.h
No logical code changes were made, but checkpatch.pl is much happier now.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux/usb.h')
-rw-r--r-- | include/linux/usb.h | 204 |
1 files changed, 113 insertions, 91 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h index f8a60756fe2a..2372e2e6b527 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -162,19 +162,19 @@ struct usb_interface { | |||
162 | unsigned needs_remote_wakeup:1; /* driver requires remote wakeup */ | 162 | unsigned needs_remote_wakeup:1; /* driver requires remote wakeup */ |
163 | 163 | ||
164 | struct device dev; /* interface specific device info */ | 164 | struct device dev; /* interface specific device info */ |
165 | struct device *usb_dev; /* pointer to the usb class's device, if any */ | 165 | struct device *usb_dev; |
166 | int pm_usage_cnt; /* usage counter for autosuspend */ | 166 | int pm_usage_cnt; /* usage counter for autosuspend */ |
167 | }; | 167 | }; |
168 | #define to_usb_interface(d) container_of(d, struct usb_interface, dev) | 168 | #define to_usb_interface(d) container_of(d, struct usb_interface, dev) |
169 | #define interface_to_usbdev(intf) \ | 169 | #define interface_to_usbdev(intf) \ |
170 | container_of(intf->dev.parent, struct usb_device, dev) | 170 | container_of(intf->dev.parent, struct usb_device, dev) |
171 | 171 | ||
172 | static inline void *usb_get_intfdata (struct usb_interface *intf) | 172 | static inline void *usb_get_intfdata(struct usb_interface *intf) |
173 | { | 173 | { |
174 | return dev_get_drvdata (&intf->dev); | 174 | return dev_get_drvdata(&intf->dev); |
175 | } | 175 | } |
176 | 176 | ||
177 | static inline void usb_set_intfdata (struct usb_interface *intf, void *data) | 177 | static inline void usb_set_intfdata(struct usb_interface *intf, void *data) |
178 | { | 178 | { |
179 | dev_set_drvdata(&intf->dev, data); | 179 | dev_set_drvdata(&intf->dev, data); |
180 | } | 180 | } |
@@ -275,9 +275,10 @@ struct usb_host_config { | |||
275 | 275 | ||
276 | int __usb_get_extra_descriptor(char *buffer, unsigned size, | 276 | int __usb_get_extra_descriptor(char *buffer, unsigned size, |
277 | unsigned char type, void **ptr); | 277 | unsigned char type, void **ptr); |
278 | #define usb_get_extra_descriptor(ifpoint,type,ptr)\ | 278 | #define usb_get_extra_descriptor(ifpoint, type, ptr) \ |
279 | __usb_get_extra_descriptor((ifpoint)->extra,(ifpoint)->extralen,\ | 279 | __usb_get_extra_descriptor((ifpoint)->extra, \ |
280 | type,(void**)ptr) | 280 | (ifpoint)->extralen, \ |
281 | type, (void **)ptr) | ||
281 | 282 | ||
282 | /* ----------------------------------------------------------------------- */ | 283 | /* ----------------------------------------------------------------------- */ |
283 | 284 | ||
@@ -388,7 +389,7 @@ struct usb_device { | |||
388 | unsigned can_submit:1; /* URBs may be submitted */ | 389 | unsigned can_submit:1; /* URBs may be submitted */ |
389 | unsigned discon_suspended:1; /* Disconnected while suspended */ | 390 | unsigned discon_suspended:1; /* Disconnected while suspended */ |
390 | unsigned have_langid:1; /* whether string_langid is valid */ | 391 | unsigned have_langid:1; /* whether string_langid is valid */ |
391 | unsigned authorized:1; /* Policy has determined we can use it */ | 392 | unsigned authorized:1; /* Policy has said we can use it */ |
392 | unsigned wusb:1; /* Device is Wireless USB */ | 393 | unsigned wusb:1; /* Device is Wireless USB */ |
393 | int string_langid; /* language ID for strings */ | 394 | int string_langid; /* language ID for strings */ |
394 | 395 | ||
@@ -417,7 +418,8 @@ struct usb_device { | |||
417 | 418 | ||
418 | int pm_usage_cnt; /* usage counter for autosuspend */ | 419 | int pm_usage_cnt; /* usage counter for autosuspend */ |
419 | u32 quirks; /* quirks of the whole device */ | 420 | u32 quirks; /* quirks of the whole device */ |
420 | atomic_t urbnum; /* number of URBs submitted for the whole device */ | 421 | atomic_t urbnum; /* number of URBs submitted for |
422 | the whole device */ | ||
421 | 423 | ||
422 | unsigned long active_duration; /* total time device is not suspended */ | 424 | unsigned long active_duration; /* total time device is not suspended */ |
423 | 425 | ||
@@ -501,11 +503,11 @@ static inline void usb_mark_last_busy(struct usb_device *udev) | |||
501 | /*-------------------------------------------------------------------------*/ | 503 | /*-------------------------------------------------------------------------*/ |
502 | 504 | ||
503 | /* for drivers using iso endpoints */ | 505 | /* for drivers using iso endpoints */ |
504 | extern int usb_get_current_frame_number (struct usb_device *usb_dev); | 506 | extern int usb_get_current_frame_number(struct usb_device *usb_dev); |
505 | 507 | ||
506 | /* used these for multi-interface device registration */ | 508 | /* used these for multi-interface device registration */ |
507 | extern int usb_driver_claim_interface(struct usb_driver *driver, | 509 | extern int usb_driver_claim_interface(struct usb_driver *driver, |
508 | struct usb_interface *iface, void* priv); | 510 | struct usb_interface *iface, void *priv); |
509 | 511 | ||
510 | /** | 512 | /** |
511 | * usb_interface_claimed - returns true iff an interface is claimed | 513 | * usb_interface_claimed - returns true iff an interface is claimed |
@@ -517,7 +519,8 @@ extern int usb_driver_claim_interface(struct usb_driver *driver, | |||
517 | * may need to explicitly claim that lock. | 519 | * may need to explicitly claim that lock. |
518 | * | 520 | * |
519 | */ | 521 | */ |
520 | static inline int usb_interface_claimed(struct usb_interface *iface) { | 522 | static inline int usb_interface_claimed(struct usb_interface *iface) |
523 | { | ||
521 | return (iface->dev.driver != NULL); | 524 | return (iface->dev.driver != NULL); |
522 | } | 525 | } |
523 | 526 | ||
@@ -560,12 +563,11 @@ extern struct usb_host_interface *usb_altnum_to_altsetting( | |||
560 | * USB 2.0 root hubs (EHCI host controllers) will get one path ID if they are | 563 | * USB 2.0 root hubs (EHCI host controllers) will get one path ID if they are |
561 | * high speed, and a different one if they are full or low speed. | 564 | * high speed, and a different one if they are full or low speed. |
562 | */ | 565 | */ |
563 | static inline int usb_make_path (struct usb_device *dev, char *buf, | 566 | static inline int usb_make_path(struct usb_device *dev, char *buf, size_t size) |
564 | size_t size) | ||
565 | { | 567 | { |
566 | int actual; | 568 | int actual; |
567 | actual = snprintf (buf, size, "usb-%s-%s", dev->bus->bus_name, | 569 | actual = snprintf(buf, size, "usb-%s-%s", dev->bus->bus_name, |
568 | dev->devpath); | 570 | dev->devpath); |
569 | return (actual >= (int)size) ? -1 : actual; | 571 | return (actual >= (int)size) ? -1 : actual; |
570 | } | 572 | } |
571 | 573 | ||
@@ -611,7 +613,8 @@ static inline int usb_endpoint_dir_in(const struct usb_endpoint_descriptor *epd) | |||
611 | * | 613 | * |
612 | * Returns true if the endpoint is of type OUT, otherwise it returns false. | 614 | * Returns true if the endpoint is of type OUT, otherwise it returns false. |
613 | */ | 615 | */ |
614 | static inline int usb_endpoint_dir_out(const struct usb_endpoint_descriptor *epd) | 616 | static inline int usb_endpoint_dir_out( |
617 | const struct usb_endpoint_descriptor *epd) | ||
615 | { | 618 | { |
616 | return ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT); | 619 | return ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT); |
617 | } | 620 | } |
@@ -622,7 +625,8 @@ static inline int usb_endpoint_dir_out(const struct usb_endpoint_descriptor *epd | |||
622 | * | 625 | * |
623 | * Returns true if the endpoint is of type bulk, otherwise it returns false. | 626 | * Returns true if the endpoint is of type bulk, otherwise it returns false. |
624 | */ | 627 | */ |
625 | static inline int usb_endpoint_xfer_bulk(const struct usb_endpoint_descriptor *epd) | 628 | static inline int usb_endpoint_xfer_bulk( |
629 | const struct usb_endpoint_descriptor *epd) | ||
626 | { | 630 | { |
627 | return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == | 631 | return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == |
628 | USB_ENDPOINT_XFER_BULK); | 632 | USB_ENDPOINT_XFER_BULK); |
@@ -634,7 +638,8 @@ static inline int usb_endpoint_xfer_bulk(const struct usb_endpoint_descriptor *e | |||
634 | * | 638 | * |
635 | * Returns true if the endpoint is of type control, otherwise it returns false. | 639 | * Returns true if the endpoint is of type control, otherwise it returns false. |
636 | */ | 640 | */ |
637 | static inline int usb_endpoint_xfer_control(const struct usb_endpoint_descriptor *epd) | 641 | static inline int usb_endpoint_xfer_control( |
642 | const struct usb_endpoint_descriptor *epd) | ||
638 | { | 643 | { |
639 | return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == | 644 | return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == |
640 | USB_ENDPOINT_XFER_CONTROL); | 645 | USB_ENDPOINT_XFER_CONTROL); |
@@ -647,7 +652,8 @@ static inline int usb_endpoint_xfer_control(const struct usb_endpoint_descriptor | |||
647 | * Returns true if the endpoint is of type interrupt, otherwise it returns | 652 | * Returns true if the endpoint is of type interrupt, otherwise it returns |
648 | * false. | 653 | * false. |
649 | */ | 654 | */ |
650 | static inline int usb_endpoint_xfer_int(const struct usb_endpoint_descriptor *epd) | 655 | static inline int usb_endpoint_xfer_int( |
656 | const struct usb_endpoint_descriptor *epd) | ||
651 | { | 657 | { |
652 | return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == | 658 | return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == |
653 | USB_ENDPOINT_XFER_INT); | 659 | USB_ENDPOINT_XFER_INT); |
@@ -660,7 +666,8 @@ static inline int usb_endpoint_xfer_int(const struct usb_endpoint_descriptor *ep | |||
660 | * Returns true if the endpoint is of type isochronous, otherwise it returns | 666 | * Returns true if the endpoint is of type isochronous, otherwise it returns |
661 | * false. | 667 | * false. |
662 | */ | 668 | */ |
663 | static inline int usb_endpoint_xfer_isoc(const struct usb_endpoint_descriptor *epd) | 669 | static inline int usb_endpoint_xfer_isoc( |
670 | const struct usb_endpoint_descriptor *epd) | ||
664 | { | 671 | { |
665 | return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == | 672 | return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == |
666 | USB_ENDPOINT_XFER_ISOC); | 673 | USB_ENDPOINT_XFER_ISOC); |
@@ -673,7 +680,8 @@ static inline int usb_endpoint_xfer_isoc(const struct usb_endpoint_descriptor *e | |||
673 | * Returns true if the endpoint has bulk transfer type and IN direction, | 680 | * Returns true if the endpoint has bulk transfer type and IN direction, |
674 | * otherwise it returns false. | 681 | * otherwise it returns false. |
675 | */ | 682 | */ |
676 | static inline int usb_endpoint_is_bulk_in(const struct usb_endpoint_descriptor *epd) | 683 | static inline int usb_endpoint_is_bulk_in( |
684 | const struct usb_endpoint_descriptor *epd) | ||
677 | { | 685 | { |
678 | return (usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_in(epd)); | 686 | return (usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_in(epd)); |
679 | } | 687 | } |
@@ -685,7 +693,8 @@ static inline int usb_endpoint_is_bulk_in(const struct usb_endpoint_descriptor * | |||
685 | * Returns true if the endpoint has bulk transfer type and OUT direction, | 693 | * Returns true if the endpoint has bulk transfer type and OUT direction, |
686 | * otherwise it returns false. | 694 | * otherwise it returns false. |
687 | */ | 695 | */ |
688 | static inline int usb_endpoint_is_bulk_out(const struct usb_endpoint_descriptor *epd) | 696 | static inline int usb_endpoint_is_bulk_out( |
697 | const struct usb_endpoint_descriptor *epd) | ||
689 | { | 698 | { |
690 | return (usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_out(epd)); | 699 | return (usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_out(epd)); |
691 | } | 700 | } |
@@ -697,7 +706,8 @@ static inline int usb_endpoint_is_bulk_out(const struct usb_endpoint_descriptor | |||
697 | * Returns true if the endpoint has interrupt transfer type and IN direction, | 706 | * Returns true if the endpoint has interrupt transfer type and IN direction, |
698 | * otherwise it returns false. | 707 | * otherwise it returns false. |
699 | */ | 708 | */ |
700 | static inline int usb_endpoint_is_int_in(const struct usb_endpoint_descriptor *epd) | 709 | static inline int usb_endpoint_is_int_in( |
710 | const struct usb_endpoint_descriptor *epd) | ||
701 | { | 711 | { |
702 | return (usb_endpoint_xfer_int(epd) && usb_endpoint_dir_in(epd)); | 712 | return (usb_endpoint_xfer_int(epd) && usb_endpoint_dir_in(epd)); |
703 | } | 713 | } |
@@ -709,7 +719,8 @@ static inline int usb_endpoint_is_int_in(const struct usb_endpoint_descriptor *e | |||
709 | * Returns true if the endpoint has interrupt transfer type and OUT direction, | 719 | * Returns true if the endpoint has interrupt transfer type and OUT direction, |
710 | * otherwise it returns false. | 720 | * otherwise it returns false. |
711 | */ | 721 | */ |
712 | static inline int usb_endpoint_is_int_out(const struct usb_endpoint_descriptor *epd) | 722 | static inline int usb_endpoint_is_int_out( |
723 | const struct usb_endpoint_descriptor *epd) | ||
713 | { | 724 | { |
714 | return (usb_endpoint_xfer_int(epd) && usb_endpoint_dir_out(epd)); | 725 | return (usb_endpoint_xfer_int(epd) && usb_endpoint_dir_out(epd)); |
715 | } | 726 | } |
@@ -721,7 +732,8 @@ static inline int usb_endpoint_is_int_out(const struct usb_endpoint_descriptor * | |||
721 | * Returns true if the endpoint has isochronous transfer type and IN direction, | 732 | * Returns true if the endpoint has isochronous transfer type and IN direction, |
722 | * otherwise it returns false. | 733 | * otherwise it returns false. |
723 | */ | 734 | */ |
724 | static inline int usb_endpoint_is_isoc_in(const struct usb_endpoint_descriptor *epd) | 735 | static inline int usb_endpoint_is_isoc_in( |
736 | const struct usb_endpoint_descriptor *epd) | ||
725 | { | 737 | { |
726 | return (usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_in(epd)); | 738 | return (usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_in(epd)); |
727 | } | 739 | } |
@@ -733,7 +745,8 @@ static inline int usb_endpoint_is_isoc_in(const struct usb_endpoint_descriptor * | |||
733 | * Returns true if the endpoint has isochronous transfer type and OUT direction, | 745 | * Returns true if the endpoint has isochronous transfer type and OUT direction, |
734 | * otherwise it returns false. | 746 | * otherwise it returns false. |
735 | */ | 747 | */ |
736 | static inline int usb_endpoint_is_isoc_out(const struct usb_endpoint_descriptor *epd) | 748 | static inline int usb_endpoint_is_isoc_out( |
749 | const struct usb_endpoint_descriptor *epd) | ||
737 | { | 750 | { |
738 | return (usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_out(epd)); | 751 | return (usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_out(epd)); |
739 | } | 752 | } |
@@ -764,8 +777,9 @@ static inline int usb_endpoint_is_isoc_out(const struct usb_endpoint_descriptor | |||
764 | * specific device. | 777 | * specific device. |
765 | */ | 778 | */ |
766 | #define USB_DEVICE(vend,prod) \ | 779 | #define USB_DEVICE(vend,prod) \ |
767 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE, .idVendor = (vend), \ | 780 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE, \ |
768 | .idProduct = (prod) | 781 | .idVendor = (vend), \ |
782 | .idProduct = (prod) | ||
769 | /** | 783 | /** |
770 | * USB_DEVICE_VER - macro used to describe a specific usb device with a | 784 | * USB_DEVICE_VER - macro used to describe a specific usb device with a |
771 | * version range | 785 | * version range |
@@ -777,10 +791,12 @@ static inline int usb_endpoint_is_isoc_out(const struct usb_endpoint_descriptor | |||
777 | * This macro is used to create a struct usb_device_id that matches a | 791 | * This macro is used to create a struct usb_device_id that matches a |
778 | * specific device, with a version range. | 792 | * specific device, with a version range. |
779 | */ | 793 | */ |
780 | #define USB_DEVICE_VER(vend,prod,lo,hi) \ | 794 | #define USB_DEVICE_VER(vend, prod, lo, hi) \ |
781 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE_AND_VERSION, \ | 795 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE_AND_VERSION, \ |
782 | .idVendor = (vend), .idProduct = (prod), \ | 796 | .idVendor = (vend), \ |
783 | .bcdDevice_lo = (lo), .bcdDevice_hi = (hi) | 797 | .idProduct = (prod), \ |
798 | .bcdDevice_lo = (lo), \ | ||
799 | .bcdDevice_hi = (hi) | ||
784 | 800 | ||
785 | /** | 801 | /** |
786 | * USB_DEVICE_INTERFACE_PROTOCOL - macro used to describe a usb | 802 | * USB_DEVICE_INTERFACE_PROTOCOL - macro used to describe a usb |
@@ -792,8 +808,9 @@ static inline int usb_endpoint_is_isoc_out(const struct usb_endpoint_descriptor | |||
792 | * This macro is used to create a struct usb_device_id that matches a | 808 | * This macro is used to create a struct usb_device_id that matches a |
793 | * specific interface protocol of devices. | 809 | * specific interface protocol of devices. |
794 | */ | 810 | */ |
795 | #define USB_DEVICE_INTERFACE_PROTOCOL(vend,prod,pr) \ | 811 | #define USB_DEVICE_INTERFACE_PROTOCOL(vend, prod, pr) \ |
796 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_PROTOCOL, \ | 812 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE | \ |
813 | USB_DEVICE_ID_MATCH_INT_PROTOCOL, \ | ||
797 | .idVendor = (vend), \ | 814 | .idVendor = (vend), \ |
798 | .idProduct = (prod), \ | 815 | .idProduct = (prod), \ |
799 | .bInterfaceProtocol = (pr) | 816 | .bInterfaceProtocol = (pr) |
@@ -807,12 +824,14 @@ static inline int usb_endpoint_is_isoc_out(const struct usb_endpoint_descriptor | |||
807 | * This macro is used to create a struct usb_device_id that matches a | 824 | * This macro is used to create a struct usb_device_id that matches a |
808 | * specific class of devices. | 825 | * specific class of devices. |
809 | */ | 826 | */ |
810 | #define USB_DEVICE_INFO(cl,sc,pr) \ | 827 | #define USB_DEVICE_INFO(cl, sc, pr) \ |
811 | .match_flags = USB_DEVICE_ID_MATCH_DEV_INFO, .bDeviceClass = (cl), \ | 828 | .match_flags = USB_DEVICE_ID_MATCH_DEV_INFO, \ |
812 | .bDeviceSubClass = (sc), .bDeviceProtocol = (pr) | 829 | .bDeviceClass = (cl), \ |
830 | .bDeviceSubClass = (sc), \ | ||
831 | .bDeviceProtocol = (pr) | ||
813 | 832 | ||
814 | /** | 833 | /** |
815 | * USB_INTERFACE_INFO - macro used to describe a class of usb interfaces | 834 | * USB_INTERFACE_INFO - macro used to describe a class of usb interfaces |
816 | * @cl: bInterfaceClass value | 835 | * @cl: bInterfaceClass value |
817 | * @sc: bInterfaceSubClass value | 836 | * @sc: bInterfaceSubClass value |
818 | * @pr: bInterfaceProtocol value | 837 | * @pr: bInterfaceProtocol value |
@@ -820,9 +839,11 @@ static inline int usb_endpoint_is_isoc_out(const struct usb_endpoint_descriptor | |||
820 | * This macro is used to create a struct usb_device_id that matches a | 839 | * This macro is used to create a struct usb_device_id that matches a |
821 | * specific class of interfaces. | 840 | * specific class of interfaces. |
822 | */ | 841 | */ |
823 | #define USB_INTERFACE_INFO(cl,sc,pr) \ | 842 | #define USB_INTERFACE_INFO(cl, sc, pr) \ |
824 | .match_flags = USB_DEVICE_ID_MATCH_INT_INFO, .bInterfaceClass = (cl), \ | 843 | .match_flags = USB_DEVICE_ID_MATCH_INT_INFO, \ |
825 | .bInterfaceSubClass = (sc), .bInterfaceProtocol = (pr) | 844 | .bInterfaceClass = (cl), \ |
845 | .bInterfaceSubClass = (sc), \ | ||
846 | .bInterfaceProtocol = (pr) | ||
826 | 847 | ||
827 | /** | 848 | /** |
828 | * USB_DEVICE_AND_INTERFACE_INFO - macro used to describe a specific usb device | 849 | * USB_DEVICE_AND_INTERFACE_INFO - macro used to describe a specific usb device |
@@ -839,12 +860,14 @@ static inline int usb_endpoint_is_isoc_out(const struct usb_endpoint_descriptor | |||
839 | * This is especially useful when explicitly matching devices that have | 860 | * This is especially useful when explicitly matching devices that have |
840 | * vendor specific bDeviceClass values, but standards-compliant interfaces. | 861 | * vendor specific bDeviceClass values, but standards-compliant interfaces. |
841 | */ | 862 | */ |
842 | #define USB_DEVICE_AND_INTERFACE_INFO(vend,prod,cl,sc,pr) \ | 863 | #define USB_DEVICE_AND_INTERFACE_INFO(vend, prod, cl, sc, pr) \ |
843 | .match_flags = USB_DEVICE_ID_MATCH_INT_INFO \ | 864 | .match_flags = USB_DEVICE_ID_MATCH_INT_INFO \ |
844 | | USB_DEVICE_ID_MATCH_DEVICE, \ | 865 | | USB_DEVICE_ID_MATCH_DEVICE, \ |
845 | .idVendor = (vend), .idProduct = (prod), \ | 866 | .idVendor = (vend), \ |
867 | .idProduct = (prod), \ | ||
846 | .bInterfaceClass = (cl), \ | 868 | .bInterfaceClass = (cl), \ |
847 | .bInterfaceSubClass = (sc), .bInterfaceProtocol = (pr) | 869 | .bInterfaceSubClass = (sc), \ |
870 | .bInterfaceProtocol = (pr) | ||
848 | 871 | ||
849 | /* ----------------------------------------------------------------------- */ | 872 | /* ----------------------------------------------------------------------- */ |
850 | 873 | ||
@@ -1122,7 +1145,7 @@ typedef void (*usb_complete_t)(struct urb *); | |||
1122 | * transferred. It will normally be the same as requested, unless | 1145 | * transferred. It will normally be the same as requested, unless |
1123 | * either an error was reported or a short read was performed. | 1146 | * either an error was reported or a short read was performed. |
1124 | * The URB_SHORT_NOT_OK transfer flag may be used to make such | 1147 | * The URB_SHORT_NOT_OK transfer flag may be used to make such |
1125 | * short reads be reported as errors. | 1148 | * short reads be reported as errors. |
1126 | * @setup_packet: Only used for control transfers, this points to eight bytes | 1149 | * @setup_packet: Only used for control transfers, this points to eight bytes |
1127 | * of setup data. Control transfers always start by sending this data | 1150 | * of setup data. Control transfers always start by sending this data |
1128 | * to the device. Then transfer_buffer is read or written, if needed. | 1151 | * to the device. Then transfer_buffer is read or written, if needed. |
@@ -1141,7 +1164,7 @@ typedef void (*usb_complete_t)(struct urb *); | |||
1141 | * @complete: Completion handler. This URB is passed as the parameter to the | 1164 | * @complete: Completion handler. This URB is passed as the parameter to the |
1142 | * completion function. The completion function may then do what | 1165 | * completion function. The completion function may then do what |
1143 | * it likes with the URB, including resubmitting or freeing it. | 1166 | * it likes with the URB, including resubmitting or freeing it. |
1144 | * @iso_frame_desc: Used to provide arrays of ISO transfer buffers and to | 1167 | * @iso_frame_desc: Used to provide arrays of ISO transfer buffers and to |
1145 | * collect the transfer status for each buffer. | 1168 | * collect the transfer status for each buffer. |
1146 | * | 1169 | * |
1147 | * This structure identifies USB transfer requests. URBs must be allocated by | 1170 | * This structure identifies USB transfer requests. URBs must be allocated by |
@@ -1245,8 +1268,7 @@ typedef void (*usb_complete_t)(struct urb *); | |||
1245 | * when the urb is owned by the hcd, that is, since the call to | 1268 | * when the urb is owned by the hcd, that is, since the call to |
1246 | * usb_submit_urb() till the entry into the completion routine. | 1269 | * usb_submit_urb() till the entry into the completion routine. |
1247 | */ | 1270 | */ |
1248 | struct urb | 1271 | struct urb { |
1249 | { | ||
1250 | /* private: usb core and host controller only fields in the urb */ | 1272 | /* private: usb core and host controller only fields in the urb */ |
1251 | struct kref kref; /* reference count of the URB */ | 1273 | struct kref kref; /* reference count of the URB */ |
1252 | void *hcpriv; /* private data for host controller */ | 1274 | void *hcpriv; /* private data for host controller */ |
@@ -1257,10 +1279,10 @@ struct urb | |||
1257 | /* public: documented fields in the urb that can be used by drivers */ | 1279 | /* public: documented fields in the urb that can be used by drivers */ |
1258 | struct list_head urb_list; /* list head for use by the urb's | 1280 | struct list_head urb_list; /* list head for use by the urb's |
1259 | * current owner */ | 1281 | * current owner */ |
1260 | struct list_head anchor_list; /* the URB may be anchored by the driver */ | 1282 | struct list_head anchor_list; /* the URB may be anchored */ |
1261 | struct usb_anchor *anchor; | 1283 | struct usb_anchor *anchor; |
1262 | struct usb_device *dev; /* (in) pointer to associated device */ | 1284 | struct usb_device *dev; /* (in) pointer to associated device */ |
1263 | struct usb_host_endpoint *ep; /* (internal) pointer to endpoint struct */ | 1285 | struct usb_host_endpoint *ep; /* (internal) pointer to endpoint */ |
1264 | unsigned int pipe; /* (in) pipe information */ | 1286 | unsigned int pipe; /* (in) pipe information */ |
1265 | int status; /* (return) non-ISO status */ | 1287 | int status; /* (return) non-ISO status */ |
1266 | unsigned int transfer_flags; /* (in) URB_SHORT_NOT_OK | ...*/ | 1288 | unsigned int transfer_flags; /* (in) URB_SHORT_NOT_OK | ...*/ |
@@ -1297,14 +1319,14 @@ struct urb | |||
1297 | * Initializes a control urb with the proper information needed to submit | 1319 | * Initializes a control urb with the proper information needed to submit |
1298 | * it to a device. | 1320 | * it to a device. |
1299 | */ | 1321 | */ |
1300 | static inline void usb_fill_control_urb (struct urb *urb, | 1322 | static inline void usb_fill_control_urb(struct urb *urb, |
1301 | struct usb_device *dev, | 1323 | struct usb_device *dev, |
1302 | unsigned int pipe, | 1324 | unsigned int pipe, |
1303 | unsigned char *setup_packet, | 1325 | unsigned char *setup_packet, |
1304 | void *transfer_buffer, | 1326 | void *transfer_buffer, |
1305 | int buffer_length, | 1327 | int buffer_length, |
1306 | usb_complete_t complete_fn, | 1328 | usb_complete_t complete_fn, |
1307 | void *context) | 1329 | void *context) |
1308 | { | 1330 | { |
1309 | urb->dev = dev; | 1331 | urb->dev = dev; |
1310 | urb->pipe = pipe; | 1332 | urb->pipe = pipe; |
@@ -1328,13 +1350,13 @@ static inline void usb_fill_control_urb (struct urb *urb, | |||
1328 | * Initializes a bulk urb with the proper information needed to submit it | 1350 | * Initializes a bulk urb with the proper information needed to submit it |
1329 | * to a device. | 1351 | * to a device. |
1330 | */ | 1352 | */ |
1331 | static inline void usb_fill_bulk_urb (struct urb *urb, | 1353 | static inline void usb_fill_bulk_urb(struct urb *urb, |
1332 | struct usb_device *dev, | 1354 | struct usb_device *dev, |
1333 | unsigned int pipe, | 1355 | unsigned int pipe, |
1334 | void *transfer_buffer, | 1356 | void *transfer_buffer, |
1335 | int buffer_length, | 1357 | int buffer_length, |
1336 | usb_complete_t complete_fn, | 1358 | usb_complete_t complete_fn, |
1337 | void *context) | 1359 | void *context) |
1338 | { | 1360 | { |
1339 | urb->dev = dev; | 1361 | urb->dev = dev; |
1340 | urb->pipe = pipe; | 1362 | urb->pipe = pipe; |
@@ -1362,14 +1384,14 @@ static inline void usb_fill_bulk_urb (struct urb *urb, | |||
1362 | * the endpoint interval, and express polling intervals in microframes | 1384 | * the endpoint interval, and express polling intervals in microframes |
1363 | * (eight per millisecond) rather than in frames (one per millisecond). | 1385 | * (eight per millisecond) rather than in frames (one per millisecond). |
1364 | */ | 1386 | */ |
1365 | static inline void usb_fill_int_urb (struct urb *urb, | 1387 | static inline void usb_fill_int_urb(struct urb *urb, |
1366 | struct usb_device *dev, | 1388 | struct usb_device *dev, |
1367 | unsigned int pipe, | 1389 | unsigned int pipe, |
1368 | void *transfer_buffer, | 1390 | void *transfer_buffer, |
1369 | int buffer_length, | 1391 | int buffer_length, |
1370 | usb_complete_t complete_fn, | 1392 | usb_complete_t complete_fn, |
1371 | void *context, | 1393 | void *context, |
1372 | int interval) | 1394 | int interval) |
1373 | { | 1395 | { |
1374 | urb->dev = dev; | 1396 | urb->dev = dev; |
1375 | urb->pipe = pipe; | 1397 | urb->pipe = pipe; |
@@ -1422,15 +1444,15 @@ static inline int usb_urb_dir_out(struct urb *urb) | |||
1422 | return (urb->transfer_flags & URB_DIR_MASK) == URB_DIR_OUT; | 1444 | return (urb->transfer_flags & URB_DIR_MASK) == URB_DIR_OUT; |
1423 | } | 1445 | } |
1424 | 1446 | ||
1425 | void *usb_buffer_alloc (struct usb_device *dev, size_t size, | 1447 | void *usb_buffer_alloc(struct usb_device *dev, size_t size, |
1426 | gfp_t mem_flags, dma_addr_t *dma); | 1448 | gfp_t mem_flags, dma_addr_t *dma); |
1427 | void usb_buffer_free (struct usb_device *dev, size_t size, | 1449 | void usb_buffer_free(struct usb_device *dev, size_t size, |
1428 | void *addr, dma_addr_t dma); | 1450 | void *addr, dma_addr_t dma); |
1429 | 1451 | ||
1430 | #if 0 | 1452 | #if 0 |
1431 | struct urb *usb_buffer_map (struct urb *urb); | 1453 | struct urb *usb_buffer_map(struct urb *urb); |
1432 | void usb_buffer_dmasync (struct urb *urb); | 1454 | void usb_buffer_dmasync(struct urb *urb); |
1433 | void usb_buffer_unmap (struct urb *urb); | 1455 | void usb_buffer_unmap(struct urb *urb); |
1434 | #endif | 1456 | #endif |
1435 | 1457 | ||
1436 | struct scatterlist; | 1458 | struct scatterlist; |
@@ -1502,7 +1524,7 @@ struct usb_sg_request { | |||
1502 | int status; | 1524 | int status; |
1503 | size_t bytes; | 1525 | size_t bytes; |
1504 | 1526 | ||
1505 | /* | 1527 | /* |
1506 | * members below are private: to usbcore, | 1528 | * members below are private: to usbcore, |
1507 | * and are not provided for driver access! | 1529 | * and are not provided for driver access! |
1508 | */ | 1530 | */ |
@@ -1520,18 +1542,18 @@ struct usb_sg_request { | |||
1520 | struct completion complete; | 1542 | struct completion complete; |
1521 | }; | 1543 | }; |
1522 | 1544 | ||
1523 | int usb_sg_init ( | 1545 | int usb_sg_init( |
1524 | struct usb_sg_request *io, | 1546 | struct usb_sg_request *io, |
1525 | struct usb_device *dev, | 1547 | struct usb_device *dev, |
1526 | unsigned pipe, | 1548 | unsigned pipe, |
1527 | unsigned period, | 1549 | unsigned period, |
1528 | struct scatterlist *sg, | 1550 | struct scatterlist *sg, |
1529 | int nents, | 1551 | int nents, |
1530 | size_t length, | 1552 | size_t length, |
1531 | gfp_t mem_flags | 1553 | gfp_t mem_flags |
1532 | ); | 1554 | ); |
1533 | void usb_sg_cancel (struct usb_sg_request *io); | 1555 | void usb_sg_cancel(struct usb_sg_request *io); |
1534 | void usb_sg_wait (struct usb_sg_request *io); | 1556 | void usb_sg_wait(struct usb_sg_request *io); |
1535 | 1557 | ||
1536 | 1558 | ||
1537 | /* ----------------------------------------------------------------------- */ | 1559 | /* ----------------------------------------------------------------------- */ |
@@ -1588,21 +1610,21 @@ static inline unsigned int __create_pipe(struct usb_device *dev, | |||
1588 | 1610 | ||
1589 | /* Create various pipes... */ | 1611 | /* Create various pipes... */ |
1590 | #define usb_sndctrlpipe(dev,endpoint) \ | 1612 | #define usb_sndctrlpipe(dev,endpoint) \ |
1591 | ((PIPE_CONTROL << 30) | __create_pipe(dev,endpoint)) | 1613 | ((PIPE_CONTROL << 30) | __create_pipe(dev, endpoint)) |
1592 | #define usb_rcvctrlpipe(dev,endpoint) \ | 1614 | #define usb_rcvctrlpipe(dev,endpoint) \ |
1593 | ((PIPE_CONTROL << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN) | 1615 | ((PIPE_CONTROL << 30) | __create_pipe(dev, endpoint) | USB_DIR_IN) |
1594 | #define usb_sndisocpipe(dev,endpoint) \ | 1616 | #define usb_sndisocpipe(dev,endpoint) \ |
1595 | ((PIPE_ISOCHRONOUS << 30) | __create_pipe(dev,endpoint)) | 1617 | ((PIPE_ISOCHRONOUS << 30) | __create_pipe(dev, endpoint)) |
1596 | #define usb_rcvisocpipe(dev,endpoint) \ | 1618 | #define usb_rcvisocpipe(dev,endpoint) \ |
1597 | ((PIPE_ISOCHRONOUS << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN) | 1619 | ((PIPE_ISOCHRONOUS << 30) | __create_pipe(dev, endpoint) | USB_DIR_IN) |
1598 | #define usb_sndbulkpipe(dev,endpoint) \ | 1620 | #define usb_sndbulkpipe(dev,endpoint) \ |
1599 | ((PIPE_BULK << 30) | __create_pipe(dev,endpoint)) | 1621 | ((PIPE_BULK << 30) | __create_pipe(dev, endpoint)) |
1600 | #define usb_rcvbulkpipe(dev,endpoint) \ | 1622 | #define usb_rcvbulkpipe(dev,endpoint) \ |
1601 | ((PIPE_BULK << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN) | 1623 | ((PIPE_BULK << 30) | __create_pipe(dev, endpoint) | USB_DIR_IN) |
1602 | #define usb_sndintpipe(dev,endpoint) \ | 1624 | #define usb_sndintpipe(dev,endpoint) \ |
1603 | ((PIPE_INTERRUPT << 30) | __create_pipe(dev,endpoint)) | 1625 | ((PIPE_INTERRUPT << 30) | __create_pipe(dev, endpoint)) |
1604 | #define usb_rcvintpipe(dev,endpoint) \ | 1626 | #define usb_rcvintpipe(dev,endpoint) \ |
1605 | ((PIPE_INTERRUPT << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN) | 1627 | ((PIPE_INTERRUPT << 30) | __create_pipe(dev, endpoint) | USB_DIR_IN) |
1606 | 1628 | ||
1607 | /*-------------------------------------------------------------------------*/ | 1629 | /*-------------------------------------------------------------------------*/ |
1608 | 1630 | ||