Linux wireless drivers development
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@qca.qualcomm.com>
To: kvalo@qca.qualcomm.com
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH 10/10] ath6kl: add firmware IE for maximum number of vifs
Date: Mon, 14 Nov 2011 19:31:38 +0200	[thread overview]
Message-ID: <20111114173138.29925.77938.stgit@localhost6.localdomain6> (raw)
In-Reply-To: <20111114172836.29925.4134.stgit@localhost6.localdomain6>

Not all firmwares support multiple vifs and we need to read the limit from
the firmware image.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath6kl/core.h |    3 ++-
 drivers/net/wireless/ath/ath6kl/init.c |   11 +++++++++++
 2 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/core.h b/drivers/net/wireless/ath/ath6kl/core.h
index 6fdaaf7..b185564 100644
--- a/drivers/net/wireless/ath/ath6kl/core.h
+++ b/drivers/net/wireless/ath/ath6kl/core.h
@@ -71,6 +71,7 @@ enum ath6kl_fw_ie_type {
 	ATH6KL_FW_IE_CAPABILITIES = 6,
 	ATH6KL_FW_IE_PATCH_ADDR = 7,
 	ATH6KL_FW_IE_BOARD_ADDR = 8,
+	ATH6KL_FW_IE_VIF_MAX = 9,
 };
 
 enum ath6kl_fw_capability {
@@ -502,7 +503,7 @@ struct ath6kl {
 	/* Lock to avoid race in vif_list entries among add/del/traverse */
 	spinlock_t list_lock;
 	u8 num_vif;
-	int vif_max;
+	unsigned int vif_max;
 	u8 max_norm_iface;
 	u8 avail_idx_map;
 	spinlock_t lock;
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
index 0f72461..6c4f6a9 100644
--- a/drivers/net/wireless/ath/ath6kl/init.c
+++ b/drivers/net/wireless/ath/ath6kl/init.c
@@ -963,6 +963,17 @@ static int ath6kl_fetch_fw_api2(struct ath6kl *ar)
 				   "found board address ie 0x%x\n",
 				   ar->hw.board_addr);
 			break;
+		case ATH6KL_FW_IE_VIF_MAX:
+			if (ie_len != sizeof(*val))
+				break;
+
+			val = (__le32 *) data;
+			ar->vif_max = min_t(unsigned int, le32_to_cpup(val),
+					    ATH6KL_VIF_MAX);
+
+			ath6kl_dbg(ATH6KL_DBG_BOOT,
+				   "found vif max ie %d\n", ar->vif_max);
+			break;
 		default:
 			ath6kl_dbg(ATH6KL_DBG_BOOT, "Unknown fw ie: %u\n",
 				   le32_to_cpup(&hdr->id));


  parent reply	other threads:[~2011-11-14 17:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-14 17:29 [PATCH 00/10] ath6kl: configurable board address and multivif Kalle Valo
2011-11-14 17:30 ` [PATCH 01/10] ath6kl: remove hw version related parameter defines Kalle Valo
2011-11-14 17:30 ` [PATCH 02/10] ath6kl: move hw version related to parameters to struct Kalle Valo
2011-11-14 17:30 ` [PATCH 03/10] ath6kl: add board address to struct ath6kl_hw Kalle Valo
2011-11-14 17:30 ` [PATCH 04/10] ath6kl: add firmware IE for board data address Kalle Valo
2011-11-14 17:30 ` [PATCH 05/10] ath6kl: add name field to struct ath6kl_hw Kalle Valo
2011-11-14 17:31 ` [PATCH 06/10] ath6kl: use hardware version names consistently Kalle Valo
2011-11-14 17:31 ` [PATCH 07/10] ath6kl: add ar6004 firmwares to sdio module Kalle Valo
2011-11-14 17:31 ` [PATCH 08/10] ath6kl: add firmware filename info to struct ath6kl_hw Kalle Valo
2011-11-14 17:31 ` [PATCH 09/10] ath6kl: make maximum number of vifs runtime configurable Kalle Valo
2011-11-14 17:31 ` Kalle Valo [this message]
2011-11-16  8:37 ` [PATCH 00/10] ath6kl: configurable board address and multivif 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=20111114173138.29925.77938.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