@@ -295,24 +295,6 @@ static int fbnic_fw_xmit_simple_msg(struct fbnic_dev *fbd, u32 msg_type)
295
295
return err ;
296
296
}
297
297
298
- /**
299
- * fbnic_fw_xmit_cap_msg - Allocate and populate a FW capabilities message
300
- * @fbd: FBNIC device structure
301
- *
302
- * Return: NULL on failure to allocate, error pointer on error, or pointer
303
- * to new TLV test message.
304
- *
305
- * Sends a single TLV header indicating the host wants the firmware to
306
- * confirm the capabilities and version.
307
- **/
308
- static int fbnic_fw_xmit_cap_msg (struct fbnic_dev * fbd )
309
- {
310
- int err = fbnic_fw_xmit_simple_msg (fbd , FBNIC_TLV_MSG_ID_HOST_CAP_REQ );
311
-
312
- /* Return 0 if we are not calling this on ASIC */
313
- return (err == - EOPNOTSUPP ) ? 0 : err ;
314
- }
315
-
316
298
static void fbnic_mbx_init_desc_ring (struct fbnic_dev * fbd , int mbx_idx )
317
299
{
318
300
struct fbnic_fw_mbx * mbx = & fbd -> mbx [mbx_idx ];
@@ -336,15 +318,6 @@ static void fbnic_mbx_init_desc_ring(struct fbnic_dev *fbd, int mbx_idx)
336
318
/* Enable DMA reads from the device */
337
319
wr32 (fbd , FBNIC_PUL_OB_TLP_HDR_AR_CFG ,
338
320
FBNIC_PUL_OB_TLP_HDR_AR_CFG_BME );
339
-
340
- /* Force version to 1 if we successfully requested an update
341
- * from the firmware. This should be overwritten once we get
342
- * the actual version from the firmware in the capabilities
343
- * request message.
344
- */
345
- if (!fbnic_fw_xmit_cap_msg (fbd ) &&
346
- !fbd -> fw_cap .running .mgmt .version )
347
- fbd -> fw_cap .running .mgmt .version = 1 ;
348
321
break ;
349
322
}
350
323
}
@@ -774,6 +747,7 @@ int fbnic_mbx_poll_tx_ready(struct fbnic_dev *fbd)
774
747
{
775
748
unsigned long timeout = jiffies + 10 * HZ + 1 ;
776
749
struct fbnic_fw_mbx * tx_mbx ;
750
+ int err ;
777
751
778
752
tx_mbx = & fbd -> mbx [FBNIC_IPC_MBX_TX_IDX ];
779
753
while (!tx_mbx -> ready ) {
@@ -795,7 +769,22 @@ int fbnic_mbx_poll_tx_ready(struct fbnic_dev *fbd)
795
769
fbnic_mbx_poll (fbd );
796
770
}
797
771
772
+ /* Request an update from the firmware. This should overwrite
773
+ * mgmt.version once we get the actual version from the firmware
774
+ * in the capabilities request message.
775
+ */
776
+ err = fbnic_fw_xmit_simple_msg (fbd , FBNIC_TLV_MSG_ID_HOST_CAP_REQ );
777
+ if (err )
778
+ goto clean_mbx ;
779
+
780
+ /* Use "1" to indicate we entered the state waiting for a response */
781
+ fbd -> fw_cap .running .mgmt .version = 1 ;
782
+
798
783
return 0 ;
784
+ clean_mbx :
785
+ /* Cleanup Rx buffers and disable mailbox */
786
+ fbnic_mbx_clean (fbd );
787
+ return err ;
799
788
}
800
789
801
790
void fbnic_mbx_flush_tx (struct fbnic_dev * fbd )
0 commit comments