Skip to content

Commit

Permalink
cxgb3: Fix T3C MAC max packet size access
Browse files Browse the repository at this point in the history
Max packet size is not the only field in T3C's High Water Mark register.
Mask the register to access this field.

Signed-off-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Divy Le Ray authored and David S. Miller committed Jul 8, 2009
1 parent 619f05c commit cfe2462
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions drivers/net/cxgb3/xgmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,11 +447,12 @@ int t3_mac_set_speed_duplex_fc(struct cmac *mac, int speed, int duplex, int fc)

val = t3_read_reg(adap, A_XGM_RXFIFO_CFG + oft);
val &= ~V_RXFIFOPAUSEHWM(M_RXFIFOPAUSEHWM);
if (fc & PAUSE_TX)
val |= V_RXFIFOPAUSEHWM(rx_fifo_hwm(
t3_read_reg(adap,
A_XGM_RX_MAX_PKT_SIZE
+ oft)) / 8);
if (fc & PAUSE_TX) {
u32 rx_max_pkt_size =
G_RXMAXPKTSIZE(t3_read_reg(adap,
A_XGM_RX_MAX_PKT_SIZE + oft));
val |= V_RXFIFOPAUSEHWM(rx_fifo_hwm(rx_max_pkt_size) / 8);
}
t3_write_reg(adap, A_XGM_RXFIFO_CFG + oft, val);

t3_set_reg_field(adap, A_XGM_TX_CFG + oft, F_TXPAUSEEN,
Expand Down

0 comments on commit cfe2462

Please sign in to comment.