Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Call for testing: Attansic L1E




On Apr 20, 2009, at 16:58 , Christoph Egger wrote"

Great work! Thanks. I committed the driver to get more users/testers.


Is it possible to pull the driver plus the atphy up to 5.0? As it's rather late in the release cycle, it could be added commented out in the GENRIC kernel config file?

I added it to 5.0_RC4 by copying the files

sys/dev/mii/atphy.c
sys/dev/pci/if_ale.c
sys/dev/pci/if_alereg.h

from -current and applying the patch below (modulo make -f Makefile.miidevs and make -f Makefile.pcidevs). The only non-obvious pull-up would be revision 1.62 of sys/dev/mii/mii_physubr.c, which added the mii_anar() function used by the driver.

NetBSD 5.0_RC4 (WAPANA) #61: Mon Apr 20 18:20:54 EDT 2009

ale0 at pci4 dev 0 function 0: Attansic/Atheros L1E Ethernet
ale0: ioapic0 pin 17
ale0: Ethernet address 00:23:54:28:0e:41
atphy0 at ale0 phy 0: L1 10/100/1000 PHY, rev. 9
atphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT-FDX, auto

# ifconfig -v ale0
ale0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        address: 00:23:54:28:0e:41
        media: Ethernet autoselect (1000baseT full-duplex)
        status: active
        input: 21709548 packets, 4868576277 bytes, 8791 multicasts
output: 196976601 packets, 274933721247 bytes, 5 multicasts, 72 errors, 1080 collisions
        inet 10.99.1.65 netmask 0xffff0000 broadcast 10.99.255.255
        inet6 fe80::223:54ff:fe28:e41%ale0 prefixlen 64 scopeid 0x1

--
    aew

? dev/mii/atphy.c
? dev/pci/if_ale.c
? dev/pci/if_alereg.h
Index: dev/mii/files.mii
===================================================================
RCS file: /cvsroot/src/sys/dev/mii/files.mii,v
retrieving revision 1.41
diff -u -r1.41 files.mii
--- dev/mii/files.mii   2 Jan 2008 00:41:07 -0000       1.41
+++ dev/mii/files.mii   20 Apr 2009 22:21:35 -0000
@@ -131,3 +131,7 @@
 device mvphy: mii_phy
 attach mvphy at mii
 file   dev/mii/mvphy.c                         mvphy
+
+device atphy: mii_phy
+attach atphy at mii
+file   dev/mii/atphy.c                         atphy
Index: dev/mii/mii_physubr.c
===================================================================
RCS file: /cvsroot/src/sys/dev/mii/mii_physubr.c,v
retrieving revision 1.60
diff -u -r1.60 mii_physubr.c
--- dev/mii/mii_physubr.c       4 May 2008 17:06:09 -0000       1.60
+++ dev/mii/mii_physubr.c       20 Apr 2009 22:21:35 -0000
@@ -626,3 +626,35 @@
        PHY_RESET(sc);
        return PHY_SERVICE(sc, sc->mii_pdata, MII_MEDIACHG) == 0;
 }
+
+/*
+ * Given an ifmedia word, return the corresponding ANAR value.
+ */
+int
+mii_anar(int media)
+{
+       int rv;
+
+       switch (media & (IFM_TMASK|IFM_NMASK|IFM_FDX)) {
+       case IFM_ETHER|IFM_10_T:
+               rv = ANAR_10|ANAR_CSMA;
+               break;
+       case IFM_ETHER|IFM_10_T|IFM_FDX:
+               rv = ANAR_10_FD|ANAR_CSMA;
+               break;
+       case IFM_ETHER|IFM_100_TX:
+               rv = ANAR_TX|ANAR_CSMA;
+               break;
+       case IFM_ETHER|IFM_100_TX|IFM_FDX:
+               rv = ANAR_TX_FD|ANAR_CSMA;
+               break;
+       case IFM_ETHER|IFM_100_T4:
+               rv = ANAR_T4|ANAR_CSMA;
+               break;
+       default:
+               rv = 0;
+               break;
+       }
+
+       return rv;
+}
Index: dev/mii/miidevs
===================================================================
RCS file: /cvsroot/src/sys/dev/mii/miidevs,v
retrieving revision 1.78
diff -u -r1.78 miidevs
--- dev/mii/miidevs     28 Sep 2008 18:30:11 -0000      1.78
+++ dev/mii/miidevs     20 Apr 2009 22:21:35 -0000
@@ -47,6 +47,8 @@
 
 oui ALTIMA                     0x0010a9        Altima Communications
 oui AMD                                0x00001a        Advanced Micro Devices
