diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2008-12-30 21:58:17 +0100 |
---|---|---|
committer | Hans Verkuil <hverkuil@xs4all.nl> | 2008-12-30 21:58:17 +0100 |
commit | 1ca1203a1eab7dc3951e569975bbbccc76aeb8fe (patch) | |
tree | 01ebfe8e3873a2bb62ce33fb2e2e125ce7fc966a /v4l | |
parent | 3f85abb813f1ad7454fb7a2f8e2998373571fe39 (diff) | |
download | mediapointer-dvb-s2-1ca1203a1eab7dc3951e569975bbbccc76aeb8fe.tar.gz mediapointer-dvb-s2-1ca1203a1eab7dc3951e569975bbbccc76aeb8fe.tar.bz2 |
v4l: fix compile errors for older kernels
From: Hans Verkuil <hverkuil@xs4all.nl>
Priority: normal
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'v4l')
-rw-r--r-- | v4l/compat.h | 61 |
1 files changed, 59 insertions, 2 deletions
diff --git a/v4l/compat.h b/v4l/compat.h index 200c21458..c2b805cec 100644 --- a/v4l/compat.h +++ b/v4l/compat.h @@ -280,8 +280,8 @@ static inline int dummy_algo_control(struct i2c_adapter *adapter, #define PCI_DEVICE_ID_MARVELL_88ALP01_CCIC 0x4102 #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) #ifdef __LINUX_USB_H +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) /* * usb_endpoint_* functions * @@ -328,10 +328,67 @@ usb_endpoint_is_int_in(const struct usb_endpoint_descriptor *epd) { return usb_endpoint_xfer_int(epd) && usb_endpoint_dir_in(epd); } + +static inline int usb_endpoint_dir_out( + const struct usb_endpoint_descriptor *epd) +{ + return ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT); +} + +static inline int usb_endpoint_is_bulk_in( + const struct usb_endpoint_descriptor *epd) +{ + return (usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_in(epd)); +} + +static inline int usb_endpoint_is_bulk_out( + const struct usb_endpoint_descriptor *epd) +{ + return (usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_out(epd)); +} + +static inline int usb_endpoint_is_int_out( + const struct usb_endpoint_descriptor *epd) +{ + return (usb_endpoint_xfer_int(epd) && usb_endpoint_dir_out(epd)); +} + +static inline int usb_endpoint_is_isoc_in( + const struct usb_endpoint_descriptor *epd) +{ + return (usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_in(epd)); +} + +static inline int usb_endpoint_is_isoc_out( + const struct usb_endpoint_descriptor *epd) +{ + return (usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_out(epd)); +} #endif /* RHEL_HAS_USB_ENDPOINT */ -#endif /* __LINUX_USB_H */ #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 21) +static inline int usb_endpoint_xfer_control( + const struct usb_endpoint_descriptor *epd) +{ + return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == + USB_ENDPOINT_XFER_CONTROL); +} +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) +static inline int usb_endpoint_num(const struct usb_endpoint_descriptor *epd) +{ + return epd->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; +} + +static inline int usb_endpoint_type(const struct usb_endpoint_descriptor *epd) +{ + return epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK; +} +#endif +#endif /* __LINUX_USB_H */ + #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22) /* * Linked list API |