aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb.h
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2008-12-29 16:48:19 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2009-03-24 19:20:27 -0400
commit4d6914b72966862f37de634299a80ca2a4b1829f (patch)
tree1c7dec08838b413a6a32343879f1209362bda491 /include/linux/usb.h
parentee069fb1185895e725ad942c7a529f947e25166d (diff)
USB: Move definitions from usb.h to usb/ch9.h
The functions: usb_endpoint_dir_in(epd) usb_endpoint_dir_out(epd) usb_endpoint_is_bulk_in(epd) usb_endpoint_is_bulk_out(epd) usb_endpoint_is_int_in(epd) usb_endpoint_is_int_out(epd) usb_endpoint_is_isoc_in(epd) usb_endpoint_is_isoc_out(epd) usb_endpoint_num(epd) usb_endpoint_type(epd) usb_endpoint_xfer_bulk(epd) usb_endpoint_xfer_control(epd) usb_endpoint_xfer_int(epd) usb_endpoint_xfer_isoc(epd) are moved from include/linux/usb.h to include/linux/usb/ch9.h. include/linux/usb/ch9.h makes more sense for these functions because they only depend on constants that are defined in this file. Signed-off-by: Julia Lawall <julia@diku.dk> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux/usb.h')
-rw-r--r--include/linux/usb.h180
1 files changed, 0 insertions, 180 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 88079fd60235..0c05ff621192 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 */
652static 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 */
664static 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 */
675static 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 */
686static 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 */
698static 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 */
711static 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 */
725static 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 */
739static 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 */
753static 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 */
766static 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 */
779static 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 */
792static 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 */
805static 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 */
818static 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 \