Linux wireless drivers development
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: linux-wireless@vger.kernel.org
Cc: Johannes Berg <johannes.berg@intel.com>
Subject: [PATCH 03/37] iwlwifi: fix calibration parser
Date: Mon, 28 Jan 2013 10:37:10 +0100	[thread overview]
Message-ID: <1359365864-4259-4-git-send-email-johannes@sipsolutions.net> (raw)
In-Reply-To: <1359365864-4259-1-git-send-email-johannes@sipsolutions.net>

From: Johannes Berg <johannes.berg@intel.com>

The firmware TLV for calibration data isn't
really a u64, but two u32 values. Define a
struct for that and change the parser.

Change-Id: Ia50f7fcd54ee0edb570eac84397942316b6fafa5
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-drv.c |  8 ++++++--
 drivers/net/wireless/iwlwifi/iwl-fw.h  | 15 ++++++++++++++-
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-drv.c b/drivers/net/wireless/iwlwifi/iwl-drv.c
index a7fb5ba..c675196 100644
--- a/drivers/net/wireless/iwlwifi/iwl-drv.c
+++ b/drivers/net/wireless/iwlwifi/iwl-drv.c
@@ -268,7 +268,7 @@ struct fw_sec_parsing {
  */
 struct iwl_tlv_calib_data {
 	__le32 ucode_type;
-	__le64 calib;
+	struct iwl_tlv_calib_ctrl calib;
 } __packed;
 
 struct iwl_firmware_pieces {
@@ -358,7 +358,11 @@ static int iwl_set_default_calib(struct iwl_drv *drv, const u8 *data)
 			ucode_type);
 		return -EINVAL;
 	}
-	drv->fw.default_calib[ucode_type] = le64_to_cpu(def_calib->calib);
+	drv->fw.default_calib[ucode_type].flow_trigger =
+		def_calib->calib.flow_trigger;
+	drv->fw.default_calib[ucode_type].event_trigger =
+		def_calib->calib.event_trigger;
+
 	return 0;
 }
 
