diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2009-03-28 16:29:51 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-03-28 16:29:51 -0400 |
commit | ed40d0c472b136682b2fcba05f89762859c7374f (patch) | |
tree | 076b83a26bcd63d6158463735dd34c10bbc591dc /include/linux/usb.h | |
parent | 9e495834e59ca9b29f1a1f63b9f5533bb022ac49 (diff) | |
parent | 5d80f8e5a9dc9c9a94d4aeaa567e219a808b8a4a (diff) |
Merge branch 'origin' into devel
Conflicts:
sound/soc/pxa/pxa2xx-i2s.c
Diffstat (limited to 'include/linux/usb.h')
-rw-r--r-- | include/linux/usb.h | 184 |
1 files changed, 2 insertions, 182 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h index 88079fd60235..c6b2ab41b908 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -643,186 +643,6 @@ static inline int usb_make_path(struct usb_device *dev, char *buf, size_t size) | |||
643 | 643 | ||
644 | /*-------------------------------------------------------------------------*/ | 644 | /*-------------------------------------------------------------------------*/ |
645 | 645 | ||
646 | /** | ||
647 | * usb_endpoint_num - get the endpoint's number | ||
648 | * @epd: endpoint to be checked | ||
649 | * | ||
650 | * Returns @epd's number: 0 to 15. | ||
651 | */ | ||
652 | static inline int usb_endpoint_num(const struct usb_endpoint_descriptor *epd) | ||
653 | { | ||
654 | return epd->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; | ||
655 | } | ||
656 | |||
657 | /** | ||
658 | * usb_endpoint_type - get the endpoint's transfer type | ||
659 | * @epd: endpoint to be checked | ||
660 | * | ||
661 | * Returns one of USB_ENDPOINT_XFER_{CONTROL, ISOC, BULK, INT} according | ||
662 | * to @epd's transfer type. | ||
663 | */ | ||
664 | static inline int usb_endpoint_type(const struct usb_endpoint_descriptor *epd) | ||
665 | { | ||
666 | return epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK; | ||
667 | } | ||
668 | |||
669 | /** | ||
670 | * usb_endpoint_dir_in - check if the endpoint has IN direction | ||
671 | * @epd: endpoint to be checked | ||
672 | * | ||
673 | * Returns true if the endpoint is of type IN, otherwise it returns false. | ||
674 | */ | ||
675 | static inline int usb_endpoint_dir_in(const struct usb_endpoint_descriptor *epd) | ||
676 | { | ||
677 | return ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN); | ||
678 | } | ||
679 | |||
680 | /** | ||
681 | * usb_endpoint_dir_out - check if the endpoint has OUT direction | ||
682 | * @epd: endpoint to be checked | ||
683 | * | ||
684 | * Returns true if the endpoint is of type OUT, otherwise it returns false. | ||
685 | */ | ||
686 | static inline int usb_endpoint_dir_out( | ||
687 | const struct usb_endpoint_descriptor *epd) | ||
688 | { | ||
689 | return ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT); | ||
690 | } | ||
691 | |||
692 | /** | ||
693 | * usb_endpoint_xfer_bulk - check if the endpoint has bulk transfer type | ||
694 | * @epd: endpoint to be checked | ||
695 | * | ||
696 | * Returns true if the endpoint is of type bulk, otherwise it returns false. | ||
697 | */ | ||
698 | static inline int usb_endpoint_xfer_bulk( | ||
699 | const struct usb_endpoint_descriptor *epd) | ||
700 | { | ||
701 | return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == | ||
702 | USB_ENDPOINT_XFER_BULK); | ||
703 | } | ||
704 | |||
705 | /** | ||
706 | * usb_endpoint_xfer_control - check if the endpoint has control transfer type | ||
707 | * @epd: endpoint to be checked | ||
708 | * | ||
709 | * Returns true if the endpoint is of type control, otherwise it returns false. | ||
710 | */ | ||
711 | static inline int usb_endpoint_xfer_control( | ||
712 | const struct usb_endpoint_descriptor *epd) | ||
713 | { | ||
714 | return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == | ||
715 | USB_ENDPOINT_XFER_CONTROL); | ||
716 | } | ||
717 | |||
718 | /** | ||
719 | * usb_endpoint_xfer_int - check if the endpoint has interrupt transfer type | ||
720 | * @epd: endpoint to be checked | ||
721 | * | ||
722 | * Returns true if the endpoint is of type interrupt, otherwise it returns | ||
723 | * false. | ||
724 | */ | ||
725 | static inline int usb_endpoint_xfer_int( | ||
726 | const struct usb_endpoint_descriptor *epd) | ||
727 | { | ||
728 | return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == | ||
729 | USB_ENDPOINT_XFER_INT); | ||
730 | } | ||
731 | |||
732 | /** | ||
733 | * usb_endpoint_xfer_isoc - check if the endpoint has isochronous transfer type | ||
734 | * @epd: endpoint to be checked | ||
735 | * | ||
736 | * Returns true if the endpoint is of type isochronous, otherwise it returns | ||
737 | * false. | ||
738 | */ | ||
739 | static inline int usb_endpoint_xfer_isoc( | ||
740 | const struct usb_endpoint_descriptor *epd) | ||
741 | { | ||
742 | return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == | ||
743 | USB_ENDPOINT_XFER_ISOC); | ||
744 | } | ||
745 | |||
746 | /** | ||
747 | * usb_endpoint_is_bulk_in - check if the endpoint is bulk IN | ||
748 | * @epd: endpoint to be checked | ||
749 | * | ||
750 | * Returns true if the endpoint has bulk transfer type and IN direction, | ||
751 | * otherwise it returns false. | ||
752 | */ | ||
753 | static inline int usb_endpoint_is_bulk_in( | ||
754 | const struct usb_endpoint_descriptor *epd) | ||
755 | { | ||
756 | return (usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_in(epd)); | ||
757 | } | ||
758 | |||
759 | /** | ||
760 | * usb_endpoint_is_bulk_out - check if the endpoint is bulk OUT | ||
761 | * @epd: endpoint to be checked | ||
762 | * | ||
763 | * Returns true if the endpoint has bulk transfer type and OUT direction, | ||
764 | * otherwise it returns false. | ||
765 | */ | ||
766 | static inline int usb_endpoint_is_bulk_out( | ||
767 | const struct usb_endpoint_descriptor *epd) | ||
768 | { | ||
769 | return (usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_out(epd)); | ||
770 | } | ||
771 | |||
772 | /** | ||
773 | * usb_endpoint_is_int_in - check if the endpoint is interrupt IN | ||
774 | * @epd: endpoint to be checked | ||
775 | * | ||
776 | * Returns true if the endpoint has interrupt transfer type and IN direction, | ||
777 | * otherwise it returns false. | ||
778 | */ | ||
779 | static inline int usb_endpoint_is_int_in( | ||
780 | const struct usb_endpoint_descriptor *epd) | ||
781 | { | ||
782 | return (usb_endpoint_xfer_int(epd) && usb_endpoint_dir_in(epd)); | ||
783 | } | ||
784 | |||
785 | /** | ||
786 | * usb_endpoint_is_int_out - check if the endpoint is interrupt OUT | ||
787 | * @epd: endpoint to be checked | ||
788 | * | ||
789 | * Returns true if the endpoint has interrupt transfer type and OUT direction, | ||
790 | * otherwise it returns false. | ||
791 | */ | ||
792 | static inline int usb_endpoint_is_int_out( | ||
793 | const struct usb_endpoint_descriptor *epd) | ||
794 | { | ||
795 | return (usb_endpoint_xfer_int(epd) && usb_endpoint_dir_out(epd)); | ||
796 | } | ||
797 | |||
798 | /** | ||
799 | * usb_endpoint_is_isoc_in - check if the endpoint is isochronous IN | ||
800 | * @epd: endpoint to be checked | ||
801 | * | ||
802 | * Returns true if the endpoint has isochronous transfer type and IN direction, | ||
803 | * otherwise it returns false. | ||
804 | */ | ||
805 | static inline int usb_endpoint_is_isoc_in( | ||
806 | const struct usb_endpoint_descriptor *epd) | ||
807 | { | ||
808 | return (usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_in(epd)); | ||
809 | } | ||
810 | |||
811 | /** | ||
812 | * usb_endpoint_is_isoc_out - check if the endpoint is isochronous OUT | ||
813 | * @epd: endpoint to be checked | ||
814 | * | ||
815 | * Returns true if the endpoint has isochronous transfer type and OUT direction, | ||
816 | * otherwise it returns false. | ||
817 | */ | ||
818 | static inline int usb_endpoint_is_isoc_out( | ||
819 | const struct usb_endpoint_descriptor *epd) | ||
820 | { | ||
821 | return (usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_out(epd)); | ||
822 | } | ||
823 | |||
824 | /*-------------------------------------------------------------------------*/ | ||
825 | |||
826 | #define USB_DEVICE_ID_MATCH_DEVICE \ | 646 | #define USB_DEVICE_ID_MATCH_DEVICE \ |
827 | (USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT) | 647 | (USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT) |
828 | #define USB_DEVICE_ID_MATCH_DEV_RANGE \ | 648 | #define USB_DEVICE_ID_MATCH_DEV_RANGE \ |
@@ -1357,8 +1177,8 @@ struct urb { | |||
1357 | unsigned int transfer_flags; /* (in) URB_SHORT_NOT_OK | ...*/ | 1177 | unsigned int transfer_flags; /* (in) URB_SHORT_NOT_OK | ...*/ |
1358 | void *transfer_buffer; /* (in) associated data buffer */ | 1178 | void *transfer_buffer; /* (in) associated data buffer */ |
1359 | dma_addr_t transfer_dma; /* (in) dma addr for transfer_buffer */ | 1179 | dma_addr_t transfer_dma; /* (in) dma addr for transfer_buffer */ |
1360 | int transfer_buffer_length; /* (in) data buffer length */ | 1180 | u32 transfer_buffer_length; /* (in) data buffer length */ |
1361 | int actual_length; /* (return) actual transfer length */ | 1181 | u32 actual_length; /* (return) actual transfer length */ |
1362 | unsigned char *setup_packet; /* (in) setup packet (control only) */ | 1182 | unsigned char *setup_packet; /* (in) setup packet (control only) */ |
1363 | dma_addr_t setup_dma; /* (in) dma addr for setup_packet */ | 1183 | dma_addr_t setup_dma; /* (in) dma addr for setup_packet */ |
1364 | int start_frame; /* (modify) start frame (ISO) */ | 1184 | int start_frame; /* (modify) start frame (ISO) */ |