net/bnxt: support HWRM port PHY qcaps
authorVenkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Thu, 2 Jul 2020 23:27:54 +0000 (16:27 -0700)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 7 Jul 2020 21:38:26 +0000 (23:38 +0200)
Issue HWRM_PORT_PHY_QCAPS to the firmware to get the physical
port count of the device.

Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/bnxt.h
drivers/net/bnxt/bnxt_ethdev.c
drivers/net/bnxt/bnxt_hwrm.c
drivers/net/bnxt/bnxt_hwrm.h

index 0bdf8f5..65862ab 100644 (file)
@@ -747,6 +747,7 @@ struct bnxt {
        uint32_t                outer_tpid_bd;
        struct bnxt_pf_info     *pf;
        struct bnxt_parent_info *parent;
+       uint8_t                 port_cnt;
        uint8_t                 vxlan_port_cnt;
        uint8_t                 geneve_port_cnt;
        uint16_t                vxlan_port;
index 7edc9a7..3c76f21 100644 (file)
@@ -5286,6 +5286,8 @@ static int bnxt_init_fw(struct bnxt *bp)
 
        bnxt_hwrm_parent_pf_qcfg(bp);
 
+       bnxt_hwrm_port_phy_qcaps(bp);
+
        rc = bnxt_hwrm_cfa_adv_flow_mgmt_qcaps(bp);
        if (rc)
                return rc;
index 347e1c7..e6a28d0 100644 (file)
@@ -1330,6 +1330,28 @@ static int bnxt_hwrm_port_phy_qcfg(struct bnxt *bp,
        return rc;
 }
 
+int bnxt_hwrm_port_phy_qcaps(struct bnxt *bp)
+{
+       int rc = 0;
+       struct hwrm_port_phy_qcaps_input req = {0};
+       struct hwrm_port_phy_qcaps_output *resp = bp->hwrm_cmd_resp_addr;
+
+       if (BNXT_VF(bp) && !BNXT_VF_IS_TRUSTED(bp))
+               return 0;
+
+       HWRM_PREP(&req, HWRM_PORT_PHY_QCAPS, BNXT_USE_CHIMP_MB);
+
+       rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB);
+
+       HWRM_CHECK_RESULT();
+
+       bp->port_cnt = resp->port_cnt;
+
+       HWRM_UNLOCK();
+
+       return 0;
+}
+
 static bool bnxt_find_lossy_profile(struct bnxt *bp)
 {
        int i = 0;
index ef89975..87cd407 100644 (file)
@@ -275,4 +275,5 @@ int bnxt_hwrm_get_dflt_vnic_id(struct bnxt *bp, uint16_t fid,
 int bnxt_hwrm_get_dflt_vnic_svif(struct bnxt *bp, uint16_t fid,
                                 uint16_t *vnic_id, uint16_t *svif);
 int bnxt_hwrm_parent_pf_qcfg(struct bnxt *bp);
+int bnxt_hwrm_port_phy_qcaps(struct bnxt *bp);
 #endif