public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Divy Le Ray <divy@chelsio.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	swise@opengridcomputing.com
Subject: [PATCH 2/8 net-next-2.6] cxgb3: Fix T3C MAC max packet size access
Date: Tue, 07 Jul 2009 22:48:38 -0700	[thread overview]
Message-ID: <20090708054838.11344.97432.stgit@speedy5> (raw)
In-Reply-To: <20090708054832.11344.82449.stgit@speedy5>

From: Divy Le Ray <divy@chelsio.com>

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>
---

 drivers/net/cxgb3/xgmac.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)


diff --git a/drivers/net/cxgb3/xgmac.c b/drivers/net/cxgb3/xgmac.c
index f87f943..0109ee4 100644
--- a/drivers/net/cxgb3/xgmac.c
+++ b/drivers/net/cxgb3/xgmac.c
@@ -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,


  reply	other threads:[~2009-07-08  5:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-08  5:48 [PATCH 1/8 net-next-2.6] cxgb3: Drain Mac Tx fifo when the port goes down Divy Le Ray
2009-07-08  5:48 ` Divy Le Ray [this message]
2009-07-08  5:48 ` [PATCH 3/8 net-next-2.6] cxgb3: AEL2020 phy support update Divy Le Ray
2009-07-08  5:48 ` [PATCH 4/8 net-next-2.6] cxgb3: AQ100X " Divy Le Ray
2009-07-08  5:48 ` [PATCH 5/8 net-next-2.6] cxgb3: fix phy power down Divy Le Ray
2009-07-08  5:48 ` [PATCH 6/8 net-next-2.6] cxgb3: Fix mss table initialization Divy Le Ray
2009-07-08  5:49 ` [PATCH 7/8 net-next-2.6] cxgb3: fix mac index mapping Divy Le Ray
2009-07-08  5:49 ` [PATCH 8/8 net-next-2.6] cxgb3: use request_firmware() for the EDC registers setup Divy Le Ray

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090708054838.11344.97432.stgit@speedy5 \
    --to=divy@chelsio.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=swise@opengridcomputing.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox