diff options
author | Matt Carlson <mcarlson@broadcom.com> | 2009-08-28 09:57:12 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-08-29 18:42:36 -0400 |
commit | fdb72b38c94c0ead1f78ecc8db64b832feda22c3 (patch) | |
tree | fba8a1f9351b6d2f5abb6b63f4d906627ea3572a /drivers/net/tg3.c | |
parent | 8590a603e5e20ccf49d6cf0ea71ecf5388d1f9da (diff) |
tg3: Break out mini producer ring handling
This patch separates the code that sets up the mini producer ring from
the code that sets up the jumbo producer rings. The 5717 asic rev
devices do not have a mini ring, but do have a jumbo frame
implementation similar to the 5704 and previous devices.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tg3.c')
-rw-r--r-- | drivers/net/tg3.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 4c4d164a4b44..606703cf9618 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -6967,19 +6967,16 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) | |||
6967 | tw32(RCVDBDI_STD_BD + TG3_BDINFO_NIC_ADDR, | 6967 | tw32(RCVDBDI_STD_BD + TG3_BDINFO_NIC_ADDR, |
6968 | NIC_SRAM_RX_BUFFER_DESC); | 6968 | NIC_SRAM_RX_BUFFER_DESC); |
6969 | 6969 | ||
6970 | /* Don't even try to program the JUMBO/MINI buffer descriptor | 6970 | /* Disable the mini ring */ |
6971 | * configs on 5705. | 6971 | if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) |
6972 | */ | ||
6973 | if (tp->tg3_flags2 & TG3_FLG2_5705_PLUS) { | ||
6974 | tw32(RCVDBDI_STD_BD + TG3_BDINFO_MAXLEN_FLAGS, | ||
6975 | RX_STD_MAX_SIZE_5705 << BDINFO_FLAGS_MAXLEN_SHIFT); | ||
6976 | } else { | ||
6977 | tw32(RCVDBDI_STD_BD + TG3_BDINFO_MAXLEN_FLAGS, | ||
6978 | RX_STD_MAX_SIZE << BDINFO_FLAGS_MAXLEN_SHIFT); | ||
6979 | |||
6980 | tw32(RCVDBDI_MINI_BD + TG3_BDINFO_MAXLEN_FLAGS, | 6972 | tw32(RCVDBDI_MINI_BD + TG3_BDINFO_MAXLEN_FLAGS, |
6981 | BDINFO_FLAGS_DISABLED); | 6973 | BDINFO_FLAGS_DISABLED); |
6982 | 6974 | ||
6975 | /* Program the jumbo buffer descriptor ring control | ||
6976 | * blocks on those devices that have them. | ||
6977 | */ | ||
6978 | if ((tp->tg3_flags2 & TG3_FLG2_JUMBO_CAPABLE) && | ||
6979 | !(tp->tg3_flags2 & TG3_FLG2_5780_CLASS)) { | ||
6983 | /* Setup replenish threshold. */ | 6980 | /* Setup replenish threshold. */ |
6984 | tw32(RCVBDI_JUMBO_THRESH, tp->rx_jumbo_pending / 8); | 6981 | tw32(RCVBDI_JUMBO_THRESH, tp->rx_jumbo_pending / 8); |
6985 | 6982 | ||
@@ -6997,7 +6994,11 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) | |||
6997 | BDINFO_FLAGS_DISABLED); | 6994 | BDINFO_FLAGS_DISABLED); |
6998 | } | 6995 | } |
6999 | 6996 | ||
7000 | } | 6997 | val = RX_STD_MAX_SIZE << BDINFO_FLAGS_MAXLEN_SHIFT; |
6998 | } else | ||
6999 | val = RX_STD_MAX_SIZE_5705 << BDINFO_FLAGS_MAXLEN_SHIFT; | ||
7000 | |||
7001 | tw32(RCVDBDI_STD_BD + TG3_BDINFO_MAXLEN_FLAGS, val); | ||
7001 | 7002 | ||
7002 | /* There is only one send ring on 5705/5750, no need to explicitly | 7003 | /* There is only one send ring on 5705/5750, no need to explicitly |
7003 | * disable the others. | 7004 | * disable the others. |