do proper subclassing of node free+copy; the previous hack falls apart when

the 802.11 layer does useful work

Obtained from:	madwifi
This commit is contained in:
Sam Leffler 2004-04-03 00:06:23 +00:00
parent babe2453bd
commit 1e77407972

View file

@ -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);
}