FreeBSD Bugzilla – Attachment 20334 Details for
Bug 35900
Changing RealTek 8139 MAC address fails
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 1008 bytes, created by
Mark Kettenis
on 2002-03-14 21:50:00 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Mark Kettenis
Created:
2002-03-14 21:50:00 UTC
Size:
1008 bytes
patch
obsolete
>--- /usr/src/sys/pci/if_rl.c.orig Thu Jul 19 20:33:07 2001 >+++ /usr/src/sys/pci/if_rl.c Thu Mar 14 21:53:25 2002 >@@ -1414,7 +1414,7 @@ > struct rl_softc *sc = xsc; > struct ifnet *ifp = &sc->arpcom.ac_if; > struct mii_data *mii; >- int s, i; >+ int s; > u_int32_t rxcfg = 0; > > s = splimp(); >@@ -1426,10 +1426,15 @@ > */ > rl_stop(sc); > >- /* Init our MAC address */ >- for (i = 0; i < ETHER_ADDR_LEN; i++) { >- CSR_WRITE_1(sc, RL_IDR0 + i, sc->arpcom.ac_enaddr[i]); >- } >+ /* >+ * Init our MAC address. Even though the chipset >+ * documentation doesn't mention it, we need to enter "Config >+ * register write enable" mode to modify the ID registers. >+ */ >+ CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_WRITECFG); >+ CSR_WRITE_4(sc, RL_IDR0, *(u_int32_t *)(&sc->arpcom.ac_enaddr[0])); >+ CSR_WRITE_4(sc, RL_IDR4, *(u_int32_t *)(&sc->arpcom.ac_enaddr[4])); >+ CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_OFF); > > /* Init the RX buffer pointer register. */ > CSR_WRITE_4(sc, RL_RXADDR, vtophys(sc->rl_cdata.rl_rx_buf));
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 35900
: 20334