diff options
author | Michael Hunold <devnull@localhost> | 2004-03-31 09:55:31 +0000 |
---|---|---|
committer | Michael Hunold <devnull@localhost> | 2004-03-31 09:55:31 +0000 |
commit | d4c06b410b65a258a055d8edb0c6935d0b1f8f6f (patch) | |
tree | 06a56f1eb821f74eb4a0b1138f230c35dbdbe5ca /linux/drivers/media/dvb/dvb-core | |
parent | 23edf6c1a2c8a0644077bd8f3960a262985d7065 (diff) | |
download | mediapointer-dvb-s2-d4c06b410b65a258a055d8edb0c6935d0b1f8f6f.tar.gz mediapointer-dvb-s2-d4c06b410b65a258a055d8edb0c6935d0b1f8f6f.tar.bz2 |
- first try to fix the module use count bugs, thanks to Hernan A.Perez Masci for his work!
- dvb_net most likely doesn't work with 2.6 yet and dvb_net is untested in general
Diffstat (limited to 'linux/drivers/media/dvb/dvb-core')
-rw-r--r-- | linux/drivers/media/dvb/dvb-core/dvb_net.c | 9 | ||||
-rw-r--r-- | linux/drivers/media/dvb/dvb-core/dvbdev.c | 7 | ||||
-rw-r--r-- | linux/drivers/media/dvb/dvb-core/dvbdev.h | 4 |
3 files changed, 16 insertions, 4 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_net.c b/linux/drivers/media/dvb/dvb-core/dvb_net.c index 2d4e65e91..427c314e3 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_net.c +++ b/linux/drivers/media/dvb/dvb-core/dvb_net.c @@ -46,6 +46,7 @@ struct dvb_net_priv { struct net_device_stats stats; char name[6]; u16 pid; + struct dvb_net *host; struct dmx_demux *demux; struct dmx_section_feed *secfeed; struct dmx_section_filter *secfilter; @@ -469,6 +470,8 @@ static int dvb_net_init_dev (struct net_device *dev) static void dvb_net_setup(struct net_device *dev) #endif { + struct dvb_net_priv *priv = (struct dvb_net_priv*)dev->priv; + ether_setup(dev); dev->open = dvb_net_open; @@ -481,7 +484,8 @@ static void dvb_net_setup(struct net_device *dev) dev->mtu = 4096; dev->mc_count = 0; dev->hard_header_cache = NULL; - + dev->owner = priv->host->dvbdev->adapter->module; + dev->flags |= IFF_NOARP; #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) return 0; @@ -536,7 +540,8 @@ static int dvb_net_add_if(struct dvb_net *dvbnet, u16 pid) priv->demux = demux; priv->pid = pid; priv->rx_mode = RX_MODE_UNI; - + priv->host = dvbnet; + INIT_WORK(&priv->set_multicast_list_wq, wq_set_multicast_list, net); INIT_WORK(&priv->restart_net_feed_wq, wq_restart_net_feed, net); diff --git a/linux/drivers/media/dvb/dvb-core/dvbdev.c b/linux/drivers/media/dvb/dvb-core/dvbdev.c index bcfb827d4..9f6a63714 100644 --- a/linux/drivers/media/dvb/dvb-core/dvbdev.c +++ b/linux/drivers/media/dvb/dvb-core/dvbdev.c @@ -220,6 +220,8 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, dvbdev->adapter = adap; dvbdev->priv = priv; + dvbdev->fops->owner = adap->module; + list_add_tail (&dvbdev->list_head, &adap->device_list); #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) @@ -246,6 +248,8 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, nums2minor(adap->num, type, id)); #endif + + return 0; } @@ -287,7 +291,7 @@ skip: } -int dvb_register_adapter(struct dvb_adapter **padap, const char *name) +int dvb_register_adapter(struct dvb_adapter **padap, const char *name, struct module *module) { struct dvb_adapter *adap; int num; @@ -321,6 +325,7 @@ int dvb_register_adapter(struct dvb_adapter **padap, const char *name) #endif adap->num = num; adap->name = name; + adap->module = module; list_add_tail (&adap->list_head, &dvb_adapter_list); diff --git a/linux/drivers/media/dvb/dvb-core/dvbdev.h b/linux/drivers/media/dvb/dvb-core/dvbdev.h index 22e20f340..cd0550b8f 100644 --- a/linux/drivers/media/dvb/dvb-core/dvbdev.h +++ b/linux/drivers/media/dvb/dvb-core/dvbdev.h @@ -52,6 +52,8 @@ struct dvb_adapter { struct list_head device_list; const char *name; u8 proposed_mac [6]; + + struct module *module; }; @@ -79,7 +81,7 @@ struct dvb_device { }; -extern int dvb_register_adapter (struct dvb_adapter **padap, const char *name); +extern int dvb_register_adapter (struct dvb_adapter **padap, const char *name, struct module *module); extern int dvb_unregister_adapter (struct dvb_adapter *adap); extern int dvb_register_device (struct dvb_adapter *adap, |