@@ -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
}
@@ -912,6 +885,7 @@ int fbnic_mbx_poll_tx_ready(struct fbnic_dev *fbd)
912
885
{
913
886
unsigned long timeout = jiffies + 10 * HZ + 1 ;
914
887
struct fbnic_fw_mbx * tx_mbx ;
888
+ int err ;
915
889
916
890
tx_mbx = & fbd -> mbx [FBNIC_IPC_MBX_TX_IDX ];
917
891
while (!tx_mbx -> ready ) {
@@ -933,7 +907,22 @@ int fbnic_mbx_poll_tx_ready(struct fbnic_dev *fbd)
933
907
fbnic_mbx_poll (fbd );
934
908
}
935
909
910
+ /* Request an update from the firmware. This should overwrite
911
+ * mgmt.version once we get the actual version from the firmware
912
+ * in the capabilities request message.
913
+ */
914
+ err = fbnic_fw_xmit_simple_msg (fbd , FBNIC_TLV_MSG_ID_HOST_CAP_REQ );
915
+ if (err )
916
+ goto clean_mbx ;
917
+
918
+ /* Use "1" to indicate we entered the state waiting for a response */
919
+ fbd -> fw_cap .running .mgmt .version = 1 ;
920
+
936
921
return 0 ;
922
+ clean_mbx :
923
+ /* Cleanup Rx buffers and disable mailbox */
924
+ fbnic_mbx_clean (fbd );
925
+ return err ;
937
926
}
938
927
939
928
static void __fbnic_fw_evict_cmpl (struct fbnic_fw_completion * cmpl_data )
0 commit comments