diff options
author | Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> | 2011-10-25 10:04:24 -0400 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2011-11-11 05:58:52 -0500 |
commit | 3226f68af4fe74932677db271b4ac4f26556954d (patch) | |
tree | ae5d1b54269dd23fe00e72186f69a3fe7f4877de | |
parent | 55055976fe15f450aded0a6f2ed2996411bd3e2e (diff) |
ath6kl: Add a modparam to enable multi normal interface support
This option lets operate more than one vif in normal mode (AP/STA/IBSS)
when support for multiple vif is enabled. This modparam needs to be used
as
modprobe ath6kl multi_norm_if_support=1
Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/cfg80211.c | 23 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/core.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/init.c | 24 |
3 files changed, 36 insertions, 12 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c index 87ede6265788..2c097045ceca 100644 --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c | |||
@@ -21,8 +21,10 @@ | |||
21 | #include "testmode.h" | 21 | #include "testmode.h" |
22 | 22 | ||
23 | static unsigned int ath6kl_p2p; | 23 | static unsigned int ath6kl_p2p; |
24 | static unsigned int multi_norm_if_support; | ||
24 | 25 | ||
25 | module_param(ath6kl_p2p, uint, 0644); | 26 | module_param(ath6kl_p2p, uint, 0644); |
27 | module_param(multi_norm_if_support, uint, 0644); | ||
26 | 28 | ||
27 | #define RATETAB_ENT(_rate, _rateid, _flags) { \ | 29 | #define RATETAB_ENT(_rate, _rateid, _flags) { \ |
28 | .bitrate = (_rate), \ | 30 | .bitrate = (_rate), \ |
@@ -341,6 +343,16 @@ static bool ath6kl_is_valid_iftype(struct ath6kl *ar, enum nl80211_iftype type, | |||
341 | } | 343 | } |
342 | } | 344 | } |
343 | 345 | ||
346 | if (type == NL80211_IFTYPE_P2P_CLIENT || | ||
347 | type == NL80211_IFTYPE_P2P_GO) { | ||
348 | for (i = ar->max_norm_iface; i < MAX_NUM_VIF; i++) { | ||
349 | if ((ar->avail_idx_map >> i) & BIT(0)) { | ||
350 | *if_idx = i; | ||
351 | return true; | ||
352 | } | ||
353 | } | ||
354 | } | ||
355 | |||
344 | return false; | 356 | return false; |
345 | } | 357 | } |
346 | 358 | ||
@@ -2095,10 +2107,19 @@ struct ath6kl *ath6kl_core_alloc(struct device *dev) | |||
2095 | } | 2107 | } |
2096 | 2108 | ||
2097 | ar = wiphy_priv(wiphy); | 2109 | ar = wiphy_priv(wiphy); |
2098 | ar->p2p = !!ath6kl_p2p; | 2110 | if (!multi_norm_if_support) |
2111 | ar->p2p = !!ath6kl_p2p; | ||
2099 | ar->wiphy = wiphy; | 2112 | ar->wiphy = wiphy; |
2100 | ar->dev = dev; | 2113 | ar->dev = dev; |
2101 | 2114 | ||
2115 | if (multi_norm_if_support) | ||
2116 | ar->max_norm_iface = 2; | ||
2117 | else | ||
2118 | ar->max_norm_iface = 1; | ||
2119 | |||
2120 | /* FIXME: Remove this once the multivif support is enabled */ | ||
2121 | ar->max_norm_iface = 1; | ||
2122 | |||
2102 | spin_lock_init(&ar->lock); | 2123 | spin_lock_init(&ar->lock); |
2103 | spin_lock_init(&ar->mcastpsq_lock); | 2124 | spin_lock_init(&ar->mcastpsq_lock); |
2104 | spin_lock_init(&ar->list_lock); | 2125 | spin_lock_init(&ar->list_lock); |
diff --git a/drivers/net/wireless/ath/ath6kl/core.h b/drivers/net/wireless/ath/ath6kl/core.h index 6933fb62ac46..427db0833a68 100644 --- a/drivers/net/wireless/ath/ath6kl/core.h +++ b/drivers/net/wireless/ath/ath6kl/core.h | |||
@@ -461,6 +461,7 @@ struct ath6kl { | |||
461 | /* Lock to avoid race in vif_list entries among add/del/traverse */ | 461 | /* Lock to avoid race in vif_list entries among add/del/traverse */ |
462 | spinlock_t list_lock; | 462 | spinlock_t list_lock; |
463 | u8 num_vif; | 463 | u8 num_vif; |
464 | u8 max_norm_iface; | ||
464 | u8 avail_idx_map; | 465 | u8 avail_idx_map; |
465 | spinlock_t lock; | 466 | spinlock_t lock; |
466 | struct semaphore sem; | 467 | struct semaphore sem; |
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c index ce34fff605ad..7784b2c00324 100644 --- a/drivers/net/wireless/ath/ath6kl/init.c +++ b/drivers/net/wireless/ath/ath6kl/init.c | |||
@@ -428,7 +428,7 @@ static int ath6kl_target_config_wlan_params(struct ath6kl *ar) | |||
428 | int ath6kl_configure_target(struct ath6kl *ar) | 428 | int ath6kl_configure_target(struct ath6kl *ar) |
429 | { | 429 | { |
430 | u32 param, ram_reserved_size; | 430 | u32 param, ram_reserved_size; |
431 | u8 fw_iftype, fw_mode = 0, fw_submode; | 431 | u8 fw_iftype, fw_mode = 0, fw_submode = 0; |
432 | int i; | 432 | int i; |
433 | 433 | ||
434 | /* | 434 | /* |
@@ -445,15 +445,19 @@ int ath6kl_configure_target(struct ath6kl *ar) | |||
445 | fw_mode |= fw_iftype << (i * HI_OPTION_FW_MODE_BITS); | 445 | fw_mode |= fw_iftype << (i * HI_OPTION_FW_MODE_BITS); |
446 | 446 | ||
447 | /* | 447 | /* |
448 | * submodes : vif[0] - AP/STA/IBSS | 448 | * By default, submodes : |
449 | * vif[1] - "P2P dev"/"P2P GO"/"P2P Client" | 449 | * vif[0] - AP/STA/IBSS |
450 | * vif[2] - "P2P dev"/"P2P GO"/"P2P Client" | 450 | * vif[1] - "P2P dev"/"P2P GO"/"P2P Client" |
451 | * vif[2] - "P2P dev"/"P2P GO"/"P2P Client" | ||
451 | */ | 452 | */ |
452 | fw_submode = HI_OPTION_FW_SUBMODE_NONE | | 453 | |
453 | (HI_OPTION_FW_SUBMODE_P2PDEV << | 454 | for (i = 0; i < ar->max_norm_iface; i++) |
454 | (1 * HI_OPTION_FW_SUBMODE_BITS)) | | 455 | fw_submode |= HI_OPTION_FW_SUBMODE_NONE << |
455 | (HI_OPTION_FW_SUBMODE_P2PDEV << | 456 | (i * HI_OPTION_FW_SUBMODE_BITS); |
456 | (2 * HI_OPTION_FW_SUBMODE_BITS)); | 457 | |
458 | for (i = ar->max_norm_iface; i < MAX_NUM_VIF; i++) | ||
459 | fw_submode |= HI_OPTION_FW_SUBMODE_P2PDEV << | ||
460 | (i * HI_OPTION_FW_SUBMODE_BITS); | ||
457 | 461 | ||
458 | /* | 462 | /* |
459 | * FIXME: This needs to be removed once the multivif | 463 | * FIXME: This needs to be removed once the multivif |
@@ -461,8 +465,6 @@ int ath6kl_configure_target(struct ath6kl *ar) | |||
461 | */ | 465 | */ |
462 | if (ar->p2p) | 466 | if (ar->p2p) |
463 | fw_submode = HI_OPTION_FW_SUBMODE_P2PDEV; | 467 | fw_submode = HI_OPTION_FW_SUBMODE_P2PDEV; |
464 | else | ||
465 | fw_submode = HI_OPTION_FW_SUBMODE_NONE; | ||
466 | 468 | ||
467 | param = HTC_PROTOCOL_VERSION; | 469 | param = HTC_PROTOCOL_VERSION; |
468 | if (ath6kl_bmi_write(ar, | 470 | if (ath6kl_bmi_write(ar, |