[Madwifi-cvs] madwifi/ath if_ath.c,1.1.2.3,1.1.2.4 if_athvar.h,1.1.2.1,1.1.2.2
Status: Beta
Brought to you by:
otaku
From: <sam...@us...> - 2004-02-29 04:30:10
|
Update of /cvsroot/madwifi/madwifi/ath In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9114/ath Modified Files: Tag: WPA if_ath.c if_athvar.h Log Message: Do proper subclassing of node free and copy methods so drivers don't need to be so aware of how the 802.11 layer manages node state: o keep super class methods when overriding ic_node_free and ic_node_copy o make ath_node_copy copy only it's data and use the super-class method to do the reset of the work o make ath_node_free cleanup just it's own state and use the super-class method to do the rest of the work (this depends on kfree not needing to know the size of the structure being reclaimed) Index: if_ath.c =================================================================== RCS file: /cvsroot/madwifi/madwifi/ath/Attic/if_ath.c,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** if_ath.c 27 Feb 2004 21:55:10 -0000 1.1.2.3 --- if_ath.c 29 Feb 2004 04:12:21 -0000 1.1.2.4 *************** *** 389,393 **** --- 389,395 ---- /* 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; *************** *** 1637,1641 **** } ATH_TXQ_UNLOCK_BH(sc); ! kfree(ni); } --- 1639,1643 ---- } ATH_TXQ_UNLOCK_BH(sc); ! (*sc->sc_node_free)(ic, ni); } *************** *** 1644,1648 **** struct ieee80211_node *dst, const struct ieee80211_node *src) { ! *(struct ath_node *)dst = *(const struct ath_node *)src; } --- 1646,1654 ---- struct ieee80211_node *dst, const struct ieee80211_node *src) { ! struct ath_softc *sc = ic->ic_dev->priv; ! ! memcpy(&dst[1], &src[1], ! sizeof(struct ath_node) - sizeof(struct ieee80211_node)); ! (*sc->sc_node_copy)(ic, dst, src); } Index: if_athvar.h =================================================================== RCS file: /cvsroot/madwifi/madwifi/ath/Attic/if_athvar.h,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** if_athvar.h 24 Feb 2004 23:33:20 -0000 1.1.2.1 --- if_athvar.h 29 Feb 2004 04:12:21 -0000 1.1.2.2 *************** *** 130,133 **** --- 130,138 ---- int (*sc_newstate)(struct ieee80211com *, enum ieee80211_state, int); + void (*sc_node_free)(struct ieee80211com *, + struct ieee80211_node *); + void (*sc_node_copy)(struct ieee80211com *, + struct ieee80211_node *, + const struct ieee80211_node *); struct ath_hal *sc_ah; /* Atheros HAL */ unsigned int sc_invalid : 1, /* being detached */ |