ral - Make sure nodes are properly uninitialized and reinitialized.
authorJoe Talbott <josepht@dragonflybsd.org>
Mon, 30 Aug 2010 20:20:44 +0000 (16:20 -0400)
committerJoe Talbott <josepht@dragonflybsd.org>
Mon, 30 Aug 2010 20:32:06 +0000 (16:32 -0400)
Adds rt2661_newassoc() which cleans up the ieee80211_node.

Reported-by: Max Herrgard <herrgard@gmail.com>
Tested-by: Max Herrgard <herrgard@gmail.com>
sys/dev/netif/ral/rt2661.c

index d6051c8..1b8358a 100644 (file)
@@ -98,6 +98,7 @@ static void           rt2661_reset_rx_ring(struct rt2661_softc *,
                            struct rt2661_rx_ring *);
 static void            rt2661_free_rx_ring(struct rt2661_softc *,
                            struct rt2661_rx_ring *);
+static void            rt2661_newassoc(struct ieee80211_node *, int);
 static int             rt2661_newstate(struct ieee80211vap *,
                            enum ieee80211_state, int);
 static uint16_t                rt2661_eeprom_read(struct rt2661_softc *, uint8_t);
@@ -303,6 +304,7 @@ rt2661_attach(device_t dev, int id)
        ieee80211_init_channels(ic, NULL, &bands);
 
        ieee80211_ifattach(ic, macaddr);
+       ic->ic_newassoc = rt2661_newassoc;
 #if 0
        ic->ic_wme.wme_update = rt2661_wme_update;
 #endif
@@ -771,6 +773,13 @@ rt2661_free_rx_ring(struct rt2661_softc *sc, struct rt2661_rx_ring *ring)
                bus_dma_tag_destroy(ring->data_dmat);
 }
 
+static void
+rt2661_newassoc(struct ieee80211_node *ni, int isnew)
+{
+       ieee80211_ratectl_node_deinit(ni);
+       ieee80211_ratectl_node_init(ni);
+}
+
 static int
 rt2661_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
 {