[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Support for MII ICS1892 [patch]
- To: tech@openbsd.org
- Subject: Support for MII ICS1892 [patch]
- From: Henning Brauer <lists-openbsdtech@bsws.de>
- Date: Tue, 29 May 2001 20:21:20 +0200
- Content-Disposition: inline
- Mail-Followup-To: tech@openbsd.org
Hi,
I've started coding support for the MII ICS1892. We do have support for the
ICS1890 (sys/dev/mii/icsphy.c), I've modified this file.
It works fine for me with one gotcha: the media autoselection does not work
in the first place. If you manually do "ifconfig dc0 media 10BaseT" and
thereafter "ifconfig dc0 media autoselect" everything works fine - no idea
why. The autoselection seems to work fine in the first place (at least the
switch tells me they chose 100BaseTX full-duplex), but ifconfig shows
"media: Ethernet autoselect (none)". After hacking the driver a bit I
narrowed it down to not seeing the autonegotiation finished, but couldn't
figure out WHY we don't detect this. Unfortunately I don't have more time to
complete this work for the next few weeks, so I'm sending the patch now.
Below there's also a small workaround for /etc/netstart to put the
interfaces to media 10BaseT and autoselect afterwards.
diff -u mii.orig/icsphy.c mii/icsphy.c
--- mii.orig/icsphy.c Tue May 29 19:31:21 2001
+++ mii/icsphy.c Tue May 29 19:34:11 2001
@@ -115,6 +115,10 @@
if (MII_OUI(ma->mii_id1, ma->mii_id2) == MII_OUI_xxICS &&
MII_MODEL(ma->mii_id2) == MII_MODEL_xxICS_1890)
return (10);
+
+ if (MII_OUI(ma->mii_id1, ma->mii_id2) == MII_OUI_xxICS &&
+ MII_MODEL(ma->mii_id2) == MII_MODEL_xxICS_1892)
+ return (10);
return (0);
}
@@ -128,8 +132,15 @@
struct mii_attach_args *ma = aux;
struct mii_data *mii = ma->mii_data;
- printf(": %s, rev. %d\n", MII_STR_xxICS_1890,
- MII_REV(ma->mii_id2));
+ if (MII_OUI(ma->mii_id1, ma->mii_id2) == MII_OUI_xxICS &&
+ MII_MODEL(ma->mii_id2) == MII_MODEL_xxICS_1890)
+ printf(": %s, rev. %d\n", MII_STR_xxICS_1890,
+ MII_REV(ma->mii_id2));
+
+ if (MII_OUI(ma->mii_id1, ma->mii_id2) == MII_OUI_xxICS &&
+ MII_MODEL(ma->mii_id2) == MII_MODEL_xxICS_1892)
+ printf(": %s, rev. %d\n", MII_STR_xxICS_1892,
+ MII_REV(ma->mii_id2));
sc->mii_inst = mii->mii_instance;
sc->mii_phy = ma->mii_phyno;
diff -u mii.orig/miidevs mii/miidevs
--- mii.orig/miidevs Tue May 29 19:31:21 2001
+++ mii/miidevs Tue May 29 19:34:24 2001
@@ -113,8 +113,10 @@
/* Contrived vendor/model for dcphy */
model xxDEC xxDC 0x0001 DC
+
/* Integrated Circuit Systems PHYs */
model xxICS 1890 0x0002 ICS1890 10/100 media interface
+model xxICS 1892 0x0003 ICS1892 10/100 media interface
/* Intel PHYs */
model xxINTEL I82553 0x0000 i82553 10/100 media interface
********************
netstart workaround:
--- netstart.orig Tue May 29 19:36:35 2001
+++ netstart Tue May 29 19:49:34 2001
@@ -192,6 +192,12 @@
;;
esac
eval "$cmd"
+
+ #very dirty hack for dc* with ics1892 PHY.
+ ifconfig $if media 10BaseT
+ sleep 2
+ ifconfig $if media autoselect
+
done < /etc/hostname.$if
done
Maybe someone wants to complete this work and commit it.
Greetings
Henning
--
* Henning Brauer, hostmaster@bsws.de, http://www.bsws.de *
* Roedingsmarkt 14, 20459 Hamburg, Germany *
Unix is very simple, but it takes a genius to understand the simplicity.
(Dennis Ritchie)