diff options
author | Patrick Boettcher <devnull@localhost> | 2005-01-24 15:21:17 +0000 |
---|---|---|
committer | Patrick Boettcher <devnull@localhost> | 2005-01-24 15:21:17 +0000 |
commit | 2f64ee5ad4f8c16351b724497b6158eb7d66baa8 (patch) | |
tree | d46f1b213c6fdd5643371d7b6ecb0807d1ab52b3 /linux | |
parent | 2fc85a3ccf65e064411f26b63a7ae8dedf31c920 (diff) | |
download | mediapointer-dvb-s2-2f64ee5ad4f8c16351b724497b6158eb7d66baa8.tar.gz mediapointer-dvb-s2-2f64ee5ad4f8c16351b724497b6158eb7d66baa8.tar.bz2 |
- fixed '"debug" is not a good name for a global variable...' (now dvb_dibusb_debug) (thanks to Adrian Bunk)
- other globals removed
Diffstat (limited to 'linux')
-rw-r--r-- | linux/drivers/media/dvb/dibusb/dvb-dibusb-core.c | 19 | ||||
-rw-r--r-- | linux/drivers/media/dvb/dibusb/dvb-dibusb-remote.c | 10 | ||||
-rw-r--r-- | linux/drivers/media/dvb/dibusb/dvb-dibusb-usb.c | 16 | ||||
-rw-r--r-- | linux/drivers/media/dvb/dibusb/dvb-dibusb.h | 20 |
4 files changed, 38 insertions, 27 deletions
diff --git a/linux/drivers/media/dvb/dibusb/dvb-dibusb-core.c b/linux/drivers/media/dvb/dibusb/dvb-dibusb-core.c index 2ac4599aa..978804947 100644 --- a/linux/drivers/media/dvb/dibusb/dvb-dibusb-core.c +++ b/linux/drivers/media/dvb/dibusb/dvb-dibusb-core.c @@ -27,17 +27,21 @@ #include <linux/moduleparam.h> /* debug */ -#ifdef CONFIG_DVB_DIBCOM_DEBUG -int debug; +static int debug; module_param(debug, int, 0644); -MODULE_PARM_DESC(debug, "set debugging level (1=info,2=xfer,4=alotmore,8=ts,16=err,32=rc (|-able))."); +MODULE_PARM_DESC(debug, "set debugging level (1=info,2=xfer,4=alotmore,8=ts,16=err,32=rc (|-able))." +#ifdef CONFIG_DVB_DIBCOM_DEBUG + " (debugging is not enabled)" #endif +); +int dvb_dibusb_debug = 0; -int pid_parse; + +static int pid_parse; module_param(pid_parse, int, 0644); MODULE_PARM_DESC(pid_parse, "enable pid parsing (filtering) when running at USB2.0"); -int rc_query_interval; +static int rc_query_interval; module_param(rc_query_interval, int, 0644); MODULE_PARM_DESC(rc_query_interval, "interval in msecs for remote control query (default: 100; min: 40)"); @@ -410,6 +414,11 @@ static int dibusb_probe(struct usb_interface *intf, dib->udev = udev; dib->dibdev = dibdev; + /* store parameters to structures */ + dvb_dibusb_debug = debug; + dib->rc_query_interval = rc_query_interval; + dib->pid_parse = pid_parse; + usb_set_intfdata(intf, dib); ret = dibusb_init(dib); diff --git a/linux/drivers/media/dvb/dibusb/dvb-dibusb-remote.c b/linux/drivers/media/dvb/dibusb/dvb-dibusb-remote.c index 95a850f0b..b3b6f2413 100644 --- a/linux/drivers/media/dvb/dibusb/dvb-dibusb-remote.c +++ b/linux/drivers/media/dvb/dibusb/dvb-dibusb-remote.c @@ -143,7 +143,7 @@ static void dibusb_remote_query(void *data) if we're busy. */ dibusb_read_remote_control(dib); schedule_delayed_work(&dib->rc_query_work, - msecs_to_jiffies(rc_query_interval)); + msecs_to_jiffies(dib->rc_query_interval)); } int dibusb_remote_init(struct usb_dibusb *dib) @@ -171,11 +171,11 @@ int dibusb_remote_init(struct usb_dibusb *dib) INIT_WORK(&dib->rc_query_work, dibusb_remote_query, dib); /* Start the remote-control polling. */ - if (rc_query_interval < 40) - rc_query_interval = 100; /* default */ + if (dib->rc_query_interval < 40) + dib->rc_query_interval = 100; /* default */ - info("schedule remote query interval to %d msecs.",rc_query_interval); - schedule_delayed_work(&dib->rc_query_work,msecs_to_jiffies(rc_query_interval)); + info("schedule remote query interval to %d msecs.",dib->rc_query_interval); + schedule_delayed_work(&dib->rc_query_work,msecs_to_jiffies(dib->rc_query_interval)); dib->init_state |= DIBUSB_STATE_REMOTE; diff --git a/linux/drivers/media/dvb/dibusb/dvb-dibusb-usb.c b/linux/drivers/media/dvb/dibusb/dvb-dibusb-usb.c index 031f4bd93..467afa52a 100644 --- a/linux/drivers/media/dvb/dibusb/dvb-dibusb-usb.c +++ b/linux/drivers/media/dvb/dibusb/dvb-dibusb-usb.c @@ -158,7 +158,7 @@ int dibusb_streaming(struct usb_dibusb *dib,int onoff) int dibusb_urb_init(struct usb_dibusb *dib) { - int ret,i,bufsize; + int ret,i,bufsize,def_pid_parse = 1; /* * when reloading the driver w/o replugging the device @@ -210,12 +210,14 @@ int dibusb_urb_init(struct usb_dibusb *dib) dib->init_state |= DIBUSB_STATE_URB_SUBMIT; } - - dib->pid_parse = 1; + /* dib->pid_parse here contains the value of the module parameter */ + /* decide if pid parsing can be deactivated: + * is possible (by speed) and wanted (by user) + */ switch (dib->dibdev->dev_cl->id) { case DIBUSB2_0: - if (dib->udev->speed == USB_SPEED_HIGH && !pid_parse) { - dib->pid_parse = 0; + if (dib->udev->speed == USB_SPEED_HIGH && !dib->pid_parse) { + def_pid_parse = 0; info("running at HIGH speed, will deliver the complete TS."); } else info("will use pid_parsing."); @@ -223,7 +225,9 @@ int dibusb_urb_init(struct usb_dibusb *dib) default: break; } - + /* from here on it contains the device and user decision */ + dib->pid_parse = def_pid_parse; + return 0; } diff --git a/linux/drivers/media/dvb/dibusb/dvb-dibusb.h b/linux/drivers/media/dvb/dibusb/dvb-dibusb.h index bfb05989f..5c443c721 100644 --- a/linux/drivers/media/dvb/dibusb/dvb-dibusb.h +++ b/linux/drivers/media/dvb/dibusb/dvb-dibusb.h @@ -27,31 +27,26 @@ /* debug */ #ifdef CONFIG_DVB_DIBCOM_DEBUG #define dprintk(level,args...) \ - do { if ((debug & level)) { printk(args); } } while (0) + do { if ((dvb_dibusb_debug & level)) { printk(args); } } while (0) -#define debug_dump(b,l) if (debug) {\ - int i; deb_xfer("%s: %d > ",__FUNCTION__,l); \ +#define debug_dump(b,l) {\ + int i; \ for (i = 0; i < l; i++) deb_xfer("%02x ", b[i]); \ deb_xfer("\n");\ } -/* module parameters - declared in -core.c */ -extern int debug; - #else #define dprintk(args...) #define debug_dump(b,l) #endif +extern int dvb_dibusb_debug; + /* Version information */ #define DRIVER_VERSION "0.3" #define DRIVER_DESC "Driver for DiBcom based USB Budget DVB-T device" #define DRIVER_AUTHOR "Patrick Boettcher, patrick.boettcher@desy.de" -/* module parameters - declared in -core.c */ -extern int pid_parse; -extern int rc_query_interval; - #define deb_info(args...) dprintk(0x01,args) #define deb_xfer(args...) dprintk(0x02,args) #define deb_alot(args...) dprintk(0x04,args) @@ -162,7 +157,6 @@ struct usb_dibusb { int init_state; int feedcount; - int pid_parse; struct dib_fe_xfer_ops xfer_ops; struct dibusb_tuner *tuner; @@ -196,6 +190,10 @@ struct usb_dibusb { struct input_dev rc_input_dev; struct work_struct rc_query_work; int rc_input_event; + + /* module parameters */ + int pid_parse; + int rc_query_interval; }; /* commonly used functions in the separated files */ |