From: Kalle Valo <kvalo@qca.qualcomm.com>
To: linux-wireless@vger.kernel.org
Subject: [PATCH 9/9] ath6kl: add firmware capabilities support
Date: Mon, 12 Sep 2011 14:13:08 +0300 [thread overview]
Message-ID: <20110912111308.16921.94633.stgit@localhost6.localdomain6> (raw)
In-Reply-To: <20110912111206.16921.90687.stgit@localhost6.localdomain6>
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>
---
drivers/net/wireless/ath/ath6kl/core.h | 12 ++++++++++++
drivers/net/wireless/ath/ath6kl/init.c | 11 ++++++++++-
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 abb4aaf..0fb82e9 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 {
ATH6KL_FW_IE_FW_IMAGE = 3,
ATH6KL_FW_IE_PATCH_IMAGE = 4,
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 {
__le32 id;
__le32 len;
@@ -491,6 +501,8 @@ struct ath6kl {
u8 *fw_patch;
size_t fw_patch_len;
+ unsigned long fw_capabilities[ATH6KL_CAPABILITY_LEN];
+
struct workqueue_struct *ath6kl_wq;
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 e2a29b2..b9b13a0 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)
struct ath6kl_fw_ie *hdr;
const char *filename;
const u8 *data;
- int ret, ie_id;
+ int ret, ie_id, i, index, bit;
__le32 *val;
switch (ar->version.target_ver) {
@@ -992,6 +992,15 @@ static int ath6kl_fetch_fw_api2(struct ath6kl *ar)
val = (__le32 *) data;
ar->hw.reserved_ram_size = le32_to_cpup(val);
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:
ath6kl_dbg(ATH6KL_DBG_TRC, "Unknown fw ie: %u\n",
le32_to_cpup(&hdr->id));
next prev parent reply other threads:[~2011-09-12 11:13 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-12 11:12 [PATCH 1/9] ath6kl: query device tree for firmware board-id Kalle Valo
2011-09-12 11:12 ` [PATCH 2/9] ath6kl: separate firmware fetch from upload Kalle Valo
2011-09-12 11:12 ` [PATCH 3/9] ath6kl: fix busy loop in ath6kl_bmi_get_rx_lkahd() Kalle Valo
2011-09-12 11:12 ` [PATCH 4/9] ath6kl: add support for firmware API 2 format Kalle Valo
2011-09-12 11:12 ` [PATCH 5/9] ath6kl: refactor firmware load address code Kalle Valo
2011-09-12 11:12 ` [PATCH 6/9] ath6kl: refactor firmware ext data addr and reserved ram handling size Kalle Valo
2011-09-12 11:12 ` [PATCH 7/9] ath6kl: read firmware start address from hardware Kalle Valo
2011-09-12 11:13 ` [PATCH 8/9] ath6kl: read reserved ram size from firmware file Kalle Valo
2011-09-12 11:13 ` Kalle Valo [this message]
2011-09-15 13:37 ` [PATCH 1/9] ath6kl: query device tree for firmware board-id Kalle Valo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110912111308.16921.94633.stgit@localhost6.localdomain6 \
--to=kvalo@qca.qualcomm.com \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox