From: Jeff Garzik <jgarzik@mandrakesoft.com>
To: "H . J . Lu" <hjl@lucon.org>
Cc: "linux kernel" <linux-kernel@vger.kernel.org>,
alan@lxorguk.ukuu.org.uk, " Mads Martin Jørgensen" <mmj@suse.com>
Subject: Re: 2.4.4-ac8 doesn't work with Lite-On 82c168 PNIC rev 32
Date: Fri, 11 May 2001 20:49:26 -0400 [thread overview]
Message-ID: <3AFC8896.47AA1481@mandrakesoft.com> (raw)
In-Reply-To: <20010511165749.B12289@lucon.org>
[-- Attachment #1: Type: text/plain, Size: 156 bytes --]
Does this patch, against ac8, help with the PNIC problem?
--
Jeff Garzik | Game called on account of naked chick
Building 1024 |
MandrakeSoft |
[-- Attachment #2: tulip.patch --]
[-- Type: text/plain, Size: 3079 bytes --]
Index: drivers/net/tulip/media.c
===================================================================
RCS file: /cvsroot/gkernel/linux_2_4/drivers/net/tulip/media.c,v
retrieving revision 1.1.1.30
diff -u -r1.1.1.30 media.c
--- drivers/net/tulip/media.c 2001/05/11 23:58:47 1.1.1.30
+++ drivers/net/tulip/media.c 2001/05/12 00:47:16
@@ -255,7 +255,7 @@
case 1: case 3: {
int phy_num = p[0];
int init_length = p[1];
- u16 *misc_info;
+ u16 *misc_info, tmp_info;
dev->if_port = 11;
new_csr6 = 0x020E0000;
@@ -282,8 +282,10 @@
for (i = 0; i < init_length; i++)
outl(init_sequence[i], ioaddr + CSR12);
}
- tp->advertising[phy_num] = get_u16(&misc_info[1]) | 1;
- if (startup < 2) {
+ tmp_info = get_u16(&misc_info[1]);
+ if (tmp_info)
+ tp->advertising[phy_num] = tmp_info | 1;
+ if (tmp_info && startup < 2) {
if (tp->mii_advertise == 0)
tp->mii_advertise = tp->advertising[phy_num];
if (tulip_debug > 1)
Index: drivers/net/tulip/tulip_core.c
===================================================================
RCS file: /cvsroot/gkernel/linux_2_4/drivers/net/tulip/tulip_core.c,v
retrieving revision 1.1.1.43
diff -u -r1.1.1.43 tulip_core.c
--- drivers/net/tulip/tulip_core.c 2001/05/11 23:58:48 1.1.1.43
+++ drivers/net/tulip/tulip_core.c 2001/05/12 00:47:17
@@ -20,10 +20,11 @@
#include <linux/init.h>
#include <linux/etherdevice.h>
#include <linux/delay.h>
+#include <linux/mii.h>
#include <asm/unaligned.h>
static char version[] __devinitdata =
- "Linux Tulip driver version 0.9.14f (May 10, 2001)\n";
+ "Linux Tulip driver version 0.9.15cvs (April XX, 2001)\n";
/* A few user-configurable values. */
@@ -1434,7 +1435,7 @@
((mii_status & 0x8000) == 0 && (mii_status & 0x7800) != 0)) {
int mii_reg0 = tulip_mdio_read(dev, phy, 0);
int mii_advert = tulip_mdio_read(dev, phy, 4);
- int to_advert;
+ unsigned int to_advert, new_bmcr;
if (tp->mii_advertise)
to_advert = tp->mii_advertise;
@@ -1455,10 +1456,30 @@
board_idx, to_advert, phy, mii_advert);
tulip_mdio_write(dev, phy, 4, to_advert);
}
+
/* Enable autonegotiation: some boards default to off. */
- tulip_mdio_write(dev, phy, 0, mii_reg0 |
- (tp->full_duplex ? 0x1100 : 0x1000) |
- (tulip_media_cap[tp->default_port]&MediaIs100 ? 0x2000:0));
+ if (tp->default_port == 0) {
+ new_bmcr = mii_reg0 | BMCR_ANENABLE;
+ if (new_bmcr != mii_reg0)
+ new_bmcr |= BMCR_ANRESTART;
+ }
+ /* ...or disable nway, if forcing media */
+ else
+ new_bmcr = mii_reg0 & ~BMCR_ANENABLE;
+
+ if (new_bmcr != mii_reg0)
+ tulip_mdio_write(dev, phy, MII_BMCR, new_bmcr);
+
+ if (tp->full_duplex) new_bmcr |= BMCR_FULLDPLX;
+ else new_bmcr &= ~BMCR_FULLDPLX;
+ if (tulip_media_cap[tp->default_port] & MediaIs100)
+ new_bmcr |= BMCR_SPEED100;
+ else new_bmcr &= ~BMCR_SPEED100;
+
+ if (new_bmcr != mii_reg0) {
+ udelay(10);
+ tulip_mdio_write(dev, phy, MII_BMCR, new_bmcr);
+ }
}
}
tp->mii_cnt = phy_idx;
next prev parent reply other threads:[~2001-05-12 0:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-05-11 23:57 2.4.4-ac8 doesn't work with Lite-On 82c168 PNIC rev 32 H . J . Lu
2001-05-12 0:49 ` Jeff Garzik [this message]
2001-05-12 0:53 ` Jeff Garzik
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=3AFC8896.47AA1481@mandrakesoft.com \
--to=jgarzik@mandrakesoft.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=hjl@lucon.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mmj@suse.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