+static __checkReturn efx_rc_t
+efx_mae_action_set_add_encap(
+ __in efx_mae_actions_t *spec,
+ __in size_t arg_size,
+ __in_bcount(arg_size) const uint8_t *arg)
+{
+ efx_rc_t rc;
+
+ /*
+ * Adding this specific action to an action set spec and setting encap.
+ * header ID in the spec are two individual steps. This design allows
+ * the client driver to avoid encap. header allocation when it simply
+ * needs to check the order of actions submitted by user ("validate"),
+ * without actually allocating an action set and inserting a rule.
+ *
+ * For now, mark encap. header ID as invalid; the caller will invoke
+ * efx_mae_action_set_fill_in_eh_id() to override the field prior
+ * to action set allocation; otherwise, the allocation will fail.
+ */
+ spec->ema_rsrc.emar_eh_id.id = EFX_MAE_RSRC_ID_INVALID;
+
+ /*
+ * As explained above, there are no arguments to handle here.
+ * efx_mae_action_set_fill_in_eh_id() will take care of them.
+ */
+ if (arg_size != 0) {
+ rc = EINVAL;
+ goto fail1;
+ }
+
+ if (arg != NULL) {
+ rc = EINVAL;
+ goto fail2;
+ }
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
+ return (rc);
+}
+