diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-24 13:15:13 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-24 13:15:13 -0400 |
commit | a319a2773a13bab56a0d0b3744ba8703324313b5 (patch) | |
tree | f02c86acabd1031439fd422a167784007e84ebb1 /drivers/net/bnx2.c | |
parent | e18fa700c9a31360bc8f193aa543b7ef7b39a06b (diff) | |
parent | 183798799216fad36c7219fe8d4d6dee6b8fa755 (diff) |
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6: (217 commits)
net/ieee80211: fix more crypto-related build breakage
[PATCH] Spidernet: add ethtool -S (show statistics)
[NET] GT96100: Delete bitrotting ethernet driver
[PATCH] mv643xx_eth: restrict to 32-bit PPC_MULTIPLATFORM
[PATCH] Cirrus Logic ep93xx ethernet driver
r8169: the MMIO region of the 8167 stands behin BAR#1
e1000, ixgb: Remove pointless wrappers
[PATCH] Remove powerpc specific parts of 3c509 driver
[PATCH] s2io: Switch to pci_get_device
[PATCH] gt96100: move to pci_get_device API
[PATCH] ehea: bugfix for register access functions
[PATCH] e1000 disable device on PCI error
drivers/net/phy/fixed: #if 0 some incomplete code
drivers/net: const-ify ethtool_ops declarations
[PATCH] ethtool: allow const ethtool_ops
[PATCH] sky2: big endian
[PATCH] sky2: fiber support
[PATCH] sky2: tx pause bug fix
drivers/net: Trim trailing whitespace
[PATCH] ehea: IBM eHEA Ethernet Device Driver
...
Manually resolved conflicts in drivers/net/ixgb/ixgb_main.c and
drivers/net/sky2.c related to CHECKSUM_HW/CHECKSUM_PARTIAL changes by
commit 84fa7933a33f806bbbaae6775e87459b1ec584c0 that just happened to be
next to unrelated changes in this update.
Diffstat (limited to 'drivers/net/bnx2.c')
-rw-r--r-- | drivers/net/bnx2.c | 166 |
1 files changed, 83 insertions, 83 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 7857b4630124..7fcf015021ec 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -148,7 +148,7 @@ static struct flash_spec flash_table[] = | |||
148 | SAIFUN_FLASH_BYTE_ADDR_MASK, 0, | 148 | SAIFUN_FLASH_BYTE_ADDR_MASK, 0, |
149 | "Entry 0100"}, | 149 | "Entry 0100"}, |
150 | /* Entry 0101: ST M45PE10 (non-buffered flash, TetonII B0) */ | 150 | /* Entry 0101: ST M45PE10 (non-buffered flash, TetonII B0) */ |
151 | {0x19000002, 0x5b808201, 0x000500db, 0x03840253, 0xaf020406, | 151 | {0x19000002, 0x5b808201, 0x000500db, 0x03840253, 0xaf020406, |
152 | 0, ST_MICRO_FLASH_PAGE_BITS, ST_MICRO_FLASH_PAGE_SIZE, | 152 | 0, ST_MICRO_FLASH_PAGE_BITS, ST_MICRO_FLASH_PAGE_SIZE, |
153 | ST_MICRO_FLASH_BYTE_ADDR_MASK, ST_MICRO_FLASH_BASE_TOTAL_SIZE*2, | 153 | ST_MICRO_FLASH_BYTE_ADDR_MASK, ST_MICRO_FLASH_BASE_TOTAL_SIZE*2, |
154 | "Entry 0101: ST M45PE10 (128kB non-bufferred)"}, | 154 | "Entry 0101: ST M45PE10 (128kB non-bufferred)"}, |
@@ -317,7 +317,7 @@ bnx2_write_phy(struct bnx2 *bp, u32 reg, u32 val) | |||
317 | BNX2_EMAC_MDIO_COMM_COMMAND_WRITE | | 317 | BNX2_EMAC_MDIO_COMM_COMMAND_WRITE | |
318 | BNX2_EMAC_MDIO_COMM_START_BUSY | BNX2_EMAC_MDIO_COMM_DISEXT; | 318 | BNX2_EMAC_MDIO_COMM_START_BUSY | BNX2_EMAC_MDIO_COMM_DISEXT; |
319 | REG_WR(bp, BNX2_EMAC_MDIO_COMM, val1); | 319 | REG_WR(bp, BNX2_EMAC_MDIO_COMM, val1); |
320 | 320 | ||
321 | for (i = 0; i < 50; i++) { | 321 | for (i = 0; i < 50; i++) { |
322 | udelay(10); | 322 | udelay(10); |
323 | 323 | ||
@@ -585,7 +585,7 @@ bnx2_resolve_flow_ctrl(struct bnx2 *bp) | |||
585 | u32 local_adv, remote_adv; | 585 | u32 local_adv, remote_adv; |
586 | 586 | ||
587 | bp->flow_ctrl = 0; | 587 | bp->flow_ctrl = 0; |
588 | if ((bp->autoneg & (AUTONEG_SPEED | AUTONEG_FLOW_CTRL)) != | 588 | if ((bp->autoneg & (AUTONEG_SPEED | AUTONEG_FLOW_CTRL)) != |
589 | (AUTONEG_SPEED | AUTONEG_FLOW_CTRL)) { | 589 | (AUTONEG_SPEED | AUTONEG_FLOW_CTRL)) { |
590 | 590 | ||
591 | if (bp->duplex == DUPLEX_FULL) { | 591 | if (bp->duplex == DUPLEX_FULL) { |
@@ -1087,7 +1087,7 @@ bnx2_setup_serdes_phy(struct bnx2 *bp) | |||
1087 | 1087 | ||
1088 | #define PHY_ALL_10_100_SPEED (ADVERTISE_10HALF | ADVERTISE_10FULL | \ | 1088 | #define PHY_ALL_10_100_SPEED (ADVERTISE_10HALF | ADVERTISE_10FULL | \ |
1089 | ADVERTISE_100HALF | ADVERTISE_100FULL | ADVERTISE_CSMA) | 1089 | ADVERTISE_100HALF | ADVERTISE_100FULL | ADVERTISE_CSMA) |
1090 | 1090 | ||
1091 | #define PHY_ALL_1000_SPEED (ADVERTISE_1000HALF | ADVERTISE_1000FULL) | 1091 | #define PHY_ALL_1000_SPEED (ADVERTISE_1000HALF | ADVERTISE_1000FULL) |
1092 | 1092 | ||
1093 | static int | 1093 | static int |
@@ -1120,7 +1120,7 @@ bnx2_setup_copper_phy(struct bnx2 *bp) | |||
1120 | new_adv_reg |= ADVERTISE_100FULL; | 1120 | new_adv_reg |= ADVERTISE_100FULL; |
1121 | if (bp->advertising & ADVERTISED_1000baseT_Full) | 1121 | if (bp->advertising & ADVERTISED_1000baseT_Full) |
1122 | new_adv1000_reg |= ADVERTISE_1000FULL; | 1122 | new_adv1000_reg |= ADVERTISE_1000FULL; |
1123 | 1123 | ||
1124 | new_adv_reg |= ADVERTISE_CSMA; | 1124 | new_adv_reg |= ADVERTISE_CSMA; |
1125 | 1125 | ||
1126 | new_adv_reg |= bnx2_phy_get_pause_adv(bp); | 1126 | new_adv_reg |= bnx2_phy_get_pause_adv(bp); |
@@ -1157,7 +1157,7 @@ bnx2_setup_copper_phy(struct bnx2 *bp) | |||
1157 | 1157 | ||
1158 | bnx2_read_phy(bp, MII_BMSR, &bmsr); | 1158 | bnx2_read_phy(bp, MII_BMSR, &bmsr); |
1159 | bnx2_read_phy(bp, MII_BMSR, &bmsr); | 1159 | bnx2_read_phy(bp, MII_BMSR, &bmsr); |
1160 | 1160 | ||
1161 | if (bmsr & BMSR_LSTATUS) { | 1161 | if (bmsr & BMSR_LSTATUS) { |
1162 | /* Force link down */ | 1162 | /* Force link down */ |
1163 | bnx2_write_phy(bp, MII_BMCR, BMCR_LOOPBACK); | 1163 | bnx2_write_phy(bp, MII_BMCR, BMCR_LOOPBACK); |
@@ -1547,7 +1547,7 @@ bnx2_alloc_bad_rbuf(struct bnx2 *bp) | |||
1547 | } | 1547 | } |
1548 | 1548 | ||
1549 | static void | 1549 | static void |
1550 | bnx2_set_mac_addr(struct bnx2 *bp) | 1550 | bnx2_set_mac_addr(struct bnx2 *bp) |
1551 | { | 1551 | { |
1552 | u32 val; | 1552 | u32 val; |
1553 | u8 *mac_addr = bp->dev->dev_addr; | 1553 | u8 *mac_addr = bp->dev->dev_addr; |
@@ -1556,7 +1556,7 @@ bnx2_set_mac_addr(struct bnx2 *bp) | |||
1556 | 1556 | ||
1557 | REG_WR(bp, BNX2_EMAC_MAC_MATCH0, val); | 1557 | REG_WR(bp, BNX2_EMAC_MAC_MATCH0, val); |
1558 | 1558 | ||
1559 | val = (mac_addr[2] << 24) | (mac_addr[3] << 16) | | 1559 | val = (mac_addr[2] << 24) | (mac_addr[3] << 16) | |
1560 | (mac_addr[4] << 8) | mac_addr[5]; | 1560 | (mac_addr[4] << 8) | mac_addr[5]; |
1561 | 1561 | ||
1562 | REG_WR(bp, BNX2_EMAC_MAC_MATCH1, val); | 1562 | REG_WR(bp, BNX2_EMAC_MAC_MATCH1, val); |
@@ -1638,7 +1638,7 @@ bnx2_tx_int(struct bnx2 *bp) | |||
1638 | 1638 | ||
1639 | tx_buf = &bp->tx_buf_ring[sw_ring_cons]; | 1639 | tx_buf = &bp->tx_buf_ring[sw_ring_cons]; |
1640 | skb = tx_buf->skb; | 1640 | skb = tx_buf->skb; |
1641 | #ifdef BCM_TSO | 1641 | #ifdef BCM_TSO |
1642 | /* partial BD completions possible with TSO packets */ | 1642 | /* partial BD completions possible with TSO packets */ |
1643 | if (skb_is_gso(skb)) { | 1643 | if (skb_is_gso(skb)) { |
1644 | u16 last_idx, last_ring_idx; | 1644 | u16 last_idx, last_ring_idx; |
@@ -1984,12 +1984,12 @@ bnx2_poll(struct net_device *dev, int *budget) | |||
1984 | 1984 | ||
1985 | if (orig_budget > dev->quota) | 1985 | if (orig_budget > dev->quota) |
1986 | orig_budget = dev->quota; | 1986 | orig_budget = dev->quota; |
1987 | 1987 | ||
1988 | work_done = bnx2_rx_int(bp, orig_budget); | 1988 | work_done = bnx2_rx_int(bp, orig_budget); |
1989 | *budget -= work_done; | 1989 | *budget -= work_done; |
1990 | dev->quota -= work_done; | 1990 | dev->quota -= work_done; |
1991 | } | 1991 | } |
1992 | 1992 | ||
1993 | bp->last_status_idx = bp->status_blk->status_idx; | 1993 | bp->last_status_idx = bp->status_blk->status_idx; |
1994 | rmb(); | 1994 | rmb(); |
1995 | 1995 | ||
@@ -2322,7 +2322,7 @@ bnx2_init_cpus(struct bnx2 *bp) | |||
2322 | cpu_reg.bp = BNX2_RXP_CPU_HW_BREAKPOINT; | 2322 | cpu_reg.bp = BNX2_RXP_CPU_HW_BREAKPOINT; |
2323 | cpu_reg.spad_base = BNX2_RXP_SCRATCH; | 2323 | cpu_reg.spad_base = BNX2_RXP_SCRATCH; |
2324 | cpu_reg.mips_view_base = 0x8000000; | 2324 | cpu_reg.mips_view_base = 0x8000000; |
2325 | 2325 | ||
2326 | fw.ver_major = bnx2_RXP_b06FwReleaseMajor; | 2326 | fw.ver_major = bnx2_RXP_b06FwReleaseMajor; |
2327 | fw.ver_minor = bnx2_RXP_b06FwReleaseMinor; | 2327 | fw.ver_minor = bnx2_RXP_b06FwReleaseMinor; |
2328 | fw.ver_fix = bnx2_RXP_b06FwReleaseFix; | 2328 | fw.ver_fix = bnx2_RXP_b06FwReleaseFix; |
@@ -2374,7 +2374,7 @@ bnx2_init_cpus(struct bnx2 *bp) | |||
2374 | cpu_reg.bp = BNX2_TXP_CPU_HW_BREAKPOINT; | 2374 | cpu_reg.bp = BNX2_TXP_CPU_HW_BREAKPOINT; |
2375 | cpu_reg.spad_base = BNX2_TXP_SCRATCH; | 2375 | cpu_reg.spad_base = BNX2_TXP_SCRATCH; |
2376 | cpu_reg.mips_view_base = 0x8000000; | 2376 | cpu_reg.mips_view_base = 0x8000000; |
2377 | 2377 | ||
2378 | fw.ver_major = bnx2_TXP_b06FwReleaseMajor; | 2378 | fw.ver_major = bnx2_TXP_b06FwReleaseMajor; |
2379 | fw.ver_minor = bnx2_TXP_b06FwReleaseMinor; | 2379 | fw.ver_minor = bnx2_TXP_b06FwReleaseMinor; |
2380 | fw.ver_fix = bnx2_TXP_b06FwReleaseFix; | 2380 | fw.ver_fix = bnx2_TXP_b06FwReleaseFix; |
@@ -2426,7 +2426,7 @@ bnx2_init_cpus(struct bnx2 *bp) | |||
2426 | cpu_reg.bp = BNX2_TPAT_CPU_HW_BREAKPOINT; | 2426 | cpu_reg.bp = BNX2_TPAT_CPU_HW_BREAKPOINT; |
2427 | cpu_reg.spad_base = BNX2_TPAT_SCRATCH; | 2427 | cpu_reg.spad_base = BNX2_TPAT_SCRATCH; |
2428 | cpu_reg.mips_view_base = 0x8000000; | 2428 | cpu_reg.mips_view_base = 0x8000000; |
2429 | 2429 | ||
2430 | fw.ver_major = bnx2_TPAT_b06FwReleaseMajor; | 2430 | fw.ver_major = bnx2_TPAT_b06FwReleaseMajor; |
2431 | fw.ver_minor = bnx2_TPAT_b06FwReleaseMinor; | 2431 | fw.ver_minor = bnx2_TPAT_b06FwReleaseMinor; |
2432 | fw.ver_fix = bnx2_TPAT_b06FwReleaseFix; | 2432 | fw.ver_fix = bnx2_TPAT_b06FwReleaseFix; |
@@ -2478,7 +2478,7 @@ bnx2_init_cpus(struct bnx2 *bp) | |||
2478 | cpu_reg.bp = BNX2_COM_CPU_HW_BREAKPOINT; | 2478 | cpu_reg.bp = BNX2_COM_CPU_HW_BREAKPOINT; |
2479 | cpu_reg.spad_base = BNX2_COM_SCRATCH; | 2479 | cpu_reg.spad_base = BNX2_COM_SCRATCH; |
2480 | cpu_reg.mips_view_base = 0x8000000; | 2480 | cpu_reg.mips_view_base = 0x8000000; |
2481 | 2481 | ||
2482 | fw.ver_major = bnx2_COM_b06FwReleaseMajor; | 2482 | fw.ver_major = bnx2_COM_b06FwReleaseMajor; |
2483 | fw.ver_minor = bnx2_COM_b06FwReleaseMinor; | 2483 | fw.ver_minor = bnx2_COM_b06FwReleaseMinor; |
2484 | fw.ver_fix = bnx2_COM_b06FwReleaseFix; | 2484 | fw.ver_fix = bnx2_COM_b06FwReleaseFix; |
@@ -2741,7 +2741,7 @@ bnx2_enable_nvram_access(struct bnx2 *bp) | |||
2741 | 2741 | ||
2742 | val = REG_RD(bp, BNX2_NVM_ACCESS_ENABLE); | 2742 | val = REG_RD(bp, BNX2_NVM_ACCESS_ENABLE); |
2743 | /* Enable both bits, even on read. */ | 2743 | /* Enable both bits, even on read. */ |
2744 | REG_WR(bp, BNX2_NVM_ACCESS_ENABLE, | 2744 | REG_WR(bp, BNX2_NVM_ACCESS_ENABLE, |
2745 | val | BNX2_NVM_ACCESS_ENABLE_EN | BNX2_NVM_ACCESS_ENABLE_WR_EN); | 2745 | val | BNX2_NVM_ACCESS_ENABLE_EN | BNX2_NVM_ACCESS_ENABLE_WR_EN); |
2746 | } | 2746 | } |
2747 | 2747 | ||
@@ -2752,7 +2752,7 @@ bnx2_disable_nvram_access(struct bnx2 *bp) | |||
2752 | 2752 | ||
2753 | val = REG_RD(bp, BNX2_NVM_ACCESS_ENABLE); | 2753 | val = REG_RD(bp, BNX2_NVM_ACCESS_ENABLE); |
2754 | /* Disable both bits, even after read. */ | 2754 | /* Disable both bits, even after read. */ |
2755 | REG_WR(bp, BNX2_NVM_ACCESS_ENABLE, | 2755 | REG_WR(bp, BNX2_NVM_ACCESS_ENABLE, |
2756 | val & ~(BNX2_NVM_ACCESS_ENABLE_EN | | 2756 | val & ~(BNX2_NVM_ACCESS_ENABLE_EN | |
2757 | BNX2_NVM_ACCESS_ENABLE_WR_EN)); | 2757 | BNX2_NVM_ACCESS_ENABLE_WR_EN)); |
2758 | } | 2758 | } |
@@ -3143,7 +3143,7 @@ bnx2_nvram_write(struct bnx2 *bp, u32 offset, u8 *data_buf, | |||
3143 | /* Find the data_start addr */ | 3143 | /* Find the data_start addr */ |
3144 | data_start = (written == 0) ? offset32 : page_start; | 3144 | data_start = (written == 0) ? offset32 : page_start; |
3145 | /* Find the data_end addr */ | 3145 | /* Find the data_end addr */ |
3146 | data_end = (page_end > offset32 + len32) ? | 3146 | data_end = (page_end > offset32 + len32) ? |
3147 | (offset32 + len32) : page_end; | 3147 | (offset32 + len32) : page_end; |
3148 | 3148 | ||
3149 | /* Request access to the flash interface. */ | 3149 | /* Request access to the flash interface. */ |
@@ -3164,8 +3164,8 @@ bnx2_nvram_write(struct bnx2 *bp, u32 offset, u8 *data_buf, | |||
3164 | cmd_flags |= BNX2_NVM_COMMAND_LAST; | 3164 | cmd_flags |= BNX2_NVM_COMMAND_LAST; |
3165 | } | 3165 | } |
3166 | rc = bnx2_nvram_read_dword(bp, | 3166 | rc = bnx2_nvram_read_dword(bp, |
3167 | page_start + j, | 3167 | page_start + j, |
3168 | &flash_buffer[j], | 3168 | &flash_buffer[j], |
3169 | cmd_flags); | 3169 | cmd_flags); |
3170 | 3170 | ||
3171 | if (rc) | 3171 | if (rc) |
@@ -3192,7 +3192,7 @@ bnx2_nvram_write(struct bnx2 *bp, u32 offset, u8 *data_buf, | |||
3192 | if (bp->flash_info->buffered == 0) { | 3192 | if (bp->flash_info->buffered == 0) { |
3193 | for (addr = page_start; addr < data_start; | 3193 | for (addr = page_start; addr < data_start; |
3194 | addr += 4, i += 4) { | 3194 | addr += 4, i += 4) { |
3195 | 3195 | ||
3196 | rc = bnx2_nvram_write_dword(bp, addr, | 3196 | rc = bnx2_nvram_write_dword(bp, addr, |
3197 | &flash_buffer[i], cmd_flags); | 3197 | &flash_buffer[i], cmd_flags); |
3198 | 3198 | ||
@@ -3226,7 +3226,7 @@ bnx2_nvram_write(struct bnx2 *bp, u32 offset, u8 *data_buf, | |||
3226 | if (bp->flash_info->buffered == 0) { | 3226 | if (bp->flash_info->buffered == 0) { |
3227 | for (addr = data_end; addr < page_end; | 3227 | for (addr = data_end; addr < page_end; |
3228 | addr += 4, i += 4) { | 3228 | addr += 4, i += 4) { |
3229 | 3229 | ||
3230 | if (addr == page_end-4) { | 3230 | if (addr == page_end-4) { |
3231 | cmd_flags = BNX2_NVM_COMMAND_LAST; | 3231 | cmd_flags = BNX2_NVM_COMMAND_LAST; |
3232 | } | 3232 | } |
@@ -3351,9 +3351,9 @@ bnx2_init_chip(struct bnx2 *bp) | |||
3351 | val = BNX2_DMA_CONFIG_DATA_BYTE_SWAP | | 3351 | val = BNX2_DMA_CONFIG_DATA_BYTE_SWAP | |
3352 | BNX2_DMA_CONFIG_DATA_WORD_SWAP | | 3352 | BNX2_DMA_CONFIG_DATA_WORD_SWAP | |
3353 | #ifdef __BIG_ENDIAN | 3353 | #ifdef __BIG_ENDIAN |
3354 | BNX2_DMA_CONFIG_CNTL_BYTE_SWAP | | 3354 | BNX2_DMA_CONFIG_CNTL_BYTE_SWAP | |
3355 | #endif | 3355 | #endif |
3356 | BNX2_DMA_CONFIG_CNTL_WORD_SWAP | | 3356 | BNX2_DMA_CONFIG_CNTL_WORD_SWAP | |
3357 | DMA_READ_CHANS << 12 | | 3357 | DMA_READ_CHANS << 12 | |
3358 | DMA_WRITE_CHANS << 16; | 3358 | DMA_WRITE_CHANS << 16; |
3359 | 3359 | ||
@@ -3446,7 +3446,7 @@ bnx2_init_chip(struct bnx2 *bp) | |||
3446 | REG_WR(bp, BNX2_HC_STATISTICS_ADDR_H, | 3446 | REG_WR(bp, BNX2_HC_STATISTICS_ADDR_H, |
3447 | (u64) bp->stats_blk_mapping >> 32); | 3447 | (u64) bp->stats_blk_mapping >> 32); |
3448 | 3448 | ||
3449 | REG_WR(bp, BNX2_HC_TX_QUICK_CONS_TRIP, | 3449 | REG_WR(bp, BNX2_HC_TX_QUICK_CONS_TRIP, |
3450 | (bp->tx_quick_cons_trip_int << 16) | bp->tx_quick_cons_trip); | 3450 | (bp->tx_quick_cons_trip_int << 16) | bp->tx_quick_cons_trip); |
3451 | 3451 | ||
3452 | REG_WR(bp, BNX2_HC_RX_QUICK_CONS_TRIP, | 3452 | REG_WR(bp, BNX2_HC_RX_QUICK_CONS_TRIP, |
@@ -3511,7 +3511,7 @@ bnx2_init_tx_ring(struct bnx2 *bp) | |||
3511 | bp->tx_wake_thresh = bp->tx_ring_size / 2; | 3511 | bp->tx_wake_thresh = bp->tx_ring_size / 2; |
3512 | 3512 | ||
3513 | txbd = &bp->tx_desc_ring[MAX_TX_DESC_CNT]; | 3513 | txbd = &bp->tx_desc_ring[MAX_TX_DESC_CNT]; |
3514 | 3514 | ||
3515 | txbd->tx_bd_haddr_hi = (u64) bp->tx_desc_mapping >> 32; | 3515 | txbd->tx_bd_haddr_hi = (u64) bp->tx_desc_mapping >> 32; |
3516 | txbd->tx_bd_haddr_lo = (u64) bp->tx_desc_mapping & 0xffffffff; | 3516 | txbd->tx_bd_haddr_lo = (u64) bp->tx_desc_mapping & 0xffffffff; |
3517 | 3517 | ||
@@ -3519,7 +3519,7 @@ bnx2_init_tx_ring(struct bnx2 *bp) | |||
3519 | bp->tx_cons = 0; | 3519 | bp->tx_cons = 0; |
3520 | bp->hw_tx_cons = 0; | 3520 | bp->hw_tx_cons = 0; |
3521 | bp->tx_prod_bseq = 0; | 3521 | bp->tx_prod_bseq = 0; |
3522 | 3522 | ||
3523 | val = BNX2_L2CTX_TYPE_TYPE_L2; | 3523 | val = BNX2_L2CTX_TYPE_TYPE_L2; |
3524 | val |= BNX2_L2CTX_TYPE_SIZE_L2; | 3524 | val |= BNX2_L2CTX_TYPE_SIZE_L2; |
3525 | CTX_WR(bp, GET_CID_ADDR(TX_CID), BNX2_L2CTX_TYPE, val); | 3525 | CTX_WR(bp, GET_CID_ADDR(TX_CID), BNX2_L2CTX_TYPE, val); |
@@ -3540,7 +3540,7 @@ bnx2_init_rx_ring(struct bnx2 *bp) | |||
3540 | { | 3540 | { |
3541 | struct rx_bd *rxbd; | 3541 | struct rx_bd *rxbd; |
3542 | int i; | 3542 | int i; |
3543 | u16 prod, ring_prod; | 3543 | u16 prod, ring_prod; |
3544 | u32 val; | 3544 | u32 val; |
3545 | 3545 | ||
3546 | /* 8 for CRC and VLAN */ | 3546 | /* 8 for CRC and VLAN */ |
@@ -3552,7 +3552,7 @@ bnx2_init_rx_ring(struct bnx2 *bp) | |||
3552 | bp->rx_cons = 0; | 3552 | bp->rx_cons = 0; |
3553 | bp->hw_rx_cons = 0; | 3553 | bp->hw_rx_cons = 0; |
3554 | bp->rx_prod_bseq = 0; | 3554 | bp->rx_prod_bseq = 0; |
3555 | 3555 | ||
3556 | for (i = 0; i < bp->rx_max_ring; i++) { | 3556 | for (i = 0; i < bp->rx_max_ring; i++) { |
3557 | int j; | 3557 | int j; |
3558 | 3558 | ||
@@ -3927,7 +3927,7 @@ bnx2_test_memory(struct bnx2 *bp) | |||
3927 | return ret; | 3927 | return ret; |
3928 | } | 3928 | } |
3929 | } | 3929 | } |
3930 | 3930 | ||
3931 | return ret; | 3931 | return ret; |
3932 | } | 3932 | } |
3933 | 3933 | ||
@@ -4124,7 +4124,7 @@ bnx2_test_link(struct bnx2 *bp) | |||
4124 | bnx2_read_phy(bp, MII_BMSR, &bmsr); | 4124 | bnx2_read_phy(bp, MII_BMSR, &bmsr); |
4125 | bnx2_read_phy(bp, MII_BMSR, &bmsr); | 4125 | bnx2_read_phy(bp, MII_BMSR, &bmsr); |
4126 | spin_unlock_bh(&bp->phy_lock); | 4126 | spin_unlock_bh(&bp->phy_lock); |
4127 | 4127 | ||
4128 | if (bmsr & BMSR_LSTATUS) { | 4128 | if (bmsr & BMSR_LSTATUS) { |
4129 | return 0; | 4129 | return 0; |
4130 | } | 4130 | } |
@@ -4291,7 +4291,7 @@ bnx2_open(struct net_device *dev) | |||
4291 | bnx2_free_mem(bp); | 4291 | bnx2_free_mem(bp); |
4292 | return rc; | 4292 | return rc; |
4293 | } | 4293 | } |
4294 | 4294 | ||
4295 | mod_timer(&bp->timer, jiffies + bp->current_interval); | 4295 | mod_timer(&bp->timer, jiffies + bp->current_interval); |
4296 | 4296 | ||
4297 | atomic_set(&bp->intr_sem, 0); | 4297 | atomic_set(&bp->intr_sem, 0); |
@@ -4431,7 +4431,7 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
4431 | vlan_tag_flags |= | 4431 | vlan_tag_flags |= |
4432 | (TX_BD_FLAGS_VLAN_TAG | (vlan_tx_tag_get(skb) << 16)); | 4432 | (TX_BD_FLAGS_VLAN_TAG | (vlan_tx_tag_get(skb) << 16)); |
4433 | } | 4433 | } |
4434 | #ifdef BCM_TSO | 4434 | #ifdef BCM_TSO |
4435 | if ((mss = skb_shinfo(skb)->gso_size) && | 4435 | if ((mss = skb_shinfo(skb)->gso_size) && |
4436 | (skb->len > (bp->dev->mtu + ETH_HLEN))) { | 4436 | (skb->len > (bp->dev->mtu + ETH_HLEN))) { |
4437 | u32 tcp_opt_len, ip_tcp_len; | 4437 | u32 tcp_opt_len, ip_tcp_len; |
@@ -4470,7 +4470,7 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
4470 | } | 4470 | } |
4471 | 4471 | ||
4472 | mapping = pci_map_single(bp->pdev, skb->data, len, PCI_DMA_TODEVICE); | 4472 | mapping = pci_map_single(bp->pdev, skb->data, len, PCI_DMA_TODEVICE); |
4473 | 4473 | ||
4474 | tx_buf = &bp->tx_buf_ring[ring_prod]; | 4474 | tx_buf = &bp->tx_buf_ring[ring_prod]; |
4475 | tx_buf->skb = skb; | 4475 | tx_buf->skb = skb; |
4476 | pci_unmap_addr_set(tx_buf, mapping, mapping); | 4476 | pci_unmap_addr_set(tx_buf, mapping, mapping); |
@@ -4600,23 +4600,23 @@ bnx2_get_stats(struct net_device *dev) | |||
4600 | net_stats->tx_bytes = | 4600 | net_stats->tx_bytes = |
4601 | GET_NET_STATS(stats_blk->stat_IfHCOutOctets); | 4601 | GET_NET_STATS(stats_blk->stat_IfHCOutOctets); |
4602 | 4602 | ||
4603 | net_stats->multicast = | 4603 | net_stats->multicast = |
4604 | GET_NET_STATS(stats_blk->stat_IfHCOutMulticastPkts); | 4604 | GET_NET_STATS(stats_blk->stat_IfHCOutMulticastPkts); |
4605 | 4605 | ||
4606 | net_stats->collisions = | 4606 | net_stats->collisions = |
4607 | (unsigned long) stats_blk->stat_EtherStatsCollisions; | 4607 | (unsigned long) stats_blk->stat_EtherStatsCollisions; |
4608 | 4608 | ||
4609 | net_stats->rx_length_errors = | 4609 | net_stats->rx_length_errors = |
4610 | (unsigned long) (stats_blk->stat_EtherStatsUndersizePkts + | 4610 | (unsigned long) (stats_blk->stat_EtherStatsUndersizePkts + |
4611 | stats_blk->stat_EtherStatsOverrsizePkts); | 4611 | stats_blk->stat_EtherStatsOverrsizePkts); |
4612 | 4612 | ||
4613 | net_stats->rx_over_errors = | 4613 | net_stats->rx_over_errors = |
4614 | (unsigned long) stats_blk->stat_IfInMBUFDiscards; | 4614 | (unsigned long) stats_blk->stat_IfInMBUFDiscards; |
4615 | 4615 | ||
4616 | net_stats->rx_frame_errors = | 4616 | net_stats->rx_frame_errors = |
4617 | (unsigned long) stats_blk->stat_Dot3StatsAlignmentErrors; | 4617 | (unsigned long) stats_blk->stat_Dot3StatsAlignmentErrors; |
4618 | 4618 | ||
4619 | net_stats->rx_crc_errors = | 4619 | net_stats->rx_crc_errors = |
4620 | (unsigned long) stats_blk->stat_Dot3StatsFCSErrors; | 4620 | (unsigned long) stats_blk->stat_Dot3StatsFCSErrors; |
4621 | 4621 | ||
4622 | net_stats->rx_errors = net_stats->rx_length_errors + | 4622 | net_stats->rx_errors = net_stats->rx_length_errors + |
@@ -4637,7 +4637,7 @@ bnx2_get_stats(struct net_device *dev) | |||
4637 | } | 4637 | } |
4638 | 4638 | ||
4639 | net_stats->tx_errors = | 4639 | net_stats->tx_errors = |
4640 | (unsigned long) | 4640 | (unsigned long) |
4641 | stats_blk->stat_emac_tx_stat_dot3statsinternalmactransmiterrors | 4641 | stats_blk->stat_emac_tx_stat_dot3statsinternalmactransmiterrors |
4642 | + | 4642 | + |
4643 | net_stats->tx_aborted_errors + | 4643 | net_stats->tx_aborted_errors + |
@@ -4698,7 +4698,7 @@ bnx2_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |||
4698 | 4698 | ||
4699 | return 0; | 4699 | return 0; |
4700 | } | 4700 | } |
4701 | 4701 | ||
4702 | static int | 4702 | static int |
4703 | bnx2_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) | 4703 | bnx2_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) |
4704 | { | 4704 | { |
@@ -4711,7 +4711,7 @@ bnx2_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |||
4711 | if (cmd->autoneg == AUTONEG_ENABLE) { | 4711 | if (cmd->autoneg == AUTONEG_ENABLE) { |
4712 | autoneg |= AUTONEG_SPEED; | 4712 | autoneg |= AUTONEG_SPEED; |
4713 | 4713 | ||
4714 | cmd->advertising &= ETHTOOL_ALL_COPPER_SPEED; | 4714 | cmd->advertising &= ETHTOOL_ALL_COPPER_SPEED; |
4715 | 4715 | ||
4716 | /* allow advertising 1 speed */ | 4716 | /* allow advertising 1 speed */ |
4717 | if ((cmd->advertising == ADVERTISED_10baseT_Half) || | 4717 | if ((cmd->advertising == ADVERTISED_10baseT_Half) || |
@@ -4988,7 +4988,7 @@ bnx2_set_coalesce(struct net_device *dev, struct ethtool_coalesce *coal) | |||
4988 | bp->rx_ticks = (u16) coal->rx_coalesce_usecs; | 4988 | bp->rx_ticks = (u16) coal->rx_coalesce_usecs; |
4989 | if (bp->rx_ticks > 0x3ff) bp->rx_ticks = 0x3ff; | 4989 | if (bp->rx_ticks > 0x3ff) bp->rx_ticks = 0x3ff; |
4990 | 4990 | ||
4991 | bp->rx_quick_cons_trip = (u16) coal->rx_max_coalesced_frames; | 4991 | bp->rx_quick_cons_trip = (u16) coal->rx_max_coalesced_frames; |
4992 | if (bp->rx_quick_cons_trip > 0xff) bp->rx_quick_cons_trip = 0xff; | 4992 | if (bp->rx_quick_cons_trip > 0xff) bp->rx_quick_cons_trip = 0xff; |
4993 | 4993 | ||
4994 | bp->rx_ticks_int = (u16) coal->rx_coalesce_usecs_irq; | 4994 | bp->rx_ticks_int = (u16) coal->rx_coalesce_usecs_irq; |
@@ -5206,46 +5206,46 @@ static const unsigned long bnx2_stats_offset_arr[BNX2_NUM_STATS] = { | |||
5206 | STATS_OFFSET32(stat_IfHCOutMulticastPkts_hi), | 5206 | STATS_OFFSET32(stat_IfHCOutMulticastPkts_hi), |
5207 | STATS_OFFSET32(stat_IfHCOutBroadcastPkts_hi), | 5207 | STATS_OFFSET32(stat_IfHCOutBroadcastPkts_hi), |
5208 | STATS_OFFSET32(stat_emac_tx_stat_dot3statsinternalmactransmiterrors), | 5208 | STATS_OFFSET32(stat_emac_tx_stat_dot3statsinternalmactransmiterrors), |
5209 | STATS_OFFSET32(stat_Dot3StatsCarrierSenseErrors), | 5209 | STATS_OFFSET32(stat_Dot3StatsCarrierSenseErrors), |
5210 | STATS_OFFSET32(stat_Dot3StatsFCSErrors), | 5210 | STATS_OFFSET32(stat_Dot3StatsFCSErrors), |
5211 | STATS_OFFSET32(stat_Dot3StatsAlignmentErrors), | 5211 | STATS_OFFSET32(stat_Dot3StatsAlignmentErrors), |
5212 | STATS_OFFSET32(stat_Dot3StatsSingleCollisionFrames), | 5212 | STATS_OFFSET32(stat_Dot3StatsSingleCollisionFrames), |
5213 | STATS_OFFSET32(stat_Dot3StatsMultipleCollisionFrames), | 5213 | STATS_OFFSET32(stat_Dot3StatsMultipleCollisionFrames), |
5214 | STATS_OFFSET32(stat_Dot3StatsDeferredTransmissions), | 5214 | STATS_OFFSET32(stat_Dot3StatsDeferredTransmissions), |
5215 | STATS_OFFSET32(stat_Dot3StatsExcessiveCollisions), | 5215 | STATS_OFFSET32(stat_Dot3StatsExcessiveCollisions), |
5216 | STATS_OFFSET32(stat_Dot3StatsLateCollisions), | 5216 | STATS_OFFSET32(stat_Dot3StatsLateCollisions), |
5217 | STATS_OFFSET32(stat_EtherStatsCollisions), | 5217 | STATS_OFFSET32(stat_EtherStatsCollisions), |
5218 | STATS_OFFSET32(stat_EtherStatsFragments), | 5218 | STATS_OFFSET32(stat_EtherStatsFragments), |
5219 | STATS_OFFSET32(stat_EtherStatsJabbers), | 5219 | STATS_OFFSET32(stat_EtherStatsJabbers), |
5220 | STATS_OFFSET32(stat_EtherStatsUndersizePkts), | 5220 | STATS_OFFSET32(stat_EtherStatsUndersizePkts), |
5221 | STATS_OFFSET32(stat_EtherStatsOverrsizePkts), | 5221 | STATS_OFFSET32(stat_EtherStatsOverrsizePkts), |
5222 | STATS_OFFSET32(stat_EtherStatsPktsRx64Octets), | 5222 | STATS_OFFSET32(stat_EtherStatsPktsRx64Octets), |
5223 | STATS_OFFSET32(stat_EtherStatsPktsRx65Octetsto127Octets), | 5223 | STATS_OFFSET32(stat_EtherStatsPktsRx65Octetsto127Octets), |
5224 | STATS_OFFSET32(stat_EtherStatsPktsRx128Octetsto255Octets), | 5224 | STATS_OFFSET32(stat_EtherStatsPktsRx128Octetsto255Octets), |
5225 | STATS_OFFSET32(stat_EtherStatsPktsRx256Octetsto511Octets), | 5225 | STATS_OFFSET32(stat_EtherStatsPktsRx256Octetsto511Octets), |
5226 | STATS_OFFSET32(stat_EtherStatsPktsRx512Octetsto1023Octets), | 5226 | STATS_OFFSET32(stat_EtherStatsPktsRx512Octetsto1023Octets), |
5227 | STATS_OFFSET32(stat_EtherStatsPktsRx1024Octetsto1522Octets), | 5227 | STATS_OFFSET32(stat_EtherStatsPktsRx1024Octetsto1522Octets), |
5228 | STATS_OFFSET32(stat_EtherStatsPktsRx1523Octetsto9022Octets), | 5228 | STATS_OFFSET32(stat_EtherStatsPktsRx1523Octetsto9022Octets), |
5229 | STATS_OFFSET32(stat_EtherStatsPktsTx64Octets), | 5229 | STATS_OFFSET32(stat_EtherStatsPktsTx64Octets), |
5230 | STATS_OFFSET32(stat_EtherStatsPktsTx65Octetsto127Octets), | 5230 | STATS_OFFSET32(stat_EtherStatsPktsTx65Octetsto127Octets), |
5231 | STATS_OFFSET32(stat_EtherStatsPktsTx128Octetsto255Octets), | 5231 | STATS_OFFSET32(stat_EtherStatsPktsTx128Octetsto255Octets), |
5232 | STATS_OFFSET32(stat_EtherStatsPktsTx256Octetsto511Octets), | 5232 | STATS_OFFSET32(stat_EtherStatsPktsTx256Octetsto511Octets), |
5233 | STATS_OFFSET32(stat_EtherStatsPktsTx512Octetsto1023Octets), | 5233 | STATS_OFFSET32(stat_EtherStatsPktsTx512Octetsto1023Octets), |
5234 | STATS_OFFSET32(stat_EtherStatsPktsTx1024Octetsto1522Octets), | 5234 | STATS_OFFSET32(stat_EtherStatsPktsTx1024Octetsto1522Octets), |
5235 | STATS_OFFSET32(stat_EtherStatsPktsTx1523Octetsto9022Octets), | 5235 | STATS_OFFSET32(stat_EtherStatsPktsTx1523Octetsto9022Octets), |
5236 | STATS_OFFSET32(stat_XonPauseFramesReceived), | 5236 | STATS_OFFSET32(stat_XonPauseFramesReceived), |
5237 | STATS_OFFSET32(stat_XoffPauseFramesReceived), | 5237 | STATS_OFFSET32(stat_XoffPauseFramesReceived), |
5238 | STATS_OFFSET32(stat_OutXonSent), | 5238 | STATS_OFFSET32(stat_OutXonSent), |
5239 | STATS_OFFSET32(stat_OutXoffSent), | 5239 | STATS_OFFSET32(stat_OutXoffSent), |
5240 | STATS_OFFSET32(stat_MacControlFramesReceived), | 5240 | STATS_OFFSET32(stat_MacControlFramesReceived), |
5241 | STATS_OFFSET32(stat_IfInFramesL2FilterDiscards), | 5241 | STATS_OFFSET32(stat_IfInFramesL2FilterDiscards), |
5242 | STATS_OFFSET32(stat_IfInMBUFDiscards), | 5242 | STATS_OFFSET32(stat_IfInMBUFDiscards), |
5243 | STATS_OFFSET32(stat_FwRxDrop), | 5243 | STATS_OFFSET32(stat_FwRxDrop), |
5244 | }; | 5244 | }; |
5245 | 5245 | ||
5246 | /* stat_IfHCInBadOctets and stat_Dot3StatsCarrierSenseErrors are | 5246 | /* stat_IfHCInBadOctets and stat_Dot3StatsCarrierSenseErrors are |
5247 | * skipped because of errata. | 5247 | * skipped because of errata. |
5248 | */ | 5248 | */ |
5249 | static u8 bnx2_5706_stats_len_arr[BNX2_NUM_STATS] = { | 5249 | static u8 bnx2_5706_stats_len_arr[BNX2_NUM_STATS] = { |
5250 | 8,0,8,8,8,8,8,8,8,8, | 5250 | 8,0,8,8,8,8,8,8,8,8, |
5251 | 4,0,4,4,4,4,4,4,4,4, | 5251 | 4,0,4,4,4,4,4,4,4,4, |
@@ -5429,7 +5429,7 @@ bnx2_phys_id(struct net_device *dev, u32 data) | |||
5429 | return 0; | 5429 | return 0; |
5430 | } | 5430 | } |
5431 | 5431 | ||
5432 | static struct ethtool_ops bnx2_ethtool_ops = { | 5432 | static const struct ethtool_ops bnx2_ethtool_ops = { |
5433 | .get_settings = bnx2_get_settings, | 5433 | .get_settings = bnx2_get_settings, |
5434 | .set_settings = bnx2_set_settings, | 5434 | .set_settings = bnx2_set_settings, |
5435 | .get_drvinfo = bnx2_get_drvinfo, | 5435 | .get_drvinfo = bnx2_get_drvinfo, |
@@ -5665,7 +5665,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) | |||
5665 | bp->flags |= PCIX_FLAG; | 5665 | bp->flags |= PCIX_FLAG; |
5666 | 5666 | ||
5667 | clkreg = REG_RD(bp, BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS); | 5667 | clkreg = REG_RD(bp, BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS); |
5668 | 5668 | ||
5669 | clkreg &= BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_PCI_CLK_SPD_DET; | 5669 | clkreg &= BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_PCI_CLK_SPD_DET; |
5670 | switch (clkreg) { | 5670 | switch (clkreg) { |
5671 | case BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_PCI_CLK_SPD_DET_133MHZ: | 5671 | case BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_PCI_CLK_SPD_DET_133MHZ: |
@@ -5762,7 +5762,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) | |||
5762 | bp->tx_quick_cons_trip = 20; | 5762 | bp->tx_quick_cons_trip = 20; |
5763 | bp->tx_ticks_int = 80; | 5763 | bp->tx_ticks_int = 80; |
5764 | bp->tx_ticks = 80; | 5764 | bp->tx_ticks = 80; |
5765 | 5765 | ||
5766 | bp->rx_quick_cons_trip_int = 6; | 5766 | bp->rx_quick_cons_trip_int = 6; |
5767 | bp->rx_quick_cons_trip = 6; | 5767 | bp->rx_quick_cons_trip = 6; |
5768 | bp->rx_ticks_int = 18; | 5768 | bp->rx_ticks_int = 18; |
@@ -6016,7 +6016,7 @@ static struct pci_driver bnx2_pci_driver = { | |||
6016 | 6016 | ||
6017 | static int __init bnx2_init(void) | 6017 | static int __init bnx2_init(void) |
6018 | { | 6018 | { |
6019 | return pci_module_init(&bnx2_pci_driver); | 6019 | return pci_register_driver(&bnx2_pci_driver); |
6020 | } | 6020 | } |
6021 | 6021 | ||
6022 | static void __exit bnx2_cleanup(void) | 6022 | static void __exit bnx2_cleanup(void) |