diff options
author | John W. Linville <linville@tuxdriver.com> | 2006-05-26 16:06:58 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2006-05-26 16:06:58 -0400 |
commit | f587fb74b26a10354f1eb73e8d054cd15e5a2fe2 (patch) | |
tree | a453a270fc86ada85d808487c911387739ce2296 /drivers/net | |
parent | df8ccb9bf1ca360581a94c2245efb9fa613fbb29 (diff) | |
parent | 705af309505681f197f81618440954d10f120dc0 (diff) |
Merge branch 'from-linus' into upstream
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/bnx2.c | 20 | ||||
-rw-r--r-- | drivers/net/sky2.c | 19 | ||||
-rw-r--r-- | drivers/net/tg3.c | 8 |
3 files changed, 37 insertions, 10 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 5ca99e26660a..54161aef3cac 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -55,8 +55,8 @@ | |||
55 | 55 | ||
56 | #define DRV_MODULE_NAME "bnx2" | 56 | #define DRV_MODULE_NAME "bnx2" |
57 | #define PFX DRV_MODULE_NAME ": " | 57 | #define PFX DRV_MODULE_NAME ": " |
58 | #define DRV_MODULE_VERSION "1.4.39" | 58 | #define DRV_MODULE_VERSION "1.4.40" |
59 | #define DRV_MODULE_RELDATE "March 22, 2006" | 59 | #define DRV_MODULE_RELDATE "May 22, 2006" |
60 | 60 | ||
61 | #define RUN_AT(x) (jiffies + (x)) | 61 | #define RUN_AT(x) (jiffies + (x)) |
62 | 62 | ||
@@ -2945,7 +2945,7 @@ bnx2_nvram_write(struct bnx2 *bp, u32 offset, u8 *data_buf, | |||
2945 | int buf_size) | 2945 | int buf_size) |
2946 | { | 2946 | { |
2947 | u32 written, offset32, len32; | 2947 | u32 written, offset32, len32; |
2948 | u8 *buf, start[4], end[4]; | 2948 | u8 *buf, start[4], end[4], *flash_buffer = NULL; |
2949 | int rc = 0; | 2949 | int rc = 0; |
2950 | int align_start, align_end; | 2950 | int align_start, align_end; |
2951 | 2951 | ||
@@ -2985,12 +2985,19 @@ bnx2_nvram_write(struct bnx2 *bp, u32 offset, u8 *data_buf, | |||
2985 | memcpy(buf + align_start, data_buf, buf_size); | 2985 | memcpy(buf + align_start, data_buf, buf_size); |
2986 | } | 2986 | } |
2987 | 2987 | ||
2988 | if (bp->flash_info->buffered == 0) { | ||
2989 | flash_buffer = kmalloc(264, GFP_KERNEL); | ||
2990 | if (flash_buffer == NULL) { | ||
2991 | rc = -ENOMEM; | ||
2992 | goto nvram_write_end; | ||
2993 | } | ||
2994 | } | ||
2995 | |||
2988 | written = 0; | 2996 | written = 0; |
2989 | while ((written < len32) && (rc == 0)) { | 2997 | while ((written < len32) && (rc == 0)) { |
2990 | u32 page_start, page_end, data_start, data_end; | 2998 | u32 page_start, page_end, data_start, data_end; |
2991 | u32 addr, cmd_flags; | 2999 | u32 addr, cmd_flags; |
2992 | int i; | 3000 | int i; |
2993 | u8 flash_buffer[264]; | ||
2994 | 3001 | ||
2995 | /* Find the page_start addr */ | 3002 | /* Find the page_start addr */ |
2996 | page_start = offset32 + written; | 3003 | page_start = offset32 + written; |
@@ -3061,7 +3068,7 @@ bnx2_nvram_write(struct bnx2 *bp, u32 offset, u8 *data_buf, | |||
3061 | } | 3068 | } |
3062 | 3069 | ||
3063 | /* Loop to write the new data from data_start to data_end */ | 3070 | /* Loop to write the new data from data_start to data_end */ |
3064 | for (addr = data_start; addr < data_end; addr += 4, i++) { | 3071 | for (addr = data_start; addr < data_end; addr += 4, i += 4) { |
3065 | if ((addr == page_end - 4) || | 3072 | if ((addr == page_end - 4) || |
3066 | ((bp->flash_info->buffered) && | 3073 | ((bp->flash_info->buffered) && |
3067 | (addr == data_end - 4))) { | 3074 | (addr == data_end - 4))) { |
@@ -3109,6 +3116,9 @@ bnx2_nvram_write(struct bnx2 *bp, u32 offset, u8 *data_buf, | |||
3109 | } | 3116 | } |
3110 | 3117 | ||
3111 | nvram_write_end: | 3118 | nvram_write_end: |
3119 | if (bp->flash_info->buffered == 0) | ||
3120 | kfree(flash_buffer); | ||
3121 | |||
3112 | if (align_start || align_end) | 3122 | if (align_start || align_end) |
3113 | kfree(buf); | 3123 | kfree(buf); |
3114 | return rc; | 3124 | return rc; |
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 60779ebf2ff6..959109609d85 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -979,6 +979,7 @@ static int sky2_rx_start(struct sky2_port *sky2) | |||
979 | struct sky2_hw *hw = sky2->hw; | 979 | struct sky2_hw *hw = sky2->hw; |
980 | unsigned rxq = rxqaddr[sky2->port]; | 980 | unsigned rxq = rxqaddr[sky2->port]; |
981 | int i; | 981 | int i; |
982 | unsigned thresh; | ||
982 | 983 | ||
983 | sky2->rx_put = sky2->rx_next = 0; | 984 | sky2->rx_put = sky2->rx_next = 0; |
984 | sky2_qset(hw, rxq); | 985 | sky2_qset(hw, rxq); |
@@ -1003,9 +1004,21 @@ static int sky2_rx_start(struct sky2_port *sky2) | |||
1003 | sky2_rx_add(sky2, re->mapaddr); | 1004 | sky2_rx_add(sky2, re->mapaddr); |
1004 | } | 1005 | } |
1005 | 1006 | ||
1006 | /* Truncate oversize frames */ | 1007 | |
1007 | sky2_write16(hw, SK_REG(sky2->port, RX_GMF_TR_THR), sky2->rx_bufsize - 8); | 1008 | /* |
1008 | sky2_write32(hw, SK_REG(sky2->port, RX_GMF_CTRL_T), RX_TRUNC_ON); | 1009 | * The receiver hangs if it receives frames larger than the |
1010 | * packet buffer. As a workaround, truncate oversize frames, but | ||
1011 | * the register is limited to 9 bits, so if you do frames > 2052 | ||
1012 | * you better get the MTU right! | ||
1013 | */ | ||
1014 | thresh = (sky2->rx_bufsize - 8) / sizeof(u32); | ||
1015 | if (thresh > 0x1ff) | ||
1016 | sky2_write32(hw, SK_REG(sky2->port, RX_GMF_CTRL_T), RX_TRUNC_OFF); | ||
1017 | else { | ||
1018 | sky2_write16(hw, SK_REG(sky2->port, RX_GMF_TR_THR), thresh); | ||
1019 | sky2_write32(hw, SK_REG(sky2->port, RX_GMF_CTRL_T), RX_TRUNC_ON); | ||
1020 | } | ||
1021 | |||
1009 | 1022 | ||
1010 | /* Tell chip about available buffers */ | 1023 | /* Tell chip about available buffers */ |
1011 | sky2_write16(hw, Y2_QADDR(rxq, PREF_UNIT_PUT_IDX), sky2->rx_put); | 1024 | sky2_write16(hw, Y2_QADDR(rxq, PREF_UNIT_PUT_IDX), sky2->rx_put); |
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index e1b33a25a25f..49ad60b72657 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -69,8 +69,8 @@ | |||
69 | 69 | ||
70 | #define DRV_MODULE_NAME "tg3" | 70 | #define DRV_MODULE_NAME "tg3" |
71 | #define PFX DRV_MODULE_NAME ": " | 71 | #define PFX DRV_MODULE_NAME ": " |
72 | #define DRV_MODULE_VERSION "3.57" | 72 | #define DRV_MODULE_VERSION "3.58" |
73 | #define DRV_MODULE_RELDATE "Apr 28, 2006" | 73 | #define DRV_MODULE_RELDATE "May 22, 2006" |
74 | 74 | ||
75 | #define TG3_DEF_MAC_MODE 0 | 75 | #define TG3_DEF_MAC_MODE 0 |
76 | #define TG3_DEF_RX_MODE 0 | 76 | #define TG3_DEF_RX_MODE 0 |
@@ -6488,6 +6488,10 @@ static void tg3_periodic_fetch_stats(struct tg3 *tp) | |||
6488 | TG3_STAT_ADD32(&sp->rx_frame_too_long_errors, MAC_RX_STATS_FRAME_TOO_LONG); | 6488 | TG3_STAT_ADD32(&sp->rx_frame_too_long_errors, MAC_RX_STATS_FRAME_TOO_LONG); |
6489 | TG3_STAT_ADD32(&sp->rx_jabbers, MAC_RX_STATS_JABBERS); | 6489 | TG3_STAT_ADD32(&sp->rx_jabbers, MAC_RX_STATS_JABBERS); |
6490 | TG3_STAT_ADD32(&sp->rx_undersize_packets, MAC_RX_STATS_UNDERSIZE); | 6490 | TG3_STAT_ADD32(&sp->rx_undersize_packets, MAC_RX_STATS_UNDERSIZE); |
6491 | |||
6492 | TG3_STAT_ADD32(&sp->rxbds_empty, RCVLPC_NO_RCV_BD_CNT); | ||
6493 | TG3_STAT_ADD32(&sp->rx_discards, RCVLPC_IN_DISCARDS_CNT); | ||
6494 | TG3_STAT_ADD32(&sp->rx_errors, RCVLPC_IN_ERRORS_CNT); | ||
6491 | } | 6495 | } |
6492 | 6496 | ||
6493 | static void tg3_timer(unsigned long __opaque) | 6497 | static void tg3_timer(unsigned long __opaque) |