From 44588fb487e94e330e9ea9da744cb35e7f14dc96 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sat, 16 Dec 2006 18:29:03 -0200 Subject: Several stuff backported from 2.6.19-git series From: Mauro Carvalho Chehab - INIT_WORK replaced by INIT_DELAYED_WORK - struct work_struct replaced by struct delayed_work - callback parameters also changed - SLAB_KERNEL replaced by GFP_KERNEL - linux/suspend.h replaced by linux/freezer.h - on cpia: INIT_WORK replaced by INIT_WORK_NAR - file->f_dentry->d_inode replaced by file->f_path.dentry->d_inode Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/dvb/dvb-core/dvb_frontend.c | 5 ++++ linux/drivers/media/dvb/dvb-core/dvb_net.c | 31 +++++++++++++++++++++++++ 2 files changed, 36 insertions(+) (limited to 'linux/drivers/media/dvb/dvb-core') diff --git a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c index 52008bc96..fc65d9a25 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c @@ -34,7 +34,12 @@ #include #include #include +#include "compat.h" +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) #include +#else +#include +#endif #include #include diff --git a/linux/drivers/media/dvb/dvb-core/dvb_net.c b/linux/drivers/media/dvb/dvb-core/dvb_net.c index 884ce0402..3e94e6cf9 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_net.c +++ b/linux/drivers/media/dvb/dvb-core/dvb_net.c @@ -130,6 +130,9 @@ struct dvb_net_priv { int in_use; struct net_device_stats stats; u16 pid; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) + struct net_device *net; +#endif struct dvb_net *host; struct dmx_demux *demux; struct dmx_section_feed *secfeed; @@ -1130,10 +1133,20 @@ static int dvb_set_mc_filter (struct net_device *dev, struct dev_mc_list *mc) } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) static void wq_set_multicast_list (void *data) +#else +static void wq_set_multicast_list (struct work_struct *work) +#endif { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) struct net_device *dev = data; struct dvb_net_priv *priv = dev->priv; +#else + struct dvb_net_priv *priv = + container_of(work, struct dvb_net_priv, set_multicast_list_wq); + struct net_device *dev = priv->net; +#endif dvb_net_feed_stop(dev); priv->rx_mode = RX_MODE_UNI; @@ -1182,9 +1195,19 @@ static void dvb_net_set_multicast_list (struct net_device *dev) } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) static void wq_restart_net_feed (void *data) +#else +static void wq_restart_net_feed (struct work_struct *work) +#endif { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) struct net_device *dev = data; +#else + struct dvb_net_priv *priv = + container_of(work, struct dvb_net_priv, restart_net_feed_wq); + struct net_device *dev = priv->net; +#endif if (netif_running(dev)) { dvb_net_feed_stop(dev); @@ -1291,6 +1314,9 @@ static int dvb_net_add_if(struct dvb_net *dvbnet, u16 pid, u8 feedtype) dvbnet->device[if_num] = net; priv = net->priv; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) + priv->net = net; +#endif priv->demux = dvbnet->demux; priv->pid = pid; priv->rx_mode = RX_MODE_UNI; @@ -1299,8 +1325,13 @@ static int dvb_net_add_if(struct dvb_net *dvbnet, u16 pid, u8 feedtype) priv->feedtype = feedtype; reset_ule(priv); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) INIT_WORK(&priv->set_multicast_list_wq, wq_set_multicast_list, net); INIT_WORK(&priv->restart_net_feed_wq, wq_restart_net_feed, net); +#else + INIT_WORK(&priv->set_multicast_list_wq, wq_set_multicast_list); + INIT_WORK(&priv->restart_net_feed_wq, wq_restart_net_feed); +#endif mutex_init(&priv->mutex); net->base_addr = pid; -- cgit v1.2.3