diff options
author | Jouni Malinen <jouni@qca.qualcomm.com> | 2011-09-05 10:38:47 -0400 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2011-09-06 14:47:00 -0400 |
commit | 6bbc7c35ed0fb61c7739e91d5ee7016455770511 (patch) | |
tree | b8d8fb334c2eb9fa706d7763b9b7f7ec0234defb | |
parent | 689def90ac16df09e2b6ca6af86dca68706cc75b (diff) |
ath6kl: Allow enabling of P2P support
For now, use a module parameter (ath6kl_p2p) to allow P2P support
to be enabled. This is needed since there is no mechanism for
enabling the P2P mode more dynamically for a single netdev.
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/cfg80211.c | 12 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/core.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/init.c | 31 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/target.h | 6 |
4 files changed, 44 insertions, 7 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c index 640569688219..a889bf4a4722 100644 --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c | |||
@@ -20,6 +20,10 @@ | |||
20 | #include "hif-ops.h" | 20 | #include "hif-ops.h" |
21 | #include "testmode.h" | 21 | #include "testmode.h" |
22 | 22 | ||
23 | static unsigned int ath6kl_p2p; | ||
24 | |||
25 | module_param(ath6kl_p2p, uint, 0644); | ||
26 | |||
23 | #define RATETAB_ENT(_rate, _rateid, _flags) { \ | 27 | #define RATETAB_ENT(_rate, _rateid, _flags) { \ |
24 | .bitrate = (_rate), \ | 28 | .bitrate = (_rate), \ |
25 | .flags = (_flags), \ | 29 | .flags = (_flags), \ |
@@ -1936,6 +1940,7 @@ struct wireless_dev *ath6kl_cfg80211_init(struct device *dev) | |||
1936 | { | 1940 | { |
1937 | int ret = 0; | 1941 | int ret = 0; |
1938 | struct wireless_dev *wdev; | 1942 | struct wireless_dev *wdev; |
1943 | struct ath6kl *ar; | ||
1939 | 1944 | ||
1940 | wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL); | 1945 | wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL); |
1941 | if (!wdev) { | 1946 | if (!wdev) { |
@@ -1951,6 +1956,9 @@ struct wireless_dev *ath6kl_cfg80211_init(struct device *dev) | |||
1951 | return NULL; | 1956 | return NULL; |
1952 | } | 1957 | } |
1953 | 1958 | ||
1959 | ar = wiphy_priv(wdev->wiphy); | ||
1960 | ar->p2p = !!ath6kl_p2p; | ||
1961 | |||
1954 | wdev->wiphy->mgmt_stypes = ath6kl_mgmt_stypes; | 1962 | wdev->wiphy->mgmt_stypes = ath6kl_mgmt_stypes; |
1955 | 1963 | ||
1956 | wdev->wiphy->max_remain_on_channel_duration = 5000; | 1964 | wdev->wiphy->max_remain_on_channel_duration = 5000; |
@@ -1960,6 +1968,10 @@ struct wireless_dev *ath6kl_cfg80211_init(struct device *dev) | |||
1960 | 1968 | ||
1961 | wdev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | | 1969 | wdev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | |
1962 | BIT(NL80211_IFTYPE_ADHOC) | BIT(NL80211_IFTYPE_AP); | 1970 | BIT(NL80211_IFTYPE_ADHOC) | BIT(NL80211_IFTYPE_AP); |
1971 | if (ar->p2p) { | ||
1972 | wdev->wiphy->interface_modes |= BIT(NL80211_IFTYPE_P2P_GO) | | ||
1973 | BIT(NL80211_IFTYPE_P2P_CLIENT); | ||
1974 | } | ||
1963 | /* max num of ssids that can be probed during scanning */ | 1975 | /* max num of ssids that can be probed during scanning */ |
1964 | wdev->wiphy->max_scan_ssids = MAX_PROBED_SSID_INDEX; | 1976 | wdev->wiphy->max_scan_ssids = MAX_PROBED_SSID_INDEX; |
1965 | wdev->wiphy->max_scan_ie_len = 1000; /* FIX: what is correct limit? */ | 1977 | wdev->wiphy->max_scan_ie_len = 1000; /* FIX: what is correct limit? */ |
diff --git a/drivers/net/wireless/ath/ath6kl/core.h b/drivers/net/wireless/ath/ath6kl/core.h index 054da13ce488..c6ed1fc42bd9 100644 --- a/drivers/net/wireless/ath/ath6kl/core.h +++ b/drivers/net/wireless/ath/ath6kl/core.h | |||
@@ -471,6 +471,8 @@ struct ath6kl { | |||
471 | bool probe_req_report; | 471 | bool probe_req_report; |
472 | u16 next_chan; | 472 | u16 next_chan; |
473 | 473 | ||
474 | bool p2p; | ||
475 | |||
474 | #ifdef CONFIG_ATH6KL_DEBUG | 476 | #ifdef CONFIG_ATH6KL_DEBUG |
475 | struct { | 477 | struct { |
476 | struct circ_buf fwlog_buf; | 478 | struct circ_buf fwlog_buf; |
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c index 3d67025b72c4..eca34aa6e4ba 100644 --- a/drivers/net/wireless/ath/ath6kl/init.c +++ b/drivers/net/wireless/ath/ath6kl/init.c | |||
@@ -448,13 +448,26 @@ static int ath6kl_target_config_wlan_params(struct ath6kl *ar) | |||
448 | status = -EIO; | 448 | status = -EIO; |
449 | } | 449 | } |
450 | 450 | ||
451 | ret = ath6kl_wmi_info_req_cmd(ar->wmi, P2P_FLAG_CAPABILITIES_REQ | | 451 | if (ar->p2p) { |
452 | P2P_FLAG_MACADDR_REQ | | 452 | ret = ath6kl_wmi_info_req_cmd(ar->wmi, |
453 | P2P_FLAG_HMODEL_REQ); | 453 | P2P_FLAG_CAPABILITIES_REQ | |
454 | if (ret) { | 454 | P2P_FLAG_MACADDR_REQ | |
455 | ath6kl_dbg(ATH6KL_DBG_TRC, "failed to request P2P " | 455 | P2P_FLAG_HMODEL_REQ); |
456 | "capabilities (%d) - assuming P2P not supported\n", | 456 | if (ret) { |
457 | ret); | 457 | ath6kl_dbg(ATH6KL_DBG_TRC, "failed to request P2P " |
458 | "capabilities (%d) - assuming P2P not " | ||
459 | "supported\n", ret); | ||
460 | ar->p2p = 0; | ||
461 | } | ||
462 | } | ||
463 | |||
464 | if (ar->p2p) { | ||
465 | /* Enable Probe Request reporting for P2P */ | ||
466 | ret = ath6kl_wmi_probe_report_req_cmd(ar->wmi, true); | ||
467 | if (ret) { | ||
468 | ath6kl_dbg(ATH6KL_DBG_TRC, "failed to enable Probe " | ||
469 | "Request reporting (%d)\n", ret); | ||
470 | } | ||
458 | } | 471 | } |
459 | 472 | ||
460 | return status; | 473 | return status; |
@@ -492,6 +505,10 @@ int ath6kl_configure_target(struct ath6kl *ar) | |||
492 | 505 | ||
493 | param |= (1 << HI_OPTION_NUM_DEV_SHIFT); | 506 | param |= (1 << HI_OPTION_NUM_DEV_SHIFT); |
494 | param |= (fw_iftype << HI_OPTION_FW_MODE_SHIFT); | 507 | param |= (fw_iftype << HI_OPTION_FW_MODE_SHIFT); |
508 | if (ar->p2p && fw_iftype == HI_OPTION_FW_MODE_BSS_STA) { | ||
509 | param |= HI_OPTION_FW_SUBMODE_P2PDEV << | ||
510 | HI_OPTION_FW_SUBMODE_SHIFT; | ||
511 | } | ||
495 | param |= (0 << HI_OPTION_MAC_ADDR_METHOD_SHIFT); | 512 | param |= (0 << HI_OPTION_MAC_ADDR_METHOD_SHIFT); |
496 | param |= (0 << HI_OPTION_FW_BRIDGE_SHIFT); | 513 | param |= (0 << HI_OPTION_FW_BRIDGE_SHIFT); |
497 | 514 | ||
diff --git a/drivers/net/wireless/ath/ath6kl/target.h b/drivers/net/wireless/ath/ath6kl/target.h index dd8b953cbfc0..7db06a5d9194 100644 --- a/drivers/net/wireless/ath/ath6kl/target.h +++ b/drivers/net/wireless/ath/ath6kl/target.h | |||
@@ -304,6 +304,11 @@ struct host_interest { | |||
304 | #define HI_OPTION_FW_MODE_BSS_STA 0x1 | 304 | #define HI_OPTION_FW_MODE_BSS_STA 0x1 |
305 | #define HI_OPTION_FW_MODE_AP 0x2 | 305 | #define HI_OPTION_FW_MODE_AP 0x2 |
306 | 306 | ||
307 | #define HI_OPTION_FW_SUBMODE_NONE 0x0 | ||
308 | #define HI_OPTION_FW_SUBMODE_P2PDEV 0x1 | ||
309 | #define HI_OPTION_FW_SUBMODE_P2PCLIENT 0x2 | ||
310 | #define HI_OPTION_FW_SUBMODE_P2PGO 0x3 | ||
311 | |||
307 | #define HI_OPTION_NUM_DEV_SHIFT 0x9 | 312 | #define HI_OPTION_NUM_DEV_SHIFT 0x9 |
308 | 313 | ||
309 | #define HI_OPTION_FW_BRIDGE_SHIFT 0x04 | 314 | #define HI_OPTION_FW_BRIDGE_SHIFT 0x04 |
@@ -316,6 +321,7 @@ struct host_interest { | |||
316 | |------------------------------------------------------------------------------| | 321 | |------------------------------------------------------------------------------| |
317 | */ | 322 | */ |
318 | #define HI_OPTION_FW_MODE_SHIFT 0xC | 323 | #define HI_OPTION_FW_MODE_SHIFT 0xC |
324 | #define HI_OPTION_FW_SUBMODE_SHIFT 0x14 | ||
319 | 325 | ||
320 | /* Convert a Target virtual address into a Target physical address */ | 326 | /* Convert a Target virtual address into a Target physical address */ |
321 | #define AR6003_VTOP(vaddr) ((vaddr) & 0x001fffff) | 327 | #define AR6003_VTOP(vaddr) ((vaddr) & 0x001fffff) |