Commit 97e0496d authored by Kalle Valo's avatar Kalle Valo

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: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent 8a137480
...@@ -68,8 +68,18 @@ enum ath6kl_fw_ie_type { ...@@ -68,8 +68,18 @@ enum ath6kl_fw_ie_type {
ATH6KL_FW_IE_FW_IMAGE = 3, ATH6KL_FW_IE_FW_IMAGE = 3,
ATH6KL_FW_IE_PATCH_IMAGE = 4, ATH6KL_FW_IE_PATCH_IMAGE = 4,
ATH6KL_FW_IE_RESERVED_RAM_SIZE = 5, ATH6KL_FW_IE_RESERVED_RAM_SIZE = 5,
ATH6KL_FW_IE_CAPABILITIES = 6,
}; };
enum ath6kl_fw_capability {
ATH6KL_FW_CAPABILITY_HOST_P2P = 0,
/* this needs to be last */
ATH6KL_FW_CAPABILITY_MAX,
};
#define ATH6KL_CAPABILITY_LEN (ALIGN(ATH6KL_FW_CAPABILITY_MAX, 32) / 32)
struct ath6kl_fw_ie { struct ath6kl_fw_ie {
__le32 id; __le32 id;
__le32 len; __le32 len;
...@@ -491,6 +501,8 @@ struct ath6kl { ...@@ -491,6 +501,8 @@ struct ath6kl {
u8 *fw_patch; u8 *fw_patch;
size_t fw_patch_len; size_t fw_patch_len;
unsigned long fw_capabilities[ATH6KL_CAPABILITY_LEN];
struct workqueue_struct *ath6kl_wq; struct workqueue_struct *ath6kl_wq;
struct ath6kl_node_table scan_table; struct ath6kl_node_table scan_table;
......
...@@ -901,7 +901,7 @@ static int ath6kl_fetch_fw_api2(struct ath6kl *ar) ...@@ -901,7 +901,7 @@ static int ath6kl_fetch_fw_api2(struct ath6kl *ar)
struct ath6kl_fw_ie *hdr; struct ath6kl_fw_ie *hdr;
const char *filename; const char *filename;
const u8 *data; const u8 *data;
int ret, ie_id; int ret, ie_id, i, index, bit;
__le32 *val; __le32 *val;
switch (ar->version.target_ver) { switch (ar->version.target_ver) {
...@@ -992,6 +992,15 @@ static int ath6kl_fetch_fw_api2(struct ath6kl *ar) ...@@ -992,6 +992,15 @@ static int ath6kl_fetch_fw_api2(struct ath6kl *ar)
val = (__le32 *) data; val = (__le32 *) data;
ar->hw.reserved_ram_size = le32_to_cpup(val); ar->hw.reserved_ram_size = le32_to_cpup(val);
break; break;
case ATH6KL_FW_IE_CAPABILITIES:
for (i = 0; i < ATH6KL_FW_CAPABILITY_MAX; i++) {
index = ALIGN(i, 8) / 8;
bit = i % 8;
if (data[index] & (1 << bit))
__set_bit(i, ar->fw_capabilities);
}
break;
default: default:
ath6kl_dbg(ATH6KL_DBG_TRC, "Unknown fw ie: %u\n", ath6kl_dbg(ATH6KL_DBG_TRC, "Unknown fw ie: %u\n",
le32_to_cpup(&hdr->id)); le32_to_cpup(&hdr->id));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment