Delay creating ic_bss until after the super-class has a chance

to override the method pointers for manipulating nodes; this fixes
a problem where the ic_bss node was not being created properly
for the ath driver causing the driver to scribble on random memory.

Noticed by:	David Young <dyoung@pobox.com>
This commit is contained in:
sam 2003-08-13 22:09:44 +00:00
parent e588332388
commit af81e4b88b
3 changed files with 14 additions and 0 deletions

View File

@ -251,6 +251,12 @@ ieee80211_media_init(struct ifnet *ifp,
struct ieee80211_rateset *rs;
struct ieee80211_rateset allrates;
/*
* Do late attach work that must wait for any subclass
* (i.e. driver) work such as overriding methods.
*/
ieee80211_node_lateattach(ifp);
/*
* Fill in media characteristics.
*/

View File

@ -86,6 +86,13 @@ ieee80211_node_attach(struct ifnet *ifp)
ic->ic_node_alloc = ieee80211_node_alloc;
ic->ic_node_free = ieee80211_node_free;
ic->ic_node_copy = ieee80211_node_copy;
}
void
ieee80211_node_lateattach(struct ifnet *ifp)
{
struct ieee80211com *ic = (void *)ifp;
ic->ic_bss = (*ic->ic_node_alloc)(ic);
KASSERT(ic->ic_bss != NULL, ("unable to setup inital BSS node"));
ic->ic_bss->ni_chan = IEEE80211_CHAN_ANYC;

View File

@ -121,6 +121,7 @@ ieee80211_unref_node(struct ieee80211_node **ni)
struct ieee80211com;
extern void ieee80211_node_attach(struct ifnet *);
extern void ieee80211_node_lateattach(struct ifnet *);
extern void ieee80211_node_detach(struct ifnet *);
extern void ieee80211_begin_scan(struct ifnet *);