From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 0CDE3C438 for ; Thu, 23 Jun 2016 09:22:57 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP; 23 Jun 2016 00:22:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,515,1459839600"; d="scan'208";a="993455467" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by fmsmga001.fm.intel.com with ESMTP; 23 Jun 2016 00:22:56 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id u5N7Ms64013452; Thu, 23 Jun 2016 15:22:54 +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 u5N7MolK014382; Thu, 23 Jun 2016 15:22:52 +0800 Received: (from beileixi@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id u5N7Mo37014378; Thu, 23 Jun 2016 15:22:50 +0800 From: Beilei Xing To: wenzhuo.lu@intel.com Cc: dev@dpdk.org, Beilei Xing Date: Thu, 23 Jun 2016 15:22:13 +0800 Message-Id: <1466666557-14312-6-git-send-email-beilei.xing@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1466666557-14312-1-git-send-email-beilei.xing@intel.com> References: <1465977220-3970-1-git-send-email-beilei.xing@intel.com> <1466666557-14312-1-git-send-email-beilei.xing@intel.com> Subject: [dpdk-dev] [PATCH v4 05/29] ixgbe/base: fix firmware command checksum error 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: Thu, 23 Jun 2016 07:22:58 -0000 When software sends commands to firmware using the host slave command interface, firmware fails to recieve the request command with a checksum failed error. This patch sets command checksum to the default value of 0xFF according to datasheet, therefore the checksum won't be checked by firmware. Fixes: 86b8fb293fdf ("ixgbe/base: add sw-firmware sync for resource sharing on X550em_a") Fixes: 0790adeb5675 ("ixgbe/base: support X550em_a device") Signed-off-by: Beilei Xing --- drivers/net/ixgbe/base/ixgbe_x550.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/drivers/net/ixgbe/base/ixgbe_x550.c b/drivers/net/ixgbe/base/ixgbe_x550.c index 8a5b1dc..54aab06 100644 --- a/drivers/net/ixgbe/base/ixgbe_x550.c +++ b/drivers/net/ixgbe/base/ixgbe_x550.c @@ -1041,6 +1041,7 @@ s32 ixgbe_get_phy_token(struct ixgbe_hw *hw) token_cmd.hdr.cmd = FW_PHY_TOKEN_REQ_CMD; token_cmd.hdr.buf_len = FW_PHY_TOKEN_REQ_LEN; token_cmd.hdr.cmd_or_resp.cmd_resv = 0; + token_cmd.hdr.checksum = FW_DEFAULT_CHECKSUM; token_cmd.port_number = hw->bus.lan_id; token_cmd.command_type = FW_PHY_TOKEN_REQ; token_cmd.pad = 0; @@ -1071,6 +1072,7 @@ s32 ixgbe_put_phy_token(struct ixgbe_hw *hw) token_cmd.hdr.cmd = FW_PHY_TOKEN_REQ_CMD; token_cmd.hdr.buf_len = FW_PHY_TOKEN_REQ_LEN; token_cmd.hdr.cmd_or_resp.cmd_resv = 0; + token_cmd.hdr.checksum = FW_DEFAULT_CHECKSUM; token_cmd.port_number = hw->bus.lan_id; token_cmd.command_type = FW_PHY_TOKEN_REL; token_cmd.pad = 0; @@ -1094,23 +1096,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; } @@ -1124,23 +1127,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