+oui ATHEROS                    0x001374        Atheros
+oui ATTANSIC                   0x00c82e        Attansic Technology
 oui BROADCOM                   0x001018        Broadcom Corporation
 oui BROADCOM2                  0x000af7        Broadcom Corporation
 oui CICADA                     0x0003F1        Cicada Semiconductor
@@ -101,6 +103,14 @@
  * List of known models.  Grouped by oui.
  */
 
+/* Atheros PHYs */              
+model ATHEROS F1               0x0001 F1 10/100/1000 PHY
+model ATHEROS F2               0x0002 F2 10/100 PHY
+
+/* Attansic PHYs */             
+model ATTANSIC L1              0x0001 L1 10/100/1000 PHY
+model ATTANSIC L2              0x0002 L2 10/100 PHY
+
 /* Altima Communications PHYs */
 /* Don't know the model for ACXXX */
 model ALTIMA ACXXX             0x0001 ACXXX 10/100 media interface
Index: dev/mii/miivar.h
===================================================================
RCS file: /cvsroot/src/sys/dev/mii/miivar.h,v
retrieving revision 1.52
diff -u -r1.52 miivar.h
--- dev/mii/miivar.h    4 May 2008 17:06:09 -0000       1.52
+++ dev/mii/miivar.h    20 Apr 2009 22:21:35 -0000
@@ -231,6 +231,7 @@
 void   mii_tick(struct mii_data *);
 void   mii_pollstat(struct mii_data *);
 void   mii_down(struct mii_data *);
+int    mii_anar(int);
 
 int mii_ifmedia_change(struct mii_data *);
 
Index: dev/pci/files.pci
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/files.pci,v
retrieving revision 1.308
diff -u -r1.308 files.pci
--- dev/pci/files.pci   30 Oct 2008 12:02:14 -0000      1.308
+++ dev/pci/files.pci   20 Apr 2009 22:21:35 -0000
@@ -932,6 +932,11 @@
 defflag        opt_r128fb.h    R128FB_DEBUG
 defflag        opt_r128fb.h    R128FB_WAIT
 
+# Attanisc/Atheros L1E Gigabit Ethernet
+device ale: ether, ifnet, arp, mii, mii_phy
+attach ale at pci
+file   dev/pci/if_ale.c                ale
+
 # Atheros/Attansic L2 Fast-Ethernet
 device lii: ether, ifnet, arp, mii
 attach lii at pci
Index: dev/pci/pcidevs
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/pcidevs,v
retrieving revision 1.962.4.1
diff -u -r1.962.4.1 pcidevs
--- dev/pci/pcidevs     20 Mar 2009 13:01:35 -0000      1.962.4.1
+++ dev/pci/pcidevs     20 Apr 2009 22:21:36 -0000
@@ -1059,6 +1059,7 @@
 product ASUSTEK HFCPCI         0x0675  ISDN
 
 /* Attansic Technology Corp. */
+product ATTANSIC ETHERNET_L1E   0x1026  L1E Gigabit Ethernet Adapter
 product ATTANSIC ETHERNET_GIGA 0x1048  L1 Gigabit Ethernet Adapter
 product ATTANSIC ETHERNET_100  0x2048  L2 100 Mbit Ethernet Adapter
 



Home | Main Index | Thread Index | Old Index