diff options
author | sam <sam@FreeBSD.org> | 2004-04-03 00:06:23 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2004-04-03 00:06:23 +0000 |
commit | 5964f2843d1f069368b2309432aa54f76ead3a41 (patch) | |
tree | a607168a3e951a5f35108668db7850994da4d96c /sys/dev/ath | |
parent | 414d361a59b12802a06aeb3caa0d83f31e063163 (diff) | |
download | FreeBSD-src-5964f2843d1f069368b2309432aa54f76ead3a41.zip FreeBSD-src-5964f2843d1f069368b2309432aa54f76ead3a41.tar.gz |
do proper subclassing of node free+copy; the previous hack falls apart when
the 802.11 layer does useful work
Obtained from: madwifi
Diffstat (limited to 'sys/dev/ath')
-rw-r--r-- | sys/dev/ath/if_ath.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c index 3699e51..c2da257 100644 --- a/sys/dev/ath/if_ath.c +++ b/sys/dev/ath/if_ath.c @@ -325,7 +325,9 @@ ath_attach(u_int16_t devid, struct ath_softc *sc) ieee80211_ifattach(ifp); /* override default methods */ ic->ic_node_alloc = ath_node_alloc; + sc->sc_node_free = ic->ic_node_free; ic->ic_node_free = ath_node_free; + sc->sc_node_copy = ic->ic_node_copy; ic->ic_node_copy = ath_node_copy; ic->ic_node_getrssi = ath_node_getrssi; sc->sc_newstate = ic->ic_newstate; @@ -1516,14 +1518,18 @@ ath_node_free(struct ieee80211com *ic, struct ieee80211_node *ni) if (bf->bf_node == ni) bf->bf_node = NULL; } - free(ni, M_DEVBUF); + (*sc->sc_node_free)(ic, ni); } static void ath_node_copy(struct ieee80211com *ic, struct ieee80211_node *dst, const struct ieee80211_node *src) { - *(struct ath_node *)dst = *(const struct ath_node *)src; + struct ath_softc *sc = ic->ic_if.if_softc; + + memcpy(&dst[1], &src[1], + sizeof(struct ath_node) - sizeof(struct ieee80211_node)); + (*sc->sc_node_copy)(ic, dst, src); } |