From: Yuan Wang <yuanx.wang@intel.com>
To: dev@dpdk.org
Cc: anatoly.burakov@intel.com, vladimir.medvedkin@intel.com,
Dawid Zielinski <dawid.zielinski@intel.com>,
Yuan Wang <yuanx.wang@intel.com>
Subject: [PATCH 02/10] net/ixgbe/base: add interface for LED control on E610
Date: Tue, 14 Jan 2025 18:10:12 +0800 [thread overview]
Message-ID: <20250114101024.159941-3-yuanx.wang@intel.com> (raw)
In-Reply-To: <20250114101024.159941-1-yuanx.wang@intel.com>
From: Dawid Zielinski <dawid.zielinski@intel.com>
Add interface for sending ACI command for setting port
identification LED on E610.
Signed-off-by: Dawid Zielinski <dawid.zielinski@intel.com>
Signed-off-by: Yuan Wang <yuanx.wang@intel.com>
---
drivers/net/ixgbe/base/ixgbe_e610.c | 29 ++++++++++++++++++++++++
drivers/net/ixgbe/base/ixgbe_e610.h | 1 +
drivers/net/ixgbe/base/ixgbe_type_e610.h | 15 ++++++++++++
3 files changed, 45 insertions(+)
diff --git a/drivers/net/ixgbe/base/ixgbe_e610.c b/drivers/net/ixgbe/base/ixgbe_e610.c
index b0d55a2411..ee8614d3db 100644
--- a/drivers/net/ixgbe/base/ixgbe_e610.c
+++ b/drivers/net/ixgbe/base/ixgbe_e610.c
@@ -2004,6 +2004,35 @@ s32 ixgbe_aci_write_i2c(struct ixgbe_hw *hw,
return ixgbe_aci_send_cmd(hw, &desc, NULL, 0);
}
+/**
+ * ixgbe_aci_set_port_id_led - set LED value for the given port
+ * @hw: pointer to the HW struct
+ * @orig_mode: set LED original mode
+ *
+ * Set LED value for the given port (0x06E9)
+ *
+ * Return: the exit code of the operation.
+ */
+s32 ixgbe_aci_set_port_id_led(struct ixgbe_hw *hw, bool orig_mode)
+{
+ struct ixgbe_aci_cmd_set_port_id_led *cmd;
+ struct ixgbe_aci_desc desc;
+
+ cmd = &desc.params.set_port_id_led;
+
+ ixgbe_fill_dflt_direct_cmd_desc(&desc, ixgbe_aci_opc_set_port_id_led);
+
+ cmd->lport_num = (u8)hw->bus.func;
+ cmd->lport_num_valid = IXGBE_ACI_PORT_ID_PORT_NUM_VALID;
+
+ if (orig_mode)
+ cmd->ident_mode = IXGBE_ACI_PORT_IDENT_LED_ORIG;
+ else
+ cmd->ident_mode = IXGBE_ACI_PORT_IDENT_LED_BLINK;
+
+ return ixgbe_aci_send_cmd(hw, &desc, NULL, 0);
+}
+
/**
* ixgbe_aci_set_gpio - set GPIO pin state
* @hw: pointer to the hw struct
diff --git a/drivers/net/ixgbe/base/ixgbe_e610.h b/drivers/net/ixgbe/base/ixgbe_e610.h
index 4babee821e..716bb86303 100644
--- a/drivers/net/ixgbe/base/ixgbe_e610.h
+++ b/drivers/net/ixgbe/base/ixgbe_e610.h
@@ -61,6 +61,7 @@ s32 ixgbe_aci_read_i2c(struct ixgbe_hw *hw,
s32 ixgbe_aci_write_i2c(struct ixgbe_hw *hw,
struct ixgbe_aci_cmd_link_topo_addr topo_addr,
u16 bus_addr, __le16 addr, u8 params, u8 *data);
+s32 ixgbe_aci_set_port_id_led(struct ixgbe_hw *hw, bool orig_mode);
s32 ixgbe_aci_set_gpio(struct ixgbe_hw *hw, u16 gpio_ctrl_handle, u8 pin_idx,
bool value);
s32 ixgbe_aci_get_gpio(struct ixgbe_hw *hw, u16 gpio_ctrl_handle, u8 pin_idx,
diff --git a/drivers/net/ixgbe/base/ixgbe_type_e610.h b/drivers/net/ixgbe/base/ixgbe_type_e610.h
index bad332c6b8..4f09fcf3d5 100644
--- a/drivers/net/ixgbe/base/ixgbe_type_e610.h
+++ b/drivers/net/ixgbe/base/ixgbe_type_e610.h
@@ -477,6 +477,7 @@ enum ixgbe_aci_opc {
ixgbe_aci_opc_write_mdio = 0x06E5,
ixgbe_aci_opc_set_gpio_by_func = 0x06E6,
ixgbe_aci_opc_get_gpio_by_func = 0x06E7,
+ ixgbe_aci_opc_set_port_id_led = 0x06E9,
ixgbe_aci_opc_set_gpio = 0x06EC,
ixgbe_aci_opc_get_gpio = 0x06ED,
ixgbe_aci_opc_sff_eeprom = 0x06EE,
@@ -1252,6 +1253,19 @@ struct ixgbe_aci_cmd_gpio_by_func {
IXGBE_CHECK_PARAM_LEN(ixgbe_aci_cmd_gpio_by_func);
+/* Set Port Identification LED (direct, 0x06E9) */
+struct ixgbe_aci_cmd_set_port_id_led {
+ u8 lport_num;
+ u8 lport_num_valid;
+#define IXGBE_ACI_PORT_ID_PORT_NUM_VALID BIT(0)
+ u8 ident_mode;
+#define IXGBE_ACI_PORT_IDENT_LED_BLINK BIT(0)
+#define IXGBE_ACI_PORT_IDENT_LED_ORIG 0
+ u8 rsvd[13];
+};
+
+IXGBE_CHECK_PARAM_LEN(ixgbe_aci_cmd_set_port_id_led);
+
/* Set/Get GPIO (direct, 0x06EC/0x06ED) */
struct ixgbe_aci_cmd_gpio {
__le16 gpio_ctrl_handle;
@@ -1854,6 +1868,7 @@ struct ixgbe_aci_desc {
struct ixgbe_aci_cmd_mdio read_write_mdio;
struct ixgbe_aci_cmd_mdio read_mdio;
struct ixgbe_aci_cmd_mdio write_mdio;
+ struct ixgbe_aci_cmd_set_port_id_led set_port_id_led;
struct ixgbe_aci_cmd_gpio_by_func read_write_gpio_by_func;
struct ixgbe_aci_cmd_gpio read_write_gpio;
struct ixgbe_aci_cmd_sff_eeprom read_write_sff_param;
--
2.43.5
next prev parent reply other threads:[~2025-01-14 10:13 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-14 10:10 [PATCH 00/10] update net/ixgbe base driver Yuan Wang
2025-01-14 10:10 ` [PATCH 01/10] net/ixgbe/base: fix TSAM checking return value Yuan Wang
2025-01-14 10:10 ` Yuan Wang [this message]
2025-01-14 10:10 ` [PATCH 03/10] net/ixgbe/base: disable 2.5/5G speeds from auto-negotiation for E610 Yuan Wang
2025-01-14 10:10 ` [PATCH 04/10] net/ixgbe/base: Add PTP by PHY feature " Yuan Wang
2025-01-14 10:10 ` [PATCH 05/10] net/ixgbe/base: add definition of FW temp event " Yuan Wang
2025-01-14 10:10 ` [PATCH 06/10] net/ixgbe/base: Add capability for OROM recovery update Yuan Wang
2025-01-14 10:10 ` [PATCH 07/10] net/ixgbe/base: add max_drift_thresh to get_ptp_by_phy Yuan Wang
2025-01-14 10:10 ` [PATCH 08/10] net/ixgbe/base: update VF HV subsystem device ID constant Yuan Wang
2025-01-14 10:10 ` [PATCH 09/10] net/ixgbe/base: add missing buffer copy Yuan Wang
2025-01-14 10:10 ` [PATCH 10/10] net/ixgbe: update base driver README Yuan Wang
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=20250114101024.159941-3-yuanx.wang@intel.com \
--to=yuanx.wang@intel.com \
--cc=anatoly.burakov@intel.com \
--cc=dawid.zielinski@intel.com \
--cc=dev@dpdk.org \
--cc=vladimir.medvedkin@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).