@@ -352,24 +352,6 @@ static int fbnic_fw_xmit_simple_msg(struct fbnic_dev *fbd, u32 msg_type)
352
352
return err ;
353
353
}
354
354
355
- /**
356
- * fbnic_fw_xmit_cap_msg - Allocate and populate a FW capabilities message
357
- * @fbd: FBNIC device structure
358
- *
359
- * Return: NULL on failure to allocate, error pointer on error, or pointer
360
- * to new TLV test message.
361
- *
362
- * Sends a single TLV header indicating the host wants the firmware to
363
- * confirm the capabilities and version.
364
- **/
365
- static int fbnic_fw_xmit_cap_msg (struct fbnic_dev * fbd )
366
- {
367
- int err = fbnic_fw_xmit_simple_msg (fbd , FBNIC_TLV_MSG_ID_HOST_CAP_REQ );
368
-
369
- /* Return 0 if we are not calling this on ASIC */
370
- return (err == - EOPNOTSUPP ) ? 0 : err ;
371
- }
372
-
373
355
static void fbnic_mbx_init_desc_ring (struct fbnic_dev * fbd , int mbx_idx )
374
356
{
375
357
struct fbnic_fw_mbx * mbx = & fbd -> mbx [mbx_idx ];
@@ -393,15 +375,6 @@ static void fbnic_mbx_init_desc_ring(struct fbnic_dev *fbd, int mbx_idx)
393
375
/* Enable DMA reads from the device */
394
376
wr32 (fbd , FBNIC_PUL_OB_TLP_HDR_AR_CFG ,
395
377
FBNIC_PUL_OB_TLP_HDR_AR_CFG_BME );
396
-
397
- /* Force version to 1 if we successfully requested an update
398
- * from the firmware. This should be overwritten once we get
399
- * the actual version from the firmware in the capabilities
400
- * request message.
401
- */
402
- if (!fbnic_fw_xmit_cap_msg (fbd ) &&
403
- !fbd -> fw_cap .running .mgmt .version )
404
- fbd -> fw_cap .running .mgmt .version = 1 ;
405
378
break ;
406
379
}
407
380
}
@@ -907,6 +880,7 @@ int fbnic_mbx_poll_tx_ready(struct fbnic_dev *fbd)
907
880
{
908
881
unsigned long timeout = jiffies + 10 * HZ + 1 ;
909
882
struct fbnic_fw_mbx * tx_mbx ;
883
+ int err ;
910
884
911
885
tx_mbx = & fbd -> mbx [FBNIC_IPC_MBX_TX_IDX ];
912
886
while (!tx_mbx -> ready ) {
@@ -928,7 +902,22 @@ int fbnic_mbx_poll_tx_ready(struct fbnic_dev *fbd)
928
902
fbnic_mbx_poll (fbd );
929
903
}
930
904
905
+ /* Request an update from the firmware. This should overwrite
906
+ * mgmt.version once we get the actual version from the firmware
907
+ * in the capabilities request message.
908
+ */
909
+ err = fbnic_fw_xmit_simple_msg (fbd , FBNIC_TLV_MSG_ID_HOST_CAP_REQ );
910
+ if (err )
911
+ goto clean_mbx ;
912
+
913
+ /* Use "1" to indicate we entered the state waiting for a response */
914
+ fbd -> fw_cap .running .mgmt .version = 1 ;
915
+
931
916
return 0 ;
917
+ clean_mbx :
918
+ /* Cleanup Rx buffers and disable mailbox */
919
+ fbnic_mbx_clean (fbd );
920
+ return err ;
932
921
}
933
922
934
923
static void __fbnic_fw_evict_cmpl (struct fbnic_fw_completion * cmpl_data )
0 commit comments