Merge branch 'for-john' of git://git.sipsolutions.net/mac80211-next
[sfrench/cifs-2.6.git] / drivers / net / wireless / rt2x00 / rt2x00dev.c
index 07202f11be3c798f50526f596043bc183734aa56..4ffb6a584cd0c406509f8d8bf3ba1f32cf209ad2 100644 (file)
@@ -1123,6 +1123,9 @@ static inline void rt2x00lib_set_if_combinations(struct rt2x00_dev *rt2x00dev)
        struct ieee80211_iface_limit *if_limit;
        struct ieee80211_iface_combination *if_combination;
 
+       if (rt2x00dev->ops->max_ap_intf < 2)
+               return;
+
        /*
         * Build up AP interface limits structure.
         */
@@ -1181,6 +1184,13 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev)
         */
        rt2x00dev->hw->vif_data_size = sizeof(struct rt2x00_intf);
 
+       /*
+        * rt2x00 devices can only use the last n bits of the MAC address
+        * for virtual interfaces.
+        */
+       rt2x00dev->hw->wiphy->addr_mask[ETH_ALEN - 1] =
+               (rt2x00dev->ops->max_ap_intf - 1);
+
        /*
         * Determine which operating modes are supported, all modes
         * which require beaconing, depend on the availability of