Re: Driver for Attansic Technology E2200.
Hi Martin, good afternoon. First of all, I want to thank your reply with the comments about the device driver. I answer you email next to you comments. 2015-11-09 11:30 GMT+01:00 Martin Pieuchot : > Hello Guillermo, > > On 08/11/15(Sun) 17:06, Guillermo Bernaldo de Quiros Maraver wrote: > > Hi, good afternoon. > > > > I don't know if this is the correct list to post the next email so, I'm > > sorry if this isn't the correct place. > > > > My laptop computer wich is an MSI GE70 2QE has a network interface which > > currently it seems to be not supported by -current so I tried to port the > > device driver to OpenBSD based on the driver from FreeBSD which is > similar > > and now the network interface is working correctly. Next I paste some > > information about the hardware and the device driver: > > > > 1º Dmesg: > > alc0 at pci4 dev 0 function 0 "Attansic Technology E2200" rev 0x13: msi, > > address d8:cb:8a:84:db:cc > > atphy0 at alc0 phy 0: F1 10/100/1000 PHY, rev. 9 > > > > 2º Output of ifconfig alc0 > > alc0: flags=8843 mtu 1500 > > lladdr d8:cb:8a:84:db:cc > > priority: 0 > > groups: egress > > media: Ethernet autoselect (1000baseT full-duplex,rxpause,txpause) > > status: active > > inet 192.168.1.7 netmask 0xff00 broadcast 192.168.1.255 > > 3º full dmesg in the attachment > > 4º cvs diff if_alc.c and cvs diff in the attachments. > > > > I don't know if you're interested to apply the diff's into base but I > think > > that could be a good idea. > > Some comments inline. > > > alc0: could not disable Rx/Tx MAC(0x40009e00)! > > Did you investigate what does that mean? > No, I didn't because I hadn't enough time to investigate this problem but I'll investigate as soon as I have free time. > > > Index: if_alc.c > > === > > RCS file: /cvs/src/sys/dev/pci/if_alc.c,v > > retrieving revision 1.35 > > diff -u -p -r1.35 if_alc.c > > --- if_alc.c 25 Oct 2015 13:04:28 - 1.35 > > +++ if_alc.c 8 Nov 2015 16:02:09 - > > @@ -120,7 +120,8 @@ const struct pci_matchid alc_devices[] = > > { PCI_VENDOR_ATTANSIC, PCI_PRODUCT_ATTANSIC_L1D }, > > { PCI_VENDOR_ATTANSIC, PCI_PRODUCT_ATTANSIC_L1D_1 }, > > { PCI_VENDOR_ATTANSIC, PCI_PRODUCT_ATTANSIC_L2C_1 }, > > - { PCI_VENDOR_ATTANSIC, PCI_PRODUCT_ATTANSIC_L2C_2 } > > + { PCI_VENDOR_ATTANSIC, PCI_PRODUCT_ATTANSIC_L2C_2 }, > > + { PCI_VENDOR_ATTANSIC, PCI_PRODUCT_ATTANSIC_E2200 } > > }; > > > > struct cfattach alc_ca = { > > @@ -525,6 +526,7 @@ alc_phy_down(struct alc_softc *sc) > > switch (sc->sc_product) { > > case PCI_PRODUCT_ATTANSIC_L1D: > > case PCI_PRODUCT_ATTANSIC_L1D_1: > > + case PCI_PRODUCT_ATTANSIC_E2200: > > /* > >* GPHY power down caused more problems on AR8151 v2.0. > >* When driver is reloaded after GPHY power down, > > @@ -783,10 +785,14 @@ alc_attach(struct device *parent, struct > > case PCI_PRODUCT_ATTANSIC_L1D_1: > > sc->alc_flags |= ALC_FLAG_APS; > > /* FALLTHROUGH */ > > + case PCI_PRODUCT_ATTANSIC_E2200: > > + sc->alc_flags |= ALC_FLAG_AR816X_FAMILY; > > + break; > > default: > > break; > > } > > - sc->alc_flags |= ALC_FLAG_ASPM_MON | ALC_FLAG_JUMBO; > > + //sc->alc_flags |= ALC_FLAG_ASPM_MON | ALC_FLAG_JUMBO; > > + sc->alc_flags |= ALC_FLAG_JUMBO; > > Why did you change this flag? This cannot be committed as-is if this is > really needed then you could add a conditional statement based on the > product ID. > Sorry I changed this flag because in the FreeBSD device driver this flag doesn't seems to exist. I'll fix this maybe tomorrow morning. > > > > @@ -797,6 +803,7 @@ alc_attach(struct device *parent, struct > > case PCI_PRODUCT_ATTANSIC_L1D_1: > > case PCI_PRODUCT_ATTANSIC_L2C_1: > > case PCI_PRODUCT_ATTANSIC_L2C_2: > > + case PCI_PRODUCT_ATTANSIC_E2200: > > sc->alc_max_framelen = 6 * 1024; > > break; > > } > > @@ -2035,7 +2042,9 @@ alc_reset(struct alc_softc *sc) > > printf("%s: master reset timeout!\n", sc->sc_dev.dv_xname); > > > > for (i = ALC_RESET_TIMEOUT; i > 0; i--) { > > - if ((reg = CSR_READ_4(sc, ALC_IDLE_STATUS)) == 0) > > + reg = CSR_READ_4(sc,ALC_IDLE_STATUS); > > + if ((reg & (IDLE_STATUS_RXMAC | IDLE_STATUS_TXMAC | > > + IDLE_STATUS_RXQ | IDLE_STATUS_TXQ)) == 0) > > Isn't this related to the message in your dmesg? > Maybe, I just tried to write the same code as the FreeBSD device driver source code. But in fact, if you omit this code, the network doesn't works. > > > break; > > DELAY(10); > > } > > @@ -2485,6 +2494,7 @@ alc_stop_queue(struct alc_softc *sc) > > reg &= ~TXQ_CFG_ENB; > > CSR_WRITE_4(sc, ALC_TXQ_CFG, reg); > > } > > + DELAY(40); >
Re: Driver for Attansic Technology E2200.
Hello Guillermo, On 08/11/15(Sun) 17:06, Guillermo Bernaldo de Quiros Maraver wrote: > Hi, good afternoon. > > I don't know if this is the correct list to post the next email so, I'm > sorry if this isn't the correct place. > > My laptop computer wich is an MSI GE70 2QE has a network interface which > currently it seems to be not supported by -current so I tried to port the > device driver to OpenBSD based on the driver from FreeBSD which is similar > and now the network interface is working correctly. Next I paste some > information about the hardware and the device driver: > > 1º Dmesg: > alc0 at pci4 dev 0 function 0 "Attansic Technology E2200" rev 0x13: msi, > address d8:cb:8a:84:db:cc > atphy0 at alc0 phy 0: F1 10/100/1000 PHY, rev. 9 > > 2º Output of ifconfig alc0 > alc0: flags=8843 mtu 1500 > lladdr d8:cb:8a:84:db:cc > priority: 0 > groups: egress > media: Ethernet autoselect (1000baseT full-duplex,rxpause,txpause) > status: active > inet 192.168.1.7 netmask 0xff00 broadcast 192.168.1.255 > 3º full dmesg in the attachment > 4º cvs diff if_alc.c and cvs diff in the attachments. > > I don't know if you're interested to apply the diff's into base but I think > that could be a good idea. Some comments inline. > alc0: could not disable Rx/Tx MAC(0x40009e00)! Did you investigate what does that mean? > Index: if_alc.c > === > RCS file: /cvs/src/sys/dev/pci/if_alc.c,v > retrieving revision 1.35 > diff -u -p -r1.35 if_alc.c > --- if_alc.c 25 Oct 2015 13:04:28 - 1.35 > +++ if_alc.c 8 Nov 2015 16:02:09 - > @@ -120,7 +120,8 @@ const struct pci_matchid alc_devices[] = > { PCI_VENDOR_ATTANSIC, PCI_PRODUCT_ATTANSIC_L1D }, > { PCI_VENDOR_ATTANSIC, PCI_PRODUCT_ATTANSIC_L1D_1 }, > { PCI_VENDOR_ATTANSIC, PCI_PRODUCT_ATTANSIC_L2C_1 }, > - { PCI_VENDOR_ATTANSIC, PCI_PRODUCT_ATTANSIC_L2C_2 } > + { PCI_VENDOR_ATTANSIC, PCI_PRODUCT_ATTANSIC_L2C_2 }, > + { PCI_VENDOR_ATTANSIC, PCI_PRODUCT_ATTANSIC_E2200 } > }; > > struct cfattach alc_ca = { > @@ -525,6 +526,7 @@ alc_phy_down(struct alc_softc *sc) > switch (sc->sc_product) { > case PCI_PRODUCT_ATTANSIC_L1D: > case PCI_PRODUCT_ATTANSIC_L1D_1: > + case PCI_PRODUCT_ATTANSIC_E2200: > /* >* GPHY power down caused more problems on AR8151 v2.0. >* When driver is reloaded after GPHY power down, > @@ -783,10 +785,14 @@ alc_attach(struct device *parent, struct > case PCI_PRODUCT_ATTANSIC_L1D_1: > sc->alc_flags |= ALC_FLAG_APS; > /* FALLTHROUGH */ > + case PCI_PRODUCT_ATTANSIC_E2200: > + sc->alc_flags |= ALC_FLAG_AR816X_FAMILY; > + break; > default: > break; > } > - sc->alc_flags |= ALC_FLAG_ASPM_MON | ALC_FLAG_JUMBO; > + //sc->alc_flags |= ALC_FLAG_ASPM_MON | ALC_FLAG_JUMBO; > + sc->alc_flags |= ALC_FLAG_JUMBO; Why did you change this flag? This cannot be committed as-is if this is really needed then you could add a conditional statement based on the product ID. > @@ -797,6 +803,7 @@ alc_attach(struct device *parent, struct > case PCI_PRODUCT_ATTANSIC_L1D_1: > case PCI_PRODUCT_ATTANSIC_L2C_1: > case PCI_PRODUCT_ATTANSIC_L2C_2: > + case PCI_PRODUCT_ATTANSIC_E2200: > sc->alc_max_framelen = 6 * 1024; > break; > } > @@ -2035,7 +2042,9 @@ alc_reset(struct alc_softc *sc) > printf("%s: master reset timeout!\n", sc->sc_dev.dv_xname); > > for (i = ALC_RESET_TIMEOUT; i > 0; i--) { > - if ((reg = CSR_READ_4(sc, ALC_IDLE_STATUS)) == 0) > + reg = CSR_READ_4(sc,ALC_IDLE_STATUS); > + if ((reg & (IDLE_STATUS_RXMAC | IDLE_STATUS_TXMAC | > + IDLE_STATUS_RXQ | IDLE_STATUS_TXQ)) == 0) Isn't this related to the message in your dmesg? > break; > DELAY(10); > } > @@ -2485,6 +2494,7 @@ alc_stop_queue(struct alc_softc *sc) > reg &= ~TXQ_CFG_ENB; > CSR_WRITE_4(sc, ALC_TXQ_CFG, reg); > } > + DELAY(40); > for (i = ALC_TIMEOUT; i > 0; i--) { > reg = CSR_READ_4(sc, ALC_IDLE_STATUS); > if ((reg & (IDLE_STATUS_RXQ | IDLE_STATUS_TXQ)) == 0) > Index: if_alcreg.h > === > RCS file: /cvs/src/sys/dev/pci/if_alcreg.h,v > retrieving revision 1.5 > diff -u -p -r1.5 if_alcreg.h > --- if_alcreg.h 27 Nov 2014 14:52:04 - 1.5 > +++ if_alcreg.h 8 Nov 2015 16:05:42 - > @@ -1164,6 +1164,7 @@ struct alc_softc { > #define ALC_FLAG_L0S0x0400 > #define ALC_FLAG_L1S0x0800 > #define ALC_FLAG_APS0x1000 > +#define ALC_FLAG_AR816X_FAMILY 0x2000 Please use a tab here, to be coherent with the rest of the defines. > #define ALC_FLAG_DETACH
Driver for Attansic Technology E2200.
Hi, good afternoon. I don't know if this is the correct list to post the next email so, I'm sorry if this isn't the correct place. My laptop computer wich is an MSI GE70 2QE has a network interface which currently it seems to be not supported by -current so I tried to port the device driver to OpenBSD based on the driver from FreeBSD which is similar and now the network interface is working correctly. Next I paste some information about the hardware and the device driver: 1º Dmesg: alc0 at pci4 dev 0 function 0 "Attansic Technology E2200" rev 0x13: msi, address d8:cb:8a:84:db:cc atphy0 at alc0 phy 0: F1 10/100/1000 PHY, rev. 9 2º Output of ifconfig alc0 alc0: flags=8843 mtu 1500 lladdr d8:cb:8a:84:db:cc priority: 0 groups: egress media: Ethernet autoselect (1000baseT full-duplex,rxpause,txpause) status: active inet 192.168.1.7 netmask 0xff00 broadcast 192.168.1.255 3º full dmesg in the attachment 4º cvs diff if_alc.c and cvs diff in the attachments. I don't know if you're interested to apply the diff's into base but I think that could be a good idea. PS: Although the driver works correctly, I'm still debugging the driver. Thank you very much for every thing. Have a nice day. Guille ,SMEP,BMI2,ERMS,INVPCID,SENSOR,ARAT cpu2: 256KB 64b/line 8-way L2 cache cpu2: smt 0, core 2, package 0 cpu3 at mainbus0: apid 6 (application processor) cpu3: Intel(R) Core(TM) i7-4720HQ CPU @ 2.60GHz, 3392.15 MHz cpu3: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,LONG,LAHF,ABM,PERF,ITSC,FSGSBASE,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,SENSOR,ARAT cpu3: 256KB 64b/line 8-way L2 cache cpu3: smt 0, core 3, package 0 cpu4 at mainbus0: apid 1 (application processor) cpu4: Intel(R) Core(TM) i7-4720HQ CPU @ 2.60GHz, 3392.15 MHz cpu4: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,LONG,LAHF,ABM,PERF,ITSC,FSGSBASE,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,SENSOR,ARAT cpu4: 256KB 64b/line 8-way L2 cache cpu4: smt 1, core 0, package 0 cpu5 at mainbus0: apid 3 (application processor) cpu5: Intel(R) Core(TM) i7-4720HQ CPU @ 2.60GHz, 3392.15 MHz cpu5: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,LONG,LAHF,ABM,PERF,ITSC,FSGSBASE,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,SENSOR,ARAT cpu5: 256KB 64b/line 8-way L2 cache cpu5: smt 1, core 1, package 0 cpu6 at mainbus0: apid 5 (application processor) cpu6: Intel(R) Core(TM) i7-4720HQ CPU @ 2.60GHz, 3392.15 MHz cpu6: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,LONG,LAHF,ABM,PERF,ITSC,FSGSBASE,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,SENSOR,ARAT cpu6: 256KB 64b/line 8-way L2 cache cpu6: smt 1, core 2, package 0 cpu7 at mainbus0: apid 7 (application processor) cpu7: Intel(R) Core(TM) i7-4720HQ CPU @ 2.60GHz, 3392.15 MHz cpu7: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,LONG,LAHF,ABM,PERF,ITSC,FSGSBASE,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,SENSOR,ARAT cpu7: 256KB 64b/line 8-way L2 cache cpu7: smt 1, core 3, package 0 ioapic0 at mainbus0: apid 8 pa 0xfec0, version 20, 24 pins acpimcfg0 at acpi0 addr 0xf800, bus 0-63 acpihpet0 at acpi0: 14318179 Hz acpiprt0 at acpi0: bus 0 (PCI0) acpiprt1 at acpi0: bus 2 (RP01) acpiprt2 at acpi0: bus 3 (RP03) acpiprt3 at acpi0: bus 4 (RP04) acpiprt4 at acpi0: bus 5 (RP06) acpiprt5 at acpi0: bus 1 (PEG0) acpiprt6 at acpi0: bus -1 (PEG1) acpiprt7 at acpi0: bus -1 (PEG2) acpiec0 at acpi0 acpiec at acpi0 not configured acpicpu0 at acpi0: C2(200@148 mwait.1@0x33), C1(1000@1 mwait.1), PSS acpicpu1 at acpi0: C2(200@148 mwait.1@0x33), C1(1000@1 mwait.1), PSS acpicpu2 at acpi0: C2(200@148 mwait.1@0x33), C1(1000@1 mwait.1), PSS acpicpu3 at acpi0: C2(200@148 mwait.1@0x33), C1(1000@1 mwait.1), PSS acpicpu4 at acpi0: C2(200@148 mwait.1@0x33), C1(1000@1 mwait.1), PSS acpicpu5 at acpi0: C2(200@148 mwait.1@0x33), C1(1000@1 mwait.1), PSS acpicpu6 at acpi0: C2(200@148 mwait.1@0x33), C1(1000@1 mwait.1), PSS acpicpu7 at acpi0: C2(200@148 mwait.1@0x33), C1(1000@1 mwait.1), PSS