]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
wl12xx: move p2p into wlvif
authorEliad Peller <eliad@wizery.com>
Wed, 5 Oct 2011 09:55:47 +0000 (11:55 +0200)
committerLuciano Coelho <coelho@ti.com>
Fri, 7 Oct 2011 05:32:38 +0000 (08:32 +0300)
move p2p field into the per-interface data, rather than
being global.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
drivers/net/wireless/wl12xx/main.c
drivers/net/wireless/wl12xx/wl12xx.h

index 50ee9d40e641b335afb41cbf85a72d373e74f771..111a465ec541fcd8f4b82515fa6168c3fa409021 100644 (file)
@@ -1827,13 +1827,13 @@ static u8 wl12xx_get_role_type(struct wl1271 *wl, struct wl12xx_vif *wlvif)
 {
        switch (wlvif->bss_type) {
        case BSS_TYPE_AP_BSS:
-               if (wl->p2p)
+               if (wlvif->p2p)
                        return WL1271_ROLE_P2P_GO;
                else
                        return WL1271_ROLE_AP;
 
        case BSS_TYPE_STA_BSS:
-               if (wl->p2p)
+               if (wlvif->p2p)
                        return WL1271_ROLE_P2P_CL;
                else
                        return WL1271_ROLE_STA;
@@ -1890,7 +1890,7 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw,
 
        switch (ieee80211_vif_type_p2p(vif)) {
        case NL80211_IFTYPE_P2P_CLIENT:
-               wl->p2p = 1;
+               wlvif->p2p = 1;
                /* fall-through */
        case NL80211_IFTYPE_STATION:
                wlvif->bss_type = BSS_TYPE_STA_BSS;
@@ -1899,7 +1899,7 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw,
                wlvif->bss_type = BSS_TYPE_IBSS;
                break;
        case NL80211_IFTYPE_P2P_GO:
-               wl->p2p = 1;
+               wlvif->p2p = 1;
                /* fall-through */
        case NL80211_IFTYPE_AP:
                wlvif->bss_type = BSS_TYPE_AP_BSS;
@@ -2105,7 +2105,6 @@ deinit:
 
        memset(wl->ssid, 0, IEEE80211_MAX_SSID_LEN + 1);
        wl->ssid_len = 0;
-       wl->p2p = 0;
        wl->band = IEEE80211_BAND_2GHZ;
 
        wl->rx_counter = 0;
index 0578d750528b12e157dfc9ecf59a1d4788cd09f8..d84c0deee36a7b72533213e0462f8baa881e36e8 100644 (file)
@@ -400,7 +400,6 @@ struct wl1271 {
        s8 hw_pg_ver;
 
        u8 mac_addr[ETH_ALEN];
-       u8 p2p; /* we are using p2p role */
        u8 ssid[IEEE80211_MAX_SSID_LEN + 1];
        u8 ssid_len;
        int channel;
@@ -629,6 +628,7 @@ struct wl1271_station {
 
 struct wl12xx_vif {
        u8 bss_type;
+       u8 p2p; /* we are using p2p role */
 
        u32 basic_rate_set;