All of lore.kernel.org
 help / color / mirror / Atom feed
From: emann@mrv.com (Eran Mann)
To: Jeff Garzik <jgarzik@pobox.com>
Cc: Netdev <netdev@oss.sgi.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	linux.nics@intel.com,
	Ganesh Venkatesan <ganesh.venkatesan@intel.com>
Subject: [PATCH 2.6.11.6-bk2] e100: Use EEPROM config for Auto MDI/MDI-X
Date: Wed, 30 Mar 2005 15:42:12 +0200	[thread overview]
Message-ID: <424AACB4.9040600@mrv.com> (raw)
In-Reply-To: <4240E35C.2090203@pobox.com>

[-- Attachment #1: Type: text/plain, Size: 292 bytes --]

Current e100.c doesn't follow the EEPROM configuration regarding Auto 
MDI/MDI-X switching, instead it is enabled unconditionally for the 
relevant chips.
This is especially bad since according to Intel's errata this feature is 
no-longer supported.

Signed-off-by: Eran Mann <emann@mrv.com>

[-- Attachment #2: e100-mdix.patch --]
[-- Type: text/x-patch, Size: 1372 bytes --]

--- linux-2.6.11.6-bk2/drivers/net/e100.c	2005-03-29 19:57:10.000000000 +0200
+++ linux-2.6.11.6-bk2-patched/drivers/net/e100.c	2005-03-29 19:28:52.000000000 +0200
@@ -1072,13 +1072,17 @@
 		mdio_write(netdev, nic->mii.phy_id, MII_NSC_CONG, cong);
 	}
 
-	if((nic->mac >= mac_82550_D102) || ((nic->flags & ich) && 
-		(mdio_read(netdev, nic->mii.phy_id, MII_TPISTATUS) & 0x8000) && 
-		(nic->eeprom[eeprom_cnfg_mdix] & eeprom_mdix_enabled)))
-		/* enable/disable MDI/MDI-X auto-switching */
-		mdio_write(netdev, nic->mii.phy_id, MII_NCONFIG,
-			nic->mii.force_media ? 0 : NCONFIG_AUTO_SWITCH);
-
+	if(((nic->mac >= mac_82550_D102) || ((nic->flags & ich) &&
+		(mdio_read(netdev, nic->mii.phy_id, MII_TPISTATUS) &
+			0x8000)))) {
+		/* Enable/Disable Auto MDI/MDI-X Switching */
+		if ((nic->eeprom[eeprom_cnfg_mdix] & eeprom_mdix_enabled) &&
+		    !nic->mii.force_media)
+			mdio_write(netdev, nic->mii.phy_id, MII_NCONFIG,
+			   		NCONFIG_AUTO_SWITCH);
+		else
+                	mdio_write(netdev, nic->mii.phy_id, MII_NCONFIG, 0);
+		}
 	return 0;
 }
 
@@ -2245,11 +2249,11 @@
 		goto err_out_iounmap;
 	}
 
-	e100_phy_init(nic);
-
 	if((err = e100_eeprom_load(nic)))
 		goto err_out_free;
 
+	e100_phy_init(nic);
+
 	memcpy(netdev->dev_addr, nic->eeprom, ETH_ALEN);
 	if(!is_valid_ether_addr(netdev->dev_addr)) {
 		DPRINTK(PROBE, ERR, "Invalid MAC address from "

  parent reply	other threads:[~2005-03-30 13:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-23  3:32 netdev-2.6 queue updated Jeff Garzik
2005-03-23  7:55 ` bert hubert
2005-03-23  8:57   ` Jeff Garzik
2005-03-30 13:42 ` Eran Mann [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-03-31 16:39 [PATCH 2.6.11.6-bk2] e100: Use EEPROM config for Auto MDI/MDI-X Venkatesan, Ganesh

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=424AACB4.9040600@mrv.com \
    --to=emann@mrv.com \
    --cc=ganesh.venkatesan@intel.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux.nics@intel.com \
    --cc=netdev@oss.sgi.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.