xfs: remove iclog calculation special cases
[linux-2.6/kvm.git] / drivers / staging / frontier / frontier_compat.h
blob00450e637ac84cac5251e670ddf85530db024c39
1 /* USB defines for older kernels */
3 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19)
5 /**
6 * usb_endpoint_dir_out - check if the endpoint has OUT direction
7 * @epd: endpoint to be checked
9 * Returns true if the endpoint is of type OUT, otherwise it returns false.
12 static inline int usb_endpoint_dir_out(const struct usb_endpoint_descriptor *epd)
14 return ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT);
17 static inline int usb_endpoint_dir_in(const struct usb_endpoint_descriptor *epd)
19 return ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN);
23 /**
24 * usb_endpoint_xfer_int - check if the endpoint has interrupt transfer type
25 * @epd: endpoint to be checked
27 * Returns true if the endpoint is of type interrupt, otherwise it returns
28 * false.
30 static inline int usb_endpoint_xfer_int(const struct usb_endpoint_descriptor *epd)
32 return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
33 USB_ENDPOINT_XFER_INT);
37 /**
38 * usb_endpoint_is_int_in - check if the endpoint is interrupt IN
39 * @epd: endpoint to be checked
41 * Returns true if the endpoint has interrupt transfer type and IN direction,
42 * otherwise it returns false.
45 static inline int usb_endpoint_is_int_in(const struct usb_endpoint_descriptor *epd)
47 return (usb_endpoint_xfer_int(epd) && usb_endpoint_dir_in(epd));
50 /**
51 * usb_endpoint_is_int_out - check if the endpoint is interrupt OUT
52 * @epd: endpoint to be checked
54 * Returns true if the endpoint has interrupt transfer type and OUT direction,
55 * otherwise it returns false.
58 static inline int usb_endpoint_is_int_out(const struct usb_endpoint_descriptor *epd)
60 return (usb_endpoint_xfer_int(epd) && usb_endpoint_dir_out(epd));
63 #endif /* older kernel versions */