Skip to content

Commit 11f15ed

Browse files
Michael Chandavem330
authored andcommitted
bnxt_en: Update to Firmware 1.2.2 spec.
Use new field names in API structs and stop using deprecated fields auto_link_speed and auto_duplex in phy_cfg/phy_qcfg structs. Update copyright year to 2016. Signed-off-by: Michael Chan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 04c85bf commit 11f15ed

File tree

9 files changed

+431
-56
lines changed

9 files changed

+431
-56
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* Broadcom NetXtreme-C/E network driver.
22
*
3-
* Copyright (c) 2014-2015 Broadcom Corporation
3+
* Copyright (c) 2014-2016 Broadcom Corporation
44
*
55
* This program is free software; you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by
@@ -2763,7 +2763,7 @@ static int bnxt_hwrm_func_drv_rgtr(struct bnxt *bp)
27632763
* only checks if it is non-zero to enable async event forwarding
27642764
*/
27652765
req.async_event_fwd[0] |= cpu_to_le32(1);
2766-
req.os_type = cpu_to_le16(1);
2766+
req.os_type = cpu_to_le16(FUNC_DRV_RGTR_REQ_OS_TYPE_LINUX);
27672767
req.ver_maj = DRV_VER_MAJ;
27682768
req.ver_min = DRV_VER_MIN;
27692769
req.ver_upd = DRV_VER_UPD;
@@ -3726,7 +3726,7 @@ int bnxt_hwrm_func_qcaps(struct bnxt *bp)
37263726

37273727
pf->fw_fid = le16_to_cpu(resp->fid);
37283728
pf->port_id = le16_to_cpu(resp->port_id);
3729-
memcpy(pf->mac_addr, resp->perm_mac_address, ETH_ALEN);
3729+
memcpy(pf->mac_addr, resp->mac_address, ETH_ALEN);
37303730
memcpy(bp->dev->dev_addr, pf->mac_addr, ETH_ALEN);
37313731
pf->max_rsscos_ctxs = le16_to_cpu(resp->max_rsscos_ctx);
37323732
pf->max_cp_rings = le16_to_cpu(resp->max_cmpl_rings);
@@ -3751,7 +3751,7 @@ int bnxt_hwrm_func_qcaps(struct bnxt *bp)
37513751
struct bnxt_vf_info *vf = &bp->vf;
37523752

37533753
vf->fw_fid = le16_to_cpu(resp->fid);
3754-
memcpy(vf->mac_addr, resp->perm_mac_address, ETH_ALEN);
3754+
memcpy(vf->mac_addr, resp->mac_address, ETH_ALEN);
37553755
if (is_valid_ether_addr(vf->mac_addr))
37563756
/* overwrite netdev dev_adr with admin VF MAC */
37573757
memcpy(bp->dev->dev_addr, vf->mac_addr, ETH_ALEN);
@@ -3842,6 +3842,8 @@ static int bnxt_hwrm_ver_get(struct bnxt *bp)
38423842

38433843
memcpy(&bp->ver_resp, resp, sizeof(struct hwrm_ver_get_output));
38443844

