get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/540137/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 540137,
    "url": "http://patchwork.ozlabs.org/api/patches/540137/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1313149536.305776.1446575844476.JavaMail.zimbra@xes-inc.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": "<1313149536.305776.1446575844476.JavaMail.zimbra@xes-inc.com>",
    "list_archive_url": null,
    "date": "2015-11-03T18:37:24",
    "name": "[3/5] igb: Improve cable length function for I210, etc.",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "66bd64152183de8c8d0a883c665836a7f931f8e9",
    "submitter": {
        "id": 10211,
        "url": "http://patchwork.ozlabs.org/api/people/10211/?format=api",
        "name": "Aaron Sierra",
        "email": "asierra@xes-inc.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/1313149536.305776.1446575844476.JavaMail.zimbra@xes-inc.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/540137/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/540137/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 hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ozlabs.org (Postfix) with ESMTP id C21981413DC\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  5 Nov 2015 05:59:30 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 225CD93994;\n\tWed,  4 Nov 2015 18:59:30 +0000 (UTC)",
            "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id oDl9CSHggUFo; Wed,  4 Nov 2015 18:59:26 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 6FEE29397B;\n\tWed,  4 Nov 2015 18:59:26 +0000 (UTC)",
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id 3C85D1CEEE1\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue,  3 Nov 2015 19:34:25 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 3648D841A0\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue,  3 Nov 2015 19:34:25 +0000 (UTC)",
            "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id jo1bO2Ojty-z for <intel-wired-lan@lists.osuosl.org>;\n\tTue,  3 Nov 2015 19:34:24 +0000 (UTC)",
            "from xes-mad.com (xes-mad.com [216.165.139.218])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id 7D44184294\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue,  3 Nov 2015 19:34:24 +0000 (UTC)",
            "from zimbra.xes-mad.com (zimbra.xes-mad.com [10.52.0.127])\n\tby xes-mad.com (8.13.8/8.13.8) with ESMTP id tA3IbOwC028496;\n\tTue, 3 Nov 2015 12:37:24 -0600"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "from auto-whitelisted by SQLgrey-1.7.6",
        "Date": "Tue, 3 Nov 2015 12:37:24 -0600 (CST)",
        "From": "Aaron Sierra <asierra@xes-inc.com>",
        "To": "Jeff Kirsher <jeffrey.t.kirsher@intel.com>,\n\tintel-wired-lan@lists.osuosl.org",
        "Message-ID": "<1313149536.305776.1446575844476.JavaMail.zimbra@xes-inc.com>",
        "In-Reply-To": "<853516779.304421.1446575216170.JavaMail.zimbra@xes-inc.com>",
        "MIME-Version": "1.0",
        "X-Originating-IP": "[10.52.16.65]",
        "X-Mailer": "Zimbra 8.0.6_GA_5922 (ZimbraWebClient - FF40 (Linux)/8.0.6_GA_5922)",
        "Thread-Topic": "Improve cable length function for I210, etc.",
        "Thread-Index": "eAds6qRV9iYjnfrFxxuCrcRX3P2gWw==",
        "X-Mailman-Approved-At": "Wed, 04 Nov 2015 18:59:25 +0000",
        "Cc": "Joe Schultz <jschultz@xes-inc.com>",
        "Subject": "[Intel-wired-lan] [PATCH 3/5] igb: Improve cable length function\n\tfor I210, etc.",
        "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": "From: Joe Schultz <jschultz@xes-inc.com>\n\nPreviously, the PHY-specific code to get the cable length for the\nI210 internal and related PHYs was reporting the cable length of a\nsingle pair and reporting it as the min, max, and total cable length.\nUpdate it so that all four pairs are checked so the true min, max,\nand average cable lengths are reported.\n\nSigned-off-by: Joe Schultz <jschultz@xes-inc.com>\nSigned-off-by: Aaron Sierra <asierra@xes-inc.com>\n---\n drivers/net/ethernet/intel/igb/e1000_defines.h |  5 ++-\n drivers/net/ethernet/intel/igb/e1000_hw.h      |  1 +\n drivers/net/ethernet/intel/igb/e1000_phy.c     | 54 ++++++++++++++++++++++----\n 3 files changed, 51 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/igb/e1000_defines.h b/drivers/net/ethernet/intel/igb/e1000_defines.h\nindex b191504..4ae3054 100644\n--- a/drivers/net/ethernet/intel/igb/e1000_defines.h\n+++ b/drivers/net/ethernet/intel/igb/e1000_defines.h\n@@ -927,7 +927,10 @@\n \n /* Intel i347-AT4 Registers */\n \n-#define I347AT4_PCDL                   0x10 /* PHY Cable Diagnostics Length */\n+#define I347AT4_PCDL0                  0x10 /* Pair 0 PHY Cable Diagnostics Length */\n+#define I347AT4_PCDL1                  0x11 /* Pair 1 PHY Cable Diagnostics Length */\n+#define I347AT4_PCDL2                  0x12 /* Pair 2 PHY Cable Diagnostics Length */\n+#define I347AT4_PCDL3                  0x13 /* Pair 3 PHY Cable Diagnostics Length */\n #define I347AT4_PCDC                   0x15 /* PHY Cable Diagnostics Control */\n #define I347AT4_PAGE_SELECT            0x16\n \ndiff --git a/drivers/net/ethernet/intel/igb/e1000_hw.h b/drivers/net/ethernet/intel/igb/e1000_hw.h\nindex 2003b37..4034207 100644\n--- a/drivers/net/ethernet/intel/igb/e1000_hw.h\n+++ b/drivers/net/ethernet/intel/igb/e1000_hw.h\n@@ -441,6 +441,7 @@ struct e1000_phy_info {\n \tu16 cable_length;\n \tu16 max_cable_length;\n \tu16 min_cable_length;\n+\tu16 pair_length[4];\n \n \tu8 mdix;\n \ndiff --git a/drivers/net/ethernet/intel/igb/e1000_phy.c b/drivers/net/ethernet/intel/igb/e1000_phy.c\nindex 407d44a..66bc308 100644\n--- a/drivers/net/ethernet/intel/igb/e1000_phy.c\n+++ b/drivers/net/ethernet/intel/igb/e1000_phy.c\n@@ -1717,6 +1717,9 @@ s32 igb_get_cable_length_m88_gen2(struct e1000_hw *hw)\n \tstruct e1000_phy_info *phy = &hw->phy;\n \ts32 ret_val;\n \tu16 phy_data, phy_data2, index, default_page, is_cm;\n+\tint len_tot = 0;\n+\tu16 len_min;\n+\tu16 len_max;\n \n \tswitch (hw->phy.id) {\n \tcase M88E1543_E_PHY_ID:\n@@ -1733,11 +1736,6 @@ s32 igb_get_cable_length_m88_gen2(struct e1000_hw *hw)\n \t\tif (ret_val)\n \t\t\tgoto out;\n \n-\t\t/* Get cable length from PHY Cable Diagnostics Control Reg */\n-\t\tret_val = phy->ops.read_reg(hw, I347AT4_PCDL, &phy_data);\n-\t\tif (ret_val)\n-\t\t\tgoto out;\n-\n \t\t/* Check if the unit of cable length is meters or cm */\n \t\tret_val = phy->ops.read_reg(hw, I347AT4_PCDC, &phy_data2);\n \t\tif (ret_val)\n@@ -1745,10 +1743,50 @@ s32 igb_get_cable_length_m88_gen2(struct e1000_hw *hw)\n \n \t\tis_cm = !(phy_data2 & I347AT4_PCDC_CABLE_LENGTH_UNIT);\n \n+\t\t/* Get cable length from Pair 0 length Regs */\n+\t\tret_val = phy->ops.read_reg(hw, I347AT4_PCDL0, &phy_data);\n+\t\tif (ret_val)\n+\t\t\tgoto out;\n+\n+\t\tphy->pair_length[0] = phy_data / (is_cm ? 100 : 1);\n+\t\tlen_tot = phy->pair_length[0];\n+\t\tlen_min = phy->pair_length[0];\n+\t\tlen_max = phy->pair_length[0];\n+\n+\t\t/* Get cable length from Pair 1 length Regs */\n+\t\tret_val = phy->ops.read_reg(hw, I347AT4_PCDL1, &phy_data);\n+\t\tif (ret_val)\n+\t\t\tgoto out;\n+\n+\t\tphy->pair_length[1] = phy_data / (is_cm ? 100 : 1);\n+\t\tlen_tot += phy->pair_length[1];\n+\t\tlen_min = min(len_min, phy->pair_length[1]);\n+\t\tlen_max = max(len_max, phy->pair_length[1]);\n+\n+\t\t/* Get cable length from Pair 2 length Regs */\n+\t\tret_val = phy->ops.read_reg(hw, I347AT4_PCDL2, &phy_data);\n+\t\tif (ret_val)\n+\t\t\tgoto out;\n+\n+\t\tphy->pair_length[2] = phy_data / (is_cm ? 100 : 1);\n+\t\tlen_tot += phy->pair_length[2];\n+\t\tlen_min = min(len_min, phy->pair_length[2]);\n+\t\tlen_max = max(len_max, phy->pair_length[2]);\n+\n+\t\t/* Get cable length from Pair 3 length Regs */\n+\t\tret_val = phy->ops.read_reg(hw, I347AT4_PCDL3, &phy_data);\n+\t\tif (ret_val)\n+\t\t\tgoto out;\n+\n+\t\tphy->pair_length[3] = phy_data / (is_cm ? 100 : 1);\n+\t\tlen_tot += phy->pair_length[3];\n+\t\tlen_min = min(len_min, phy->pair_length[3]);\n+\t\tlen_max = max(len_max, phy->pair_length[3]);\n+\n \t\t/* Populate the phy structure with cable length in meters */\n-\t\tphy->min_cable_length = phy_data / (is_cm ? 100 : 1);\n-\t\tphy->max_cable_length = phy_data / (is_cm ? 100 : 1);\n-\t\tphy->cable_length = phy_data / (is_cm ? 100 : 1);\n+\t\tphy->min_cable_length = len_min;\n+\t\tphy->max_cable_length = len_max;\n+\t\tphy->cable_length = len_tot / 4;\n \n \t\t/* Reset the page selec to its original value */\n \t\tret_val = phy->ops.write_reg(hw, I347AT4_PAGE_SELECT,\n",
    "prefixes": [
        "3/5"
    ]
}