mwifiex: multi-interface support for mwifiex
authorAvinash Patil <patila@marvell.com>
Wed, 9 May 2012 01:30:16 +0000 (18:30 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 16 May 2012 16:46:34 +0000 (12:46 -0400)
mwifiex supports STA and AP interfaces which use same phy.
Indicate this to cfg80211.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/mwifiex/cfg80211.c

index 38d51910d13cd7a7f8826e37a055f3300046cab0..453239389d26bc0373930d1d640fe5c459885e88 100644 (file)
 #include "cfg80211.h"
 #include "main.h"
 
+static const struct ieee80211_iface_limit mwifiex_ap_sta_limits[] = {
+       {
+               .max = 1, .types = BIT(NL80211_IFTYPE_STATION),
+       },
+       {
+               .max = 1, .types = BIT(NL80211_IFTYPE_AP),
+       },
+};
+
+static const struct ieee80211_iface_combination mwifiex_iface_comb_ap_sta = {
+       .limits = mwifiex_ap_sta_limits,
+       .num_different_channels = 1,
+       .n_limits = ARRAY_SIZE(mwifiex_ap_sta_limits),
+       .max_interfaces = MWIFIEX_MAX_BSS_NUM,
+       .beacon_int_infra_match = true,
+};
+
 /*
  * This function maps the nl802.11 channel type into driver channel type.
  *
@@ -1505,6 +1522,9 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter)
        else
                wiphy->bands[IEEE80211_BAND_5GHZ] = NULL;
 
+       wiphy->iface_combinations = &mwifiex_iface_comb_ap_sta;
+       wiphy->n_iface_combinations = 1;
+
        /* Initialize cipher suits */
        wiphy->cipher_suites = mwifiex_cipher_suites;
        wiphy->n_cipher_suites = ARRAY_SIZE(mwifiex_cipher_suites);