Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/599651/?format=api
{ "id": 599651, "url": "http://patchwork.ozlabs.org/api/patches/599651/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20160318183255.40415.40751.stgit@mdrustad-wks.jf.intel.com/", "project": { "id": 46, "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api", "name": "Intel Wired Ethernet development", "link_name": "intel-wired-lan", "list_id": "intel-wired-lan.osuosl.org", "list_email": "intel-wired-lan@osuosl.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20160318183255.40415.40751.stgit@mdrustad-wks.jf.intel.com>", "list_archive_url": null, "date": "2016-03-18T18:32:55", "name": "[V2,2/7] ixgbe: Add support for phy token firmware command", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": false, "hash": "1be2c14c2410d3b767e7dd1dc3ee3ef9431fa137", "submitter": { "id": 13252, "url": "http://patchwork.ozlabs.org/api/people/13252/?format=api", "name": "Rustad, Mark D", "email": "mark.d.rustad@intel.com" }, "delegate": { "id": 68, "url": "http://patchwork.ozlabs.org/api/users/68/?format=api", "username": "jtkirshe", "first_name": "Jeff", "last_name": "Kirsher", "email": "jeffrey.t.kirsher@intel.com" }, "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20160318183255.40415.40751.stgit@mdrustad-wks.jf.intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/599651/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/599651/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@lists.osuosl.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Received": [ "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ozlabs.org (Postfix) with ESMTP id 3qRYkM1FQbz9s9Z\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 19 Mar 2016 05:32:59 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 6D34D92189;\n\tFri, 18 Mar 2016 18:32:58 +0000 (UTC)", "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 4lonBUYPZ7+q; Fri, 18 Mar 2016 18:32:57 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 23CAB92185;\n\tFri, 18 Mar 2016 18:32:57 +0000 (UTC)", "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id 3665B1C105C\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 18 Mar 2016 18:32:56 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 30BAD92192\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 18 Mar 2016 18:32:56 +0000 (UTC)", "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 9-0ANEaxLeaw for <intel-wired-lan@lists.osuosl.org>;\n\tFri, 18 Mar 2016 18:32:55 +0000 (UTC)", "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 980E092191\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 18 Mar 2016 18:32:55 +0000 (UTC)", "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby orsmga103.jf.intel.com with ESMTP; 18 Mar 2016 11:32:55 -0700", "from mdrustad-wks.jf.intel.com ([134.134.3.229])\n\tby orsmga002.jf.intel.com with ESMTP; 18 Mar 2016 11:32:55 -0700" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.24,356,1455004800\"; d=\"scan'208\";a=\"937001186\"", "From": "Mark D Rustad <mark.d.rustad@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Fri, 18 Mar 2016 11:32:55 -0700", "Message-ID": "<20160318183255.40415.40751.stgit@mdrustad-wks.jf.intel.com>", "In-Reply-To": "<20160318183203.40415.3005.stgit@mdrustad-wks.jf.intel.com>", "References": "<20160318183203.40415.3005.stgit@mdrustad-wks.jf.intel.com>", "User-Agent": "StGit/unknown-version", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [PATCH V2 2/7] ixgbe: Add support for phy token\n\tfirmware command", "X-BeenThere": "intel-wired-lan@lists.osuosl.org", "X-Mailman-Version": "2.1.18-1", "Precedence": "list", "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.lists.osuosl.org>", "List-Unsubscribe": "<http://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=unsubscribe>", "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>", "List-Post": "<mailto:intel-wired-lan@lists.osuosl.org>", "List-Help": "<mailto:intel-wired-lan-request@lists.osuosl.org?subject=help>", "List-Subscribe": "<http://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=subscribe>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "intel-wired-lan-bounces@lists.osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@lists.osuosl.org>" }, "content": "The new mac includes a new firmware command that need to be used\nto control phy access, so add definitions and support for it.\n\nSigned-off-by: Mark Rustad <mark.d.rustad@intel.com>\n---\n drivers/net/ethernet/intel/ixgbe/ixgbe_type.h | 19 +++++++++\n drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c | 55 +++++++++++++++++++++++++\n 2 files changed, 74 insertions(+)", "diff": "diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h\nindex fae85d1c3bf9..818e0a10d1bd 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h\n@@ -2626,6 +2626,16 @@ enum ixgbe_fdir_pballoc_type {\n #define FW_MAX_READ_BUFFER_SIZE\t\t1024\n #define FW_DISABLE_RXEN_CMD\t\t0xDE\n #define FW_DISABLE_RXEN_LEN\t\t0x1\n+#define FW_PHY_MGMT_REQ_CMD\t\t0x20\n+#define FW_PHY_TOKEN_REQ_CMD\t\t0x0A\n+#define FW_PHY_TOKEN_REQ_LEN\t\t2\n+#define FW_PHY_TOKEN_REQ\t\t0\n+#define FW_PHY_TOKEN_REL\t\t1\n+#define FW_PHY_TOKEN_OK\t\t\t1\n+#define FW_PHY_TOKEN_RETRY\t\t0x80\n+#define FW_PHY_TOKEN_DELAY\t\t5\t/* milliseconds */\n+#define FW_PHY_TOKEN_WAIT\t\t5\t/* seconds */\n+#define FW_PHY_TOKEN_RETRIES ((FW_PHY_TOKEN_WAIT * 1000) / FW_PHY_TOKEN_DELAY)\n \n /* Host Interface Command Structures */\n struct ixgbe_hic_hdr {\n@@ -2694,6 +2704,13 @@ struct ixgbe_hic_disable_rxen {\n \tu16 pad3;\n };\n \n+struct ixgbe_hic_phy_token_req {\n+\tstruct ixgbe_hic_hdr hdr;\n+\tu8 port_number;\n+\tu8 command_type;\n+\tu16 pad;\n+};\n+\n /* Transmit Descriptor - Advanced */\n union ixgbe_adv_tx_desc {\n \tstruct {\n@@ -3525,6 +3542,8 @@ struct ixgbe_info {\n #define IXGBE_ERR_INVALID_ARGUMENT -32\n #define IXGBE_ERR_HOST_INTERFACE_COMMAND -33\n #define IXGBE_ERR_FDIR_CMD_INCOMPLETE\t\t-38\n+#define IXGBE_ERR_FW_RESP_INVALID\t\t-39\n+#define IXGBE_ERR_TOKEN_RETRY\t\t\t-40\n #define IXGBE_NOT_IMPLEMENTED 0x7FFFFFFF\n \n #define IXGBE_FUSES0_GROUP(_i)\t\t(0x11158 + ((_i) * 4))\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c\nindex 65832fa30426..aaea94759d76 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c\n@@ -413,6 +413,61 @@ out:\n \treturn ret;\n }\n \n+/**\n+ * ixgbe_get_phy_token - Get the token for shared phy access\n+ * @hw: Pointer to hardware structure\n+ */\n+static s32 ixgbe_get_phy_token(struct ixgbe_hw *hw)\n+{\n+\tstruct ixgbe_hic_phy_token_req token_cmd;\n+\ts32 status;\n+\n+\ttoken_cmd.hdr.cmd = FW_PHY_TOKEN_REQ_CMD;\n+\ttoken_cmd.hdr.buf_len = FW_PHY_TOKEN_REQ_LEN;\n+\ttoken_cmd.hdr.cmd_or_resp.cmd_resv = 0;\n+\ttoken_cmd.hdr.checksum = FW_DEFAULT_CHECKSUM;\n+\ttoken_cmd.port_number = hw->bus.lan_id;\n+\ttoken_cmd.command_type = FW_PHY_TOKEN_REQ;\n+\ttoken_cmd.pad = 0;\n+\tstatus = ixgbe_host_interface_command(hw, &token_cmd, sizeof(token_cmd),\n+\t\t\t\t\t IXGBE_HI_COMMAND_TIMEOUT,\n+\t\t\t\t\t true);\n+\tif (status)\n+\t\treturn status;\n+\tif (token_cmd.hdr.cmd_or_resp.ret_status == FW_PHY_TOKEN_OK)\n+\t\treturn 0;\n+\tif (token_cmd.hdr.cmd_or_resp.ret_status != FW_PHY_TOKEN_RETRY)\n+\t\treturn IXGBE_ERR_FW_RESP_INVALID;\n+\n+\treturn IXGBE_ERR_TOKEN_RETRY;\n+}\n+\n+/**\n+ * ixgbe_put_phy_token - Put the token for shared phy access\n+ * @hw: Pointer to hardware structure\n+ */\n+static s32 ixgbe_put_phy_token(struct ixgbe_hw *hw)\n+{\n+\tstruct ixgbe_hic_phy_token_req token_cmd;\n+\ts32 status;\n+\n+\ttoken_cmd.hdr.cmd = FW_PHY_TOKEN_REQ_CMD;\n+\ttoken_cmd.hdr.buf_len = FW_PHY_TOKEN_REQ_LEN;\n+\ttoken_cmd.hdr.cmd_or_resp.cmd_resv = 0;\n+\ttoken_cmd.hdr.checksum = FW_DEFAULT_CHECKSUM;\n+\ttoken_cmd.port_number = hw->bus.lan_id;\n+\ttoken_cmd.command_type = FW_PHY_TOKEN_REL;\n+\ttoken_cmd.pad = 0;\n+\tstatus = ixgbe_host_interface_command(hw, &token_cmd, sizeof(token_cmd),\n+\t\t\t\t\t IXGBE_HI_COMMAND_TIMEOUT,\n+\t\t\t\t\t true);\n+\tif (status)\n+\t\treturn status;\n+\tif (token_cmd.hdr.cmd_or_resp.ret_status == FW_PHY_TOKEN_OK)\n+\t\treturn 0;\n+\treturn IXGBE_ERR_FW_RESP_INVALID;\n+}\n+\n /** ixgbe_read_ee_hostif_data_X550 - Read EEPROM word using a host interface\n * command assuming that the semaphore is already obtained.\n * @hw: pointer to hardware structure\n", "prefixes": [ "V2", "2/7" ] }