summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorVasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>2011-10-25 14:04:22 (GMT)
committerKalle Valo <kvalo@qca.qualcomm.com>2011-11-11 10:58:52 (GMT)
commit7b85832dfbfaf09e793755041302d9e6d67cd39e (patch)
treec88673e9d3865bc0748392f512969420df1443d0 /drivers
parent2792972395356254252f12205915a32dce9f50e4 (diff)
downloadlinux-fsl-qoriq-7b85832dfbfaf09e793755041302d9e6d67cd39e.tar.xz
ath6kl: Configure inteface information at init time
Virtual interface information need to be configured during init time to the target. With MAX_NUM_VIF is restricted to 1, currently only a single vif is being configured. Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ath/ath6kl/init.c45
-rw-r--r--drivers/net/wireless/ath/ath6kl/target.h3
2 files changed, 40 insertions, 8 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
index 83ad008..60dbf72 100644
--- a/drivers/net/wireless/ath/ath6kl/init.c
+++ b/drivers/net/wireless/ath/ath6kl/init.c
@@ -429,11 +429,42 @@ 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;
+ u8 fw_iftype, fw_mode = 0, fw_submode;
+ int i;
+ /*
+ * Note: Even though the firmware interface type is
+ * chosen as BSS_STA for all three interfaces, can
+ * be configured to IBSS/AP as long as the fw submode
+ * remains normal mode (0 - AP, STA and IBSS). But
+ * due to an target assert in firmware only one interface is
+ * configured for now.
+ */
fw_iftype = HI_OPTION_FW_MODE_BSS_STA;
- /* Tell target which HTC version it is used*/
+ for (i = 0; i < MAX_NUM_VIF; i++)
+ 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"
+ */
+ 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));
+
+ /*
+ * 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,
ath6kl_get_hi_item_addr(ar,
@@ -454,12 +485,10 @@ int ath6kl_configure_target(struct ath6kl *ar)
return -EIO;
}
- param |= (1 << HI_OPTION_NUM_DEV_SHIFT);
- param |= (fw_iftype << HI_OPTION_FW_MODE_SHIFT);
- if (ar->p2p && fw_iftype == HI_OPTION_FW_MODE_BSS_STA) {
- param |= HI_OPTION_FW_SUBMODE_P2PDEV <<
- HI_OPTION_FW_SUBMODE_SHIFT;
- }
+ param |= (MAX_NUM_VIF << HI_OPTION_NUM_DEV_SHIFT);
+ param |= fw_mode << HI_OPTION_FW_MODE_SHIFT;
+ param |= fw_submode << HI_OPTION_FW_SUBMODE_SHIFT;
+
param |= (0 << HI_OPTION_MAC_ADDR_METHOD_SHIFT);
param |= (0 << HI_OPTION_FW_BRIDGE_SHIFT);
diff --git a/drivers/net/wireless/ath/ath6kl/target.h b/drivers/net/wireless/ath/ath6kl/target.h
index c9a7605..687e2b3 100644
--- a/drivers/net/wireless/ath/ath6kl/target.h
+++ b/drivers/net/wireless/ath/ath6kl/target.h
@@ -320,7 +320,10 @@ struct host_interest {
| (2) | (2) | (2) | (2) | (2) | (2) | (2) | (2)
|------------------------------------------------------------------------------|
*/
+#define HI_OPTION_FW_MODE_BITS 0x2
#define HI_OPTION_FW_MODE_SHIFT 0xC
+
+#define HI_OPTION_FW_SUBMODE_BITS 0x2
#define HI_OPTION_FW_SUBMODE_SHIFT 0x14
/* Convert a Target virtual address into a Target physical address */