patch-2.4.0-test12 linux/drivers/i2o/i2o_lan.c

Next file: linux/drivers/ide/buddha.c
Previous file: linux/drivers/char/vt.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test11/linux/drivers/i2o/i2o_lan.c linux/drivers/i2o/i2o_lan.c
@@ -112,8 +112,10 @@
 };
 static int lan_context;
 
-static struct tq_struct i2o_post_buckets_task = {
-	0, 0, (void (*)(void *))i2o_lan_receive_post, (void *) 0
+DECLARE_TASK_QUEUE(i2o_post_buckets_task);
+struct tq_struct run_i2o_post_buckets_task = {
+	routine: (void (*)(void *)) run_task_queue,
+	data: (void *) 0
 };
 
 /* Functions to handle message failures and transaction errors:
@@ -379,8 +381,8 @@
 	/* If DDM has already consumed bucket_thresh buckets, post new ones */
 
 	if (atomic_read(&priv->buckets_out) <= priv->max_buckets_out - priv->bucket_thresh) {
-		i2o_post_buckets_task.data = (void *)dev;
-		queue_task(&i2o_post_buckets_task, &tq_immediate);
+		run_i2o_post_buckets_task.data = (void *)dev;
+		queue_task(&run_i2o_post_buckets_task, &tq_immediate);
 		mark_bh(IMMEDIATE_BH);
 	}
 
@@ -846,6 +848,7 @@
 	}
 	priv->send_active = 0;
 	spin_unlock_irq(&priv->tx_lock);
+	MOD_DEC_USE_COUNT;
 }
 
 #ifdef CONFIG_NET_FC
@@ -900,7 +903,9 @@
 
 		if ((priv->tx_batch_mode & 0x01) && !priv->send_active) {
 			priv->send_active = 1;
-			queue_task(&priv->i2o_batch_send_task, &tq_scheduler);
+			MOD_INC_USE_COUNT;
+			if (schedule_task(&priv->i2o_batch_send_task) == 0)
+				MOD_DEC_USE_COUNT;
 		}
 	} else {  /* Add new SGL element to the previous message frame */
 
@@ -986,7 +991,9 @@
 
 		if ((priv->tx_batch_mode & 0x01) && !priv->send_active) {
 			priv->send_active = 1;
-			queue_task(&priv->i2o_batch_send_task, &tq_scheduler);
+			MOD_INC_USE_COUNT;
+			if (schedule_task(&priv->i2o_batch_send_task) == 0)
+				MOD_DEC_USE_COUNT;
 		}
 	} else {  /* Add new SGL element to the previous message frame */
 
@@ -1396,7 +1403,7 @@
 	atomic_set(&priv->tx_out, 0);
 	priv->tx_count = 0;
 
-	priv->i2o_batch_send_task.next    = NULL;
+	INIT_LIST_HEAD(&priv->i2o_batch_send_task.list);
 	priv->i2o_batch_send_task.sync    = 0;
 	priv->i2o_batch_send_task.routine = (void *)i2o_lan_batch_send;
 	priv->i2o_batch_send_task.data    = (void *)dev;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)