aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorKalle Valo <kvalo@qca.qualcomm.com>2011-09-12 06:47:34 -0400
committerKalle Valo <kvalo@qca.qualcomm.com>2011-09-16 11:48:34 -0400
commit97e0496d056726ab46e7e977315f2ab847b34209 (patch)
tree64b66e757d575d393af3322fee8ecea5187a9540 /drivers
parent8a13748034e93b4134455ebf51e2fada8eb00aca (diff)
ath6kl: add firmware capabilities support
The new firmware format includes capability bits which make it possible to check what features the firmware supports. Add infrastructure to read the capabilities. For now it only provides ATH6KL_FW_CAPABILITY_HOST_P2P which is not even used anywhere yet, but that will be added later. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ath/ath6kl/core.h12
-rw-r--r--drivers/net/wireless/ath/ath6kl/init.c11
2 files changed, 22 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/core.h b/drivers/net/wireless/ath/ath6kl/core.h
index abb4aaf48c08..0fb82e9002be 100644
--- a/drivers/net/wireless/ath/ath6kl/core.h
+++ b/drivers/net/wireless/ath/ath6kl/core.h
@@ -68,8 +68,18 @@ enum ath6kl_fw_ie_type {
68 ATH6KL_FW_IE_FW_IMAGE = 3, 68 ATH6KL_FW_IE_FW_IMAGE = 3,
69 ATH6KL_FW_IE_PATCH_IMAGE = 4, 69 ATH6KL_FW_IE_PATCH_IMAGE = 4,
70 ATH6KL_FW_IE_RESERVED_RAM_SIZE = 5, 70 ATH6KL_FW_IE_RESERVED_RAM_SIZE = 5,
71 ATH6KL_FW_IE_CAPABILITIES = 6,
71}; 72};
72 73
74enum ath6kl_fw_capability {
75 ATH6KL_FW_CAPABILITY_HOST_P2P = 0,
76
77 /* this needs to be last */
78 ATH6KL_FW_CAPABILITY_MAX,
79};
80
81#define ATH6KL_CAPABILITY_LEN (ALIGN(ATH6KL_FW_CAPABILITY_MAX, 32) / 32)
82
73struct ath6kl_fw_ie { 83struct ath6kl_fw_ie {
74 __le32 id; 84 __le32 id;
75 __le32 len; 85 __le32 len;
@@ -491,6 +501,8 @@ struct ath6kl {
491 u8 *fw_patch; 501 u8 *fw_patch;
492 size_t fw_patch_len; 502 size_t fw_patch_len;
493 503
504 unsigned long fw_capabilities[ATH6KL_CAPABILITY_LEN];
505
494 struct workqueue_struct *ath6kl_wq; 506 struct workqueue_struct *ath6kl_wq;
495 507
496 struct ath6kl_node_table scan_table; 508 struct ath6kl_node_table scan_table;
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
index e2a29b25884c..b9b13a040c7e 100644
--- a/drivers/net/wireless/ath/ath6kl/init.c
+++ b/drivers/net/wireless/ath/ath6kl/init.c
@@ -901,7 +901,7 @@ static int ath6kl_fetch_fw_api2(struct ath6kl *ar)
901 struct ath6kl_fw_ie *hdr; 901 struct ath6kl_fw_ie *hdr;
902 const char *filename; 902 const char *filename;
903 const u8 *data; 903 const u8 *data;
904 int ret, ie_id; 904 int ret, ie_id, i, index, bit;
905 __le32 *val; 905 __le32 *val;
906 906
907 switch (ar->version.target_ver) { 907 switch (ar->version.target_ver) {
@@ -992,6 +992,15 @@ static int ath6kl_fetch_fw_api2(struct ath6kl *ar)
992 val = (__le32 *) data; 992 val = (__le32 *) data;
993 ar->hw.reserved_ram_size = le32_to_cpup(val); 993 ar->hw.reserved_ram_size = le32_to_cpup(val);
994 break; 994 break;
995 case ATH6KL_FW_IE_CAPABILITIES:
996 for (i = 0; i < ATH6KL_FW_CAPABILITY_MAX; i++) {
997 index = ALIGN(i, 8) / 8;
998 bit = i % 8;
999
1000 if (data[index] & (1 << bit))
1001 __set_bit(i, ar->fw_capabilities);
1002 }
1003 break;
995 default: 1004 default:
996 ath6kl_dbg(ATH6KL_DBG_TRC, "Unknown fw ie: %u\n", 1005 ath6kl_dbg(ATH6KL_DBG_TRC, "Unknown fw ie: %u\n",
997 le32_to_cpup(&hdr->id)); 1006 le32_to_cpup(&hdr->id));