diff options
Diffstat (limited to 'v4l')
-rw-r--r-- | v4l/Makefile | 2 | ||||
-rw-r--r-- | v4l/compat.h | 80 | ||||
-rwxr-xr-x | v4l/scripts/make_config_compat.pl | 60 | ||||
-rw-r--r-- | v4l/versions.txt | 5 |
4 files changed, 140 insertions, 7 deletions
diff --git a/v4l/Makefile b/v4l/Makefile index 2aa856974..f96873227 100644 --- a/v4l/Makefile +++ b/v4l/Makefile @@ -256,7 +256,7 @@ links:: oss: ln -sf . oss -config-compat.h:: $(obj)/.version .myconfig +config-compat.h:: $(obj)/.version .myconfig scripts/make_config_compat.pl perl scripts/make_config_compat.pl $(SRCDIR) $(obj)/.myconfig $(obj)/config-compat.h kernel-links makelinks:: diff --git a/v4l/compat.h b/v4l/compat.h index 49c89ea2d..186493d7f 100644 --- a/v4l/compat.h +++ b/v4l/compat.h @@ -270,18 +270,14 @@ static inline int dummy_algo_control(struct i2c_adapter *adapter, #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 28) #define snd_BUG_ON(cond) WARN((cond), "BUG? (%s)\n", __stringify(cond)) - -#define pci_ioremap_bar(pci, a) \ - ioremap_nocache(pci_resource_start(pci, a), \ - pci_resource_len(pci, a)) #endif #ifndef PCI_DEVICE_ID_MARVELL_88ALP01_CCIC #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 +324,71 @@ 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) +#ifndef RHEL_HAS_USB_ENDPOINT +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 /* RHEL_HAS_USB_ENDPOINT */ +#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; +} +#endif + +#ifdef NEED_USB_ENDPOINT_TYPE +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 @@ -345,4 +402,15 @@ usb_endpoint_is_int_in(const struct usb_endpoint_descriptor *epd) #define uninitialized_var(x) x = x #endif +#ifdef NEED_NETDEV_PRIV +#define netdev_priv(dev) ((dev)->priv) +#endif + +#ifdef NEED_PCI_IOREMAP_BAR +#define pci_ioremap_bar(pdev, bar) \ + ioremap_nocache(pci_resource_start(pdev, bar), \ + pci_resource_len(pdev, bar)) +#endif + + #endif diff --git a/v4l/scripts/make_config_compat.pl b/v4l/scripts/make_config_compat.pl index 3a8bdd81e..d24b5f718 100755 --- a/v4l/scripts/make_config_compat.pl +++ b/v4l/scripts/make_config_compat.pl @@ -197,6 +197,63 @@ sub check_algo_control() close INNET; } +sub check_net_dev() +{ + my $file = "$kdir/include/linux/netdevice.h"; + my $need_compat = 1; + + open INNET, "<$file" or die "File not found: $file"; + while (<INNET>) { + if (m/netdev_priv/) { + $need_compat = 0; + last; + } + } + + if ($need_compat) { + $out.= "\n#define NEED_NETDEV_PRIV 1\n"; + } + close INNET; +} + +sub check_usb_endpoint_type() +{ + my $file = "$kdir/include/linux/usb.h"; + my $need_compat = 1; + + open INNET, "<$file" or die "File not found: $file"; + while (<INNET>) { + if (m/usb_endpoint_type/) { + $need_compat = 0; + last; + } + } + + if ($need_compat) { + $out.= "\n#define NEED_USB_ENDPOINT_TYPE 1\n"; + } + close INNET; +} + +sub check_pci_ioremap_bar() +{ + my $file = "$kdir/include/linux/pci.h"; + my $need_compat = 1; + + open INNET, "<$file" or die "File not found: $file"; + while (<INNET>) { + if (m/pci_ioremap_bar/) { + $need_compat = 0; + last; + } + } + + if ($need_compat) { + $out.= "\n#define NEED_PCI_IOREMAP_BAR 1\n"; + } + close INNET; +} + sub check_other_dependencies() { check_spin_lock(); @@ -209,6 +266,9 @@ sub check_other_dependencies() check_proc_create(); check_pcm_lock(); check_algo_control(); + check_net_dev(); + check_usb_endpoint_type(); + check_pci_ioremap_bar(); } # Do the basic rules diff --git a/v4l/versions.txt b/v4l/versions.txt index 0393e79b0..722a9283a 100644 --- a/v4l/versions.txt +++ b/v4l/versions.txt @@ -1,11 +1,16 @@ # Use this for stuff for drivers that don't compile [2.6.99] +[2.6.28] +USB_STV06XX + [2.6.26] # Needs camera.h VIDEO_PXA27x # Requires struct i2c_device_id VIDEO_TVP514X +# requires id_table and new i2c stuff +RADIO_TEA5764 [2.6.25] # Requires gpiolib |