From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 8AED7C11C for ; Wed, 15 Jun 2016 09:54:20 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP; 15 Jun 2016 00:54:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,475,1459839600"; d="scan'208";a="828389009" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga003.jf.intel.com with ESMTP; 15 Jun 2016 00:54:18 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id u5F7sFTB014774; Wed, 15 Jun 2016 15:54:15 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id u5F7sCZA004105; Wed, 15 Jun 2016 15:54:14 +0800 Received: (from beileixi@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id u5F7sClN004101; Wed, 15 Jun 2016 15:54:12 +0800 From: Beilei Xing To: wenzhuo.lu@intel.com Cc: dev@dpdk.org, Beilei Xing Date: Wed, 15 Jun 2016 15:53:24 +0800 Message-Id: <1465977220-3970-15-git-send-email-beilei.xing@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1465977220-3970-1-git-send-email-beilei.xing@intel.com> References: <1465887596-10346-1-git-send-email-beilei.xing@intel.com> <1465977220-3970-1-git-send-email-beilei.xing@intel.com> Subject: [dpdk-dev] [PATCH v3 14/30] ixgbe/base: fix firmware commands on X550em_a X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 07:54:21 -0000 This patch fixes firmware commands on X550em_a. For one thing, the checksum value was not being set. Fixes: 0790adeb5675 ("ixgbe/base: support X550em_a device") Signed-off-by: Beilei Xing --- drivers/net/ixgbe/base/ixgbe_x550.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/net/ixgbe/base/ixgbe_x550.c b/drivers/net/ixgbe/base/ixgbe_x550.c index e91546c..aaf6572 100644 --- a/drivers/net/ixgbe/base/ixgbe_x550.c +++ b/drivers/net/ixgbe/base/ixgbe_x550.c @@ -1154,23 +1154,24 @@ s32 ixgbe_put_phy_token(struct ixgbe_hw *hw) * @data: Data to write to the register **/ s32 ixgbe_write_iosf_sb_reg_x550a(struct ixgbe_hw *hw, u32 reg_addr, - u32 device_type, u32 data) + u32 device_type, u32 data) { struct ixgbe_hic_internal_phy_req write_cmd; s32 status; UNREFERENCED_1PARAMETER(device_type); + memset(&write_cmd, 0, sizeof(write_cmd)); write_cmd.hdr.cmd = FW_INT_PHY_REQ_CMD; write_cmd.hdr.buf_len = FW_INT_PHY_REQ_LEN; + write_cmd.hdr.checksum = FW_DEFAULT_CHECKSUM; write_cmd.port_number = hw->bus.lan_id; write_cmd.command_type = FW_INT_PHY_REQ_WRITE; write_cmd.address = (u16)reg_addr; - write_cmd.rsv1 = 0; write_cmd.write_data = data; - write_cmd.pad = 0; status = ixgbe_host_interface_command(hw, (u32 *)&write_cmd, - sizeof(write_cmd), IXGBE_HI_COMMAND_TIMEOUT, false); + sizeof(write_cmd), + IXGBE_HI_COMMAND_TIMEOUT, false); return status; } @@ -1184,23 +1185,23 @@ s32 ixgbe_write_iosf_sb_reg_x550a(struct ixgbe_hw *hw, u32 reg_addr, * @data: Pointer to read data from the register **/ s32 ixgbe_read_iosf_sb_reg_x550a(struct ixgbe_hw *hw, u32 reg_addr, - u32 device_type, u32 *data) + u32 device_type, u32 *data) { struct ixgbe_hic_internal_phy_req read_cmd; s32 status; UNREFERENCED_1PARAMETER(device_type); + memset(&read_cmd, 0, sizeof(read_cmd)); read_cmd.hdr.cmd = FW_INT_PHY_REQ_CMD; read_cmd.hdr.buf_len = FW_INT_PHY_REQ_LEN; + read_cmd.hdr.checksum = FW_DEFAULT_CHECKSUM; read_cmd.port_number = hw->bus.lan_id; read_cmd.command_type = FW_INT_PHY_REQ_READ; read_cmd.address = (u16)reg_addr; - read_cmd.rsv1 = 0; - read_cmd.write_data = 0; - read_cmd.pad = 0; status = ixgbe_host_interface_command(hw, (u32 *)&read_cmd, - sizeof(read_cmd), IXGBE_HI_COMMAND_TIMEOUT, true); + sizeof(read_cmd), + IXGBE_HI_COMMAND_TIMEOUT, true); /* Extract the register value from the response. */ *data = ((struct ixgbe_hic_internal_phy_resp *)&read_cmd)->read_data; -- 2.5.0