patch-2.4.3 linux/drivers/net/eql.c

Next file: linux/drivers/net/eth16i.c
Previous file: linux/drivers/net/epic100.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.2/linux/drivers/net/eql.c linux/drivers/net/eql.c
@@ -197,7 +197,7 @@
 
 static int __init eql_init(struct net_device *dev)
 {
-	static unsigned version_printed = 0;
+	static unsigned version_printed;
 	/* static unsigned num_masters     = 0; */
 	equalizer_t *eql = 0;
 
@@ -721,6 +721,9 @@
 
 static int eql_insert_slave(slave_queue_t *queue, slave_t *slave)
 {
+	unsigned long flags;
+
+	save_flags(flags);
 	cli ();
 
 	if ( ! eql_is_full (queue) )
@@ -736,10 +739,10 @@
 		slave->next = queue->head->next;
 		queue->head->next = slave;
 		queue->num_slaves++;
-		sti ();
+		restore_flags(flags);
 		return 0;
 	}
-	sti ();
+	restore_flags(flags);
 	return 1;
 }
 
@@ -748,7 +751,9 @@
 {
 	slave_t *prev;
 	slave_t *curr;
+	unsigned long flags;
 
+	save_flags(flags);
 	cli ();
 
 	prev = queue->head;
@@ -766,10 +771,10 @@
 		prev->next = curr->next;
 		queue->num_slaves--;
 		curr->dev->flags = curr->dev->flags & ~IFF_SLAVE;
-		sti();
+		restore_flags(flags);
 		return curr;
 	}
-	sti ();
+	restore_flags(flags);
 	return 0;			/* not found */
 }
 
@@ -784,6 +789,9 @@
 
 	if (target != 0)
 	{
+		unsigned long flags;
+
+		save_flags(flags);
 		cli ();
 		prev = queue->head;
 		curr = prev->next;
@@ -794,7 +802,7 @@
 		}
 		prev->next = curr->next;
 		queue->num_slaves--;
-		sti ();
+		restore_flags(flags);
 		eql_delete_slave (curr);
 		return 0;
 	}
@@ -847,8 +855,10 @@
 		 */
 		unsigned long best_load = (unsigned long) ULONG_MAX;
 		slave_t *slave = 0;
+		unsigned long flags;
 		int i;
 
+		save_flags(flags);
 		cli ();
 		for (i = 1, slave = eql_first_slave (queue);
 			i <= eql_number_slaves (queue);
@@ -895,7 +905,7 @@
 				}
 			}
 		} /* for */
-		sti ();
+		restore_flags(flags);
 		eql_set_best_slave (queue, best_slave);
 	} /* else */
 	if (slave_corpse != 0)
@@ -948,9 +958,11 @@
 	slave_t *slave;
 	slave_t *slave_corpse = 0;
 	int i;
+	unsigned long flags;
 	
 	if ( ! eql_is_empty (eql->queue) )
 	{
+		save_flags(flags);
 		cli ();
 		for (i = 1, slave = eql_first_slave (eql->queue);
 			i <= eql_number_slaves (eql->queue);
@@ -968,7 +980,7 @@
 					slave_corpse = slave;
 			}
 		}
-		sti ();
+		restore_flags(flags);
 		if (slave_corpse != 0)
 		{
 			printk ("eql: timer found dead slave, burying...\n");

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