On 01/25/11 11:24, Kevin Lo wrote:
Hi,

The following diff adds support for Atheros AR8151/AR8152 chipsets;
mostly from FreeBSD. It also fixes an issue i386/6311.
Tested on Acer AOD255E.

Tried yesterday on EeePC 1005PX, some comments inline.

@@ -515,6 +694,20 @@ alc_attach(struct device *parent, struct
                val = CSR_READ_4(sc, ALC_PEX_UNC_ERR_SEV);
                val&= ~(PEX_UNC_ERR_SEV_DLP | PEX_UNC_ERR_SEV_FCP);
                CSR_WRITE_4(sc, ALC_PEX_UNC_ERR_SEV, val);
+               CSR_WRITE_4(sc, ALC_LTSSM_ID_CFG,
+                   CSR_READ_4(sc, ALC_LTSSM_ID_CFG)&  ~LTSSM_ID_WRO_ENB);
+               CSR_WRITE_4(sc, ALC_PCIE_PHYMISC,
+                   CSR_READ_4(sc, ALC_PCIE_PHYMISC) |
+                   PCIE_PHYMISC_FORCE_RCV_DET);
+               if (sc->sc_product == PCI_PRODUCT_ATTANSIC_L2C_1&&
+                   sc->alc_rev == ATHEROS_AR8152_B_V10) {

Using sc->sc_product and sc->alc_rev, but they are initialized later.

@@ -551,12 +747,39 @@ alc_attach(struct device *parent, struct
         * used in AR8132 can't establish gigabit link even if it
         * shows the same PHY model/revision number of AR8131.
         */
-       if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_ATTANSIC_L2C)
-               sc->alc_flags |= ALC_FLAG_FASTETHER | ALC_FLAG_JUMBO;
-       else
-               sc->alc_flags |= ALC_FLAG_JUMBO | ALC_FLAG_ASPM_MON;
+       sc->sc_product = PCI_PRODUCT(pa->pa_id);

Here is sc->sc_product, sc->alc_rev initialized line 569 of if_alc.c r1.9

alc_newbuf should always use M_DONTWAIT (get rid of init), see http://marc.info/?l=openbsd-tech&m=129639859909043&w=2

Reply via email to