brcmsmac: add interface type to brcms_bss_cfg
authorHauke Mehrtens <hauke@hauke-m.de>
Sun, 24 Mar 2013 00:45:50 +0000 (01:45 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 27 Mar 2013 17:37:33 +0000 (13:37 -0400)
This makes it possible to easily check in which mode the device is
currently running. This also adds a function to start station mode.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
drivers/net/wireless/brcm80211/brcmsmac/main.c
drivers/net/wireless/brcm80211/brcmsmac/main.h
drivers/net/wireless/brcm80211/brcmsmac/pub.h

index 2d863ff6972a7af46ca88bb3b5ea8cefdfc22acd..0e4457c83e4b1423a977db94448e1291e6211be4 100644 (file)
@@ -365,9 +365,10 @@ brcms_ops_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
        }
 
        spin_lock_bh(&wl->lock);
-       memcpy(wl->pub->cur_etheraddr, vif->addr, sizeof(vif->addr));
        wl->mute_tx = false;
        brcms_c_mute(wl->wlc, false);
+       if (vif->type == NL80211_IFTYPE_STATION)
+               brcms_c_start_station(wl->wlc, vif->addr);
        spin_unlock_bh(&wl->lock);
 
        return 0;
index 60276af727b3da51d747eee1bf444d04107ea04a..4e420ead38e978e5cc7236c290320b43e4c4d327 100644 (file)
@@ -2163,6 +2163,12 @@ void brcms_b_switch_macfreq(struct brcms_hardware *wlc_hw, u8 spurmode)
        }
 }
 
+void brcms_c_start_station(struct brcms_c_info *wlc, u8 *addr)
+{
+       memcpy(wlc->pub->cur_etheraddr, addr, sizeof(wlc->pub->cur_etheraddr));
+       wlc->bsscfg->type = BRCMS_TYPE_STATION;
+}
+
 /* Initialize GPIOs that are controlled by D11 core */
 static void brcms_c_gpio_init(struct brcms_c_info *wlc)
 {
index fb447747c2c6e9975b681a7d42f0dc6ae5ad00bd..dbf027cd5d19fe3087e07feecad535b64f73a411 100644 (file)
@@ -576,10 +576,17 @@ struct antsel_info {
        struct brcms_antselcfg antcfg_cur; /* current antenna config (auto) */
 };
 
+enum brcms_bss_type {
+       BRCMS_TYPE_STATION,
+       BRCMS_TYPE_AP,
+       BRCMS_TYPE_ADHOC,
+};
+
 /*
  * BSS configuration state
  *
  * wlc: wlc to which this bsscfg belongs to.
+ * type: interface type
  * up: is this configuration up operational
  * enable: is this configuration enabled
  * associated: is BSS in ASSOCIATED state
@@ -599,6 +606,7 @@ struct antsel_info {
  */
 struct brcms_bss_cfg {
        struct brcms_c_info *wlc;
+       enum brcms_bss_type type;
        bool up;
        bool enable;
        bool associated;
index 382fb09ac8beb28f8391736106c3274ea6a04f50..aa8580fe82bb2e2bff87394c981dfe237cea1a05 100644 (file)
@@ -333,5 +333,6 @@ extern int brcms_c_get_tx_power(struct brcms_c_info *wlc);
 extern bool brcms_c_check_radio_disabled(struct brcms_c_info *wlc);
 extern void brcms_c_mute(struct brcms_c_info *wlc, bool on);
 extern bool brcms_c_tx_flush_completed(struct brcms_c_info *wlc);
+extern void brcms_c_start_station(struct brcms_c_info *wlc, u8 *addr);
 
 #endif                         /* _BRCM_PUB_H_ */