Merge branch 'next/devel' of git://git.linaro.org/people/arnd/arm-soc
[cascardo/linux.git] / drivers / net / wireless / rt2x00 / rt2x00dev.c
index 0955c94..e1fb2a8 100644 (file)
 #include "rt2x00.h"
 #include "rt2x00lib.h"
 
+/*
+ * Utility functions.
+ */
+u32 rt2x00lib_get_bssidx(struct rt2x00_dev *rt2x00dev,
+                        struct ieee80211_vif *vif)
+{
+       /*
+        * When in STA mode, bssidx is always 0 otherwise local_address[5]
+        * contains the bss number, see BSS_ID_MASK comments for details.
+        */
+       if (rt2x00dev->intf_sta_count)
+               return 0;
+       return vif->addr[5] & (rt2x00dev->ops->max_ap_intf - 1);
+}
+EXPORT_SYMBOL_GPL(rt2x00lib_get_bssidx);
+
 /*
  * Radio control handlers.
  */
@@ -914,6 +930,11 @@ static int rt2x00lib_probe_hw(struct rt2x00_dev *rt2x00dev)
        else if (test_bit(REQUIRE_DMA, &rt2x00dev->cap_flags))
                rt2x00dev->hw->extra_tx_headroom += RT2X00_ALIGN_SIZE;
 
+       /*
+        * Tell mac80211 about the size of our private STA structure.
+        */
+       rt2x00dev->hw->sta_data_size = sizeof(struct rt2x00_sta);
+
        /*
         * Allocate tx status FIFO for driver use.
         */
@@ -946,7 +967,6 @@ static int rt2x00lib_probe_hw(struct rt2x00_dev *rt2x00dev)
                tasklet_init(&rt2x00dev->taskletname, \
                             rt2x00dev->ops->lib->taskletname, \
                             (unsigned long)rt2x00dev); \
-               tasklet_disable(&rt2x00dev->taskletname); \
        }
 
        RT2X00_TASKLET_INIT(txstatus_tasklet);