/* SPDX-License-Identifier: BSD-3-Clause
* see the individual elements.
- * Copyright(c) 2019-2020 Broadcom
+ * Copyright(c) 2019-2021 Broadcom
* All rights reserved.
*/
return rc;
}
-#ifdef TF_USE_SYSTEM_MEM
-int
-tfp_msg_hwrm_oem_cmd(struct tf *tfp,
- uint32_t max_flows)
-{
- return bnxt_hwrm_oem_cmd(container_of(tfp,
- struct bnxt,
- tfp),
- max_flows);
-}
-#endif /* TF_USE_SYSTEM_MEM */
-
/**
* Allocates zero'ed memory from the heap.
*
return 0;
}
+
+int
+tfp_get_pf(struct tf *tfp, uint16_t *pf)
+{
+ struct bnxt *bp = NULL;
+
+ if (tfp == NULL || pf == NULL)
+ return -EINVAL;
+
+ bp = container_of(tfp, struct bnxt, tfp);
+ if (BNXT_VF(bp) && bp->parent) {
+ *pf = bp->parent->fid - 1;
+ return 0;
+ } else if (BNXT_PF(bp)) {
+ *pf = bp->fw_fid - 1;
+ return 0;
+ }
+ return -EINVAL;
+}