@@ -6292,6 +6292,7 @@ int bnxt_hwrm_set_coal(struct bnxt *bp)
6292
6292
6293
6293
static void bnxt_hwrm_stat_ctx_free (struct bnxt * bp )
6294
6294
{
6295
+ struct hwrm_stat_ctx_clr_stats_input req0 = {0 };
6295
6296
struct hwrm_stat_ctx_free_input req = {0 };
6296
6297
int i ;
6297
6298
@@ -6301,6 +6302,7 @@ static void bnxt_hwrm_stat_ctx_free(struct bnxt *bp)
6301
6302
if (BNXT_CHIP_TYPE_NITRO_A0 (bp ))
6302
6303
return ;
6303
6304
6305
+ bnxt_hwrm_cmd_hdr_init (bp , & req0 , HWRM_STAT_CTX_CLR_STATS , -1 , -1 );
6304
6306
bnxt_hwrm_cmd_hdr_init (bp , & req , HWRM_STAT_CTX_FREE , -1 , -1 );
6305
6307
6306
6308
mutex_lock (& bp -> hwrm_cmd_lock );
@@ -6310,7 +6312,11 @@ static void bnxt_hwrm_stat_ctx_free(struct bnxt *bp)
6310
6312
6311
6313
if (cpr -> hw_stats_ctx_id != INVALID_STATS_CTX_ID ) {
6312
6314
req .stat_ctx_id = cpu_to_le32 (cpr -> hw_stats_ctx_id );
6313
-
6315
+ if (BNXT_FW_MAJ (bp ) <= 20 ) {
6316
+ req0 .stat_ctx_id = req .stat_ctx_id ;
6317
+ _hwrm_send_message (bp , & req0 , sizeof (req0 ),
6318
+ HWRM_CMD_TIMEOUT );
6319
+ }
6314
6320
_hwrm_send_message (bp , & req , sizeof (req ),
6315
6321
HWRM_CMD_TIMEOUT );
6316
6322
@@ -6976,7 +6982,8 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp)
6976
6982
bp -> fw_cap |= BNXT_FW_CAP_ERR_RECOVER_RELOAD ;
6977
6983
6978
6984
bp -> tx_push_thresh = 0 ;
6979
- if (flags & FUNC_QCAPS_RESP_FLAGS_PUSH_MODE_SUPPORTED )
6985
+ if ((flags & FUNC_QCAPS_RESP_FLAGS_PUSH_MODE_SUPPORTED ) &&
6986
+ BNXT_FW_MAJ (bp ) > 217 )
6980
6987
bp -> tx_push_thresh = BNXT_TX_PUSH_THRESH ;
6981
6988
6982
6989
hw_resc -> max_rsscos_ctxs = le16_to_cpu (resp -> max_rsscos_ctx );
@@ -7240,8 +7247,9 @@ static int __bnxt_hwrm_ver_get(struct bnxt *bp, bool silent)
7240
7247
static int bnxt_hwrm_ver_get (struct bnxt * bp )
7241
7248
{
7242
7249
struct hwrm_ver_get_output * resp = bp -> hwrm_cmd_resp_addr ;
7250
+ u16 fw_maj , fw_min , fw_bld , fw_rsv ;
7243
7251
u32 dev_caps_cfg , hwrm_ver ;
7244
- int rc ;
7252
+ int rc , len ;
7245
7253
7246
7254
bp -> hwrm_max_req_len = HWRM_MAX_REQ_LEN ;
7247
7255
mutex_lock (& bp -> hwrm_cmd_lock );
@@ -7273,9 +7281,22 @@ static int bnxt_hwrm_ver_get(struct bnxt *bp)
7273
7281
resp -> hwrm_intf_maj_8b , resp -> hwrm_intf_min_8b ,
7274
7282
resp -> hwrm_intf_upd_8b );
7275
7283
7276
- snprintf (bp -> fw_ver_str , BC_HWRM_STR_LEN , "%d.%d.%d.%d" ,
7277
- resp -> hwrm_fw_maj_8b , resp -> hwrm_fw_min_8b ,
7278
- resp -> hwrm_fw_bld_8b , resp -> hwrm_fw_rsvd_8b );
7284
+ fw_maj = le16_to_cpu (resp -> hwrm_fw_major );
7285
+ if (bp -> hwrm_spec_code > 0x10803 && fw_maj ) {
7286
+ fw_min = le16_to_cpu (resp -> hwrm_fw_minor );
7287
+ fw_bld = le16_to_cpu (resp -> hwrm_fw_build );
7288
+ fw_rsv = le16_to_cpu (resp -> hwrm_fw_patch );
7289
+ len = FW_VER_STR_LEN ;
7290
+ } else {
7291
+ fw_maj = resp -> hwrm_fw_maj_8b ;
7292
+ fw_min = resp -> hwrm_fw_min_8b ;
7293
+ fw_bld = resp -> hwrm_fw_bld_8b ;
7294
+ fw_rsv = resp -> hwrm_fw_rsvd_8b ;
7295
+ len = BC_HWRM_STR_LEN ;
7296
+ }
7297
+ bp -> fw_ver_code = BNXT_FW_VER_CODE (fw_maj , fw_min , fw_bld , fw_rsv );
7298
+ snprintf (bp -> fw_ver_str , len , "%d.%d.%d.%d" , fw_maj , fw_min , fw_bld ,
7299
+ fw_rsv );
7279
7300
7280
7301
if (strlen (resp -> active_pkg_name )) {
7281
7302
int fw_ver_len = strlen (bp -> fw_ver_str );
@@ -11892,7 +11913,8 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
11892
11913
dev -> ethtool_ops = & bnxt_ethtool_ops ;
11893
11914
pci_set_drvdata (pdev , dev );
11894
11915
11895
- bnxt_vpd_read_info (bp );
11916
+ if (BNXT_PF (bp ))
11917
+ bnxt_vpd_read_info (bp );
11896
11918
11897
11919
rc = bnxt_alloc_hwrm_resources (bp );
11898
11920
if (rc )
0 commit comments