diff --git a/drivers/net/wireless/iwlwifi/iwl-fw.h b/drivers/net/wireless/iwlwifi/iwl-fw.h
index 0bc8b6f..1ad31a9 100644
--- a/drivers/net/wireless/iwlwifi/iwl-fw.h
+++ b/drivers/net/wireless/iwlwifi/iwl-fw.h
@@ -139,6 +139,19 @@ struct fw_img {
 #define IWL_UCODE_API(ver)	(((ver) & 0x0000FF00) >> 8)
 #define IWL_UCODE_SERIAL(ver)	((ver) & 0x000000FF)
 
+/*
+ * Calibration control struct.
+ * Sent as part of the phy configuration command.
+ * @flow_trigger: bitmap for which calibrations to perform according to
+ *		flow triggers.
+ * @event_trigger: bitmap for which calibrations to perform according to
+ *		event triggers.
+ */
+struct iwl_tlv_calib_ctrl {
+	__le32 flow_trigger;
+	__le32 event_trigger;
+} __packed;
+
 /**
  * struct iwl_fw - variables associated with the firmware
  *
@@ -168,7 +181,7 @@ struct iwl_fw {
 	u32 init_evtlog_ptr, init_evtlog_size, init_errlog_ptr;
 	u32 inst_evtlog_ptr, inst_evtlog_size, inst_errlog_ptr;
 
-	u64 default_calib[IWL_UCODE_TYPE_MAX];
+	struct iwl_tlv_calib_ctrl default_calib[IWL_UCODE_TYPE_MAX];
 	u32 phy_config;
 
 	bool mvm_fw;
-- 
1.8.0


  parent reply	other threads:[~2013-01-28  9:37 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-28  9:37 [PATCH 0/37] iwlwifi: add the MVM driver Johannes Berg
2013-01-28  9:37 ` [PATCH 01/37] iwlwifi: add 7000 series device configuration Johannes Berg
2013-01-28  9:37 ` [PATCH 02/37] iwlwifi: clean up CMD_MODE enum Johannes Berg
2013-01-28  9:37 ` Johannes Berg [this message]
2013-01-28  9:37 ` [PATCH 04/37] iwlwifi: add NVM and PHY DB code for new MVM driver Johannes Berg
2013-01-28  9:37 ` [PATCH 05/37] iwlwifi: add the MVM driver (fw-api-d3) Johannes Berg
2013-01-28  9:37 ` [PATCH 06/37] iwlwifi: add the MVM driver (fw-api-mac) Johannes Berg
2013-01-28  9:37 ` [PATCH 07/37] iwlwifi: add the MVM driver (fw-api-power) Johannes Berg
2013-01-28  9:37 ` [PATCH 08/37] iwlwifi: add the MVM driver (fw-api-rs) Johannes Berg
2013-01-28  9:37 ` [PATCH 09/37] iwlwifi: add the MVM driver (fw-api-scan) Johannes Berg
2013-01-28  9:37 ` [PATCH 10/37] iwlwifi: add the MVM driver (fw-api-sta) Johannes Berg
2013-01-28  9:37 ` [PATCH 11/37] iwlwifi: add the MVM driver (fw-api-tx) Johannes Berg
2013-01-28  9:37 ` [PATCH 12/37] iwlwifi: add the MVM driver (fw-api) Johannes Berg
2013-01-28  9:37 ` [PATCH 13/37] iwlwifi: add the MVM driver (fw) Johannes Berg
2013-01-28  9:37 ` [PATCH 14/37] iwlwifi: add the MVM driver (binding) Johannes Berg
2013-01-28  9:37 ` [PATCH 15/37] iwlwifi: add the MVM driver (d3) Johannes Berg
2013-01-28  9:37 ` [PATCH 16/37] iwlwifi: add the MVM driver (debugfs) Johannes Berg
2013-01-28  9:37 ` [PATCH 17/37] iwlwifi: add the MVM driver (led) Johannes Berg
2013-01-28  9:37 ` [PATCH 18/37] iwlwifi: add the MVM driver (mac80211) Johannes Berg
2013-01-28  9:37 ` [PATCH 19/37] iwlwifi: add the MVM driver (mac-ctxt) Johannes Berg
2013-01-28  9:37 ` [PATCH 20/37] iwlwifi: add the MVM driver (Makefile) Johannes Berg
2013-01-28  9:37 ` [PATCH 21/37] iwlwifi: add the MVM driver (mvm.h) Johannes Berg
2013-01-28  9:37 ` [PATCH 22/37] iwlwifi: add the MVM driver (nvm) Johannes Berg
2013-01-28  9:37 ` [PATCH 23/37] iwlwifi: add the MVM driver (ops) Johannes Berg
2013-01-28  9:37 ` [PATCH 24/37] iwlwifi: add the MVM driver (phy-ctxt) Johannes Berg
2013-01-28  9:37 ` [PATCH 25/37] iwlwifi: add the MVM driver (power) Johannes Berg
2013-01-28  9:37 ` [PATCH 26/37] iwlwifi: add the MVM driver (quota) Johannes Berg
2013-01-28  9:37 ` [PATCH 27/37] iwlwifi: add the MVM driver (rs) Johannes Berg
2013-01-28  9:37 ` [PATCH 28/37] iwlwifi: add the MVM driver (rs.h) Johannes Berg
2013-01-28  9:37 ` [PATCH 29/37] iwlwifi: add the MVM driver (rx) Johannes Berg
2013-01-28  9:37 ` [PATCH 30/37] iwlwifi: add the MVM driver (scan) Johannes Berg
2013-01-28  9:37 ` [PATCH 31/37] iwlwifi: add the MVM driver (sta) Johannes Berg
2013-01-28  9:37 ` [PATCH 32/37] iwlwifi: add the MVM driver (sta.h) Johannes Berg
2013-01-28  9:37 ` [PATCH 33/37] iwlwifi: add the MVM driver (time-event) Johannes Berg
2013-01-28  9:37 ` [PATCH 34/37] iwlwifi: add the MVM driver (time-event.h) Johannes Berg
2013-01-29 13:01   ` Luciano Coelho
2013-01-28  9:37 ` [PATCH 35/37] iwlwifi: add the MVM driver (tx) Johannes Berg
2013-01-28  9:37 ` [PATCH 36/37] iwlwifi: add the MVM driver (utils) Johannes Berg
2013-01-28  9:37 ` [PATCH 37/37] iwlwifi: add the MVM driver (add to driver) Johannes Berg
2013-01-28 12:50 ` [PATCH 0/37] iwlwifi: add the MVM driver Johannes Berg
2013-01-28 14:22   ` Kalle Valo
2013-01-28 15:10     ` Sedat Dilek
2013-01-28 15:17       ` Sedat Dilek
2013-01-28 15:38         ` Johannes Berg
2013-01-28 21:56           ` Sedat Dilek
2013-01-28 22:26             ` Johannes Berg

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=1359365864-4259-4-git-send-email-johannes@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=johannes.berg@intel.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