diff options
author | yongari <yongari@FreeBSD.org> | 2010-11-06 22:07:22 +0000 |
---|---|---|
committer | yongari <yongari@FreeBSD.org> | 2010-11-06 22:07:22 +0000 |
commit | fb31655590940cd51b92296b12645bc24e5e749a (patch) | |
tree | 3519c9f2bf80dfba6177abf1e85017bacc57686c | |
parent | c96a19b55e663cd991f6ddfeff6f3ada277be24b (diff) | |
download | FreeBSD-src-fb31655590940cd51b92296b12645bc24e5e749a.zip FreeBSD-src-fb31655590940cd51b92296b12645bc24e5e749a.tar.gz |
Fix a long standing bug in programming station address for Yukon
controllers. sk(4) never reprogrammed station address for Yukon
controllers so overriding station address with ifconfig(8) was not
possible.
Fix the bug by reprogramming all registers that control station
address, flow-control and virtual station address. Virtual station
address has no use at this moment since driver does not make use of
fail over feature.
Tested by: "Mikhail T." <mi+thun <> aldan.algebra.com>
MFC after: 1 week
-rw-r--r-- | sys/dev/sk/if_sk.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/sys/dev/sk/if_sk.c b/sys/dev/sk/if_sk.c index 3ed6300..d9fae08 100644 --- a/sys/dev/sk/if_sk.c +++ b/sys/dev/sk/if_sk.c @@ -3356,6 +3356,7 @@ sk_init_yukon(sc_if) u_int16_t reg; struct sk_softc *sc; struct ifnet *ifp; + u_int8_t *eaddr; int i; SK_IF_LOCK_ASSERT(sc_if); @@ -3431,19 +3432,19 @@ sk_init_yukon(sc_if) reg |= YU_SMR_MFL_JUMBO; SK_YU_WRITE_2(sc_if, YUKON_SMR, reg); - /* Setup Yukon's address */ - for (i = 0; i < 3; i++) { - /* Write Source Address 1 (unicast filter) */ + /* Setup Yukon's station address */ + eaddr = IF_LLADDR(sc_if->sk_ifp); + for (i = 0; i < 3; i++) + SK_YU_WRITE_2(sc_if, SK_MAC0_0 + i * 4, + eaddr[i * 2] | eaddr[i * 2 + 1] << 8); + /* Set GMAC source address of flow control. */ + for (i = 0; i < 3; i++) SK_YU_WRITE_2(sc_if, YUKON_SAL1 + i * 4, - IF_LLADDR(sc_if->sk_ifp)[i * 2] | - IF_LLADDR(sc_if->sk_ifp)[i * 2 + 1] << 8); - } - - for (i = 0; i < 3; i++) { - reg = sk_win_read_2(sc_if->sk_softc, - SK_MAC1_0 + i * 2 + sc_if->sk_port * 8); - SK_YU_WRITE_2(sc_if, YUKON_SAL2 + i * 4, reg); - } + eaddr[i * 2] | eaddr[i * 2 + 1] << 8); + /* Set GMAC virtual address. */ + for (i = 0; i < 3; i++) + SK_YU_WRITE_2(sc_if, YUKON_SAL2 + i * 4, + eaddr[i * 2] | eaddr[i * 2 + 1] << 8); /* Set Rx filter */ sk_rxfilter_yukon(sc_if); |