rpms/kernel/devel linux-2.6-systemsim-work.patch, NONE, 1.1 kernel-2.6.spec, 1.2865, 1.2866
fedora-cvs-commits at redhat.com
fedora-cvs-commits at redhat.com
Wed Dec 13 14:04:21 UTC 2006
Author: dwmw2
Update of /cvs/dist/rpms/kernel/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv25697
Modified Files:
kernel-2.6.spec
Added Files:
linux-2.6-systemsim-work.patch
Log Message:
update systemsim for work_struct stuff
linux-2.6-systemsim-work.patch:
systemsim_net.c | 33 +++++++++++++++------------------
1 files changed, 15 insertions(+), 18 deletions(-)
--- NEW FILE linux-2.6-systemsim-work.patch ---
--- linux-2.6.19.ppc64/drivers/net/systemsim_net.c~ 2006-12-12 20:59:36.000000000 +0000
+++ linux-2.6.19.ppc64/drivers/net/systemsim_net.c 2006-12-13 13:56:54.000000000 +0000
@@ -87,17 +87,14 @@ static inline int systemsim_bogusnet_rec
static irqreturn_t
systemsim_net_intr(int irq, void *dev_instance);
-#define INIT_BOTTOM_HALF(x,y,z) INIT_WORK(x, y, (void*)z)
-#define SCHEDULE_BOTTOM_HALF(x) schedule_delayed_work(x, 1)
-#define KILL_BOTTOM_HALF(x) cancel_delayed_work(x); flush_scheduled_work()
-
#define MAMBO_MTU 1500
struct netdev_private {
int devno;
int closing;
- struct work_struct poll_task;
+ struct delayed_work poll_task;
struct net_device_stats stats;
+ struct net_device *ndev;
};
static int systemsim_net_probedev(int devno, void *buf)
@@ -209,16 +206,17 @@ static int systemsim_net_poll(struct net
return ret;
}
-static void systemsim_net_timer(struct net_device *dev)
+static void systemsim_net_timer(struct work_struct *work)
{
+ struct netdev_private *priv = container_of(work, struct netdev_private,
+ poll_task.work);
int budget = 16;
- struct netdev_private *priv = (struct netdev_private *)dev->priv;
+ struct net_device *dev = priv->ndev;
systemsim_net_poll(dev, &budget);
- if (!priv->closing) {
- SCHEDULE_BOTTOM_HALF(&priv->poll_task);
- }
+ if (!priv->closing)
+ schedule_delayed_work(&priv->poll_task, 1);
}
static struct net_device_stats *get_stats(struct net_device *dev)
@@ -262,7 +260,7 @@ static int systemsim_net_open(struct net
/* probe with NULL to activate interrupts */
systemsim_bogusnet_probe(priv->devno, NULL);
} else {
- systemsim_net_timer(dev);
+ systemsim_net_timer(&priv->poll_task.work);
}
return ret;
@@ -280,7 +278,8 @@ static int systemsim_net_close(struct ne
priv = dev->priv;
priv->closing = 1;
if (dev->irq == 0) {
- KILL_BOTTOM_HALF(&priv->poll_task);
+ cancel_delayed_work(&priv->poll_task);
+ flush_scheduled_work();
}
return 0;
@@ -337,20 +336,18 @@ int __init do_systemsim_net_probe(struct
dev->set_mac_address = systemsim_net_set_mac_address;
dev->do_ioctl = systemsim_net_ioctl;
- dev->priv = kmalloc(sizeof(struct netdev_private), GFP_KERNEL);
+ dev->priv = kzalloc(sizeof(struct netdev_private), GFP_KERNEL);
if (dev->priv == NULL)
return -ENOMEM;
- memset(dev->priv, 0, sizeof(struct netdev_private));
priv = dev->priv;
+ priv->ndev = dev;
priv->devno = devno;
priv->closing = 0;
dev->get_stats = get_stats;
- if (dev->irq == 0) {
- INIT_BOTTOM_HALF(&priv->poll_task, (void *)systemsim_net_timer,
- (void *)dev);
- }
+ if (dev->irq == 0)
+ INIT_DELAYED_WORK(&priv->poll_task, (void *)systemsim_net_timer);
return (0);
};
Index: kernel-2.6.spec
===================================================================
RCS file: /cvs/dist/rpms/kernel/devel/kernel-2.6.spec,v
retrieving revision 1.2865
retrieving revision 1.2866
diff -u -r1.2865 -r1.2866
--- kernel-2.6.spec 13 Dec 2006 05:44:25 -0000 1.2865
+++ kernel-2.6.spec 13 Dec 2006 14:04:18 -0000 1.2866
@@ -326,6 +326,7 @@
# 300 - 399 ppc(64)
Patch301: linux-2.6-cell-mambo-drivers.patch
+Patch302: linux-2.6-systemsim-work.patch
Patch310: linux-2.6-g5-therm-shutdown.patch
# 400 - 499 ia64
@@ -748,6 +749,7 @@
#
# Support the IBM Mambo simulator; core as well as disk and network drivers.
%patch301 -p1
+%patch302 -p1
# Alleviate G5 thermal shutdown problems
%patch310 -p1
More information about the fedora-cvs-commits
mailing list