Skip to content

Commit 73eef4c

Browse files
Michael ChanDavid S. Miller
authored andcommitted
[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: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent c770a65 commit 73eef4c

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed

drivers/net/bnx2.c

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
#define DRV_MODULE_NAME "bnx2"
1616
#define PFX DRV_MODULE_NAME ": "
17-
#define DRV_MODULE_VERSION "1.2.19"
18-
#define DRV_MODULE_RELDATE "May 23, 2005"
17+
#define DRV_MODULE_VERSION "1.2.20"
18+
#define DRV_MODULE_RELDATE "August 22, 2005"
1919

2020
#define RUN_AT(x) (jiffies + (x))
2121

@@ -1538,15 +1538,12 @@ bnx2_msi(int irq, void *dev_instance, struct pt_regs *regs)
15381538
BNX2_PCICFG_INT_ACK_CMD_MASK_INT);
15391539

15401540
/* Return here if interrupt is disabled. */
1541-
if (unlikely(atomic_read(&bp->intr_sem) != 0)) {
1542-
return IRQ_RETVAL(1);
1543-
}
1541+
if (unlikely(atomic_read(&bp->intr_sem) != 0))
1542+
return IRQ_HANDLED;
15441543

1545-
if (netif_rx_schedule_prep(dev)) {
1546-
__netif_rx_schedule(dev);
1547-
}
1544+
netif_rx_schedule(dev);
15481545

1549-
return IRQ_RETVAL(1);
1546+
return IRQ_HANDLED;
15501547
}
15511548

15521549
static irqreturn_t
@@ -1564,22 +1561,19 @@ bnx2_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
15641561
if ((bp->status_blk->status_idx == bp->last_status_idx) ||
15651562
(REG_RD(bp, BNX2_PCICFG_MISC_STATUS) &
15661563
BNX2_PCICFG_MISC_STATUS_INTA_VALUE))
1567-
return IRQ_RETVAL(0);
1564+
return IRQ_NONE;
15681565

15691566
REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD,
15701567
BNX2_PCICFG_INT_ACK_CMD_USE_INT_HC_PARAM |
15711568
BNX2_PCICFG_INT_ACK_CMD_MASK_INT);
15721569

15731570
/* Return here if interrupt is shared and is disabled. */
1574-
if (unlikely(atomic_read(&bp->intr_sem) != 0)) {
1575-
return IRQ_RETVAL(1);
1576-
}
1571+
if (unlikely(atomic_read(&bp->intr_sem) != 0))
1572+
return IRQ_HANDLED;
15771573

1578-
if (netif_rx_schedule_prep(dev)) {
1579-
__netif_rx_schedule(dev);
1580-
}
1574+
netif_rx_schedule(dev);
15811575

1582-
return IRQ_RETVAL(1);
1576+
return IRQ_HANDLED;
15831577
}
15841578

15851579
static int
@@ -5071,6 +5065,9 @@ bnx2_change_mac_addr(struct net_device *dev, void *p)
50715065
struct sockaddr *addr = p;
50725066
struct bnx2 *bp = dev->priv;
50735067

5068+
if (!is_valid_ether_addr(addr->sa_data))
5069+
return -EINVAL;
5070+
50745071
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
50755072
if (netif_running(dev))
50765073
bnx2_set_mac_addr(bp);
@@ -5369,6 +5366,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
53695366
err_out_unmap:
53705367
if (bp->regview) {
53715368
iounmap(bp->regview);
5369+
bp->regview = NULL;
53725370
}
53735371

53745372
err_out_release:

0 commit comments

Comments
 (0)