patch-2.4.0-test11 linux/drivers/net/smc9194.c

Next file: linux/drivers/net/stnic.c
Previous file: linux/drivers/net/smc-ultra32.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test10/linux/drivers/net/smc9194.c linux/drivers/net/smc9194.c
@@ -200,13 +200,6 @@
 static void smc_timeout(struct net_device *dev);
 
 /*
- . This is called by the kernel to send a packet out into the net.  it's
- . responsible for doing a best-effort send, but if it's simply not possible
- . to send it, the packet gets dropped.
-*/
-static int smc_send_packet(struct sk_buff *skb, struct net_device *dev);
-
-/*
  . This is called by the kernel in response to 'ifconfig ethX down'.  It
  . is responsible for cleaning up everything that the open routine
  . does, and maybe putting the card into a powerdown state.
@@ -512,6 +505,10 @@
 	unsigned short 		numPages;
 	word			time_out;
 
+	netif_stop_queue(dev);
+	/* Well, I want to send the packet.. but I don't know
+	   if I can send it right now...  */
+
 	if ( lp->saved_skb) {
 		/* THIS SHOULD NEVER HAPPEN. */
 		lp->stats.tx_aborted_errors++;
@@ -626,7 +623,7 @@
 	if ( packet_no & 0x80 ) {
 		/* or isn't there?  BAD CHIP! */
 		printk(KERN_DEBUG CARDNAME": Memory allocation failed. \n");
-		kfree_skb(skb);
+		dev_kfree_skb(skb);
 		lp->saved_skb = NULL;
 		netif_wake_queue(dev);
 		return;
@@ -761,6 +758,7 @@
 int __init smc_findirq( int ioaddr )
 {
 	int	timeout = 20;
+	unsigned long cookie;
 
 
 	/* I have to do a STI() here, because this is called from
@@ -768,7 +766,7 @@
 	   rather difficult to get interrupts for auto detection */
 	sti();
 
-	autoirq_setup( 0 );
+	cookie = probe_irq_on();
 
 	/*
 	 * What I try to do here is trigger an ALLOC_INT. This is done
@@ -821,7 +819,7 @@
 	cli();
 
 	/* and return what I found */
-	return autoirq_report( 0 );
+	return probe_irq_off(cookie);
 }
 
 /*----------------------------------------------------------------------
@@ -922,13 +920,6 @@
 
 	int   irqval;
 
-	/* see if I need to initialize the ethernet card structure */
-	if (dev == NULL) {
-		dev = init_etherdev(0, 0);
-		if (dev == NULL)
-			return -ENOMEM;
-	}
-
 	if (version_printed++ == 0)
 		printk("%s", version);
 
@@ -1060,7 +1051,7 @@
 
 	dev->open		        = smc_open;
 	dev->stop		        = smc_close;
-	dev->hard_start_xmit    	= smc_send_packet;
+	dev->hard_start_xmit    	= smc_wait_to_send_packet;
 	dev->tx_timeout		    	= smc_timeout;
 	dev->watchdog_timeo		= HZ/20;
 	dev->get_stats			= smc_query_statistics;
@@ -1181,14 +1172,6 @@
 	netif_wake_queue(dev);
 }
 
-static int smc_send_packet(struct sk_buff *skb, struct net_device *dev)
-{
-	netif_stop_queue(dev);
-	/* Well, I want to send the packet.. but I don't know
-	   if I can send it right now...  */
-	return smc_wait_to_send_packet( skb, dev );
-}
-
 /*--------------------------------------------------------------------
  .
  . This is the main routine of the driver, to handle the device when
@@ -1594,15 +1577,11 @@
 
 #ifdef MODULE
 
-static struct net_device devSMC9194 = {
-	"", /* device name is inserted by linux/drivers/net/net_init.c */
-	0, 0, 0, 0,
-	0, 0,  /* I/O address, IRQ */
-	0, 0, 0, NULL, smc_init };
-
-int io = 0;
-int irq = 0;
-int ifport = 0;
+static struct net_device devSMC9194 = { init: smc_init };
+
+static int io;
+static int irq;
+static int ifport;
 
 MODULE_PARM(io, "i");
 MODULE_PARM(irq, "i");

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