+
+int
+tfp_get_fid(struct tf *tfp, uint16_t *fw_fid)
+{
+ struct bnxt *bp = NULL;
+
+ if (tfp == NULL || fw_fid == NULL)
+ return -EINVAL;
+
+ bp = (struct bnxt *)tfp->bp;
+ if (bp == NULL)
+ return -EINVAL;
+
+ *fw_fid = bp->fw_fid;
+
+ return 0;
+}
+
+int
+tfp_get_pf(struct tf *tfp, uint16_t *pf)
+{
+ struct bnxt *bp = NULL;
+
+ if (tfp == NULL || pf == NULL)
+ return -EINVAL;
+
+ bp = (struct bnxt *)tfp->bp;
+ 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;
+}