MCPcopy Create free account
hub / github.com/F-Stack/f-stack / txgbevf_negotiate_api_version

Function txgbevf_negotiate_api_version

dpdk/drivers/net/txgbe/base/txgbe_vf.c:576–600  ·  view source on GitHub ↗

* txgbevf_negotiate_api_version - Negotiate supported API version * @hw: pointer to the HW structure * @api: integer containing requested API version **/

Source from the content-addressed store, hash-verified

574 * @api: integer containing requested API version
575 **/
576int txgbevf_negotiate_api_version(struct txgbe_hw *hw, int api)
577{
578 int err;
579 u32 msg[3];
580
581 /* Negotiate the mailbox API version */
582 msg[0] = TXGBE_VF_API_NEGOTIATE;
583 msg[1] = api;
584 msg[2] = 0;
585
586 err = txgbevf_write_msg_read_ack(hw, msg, msg, 3);
587 if (!err) {
588 msg[0] &= ~TXGBE_VT_MSGTYPE_CTS;
589
590 /* Store value and return 0 on success */
591 if (msg[0] == (TXGBE_VF_API_NEGOTIATE | TXGBE_VT_MSGTYPE_ACK)) {
592 hw->api_version = api;
593 return 0;
594 }
595
596 err = TXGBE_ERR_INVALID_ARGUMENT;
597 }
598
599 return err;
600}
601
602int txgbevf_get_queues(struct txgbe_hw *hw, unsigned int *num_tcs,
603 unsigned int *default_tc)

Callers 1

txgbevf_negotiate_apiFunction · 0.85

Calls 1

Tested by

no test coverage detected