There isn't always a valid mport that can be used. For these cases,
special invalid selectors can be generated. Requests that use such
selectors in any way will be rejected.
Signed-off-by: Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
#define EFX_MPORT_NULL (0U)
+/*
+ * Generate an invalid MPORT selector.
+ *
+ * The resulting MPORT selector is opaque to the caller. Requests
+ * that attempt to use it will be rejected.
+ */
+LIBEFX_API
+extern __checkReturn efx_rc_t
+efx_mae_mport_invalid(
+ __out efx_mport_sel_t *mportp);
+
/*
* Get MPORT selector of a physical port.
*
#undef EFX_MAE_MV_BIT_DESC
};
+ __checkReturn efx_rc_t
+efx_mae_mport_invalid(
+ __out efx_mport_sel_t *mportp)
+{
+ efx_dword_t dword;
+ efx_rc_t rc;
+
+ if (mportp == NULL) {
+ rc = EINVAL;
+ goto fail1;
+ }
+
+ EFX_POPULATE_DWORD_1(dword,
+ MAE_MPORT_SELECTOR_TYPE, MAE_MPORT_SELECTOR_TYPE_INVALID);
+
+ memset(mportp, 0, sizeof (*mportp));
+ mportp->sel = dword.ed_u32[0];
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
+ return (rc);
+}
+
__checkReturn efx_rc_t
efx_mae_mport_by_phy_port(
__in uint32_t phy_port,
efx_mae_mport_by_pcie_function;
efx_mae_mport_by_phy_port;
efx_mae_mport_id_by_selector;
+ efx_mae_mport_invalid;
efx_mae_outer_rule_insert;
efx_mae_outer_rule_remove;