aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2011-08-28 08:23:01 -0400
committerLuciano Coelho <coelho@ti.com>2011-09-14 06:15:20 -0400
commit045c745f8ccdb584ccc97f068c7c10c1090fbcf9 (patch)
treed75ccef18366c0296e36e1dc861044b369aad857
parent93f8c8e02597b7d7997c4a0a10173ac90ad378e8 (diff)
wl12xx: support p2p interfaces
Declare support for p2p interfaces, and create p2p_cli/p2p_go roles when being asked for. Indicate we are using a p2p interface by setting the wl->p2p flag. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
-rw-r--r--drivers/net/wireless/wl12xx/main.c24
-rw-r--r--drivers/net/wireless/wl12xx/wl12xx.h1
2 files changed, 20 insertions, 5 deletions
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index ade62b3d9a2..680f5582618 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -1825,10 +1825,16 @@ static u8 wl12xx_get_role_type(struct wl1271 *wl)
1825{ 1825{
1826 switch (wl->bss_type) { 1826 switch (wl->bss_type) {
1827 case BSS_TYPE_AP_BSS: 1827 case BSS_TYPE_AP_BSS:
1828 return WL1271_ROLE_AP; 1828 if (wl->p2p)
1829 return WL1271_ROLE_P2P_GO;
1830 else
1831 return WL1271_ROLE_AP;
1829 1832
1830 case BSS_TYPE_STA_BSS: 1833 case BSS_TYPE_STA_BSS:
1831 return WL1271_ROLE_STA; 1834 if (wl->p2p)
1835 return WL1271_ROLE_P2P_CL;
1836 else
1837 return WL1271_ROLE_STA;
1832 1838
1833 case BSS_TYPE_IBSS: 1839 case BSS_TYPE_IBSS:
1834 return WL1271_ROLE_IBSS; 1840 return WL1271_ROLE_IBSS;
@@ -1850,7 +1856,7 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw,
1850 bool booted = false; 1856 bool booted = false;
1851 1857
1852 wl1271_debug(DEBUG_MAC80211, "mac80211 add interface type %d mac %pM", 1858 wl1271_debug(DEBUG_MAC80211, "mac80211 add interface type %d mac %pM",
1853 vif->type, vif->addr); 1859 ieee80211_vif_type_p2p(vif), vif->addr);
1854 1860
1855 mutex_lock(&wl->mutex); 1861 mutex_lock(&wl->mutex);
1856 if (wl->vif) { 1862 if (wl->vif) {
@@ -1870,7 +1876,10 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw,
1870 goto out; 1876 goto out;
1871 } 1877 }
1872 1878
1873 switch (vif->type) { 1879 switch (ieee80211_vif_type_p2p(vif)) {
1880 case NL80211_IFTYPE_P2P_CLIENT:
1881 wl->p2p = 1;
1882 /* fall-through */
1874 case NL80211_IFTYPE_STATION: 1883 case NL80211_IFTYPE_STATION:
1875 wl->bss_type = BSS_TYPE_STA_BSS; 1884 wl->bss_type = BSS_TYPE_STA_BSS;
1876 wl->set_bss_type = BSS_TYPE_STA_BSS; 1885 wl->set_bss_type = BSS_TYPE_STA_BSS;
@@ -1879,6 +1888,9 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw,
1879 wl->bss_type = BSS_TYPE_IBSS; 1888 wl->bss_type = BSS_TYPE_IBSS;
1880 wl->set_bss_type = BSS_TYPE_STA_BSS; 1889 wl->set_bss_type = BSS_TYPE_STA_BSS;
1881 break; 1890 break;
1891 case NL80211_IFTYPE_P2P_GO:
1892 wl->p2p = 1;
1893 /* fall-through */
1882 case NL80211_IFTYPE_AP: 1894 case NL80211_IFTYPE_AP:
1883 wl->bss_type = BSS_TYPE_AP_BSS; 1895 wl->bss_type = BSS_TYPE_AP_BSS;
1884 break; 1896 break;
@@ -2074,6 +2086,7 @@ deinit:
2074 wl->ssid_len = 0; 2086 wl->ssid_len = 0;
2075 wl->bss_type = MAX_BSS_TYPE; 2087 wl->bss_type = MAX_BSS_TYPE;
2076 wl->set_bss_type = MAX_BSS_TYPE; 2088 wl->set_bss_type = MAX_BSS_TYPE;
2089 wl->p2p = 0;
2077 wl->band = IEEE80211_BAND_2GHZ; 2090 wl->band = IEEE80211_BAND_2GHZ;
2078 2091
2079 wl->rx_counter = 0; 2092 wl->rx_counter = 0;
@@ -4514,7 +4527,8 @@ int wl1271_init_ieee80211(struct wl1271 *wl)
4514 wl->hw->wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites); 4527 wl->hw->wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites);
4515 4528
4516 wl->hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | 4529 wl->hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
4517 BIT(NL80211_IFTYPE_ADHOC) | BIT(NL80211_IFTYPE_AP); 4530 BIT(NL80211_IFTYPE_ADHOC) | BIT(NL80211_IFTYPE_AP) |
4531 BIT(NL80211_IFTYPE_P2P_CLIENT) | BIT(NL80211_IFTYPE_P2P_GO);
4518 wl->hw->wiphy->max_scan_ssids = 1; 4532 wl->hw->wiphy->max_scan_ssids = 1;
4519 wl->hw->wiphy->max_sched_scan_ssids = 16; 4533 wl->hw->wiphy->max_sched_scan_ssids = 16;
4520 wl->hw->wiphy->max_match_sets = 16; 4534 wl->hw->wiphy->max_match_sets = 16;
diff --git a/drivers/net/wireless/wl12xx/wl12xx.h b/drivers/net/wireless/wl12xx/wl12xx.h
index b661c2c4f68..3ceb20c170b 100644
--- a/drivers/net/wireless/wl12xx/wl12xx.h
+++ b/drivers/net/wireless/wl12xx/wl12xx.h
@@ -402,6 +402,7 @@ struct wl1271 {
402 u8 mac_addr[ETH_ALEN]; 402 u8 mac_addr[ETH_ALEN];
403 u8 bss_type; 403 u8 bss_type;
404 u8 set_bss_type; 404 u8 set_bss_type;
405 u8 p2p; /* we are using p2p role */
405 u8 ssid[IEEE80211_MAX_SSID_LEN + 1]; 406 u8 ssid[IEEE80211_MAX_SSID_LEN + 1];
406 u8 ssid_len; 407 u8 ssid_len;
407 int channel; 408 int channel;