3845+
bp->hwrm_spec_code = resp->hwrm_intf_maj << 16 |
3846+
resp->hwrm_intf_min << 8 | resp->hwrm_intf_upd;
38453847
if (resp->hwrm_intf_maj < 1) {
38463848
netdev_warn(bp->dev, "HWRM interface %d.%d.%d is older than 1.0.0.\n",
38473849
resp->hwrm_intf_maj, resp->hwrm_intf_min,
@@ -4523,7 +4525,6 @@ static int bnxt_update_link(struct bnxt *bp, bool chng_link_state)
45234525
else
45244526
link_info->link_speed = 0;
45254527
link_info->force_link_speed = le16_to_cpu(resp->force_link_speed);
4526-
link_info->auto_link_speed = le16_to_cpu(resp->auto_link_speed);
45274528
link_info->support_speeds = le16_to_cpu(resp->support_speeds);
45284529
link_info->auto_link_speeds = le16_to_cpu(resp->auto_link_speed_mask);
45294530
link_info->lp_auto_link_speeds =
@@ -4533,8 +4534,8 @@ static int bnxt_update_link(struct bnxt *bp, bool chng_link_state)
45334534
link_info->phy_ver[1] = resp->phy_min;
45344535
link_info->phy_ver[2] = resp->phy_bld;
45354536
link_info->media_type = resp->media_type;
4536-
link_info->transceiver = resp->transceiver_type;
4537-
link_info->phy_addr = resp->phy_addr;
4537+
link_info->transceiver = resp->xcvr_pkg_type;
4538+
link_info->phy_addr = resp->eee_config_phy_addr;
45384539

45394540
/* TODO: need to add more logic to report VF link */
45404541
if (chng_link_state) {
@@ -4581,7 +4582,7 @@ static void bnxt_hwrm_set_link_common(struct bnxt *bp,
45814582

45824583
if (autoneg & BNXT_AUTONEG_SPEED) {
45834584
req->auto_mode |=
4584-
PORT_PHY_CFG_REQ_AUTO_MODE_MASK;
4585+
PORT_PHY_CFG_REQ_AUTO_MODE_SPEED_MASK;
45854586

45864587
req->enables |= cpu_to_le32(
45874588
PORT_PHY_CFG_REQ_ENABLES_AUTO_LINK_SPEED_MASK);
@@ -4595,9 +4596,6 @@ static void bnxt_hwrm_set_link_common(struct bnxt *bp,
45954596
req->flags |= cpu_to_le32(PORT_PHY_CFG_REQ_FLAGS_FORCE);
45964597
}
45974598

4598-
/* currently don't support half duplex */
4599-
req->auto_duplex = PORT_PHY_CFG_REQ_AUTO_DUPLEX_FULL;
4600-
req->enables |= cpu_to_le32(PORT_PHY_CFG_REQ_ENABLES_AUTO_DUPLEX);
46014599
/* tell chimp that the setting takes effect immediately */
46024600
req->flags |= cpu_to_le32(PORT_PHY_CFG_REQ_FLAGS_RESET_PHY);
46034601
}

drivers/net/ethernet/broadcom/bnxt/bnxt.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* Broadcom NetXtreme-C/E network driver.
22
*
3-
* Copyright (c) 2014-2015 Broadcom Corporation
3+
* Copyright (c) 2014-2016 Broadcom Corporation
44
*
55
* This program is free software; you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
1111
#define BNXT_H
1212

1313
#define DRV_MODULE_NAME "bnxt_en"
14-
#define DRV_MODULE_VERSION "1.0.0"
14+
#define DRV_MODULE_VERSION "1.2.0"
1515

1616
#define DRV_VER_MAJ 1
1717
#define DRV_VER_MIN 0
@@ -788,7 +788,7 @@ struct bnxt_link_info {
788788
#define BNXT_LINK_AUTO_ALLSPDS PORT_PHY_QCFG_RESP_AUTO_MODE_ALL_SPEEDS
789789
#define BNXT_LINK_AUTO_ONESPD PORT_PHY_QCFG_RESP_AUTO_MODE_ONE_SPEED
790790
#define BNXT_LINK_AUTO_ONEORBELOW PORT_PHY_QCFG_RESP_AUTO_MODE_ONE_OR_BELOW
791-
#define BNXT_LINK_AUTO_MSK PORT_PHY_QCFG_RESP_AUTO_MODE_MASK
791+
#define BNXT_LINK_AUTO_MSK PORT_PHY_QCFG_RESP_AUTO_MODE_SPEED_MASK
792792
#define PHY_VER_LEN 3
793793
u8 phy_ver[PHY_VER_LEN];
794794
u16 link_speed;
@@ -813,7 +813,6 @@ struct bnxt_link_info {
813813
#define BNXT_LINK_SPEED_MSK_40GB PORT_PHY_QCFG_RESP_SUPPORT_SPEEDS_40GB
814814
#define BNXT_LINK_SPEED_MSK_50GB PORT_PHY_QCFG_RESP_SUPPORT_SPEEDS_50GB
815815
u16 lp_auto_link_speeds;
816-
u16 auto_link_speed;
817816
u16 force_link_speed;
818817
u32 preemphasis;
819818

@@ -940,6 +939,7 @@ struct bnxt {
940939

941940
u32 msg_enable;
942941

942+
u32 hwrm_spec_code;
943943
u16 hwrm_cmd_seq;
944944
u32 hwrm_intr_seq_id;
945945
void *hwrm_cmd_resp_addr;

drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* Broadcom NetXtreme-C/E network driver.
22
*
3-
* Copyright (c) 2014-2015 Broadcom Corporation
3+
* Copyright (c) 2014-2016 Broadcom Corporation
44
*
55
* This program is free software; you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by
@@ -728,7 +728,7 @@ static int bnxt_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
728728
ethtool_speed = bnxt_fw_to_ethtool_speed(link_info->link_speed);
729729
ethtool_cmd_speed_set(cmd, ethtool_speed);
730730
if (link_info->transceiver ==
731-
PORT_PHY_QCFG_RESP_TRANSCEIVER_TYPE_XCVR_INTERNAL)
731+
PORT_PHY_QCFG_RESP_XCVR_PKG_TYPE_XCVR_INTERNAL)
732732
cmd->transceiver = XCVR_INTERNAL;
733733
else
734734
cmd->transceiver = XCVR_EXTERNAL;

drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* Broadcom NetXtreme-C/E network driver.
22
*
3-
* Copyright (c) 2014-2015 Broadcom Corporation
3+
* Copyright (c) 2014-2016 Broadcom Corporation
44
*
55
* This program is free software; you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

drivers/net/ethernet/broadcom/bnxt/bnxt_fw_hdr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* Broadcom NetXtreme-C/E network driver.
22
*
3-
* Copyright (c) 2014-2015 Broadcom Corporation
3+
* Copyright (c) 2014-2016 Broadcom Corporation
44
*
55
* This program is free software; you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

0 commit comments

Comments
 (0)