netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Aaron Brown <aaron.f.brown@intel.com>
To: davem@davemloft.net
Cc: Shannon Nelson <shannon.nelson@intel.com>,
	netdev@vger.kernel.org, gospo@redhat.com, sassmann@redhat.com,
	Aaron Brown <aaron.f.brown@intel.com>
Subject: [net-next 04/15] i40e: expose debug_write_register request
Date: Wed, 30 Jul 2014 17:32:00 -0700	[thread overview]
Message-ID: <1406766731-4209-5-git-send-email-aaron.f.brown@intel.com> (raw)
In-Reply-To: <1406766731-4209-1-git-send-email-aaron.f.brown@intel.com>

From: Shannon Nelson <shannon.nelson@intel.com>

Now that the HW registers are no longer in debug mode and many are
locked down for writes, we need to expose the Firmware API request
used to do writes on the driver's behalf.

Change-ID: I09a05c4dc9ea0b24c00193faac34d7799eaa8496
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Jim Young <jamesx.m.young>
Signed-off-by: Aaron Brown <aaron.f.brown@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_common.c    | 29 ++++++++++++++++++++++++
 drivers/net/ethernet/intel/i40e/i40e_prototype.h |  3 +++
 2 files changed, 32 insertions(+)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index a010584..df43e7c 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -2002,6 +2002,35 @@ i40e_status i40e_aq_send_msg_to_vf(struct i40e_hw *hw, u16 vfid,
 }
 
 /**
+ * i40e_aq_debug_write_register
+ * @hw: pointer to the hw struct
+ * @reg_addr: register address
+ * @reg_val: register value
+ * @cmd_details: pointer to command details structure or NULL
+ *
+ * Write to a register using the admin queue commands
+ **/
+i40e_status i40e_aq_debug_write_register(struct i40e_hw *hw,
+					u32 reg_addr, u64 reg_val,
+					struct i40e_asq_cmd_details *cmd_details)
+{
+	struct i40e_aq_desc desc;
+	struct i40e_aqc_debug_reg_read_write *cmd =
+		(struct i40e_aqc_debug_reg_read_write *)&desc.params.raw;
+	i40e_status status;
+
+	i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_debug_write_reg);
+
+	cmd->address = cpu_to_le32(reg_addr);
+	cmd->value_high = cpu_to_le32((u32)(reg_val >> 32));
+	cmd->value_low = cpu_to_le32((u32)(reg_val & 0xFFFFFFFF));
+
+	status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);
+
+	return status;
+}
+
+/**
  * i40e_aq_set_hmc_resource_profile
  * @hw: pointer to the hw struct
  * @profile: type of profile the HMC is to be set as
diff --git a/drivers/net/ethernet/intel/i40e/i40e_prototype.h b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
index 8cd4390..949a9a0 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_prototype.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
@@ -70,6 +70,9 @@ i40e_status i40e_aq_get_firmware_version(struct i40e_hw *hw,
 				u16 *fw_major_version, u16 *fw_minor_version,
 				u16 *api_major_version, u16 *api_minor_version,
 				struct i40e_asq_cmd_details *cmd_details);
+i40e_status i40e_aq_debug_write_register(struct i40e_hw *hw,
+					u32 reg_addr, u64 reg_val,
+					struct i40e_asq_cmd_details *cmd_details);
 i40e_status i40e_aq_set_phy_debug(struct i40e_hw *hw, u8 cmd_flags,
 				struct i40e_asq_cmd_details *cmd_details);
 i40e_status i40e_aq_set_default_vsi(struct i40e_hw *hw, u16 vsi_id,
-- 
1.9.3

  parent reply	other threads:[~2014-07-31  0:28 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-31  0:31 [net-next 00/15] Intel Wired LAN Driver Updates Aaron Brown
2014-07-31  0:31 ` [net-next 01/15] i40e: adds FCoE code to the i40e driver Aaron Brown
2014-07-31  0:31 ` [net-next 02/15] i40e: Adds FCoE related code to i40e core driver Aaron Brown
2014-07-31  0:31 ` [net-next 03/15] i40e: adds FCoE to build and updates its documentation Aaron Brown
2014-07-31  0:32 ` Aaron Brown [this message]
2014-07-31  0:32 ` [net-next 05/15] i40e: use correct vf_id offset for virtchnl message Aaron Brown
2014-07-31  0:32 ` [net-next 06/15] i40e: Move some variable declarations out of a loop Aaron Brown
2014-07-31 21:05   ` David Miller
2014-07-31 23:56     ` Abodunrin, Akeem G
2014-08-01  1:31       ` David Miller
2014-07-31  0:32 ` [net-next 07/15] i40e: disable local loopback on vmdq vsi Aaron Brown
2014-07-31  0:32 ` [net-next 08/15] i40evf: fix scan warning on sprintf Aaron Brown
2014-07-31  0:32 ` [net-next 09/15] i40e: Minor comment changes Aaron Brown
2014-07-31  0:32 ` [net-next 10/15] i40e: remove support for vf unicast promiscuous mode Aaron Brown
2014-07-31  0:32 ` [net-next 11/15] i40evf: future-proof vfr_stat state check Aaron Brown
2014-07-31  0:32 ` [net-next 12/15] i40evf: do not re-arm watchdog after remove Aaron Brown
2014-07-31  0:32 ` [net-next 13/15] i40evf: don't leak queue vectors Aaron Brown
2014-07-31  0:32 ` [net-next 14/15] i40evf: fix memory leak on unused interfaces Aaron Brown
2014-07-31  0:32 ` [net-next 15/15] i40evf: Fixed guest OS panic when removing vf driver Aaron Brown

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=1406766731-4209-5-git-send-email-aaron.f.brown@intel.com \
    --to=aaron.f.brown@intel.com \
    --cc=davem@davemloft.net \
    --cc=gospo@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=sassmann@redhat.com \
    --cc=shannon.nelson@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).