Skip to content

Commit

Permalink
ath6kl: Add a modparam to enable multi normal interface support
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Vasanthakumar Thiagarajan authored and Kalle Valo committed Nov 11, 2011
1 parent 5505597 commit 3226f68
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 12 deletions.
23 changes: 22 additions & 1 deletion drivers/net/wireless/ath/ath6kl/cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@
#include "testmode.h"

static unsigned int ath6kl_p2p;
static unsigned int multi_norm_if_support;

module_param(ath6kl_p2p, uint, 0644);
module_param(multi_norm_if_support, uint, 0644);

#define RATETAB_ENT(_rate, _rateid, _flags) { \
.bitrate = (_rate), \
Expand Down Expand Up @@ -341,6 +343,16 @@ static bool ath6kl_is_valid_iftype(struct ath6kl *ar, enum nl80211_iftype type,
}
}

if (type == NL80211_IFTYPE_P2P_CLIENT ||
type == NL80211_IFTYPE_P2P_GO) {
for (i = ar->max_norm_iface; i < MAX_NUM_VIF; i++) {
if ((ar->avail_idx_map >> i) & BIT(0)) {
*if_idx = i;
return true;
}
}
}

return false;
}

Expand Down Expand Up @@ -2095,10 +2107,19 @@ struct ath6kl *ath6kl_core_alloc(struct device *dev)
}

ar = wiphy_priv(wiphy);
ar->p2p = !!ath6kl_p2p;
if (!multi_norm_if_support)
ar->p2p = !!ath6kl_p2p;
ar->wiphy = wiphy;
ar->dev = dev;

if (multi_norm_if_support)
ar->max_norm_iface = 2;
else
ar->max_norm_iface = 1;

/* FIXME: Remove this once the multivif support is enabled */
ar->max_norm_iface = 1;

spin_lock_init(&ar->lock);
spin_lock_init(&ar->mcastpsq_lock);
spin_lock_init(&ar->list_lock);
Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/ath/ath6kl/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@ struct ath6kl {
/* Lock to avoid race in vif_list entries among add/del/traverse */
spinlock_t list_lock;
u8 num_vif;
u8 max_norm_iface;
u8 avail_idx_map;
spinlock_t lock;
struct semaphore sem;
Expand Down
24 changes: 13 additions & 11 deletions drivers/net/wireless/ath/ath6kl/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ static int ath6kl_target_config_wlan_params(struct ath6kl *ar)
int ath6kl_configure_target(struct ath6kl *ar)
{
u32 param, ram_reserved_size;
u8 fw_iftype, fw_mode = 0, fw_submode;
u8 fw_iftype, fw_mode = 0, fw_submode = 0;
int i;

/*
Expand All @@ -445,24 +445,26 @@ int ath6kl_configure_target(struct ath6kl *ar)
fw_mode |= fw_iftype << (i * HI_OPTION_FW_MODE_BITS);

/*
* submodes : vif[0] - AP/STA/IBSS
* vif[1] - "P2P dev"/"P2P GO"/"P2P Client"
* vif[2] - "P2P dev"/"P2P GO"/"P2P Client"
* By default, submodes :
* vif[0] - AP/STA/IBSS
* vif[1] - "P2P dev"/"P2P GO"/"P2P Client"
* vif[2] - "P2P dev"/"P2P GO"/"P2P Client"
*/
fw_submode = HI_OPTION_FW_SUBMODE_NONE |
(HI_OPTION_FW_SUBMODE_P2PDEV <<
(1 * HI_OPTION_FW_SUBMODE_BITS)) |
(HI_OPTION_FW_SUBMODE_P2PDEV <<
(2 * HI_OPTION_FW_SUBMODE_BITS));

for (i = 0; i < ar->max_norm_iface; i++)
fw_submode |= HI_OPTION_FW_SUBMODE_NONE <<
(i * HI_OPTION_FW_SUBMODE_BITS);

for (i = ar->max_norm_iface; i < MAX_NUM_VIF; i++)
fw_submode |= HI_OPTION_FW_SUBMODE_P2PDEV <<
(i * HI_OPTION_FW_SUBMODE_BITS);

/*
* FIXME: This needs to be removed once the multivif
* support is enabled.
*/
if (ar->p2p)
fw_submode = HI_OPTION_FW_SUBMODE_P2PDEV;
else
fw_submode = HI_OPTION_FW_SUBMODE_NONE;

param = HTC_PROTOCOL_VERSION;
if (ath6kl_bmi_write(ar,
Expand Down

0 comments on commit 3226f68

Please sign in to comment.