Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] Re: Two DVB-cards, change order?



Johannes Stezenbach wrote:

Probably the best thing to do is to change dvbdev_get_free_adapter_num()
to deal out number 1 first, number 0 second. If you cook up a patch which adds
a module parameter like "adapter_numbering=1,0,2,3" I would add
it to CVS.

Thanks, I've made a patch for dvbdev.c, adding the module parameter you suggested and changing the behaviour of dvbdev_get_free_adapter_num(). Seems to work just fine!

However, I'm using a quite old DVB driver (2003-11-08), so the patch is probably not very useful. I guess I should check out the latest driver from CVS and make it work there instead, and then send you the patch... Do I have to make a patch for both 2.4 and 2.6, or is 2.4 considered "obsolete" for DVB development?

And DVB_MAX_IDS is the number of DVB-cards the driver supports right? (I want to use it for setting the size of the module parameter array, but wasn't sure)

/Marcus


*** dvbdev.c.orig	Sun Aug 24 12:42:49 2003
--- dvbdev.c	Sun Jul  4 21:01:37 2004
***************
*** 45,50 ****
--- 45,53 ----
  static int dvbdev_debug = 0;
  #define dprintk if (dvbdev_debug) printk
  
+ static int adapter_numbering[4] = { -1 };
+ int adapter_numbering_current=0;
+ 
  static devfs_handle_t dvb_devfs_handle;
  static LIST_HEAD(dvb_adapter_list);
  static DECLARE_MUTEX(dvbdev_register_lock);
***************
*** 271,276 ****
--- 274,285 ----
  {
  	int num = 0;
  
+ 	if (adapter_numbering[0] != -1) {
+ 		num = adapter_numbering[adapter_numbering_current];
+ 		adapter_numbering_current++;
+ 		return num;
+ 	}
+ 
  	while (1) {
  		struct list_head *entry;
  		list_for_each (entry, &dvb_adapter_list) {
***************
*** 372,375 ****
--- 381,386 ----
  
  MODULE_PARM(dvbdev_debug,"i");
  MODULE_PARM_DESC(dvbdev_debug, "enable verbose debug messages");
+ MODULE_PARM(adapter_numbering,"1-4i");
+ MODULE_PARM_DESC(adapter_numbering, "change numbering of adapters");
  

Home | Main Index | Thread Index