summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2008-12-30 08:47:03 -0200
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-12-30 08:47:03 -0200
commitb0ab681e920adac28d099cb1ec192d2ada2c160f (patch)
tree170e336694491220e6769f55fea5e79382faba71
parent34f7174184f8336672613230fb12421a8ab2d187 (diff)
downloadmediapointer-dvb-s2-b0ab681e920adac28d099cb1ec192d2ada2c160f.tar.gz
mediapointer-dvb-s2-b0ab681e920adac28d099cb1ec192d2ada2c160f.tar.bz2
Add compat support for usb_endpoint_type()
From: Mauro Carvalho Chehab <mchehab@redhat.com> While here, make sure that config-compat.h is rebuild if the script change. Priority: normal Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--v4l/Makefile2
-rw-r--r--v4l/compat.h13
-rwxr-xr-xv4l/scripts/make_config_compat.pl20
3 files changed, 30 insertions, 5 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 22281f6f9..200c21458 100644
--- a/v4l/compat.h
+++ b/v4l/compat.h
@@ -339,14 +339,19 @@ usb_endpoint_is_int_in(const struct usb_endpoint_descriptor *epd)
#define list_first_entry(ptr, type, member) \
list_entry((ptr)->next, type, member)
-#ifdef NEED_NETDEV_PRIV
-#define netdev_priv(dev) ((dev)->priv)
-#endif
-
/*
* uninitialized_var() macro
*/
#define uninitialized_var(x) x = x
#endif
+#ifdef NEED_NETDEV_PRIV
+#define netdev_priv(dev) ((dev)->priv)
+#endif
+
+#ifdef NEED_USB_ENDPOINT_TYPE
+#define usb_endpoint_type(ep) \
+ ((ep)->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK)
+#endif
+
#endif
diff --git a/v4l/scripts/make_config_compat.pl b/v4l/scripts/make_config_compat.pl
index 8fb7a9441..dc6653b0d 100755
--- a/v4l/scripts/make_config_compat.pl
+++ b/v4l/scripts/make_config_compat.pl
@@ -216,6 +216,25 @@ sub check_net_dev()
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_other_dependencies()
{
check_spin_lock();
@@ -229,6 +248,7 @@ sub check_other_dependencies()
check_pcm_lock();
check_algo_control();
check_net_dev();
+ check_usb_endpoint_type();
}
# Do the basic rules