Commit 73eef4cd authored by Michael Chan's avatar Michael Chan Committed by David S. Miller

[BNX2]: update version and minor fixes

Update version and add 4 minor fixes, the last 2 were suggested by
Jeff Garzik:

1. check for a valid ethernet address before setting it
2. zero out bp->regview if init_one encounters an error and unmaps
   the IO address. This prevents remove_one from unmapping again.
3. use netif_rx_schedule() instead of hand coding the same.
4. use IRQ_HANDLED and IRQ_NONE.
Signed-off-by: default avatarMichael Chan <mchan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c770a65c
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
#define DRV_MODULE_NAME "bnx2" #define DRV_MODULE_NAME "bnx2"
#define PFX DRV_MODULE_NAME ": " #define PFX DRV_MODULE_NAME ": "
#define DRV_MODULE_VERSION "1.2.19" #define DRV_MODULE_VERSION "1.2.20"
#define DRV_MODULE_RELDATE "May 23, 2005" #define DRV_MODULE_RELDATE "August 22, 2005"
#define RUN_AT(x) (jiffies + (x)) #define RUN_AT(x) (jiffies + (x))
...@@ -1538,15 +1538,12 @@ bnx2_msi(int irq, void *dev_instance, struct pt_regs *regs) ...@@ -1538,15 +1538,12 @@ bnx2_msi(int irq, void *dev_instance, struct pt_regs *regs)
BNX2_PCICFG_INT_ACK_CMD_MASK_INT); BNX2_PCICFG_INT_ACK_CMD_MASK_INT);
/* Return here if interrupt is disabled. */ /* Return here if interrupt is disabled. */
if (unlikely(atomic_read(&bp->intr_sem) != 0)) { if (unlikely(atomic_read(&bp->intr_sem) != 0))
return IRQ_RETVAL(1); return IRQ_HANDLED;
}
if (netif_rx_schedule_prep(dev)) { netif_rx_schedule(dev);
__netif_rx_schedule(dev);
}
return IRQ_RETVAL(1); return IRQ_HANDLED;
} }
static irqreturn_t static irqreturn_t
...@@ -1564,22 +1561,19 @@ bnx2_interrupt(int irq, void *dev_instance, struct pt_regs *regs) ...@@ -1564,22 +1561,19 @@ bnx2_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
if ((bp->status_blk->status_idx == bp->last_status_idx) || if ((bp->status_blk->status_idx == bp->last_status_idx) ||
(REG_RD(bp, BNX2_PCICFG_MISC_STATUS) & (REG_RD(bp, BNX2_PCICFG_MISC_STATUS) &
BNX2_PCICFG_MISC_STATUS_INTA_VALUE)) BNX2_PCICFG_MISC_STATUS_INTA_VALUE))
return IRQ_RETVAL(0); return IRQ_NONE;
REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD, REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD,
BNX2_PCICFG_INT_ACK_CMD_USE_INT_HC_PARAM | BNX2_PCICFG_INT_ACK_CMD_USE_INT_HC_PARAM |
BNX2_PCICFG_INT_ACK_CMD_MASK_INT); BNX2_PCICFG_INT_ACK_CMD_MASK_INT);
/* Return here if interrupt is shared and is disabled. */ /* Return here if interrupt is shared and is disabled. */
if (unlikely(atomic_read(&bp->intr_sem) != 0)) { if (unlikely(atomic_read(&bp->intr_sem) != 0))
return IRQ_RETVAL(1); return IRQ_HANDLED;
}
if (netif_rx_schedule_prep(dev)) { netif_rx_schedule(dev);
__netif_rx_schedule(dev);
}
return IRQ_RETVAL(1); return IRQ_HANDLED;
} }
static int static int
...@@ -5071,6 +5065,9 @@ bnx2_change_mac_addr(struct net_device *dev, void *p) ...@@ -5071,6 +5065,9 @@ bnx2_change_mac_addr(struct net_device *dev, void *p)
struct sockaddr *addr = p; struct sockaddr *addr = p;
struct bnx2 *bp = dev->priv; struct bnx2 *bp = dev->priv;
if (!is_valid_ether_addr(addr->sa_data))
return -EINVAL;
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len); memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
if (netif_running(dev)) if (netif_running(dev))
bnx2_set_mac_addr(bp); bnx2_set_mac_addr(bp);
...@@ -5369,6 +5366,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) ...@@ -5369,6 +5366,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
err_out_unmap: err_out_unmap:
if (bp->regview) { if (bp->regview) {
iounmap(bp->regview); iounmap(bp->regview);
bp->regview = NULL;
} }
err_out_release: err_out_release:
......
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