diff options
author | Alex Woods <devnull@localhost> | 2003-06-22 12:14:46 +0000 |
---|---|---|
committer | Alex Woods <devnull@localhost> | 2003-06-22 12:14:46 +0000 |
commit | 5f49c5a0e30a742f8607e0a4e744587db8ed3a00 (patch) | |
tree | 2b6a52e239f41f507aa69c394d6a0b910f92de81 /linux/drivers/media/dvb | |
parent | fa424863e7af7e98d93fd296469a86ef6cfddbe5 (diff) | |
download | mediapointer-dvb-s2-5f49c5a0e30a742f8607e0a4e744587db8ed3a00.tar.gz mediapointer-dvb-s2-5f49c5a0e30a742f8607e0a4e744587db8ed3a00.tar.bz2 |
Rollback to munges and split usb compat stuff out to fix building
against 2.4 and 2.5 kernels.
Diffstat (limited to 'linux/drivers/media/dvb')
-rw-r--r-- | linux/drivers/media/dvb/dvb-core/dvb_compat.h | 14 | ||||
-rw-r--r-- | linux/drivers/media/dvb/dvb-core/dvb_usb_compat.h | 17 | ||||
-rw-r--r-- | linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c | 16 | ||||
-rw-r--r-- | linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c | 20 |
4 files changed, 46 insertions, 21 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_compat.h b/linux/drivers/media/dvb/dvb-core/dvb_compat.h index 71488ab6e..980b4cd85 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_compat.h +++ b/linux/drivers/media/dvb/dvb-core/dvb_compat.h @@ -102,19 +102,5 @@ extern struct page * vmalloc_to_page(void *addr); #include <linux/workqueue.h> #endif - -/* USB compatibility */ - -#include <linux/usb.h> - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) -typedef struct iso_packet_descriptor usb_iso_packet_descriptor; -#define URB_ISO_ASAP USB_ISO_ASAP -#undef usb_alloc_urb -#undef usb_submit_urb -#define usb_alloc_urb(urb,flags) usb_alloc_urb(urb) -#define usb_submit_urb(urb,flags) usb_submit_urb(urb) -#endif - #endif diff --git a/linux/drivers/media/dvb/dvb-core/dvb_usb_compat.h b/linux/drivers/media/dvb/dvb-core/dvb_usb_compat.h new file mode 100644 index 000000000..f80ac9ef3 --- /dev/null +++ b/linux/drivers/media/dvb/dvb-core/dvb_usb_compat.h @@ -0,0 +1,17 @@ +#ifndef __MORECRAP_H +#define __MORECRAP_H + +/* USB compatibility */ + +#include <linux/usb.h> + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) +typedef struct iso_packet_descriptor usb_iso_packet_descriptor; +#define URB_ISO_ASAP USB_ISO_ASAP +#define URB_MEM_FLAG +#else +#define URB_MEM_FLAG , GFP_KERNEL +#endif + +#endif + diff --git a/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c index dd1454e41..a06658303 100644 --- a/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c +++ b/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c @@ -28,6 +28,7 @@ #include <linux/dvb/dmx.h> #include <linux/pci.h> +#include "dvb_usb_compat.h" #include "dvb_functions.h" /* @@ -775,7 +776,9 @@ void ttusb_iso_irq (struct urb *urb, struct pt_regs *ptregs) } } - usb_submit_urb(urb, GFP_KERNEL); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) + usb_submit_urb(urb URB_MEM_FLAG); +#endif } @@ -808,7 +811,7 @@ int ttusb_alloc_iso_urbs (struct ttusb *ttusb) for (i=0; i<ISO_BUF_COUNT; i++) { struct urb *urb; - if (!(urb = usb_alloc_urb (FRAMES_PER_ISO_BUF, GFP_KERNEL))) { + if (!(urb = usb_alloc_urb (FRAMES_PER_ISO_BUF URB_MEM_FLAG))) { ttusb_free_iso_urbs (ttusb); return -ENOMEM; } @@ -867,8 +870,15 @@ int ttusb_start_iso_xfer (struct ttusb *ttusb) } } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) + for (i=0; i<ISO_BUF_COUNT; i++) { + int next = (i + 1) % ISO_BUF_COUNT; + ttusb->iso_urb[i]->next = ttusb->iso_urb[next]; + } +#endif + for (i=0; i<ISO_BUF_COUNT; i++) { - if ((err = usb_submit_urb(ttusb->iso_urb[i], GFP_KERNEL))) { + if ((err = usb_submit_urb (ttusb->iso_urb[i] URB_MEM_FLAG))) { ttusb_stop_iso_xfer (ttusb); printk ("%s: failed urb submission (%i: err = %i)!\n", __FUNCTION__, i, err); diff --git a/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c index b86dcc616..933922002 100644 --- a/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c +++ b/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c @@ -25,8 +25,8 @@ #include <linux/usb.h> #include "ttusb_dec.h" -#include "dvb_functions.h" #include "dvb_frontend.h" +#include "dvb_usb_compat.h" static int debug = 0; @@ -470,7 +470,10 @@ ttusb_dec_process_urb(struct urb *urb, struct pt_regs *ptregs) } - usb_submit_urb(urb, GFP_KERNEL); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) + usb_submit_urb(urb URB_MEM_FLAG); +#endif + } static void @@ -573,7 +576,7 @@ ttusb_dec_start_iso_xfer(struct ttusb_dec *dec) for (i = 0; i < ISO_BUF_COUNT; i++) { - if ((result = usb_submit_urb(dec->iso_urb[i], GFP_KERNEL))) { + if ((result = usb_submit_urb(dec->iso_urb[i] URB_MEM_FLAG))) { printk("%s: failed urb submission %d: error %d\n", __FUNCTION__, i, result); @@ -759,7 +762,7 @@ ttusb_dec_alloc_iso_urbs(struct ttusb_dec * dec) struct urb *urb; - if (!(urb = usb_alloc_urb(FRAMES_PER_ISO_BUF, GFP_KERNEL))) { + if (!(urb = usb_alloc_urb(FRAMES_PER_ISO_BUF URB_MEM_FLAG))) { ttusb_dec_free_iso_urbs(dec); return -ENOMEM; @@ -772,6 +775,15 @@ ttusb_dec_alloc_iso_urbs(struct ttusb_dec * dec) ttusb_dec_setup_urbs(dec); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) + for (i = 0; i < ISO_BUF_COUNT; i++) { + + int next = (i + 1) % ISO_BUF_COUNT; + dec->iso_urb[i]->next = dec->iso_urb[next]; + + } +#endif + return 0; } |