Thanks committed. This would have been matched by RL_HWREV_8168G_SPIN2 had I not forgotten to mask the define with 0x7c800000 when adding it.
On Tue, Apr 22, 2014 at 06:02:41PM -0400, Rafael Neves wrote: > Hi tech@, > > I put my hands today on a Dell Lattitude 3440 and it has an Atheros > AR9565 and a Realtek 8168. Trying -current on it shows up that re(4) > attaches but it cannot recognize the hardware revision and properly > init the card (full dmesg at end): > re0 at pci3 dev 0 function 0 "Realtek 8168" rev 0x10: unknown ASIC > (0x5080), msi, address 00:00:00:00:00:00 > rgephy0 at re0 phy 7: RTL8251 PHY, rev. 0 > > Sprinkling some printf'f in re.c I found that in re_attach there is no > RL_HWREV that matches sc->hw_rev. Actually for this card: > CSR_READ_4(sc, RLTXCFG) = 0x53900d00 > RX_TXCFG_HWREV = 0x7c800000 > sc->hw_rev = 0x50800000 (= CSR_READ_4(sc, RLTXCFG) & RX_TXCFG_HWREV) > > I searched on FreeBSD re(4) driver and it seems to support this chip > and labels it as 8168GU (see [1] and [2]). The patch below ports these > bits from FreeBSD code but it only uses the flag that OpenBSD re.c > sets for other hardware revisions. After aply the patch the card is > properly recognized and is working, at least it survived two days of > normal use and a full dhclient & pkd_add -u. The same dmesg lines now > becames (real mac address supressed): > re0 at pci3 dev 0 function 0 "Realtek 8168" rev 0x10: > RTL8168GU/8111GU (0x5080), msi, address xx:xx:xx:xx:xx:xx > rgephy0 at re0 phy 7: RTL8251 PHY, rev. 0 > > Thanks, > Rafael. > > References: > [1] http://marc.info/?l=freebsd-commits-all&m=138302463226323&w=2
