netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next-2.6] cxgb3: fix 2 ports 1G regression
@ 2009-08-05 21:59 Divy Le Ray
  2009-08-06  3:28 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Divy Le Ray @ 2009-08-05 21:59 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-kernel, swise

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

commit 88045b3cf0f8981129cb489c7b6bc36c21dd33a7
	cxgb3: fix mac index mapping

	Override the mac index computation for the gen2 adapter,
	as each port is expected to use index 0.

introduces a regression on 2 port 1G adapter
as its xauicfg vpd value is null.
Add a check on the device id.

Signed-off-by: Divy Le Ray <divy@chelsio.com>
---

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


diff --git a/drivers/net/cxgb3/t3_hw.c b/drivers/net/cxgb3/t3_hw.c
index 526e144..032cfe0 100644
--- a/drivers/net/cxgb3/t3_hw.c
+++ b/drivers/net/cxgb3/t3_hw.c
@@ -3692,8 +3692,12 @@ static void mc7_prep(struct adapter *adapter, struct mc7 *mc7,
 
 void mac_prep(struct cmac *mac, struct adapter *adapter, int index)
 {
+	u16 devid;
+
 	mac->adapter = adapter;
-	if (!adapter->params.vpd.xauicfg[1])
+	pci_read_config_word(adapter->pdev, 0x2, &devid);
+
+	if (devid == 0x37 && !adapter->params.vpd.xauicfg[1])
 		index = 0;
 	mac->offset = (XGMAC0_1_BASE_ADDR - XGMAC0_0_BASE_ADDR) * index;
 	mac->nucast = 1;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next-2.6] cxgb3: fix 2 ports 1G regression
  2009-08-05 21:59 [PATCH net-next-2.6] cxgb3: fix 2 ports 1G regression Divy Le Ray
@ 2009-08-06  3:28 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2009-08-06  3:28 UTC (permalink / raw)
  To: divy; +Cc: netdev, linux-kernel, swise

From: Divy Le Ray <divy@chelsio.com>
Date: Wed, 05 Aug 2009 14:59:23 -0700

> commit 88045b3cf0f8981129cb489c7b6bc36c21dd33a7
> 	cxgb3: fix mac index mapping
> 
> 	Override the mac index computation for the gen2 adapter,
> 	as each port is expected to use index 0.
> 
> introduces a regression on 2 port 1G adapter
> as its xauicfg vpd value is null.
> Add a check on the device id.
> 
> Signed-off-by: Divy Le Ray <divy@chelsio.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-08-06  3:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-05 21:59 [PATCH net-next-2.6] cxgb3: fix 2 ports 1G regression Divy Le Ray
2009-08-06  3:28 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).