Commit 82cdb027 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] smc91x: cosmetics

From: Nicolas Pitre <nico@cam.org>

Update version string, some coments, rename a variable, etc.  Nothing really
worrying...
Signed-off-by: default avatarNicolas Pitre <nico@cam.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
parent 585aaa59
...@@ -55,9 +55,10 @@ ...@@ -55,9 +55,10 @@
* smc_phy_configure * smc_phy_configure
* - clean up (and fix stack overrun) in PHY * - clean up (and fix stack overrun) in PHY
* MII read/write functions * MII read/write functions
* 22/09/04 Nicolas Pitre big update (see commit log for details)
*/ */
static const char version[] = static const char version[] =
"smc91x.c: v1.0, mar 07 2003 by Nicolas Pitre <nico@cam.org>\n"; "smc91x.c: v1.1, sep 22 2004 by Nicolas Pitre <nico@cam.org>\n";
/* Debugging level */ /* Debugging level */
#ifndef SMC_DEBUG #ifndef SMC_DEBUG
...@@ -175,7 +176,7 @@ struct smc_local { ...@@ -175,7 +176,7 @@ struct smc_local {
* packet, I will store the skbuff here, until I get the * packet, I will store the skbuff here, until I get the
* desired memory. Then, I'll send it out and free it. * desired memory. Then, I'll send it out and free it.
*/ */
struct sk_buff *saved_skb; struct sk_buff *pending_tx_skb;
struct tasklet_struct tx_task; struct tasklet_struct tx_task;
/* /*
...@@ -382,9 +383,9 @@ static void smc_reset(struct net_device *dev) ...@@ -382,9 +383,9 @@ static void smc_reset(struct net_device *dev)
SMC_WAIT_MMU_BUSY(); SMC_WAIT_MMU_BUSY();
/* clear anything saved */ /* clear anything saved */
if (lp->saved_skb != NULL) { if (lp->pending_tx_skb != NULL) {
dev_kfree_skb (lp->saved_skb); dev_kfree_skb (lp->pending_tx_skb);
lp->saved_skb = NULL; lp->pending_tx_skb = NULL;
lp->stats.tx_errors++; lp->stats.tx_errors++;
lp->stats.tx_aborted_errors++; lp->stats.tx_aborted_errors++;
} }
...@@ -573,14 +574,13 @@ static inline void smc_rcv(struct net_device *dev) ...@@ -573,14 +574,13 @@ static inline void smc_rcv(struct net_device *dev)
/* /*
* This is called to actually send a packet to the chip. * This is called to actually send a packet to the chip.
* Returns non-zero when successful.
*/ */
static void smc_hardware_send_pkt(unsigned long data) static void smc_hardware_send_pkt(unsigned long data)
{ {
struct net_device *dev = (struct net_device *)data; struct net_device *dev = (struct net_device *)data;
struct smc_local *lp = netdev_priv(dev); struct smc_local *lp = netdev_priv(dev);
unsigned long ioaddr = dev->base_addr; unsigned long ioaddr = dev->base_addr;
struct sk_buff *skb = lp->saved_skb; struct sk_buff *skb = lp->pending_tx_skb;
unsigned int packet_no, len; unsigned int packet_no, len;
unsigned char *buf; unsigned char *buf;
...@@ -591,7 +591,7 @@ static void smc_hardware_send_pkt(unsigned long data) ...@@ -591,7 +591,7 @@ static void smc_hardware_send_pkt(unsigned long data)
return; return;
} }
lp->saved_skb = NULL; lp->pending_tx_skb = NULL;
packet_no = SMC_GET_AR(); packet_no = SMC_GET_AR();
if (unlikely(packet_no & AR_FAILED)) { if (unlikely(packet_no & AR_FAILED)) {
printk("%s: Memory allocation failed.\n", dev->name); printk("%s: Memory allocation failed.\n", dev->name);
...@@ -665,8 +665,8 @@ static int smc_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -665,8 +665,8 @@ static int smc_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
DBG(3, "%s: %s\n", dev->name, __FUNCTION__); DBG(3, "%s: %s\n", dev->name, __FUNCTION__);
BUG_ON(lp->saved_skb != NULL); BUG_ON(lp->pending_tx_skb != NULL);
lp->saved_skb = skb; lp->pending_tx_skb = skb;
/* /*
* The MMU wants the number of pages to be the number of 256 bytes * The MMU wants the number of pages to be the number of 256 bytes
...@@ -682,7 +682,7 @@ static int smc_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -682,7 +682,7 @@ static int smc_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
numPages = ((skb->len & ~1) + (6 - 1)) >> 8; numPages = ((skb->len & ~1) + (6 - 1)) >> 8;
if (unlikely(numPages > 7)) { if (unlikely(numPages > 7)) {
printk("%s: Far too big packet error.\n", dev->name); printk("%s: Far too big packet error.\n", dev->name);
lp->saved_skb = NULL; lp->pending_tx_skb = NULL;
lp->stats.tx_errors++; lp->stats.tx_errors++;
lp->stats.tx_dropped++; lp->stats.tx_dropped++;
dev_kfree_skb(skb); dev_kfree_skb(skb);
...@@ -1524,9 +1524,9 @@ static int smc_close(struct net_device *dev) ...@@ -1524,9 +1524,9 @@ static int smc_close(struct net_device *dev)
smc_phy_powerdown(dev, lp->mii.phy_id); smc_phy_powerdown(dev, lp->mii.phy_id);
} }
if (lp->saved_skb) { if (lp->pending_tx_skb) {
dev_kfree_skb(lp->saved_skb); dev_kfree_skb(lp->pending_tx_skb);
lp->saved_skb = NULL; lp->pending_tx_skb = NULL;
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment