diff options
Diffstat (limited to 'drivers/staging/fsl_dpa_offload/dpa_classifier.c')
-rw-r--r-- | drivers/staging/fsl_dpa_offload/dpa_classifier.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/staging/fsl_dpa_offload/dpa_classifier.c b/drivers/staging/fsl_dpa_offload/dpa_classifier.c index a39fc69..5056b2e 100644 --- a/drivers/staging/fsl_dpa_offload/dpa_classifier.c +++ b/drivers/staging/fsl_dpa_offload/dpa_classifier.c @@ -462,6 +462,9 @@ int dpa_classif_table_modify_miss_action(int td, return -EBUSY; } } + + memcpy(&ptable->miss_action, miss_action, sizeof(*miss_action)); + RELEASE_OBJECT(ptable); dpa_cls_dbg(("DEBUG: dpa_classifier %s (%d) <--\n", __func__, @@ -3230,6 +3233,26 @@ static inline void key_apply_mask(const struct dpa_offload_lookup_key *key, new_key[i] = key->byte[i] & key->mask[i]; } +int dpa_classif_get_miss_action(int td, struct dpa_cls_tbl_action *miss_action) +{ + struct dpa_cls_table *ptable; + + if (!miss_action) + return -EINVAL; + + LOCK_OBJECT(table_array, td, ptable, -EINVAL); + if (ptable->miss_action.type == DPA_CLS_TBL_ACTION_NONE) { + /* No miss action was specified for this table */ + RELEASE_OBJECT(ptable); + return -ENODEV; + } else + memcpy(miss_action, &ptable->miss_action, sizeof(*miss_action)); + + RELEASE_OBJECT(ptable); + + return 0; +} + static int nat_hm_check_params(const struct dpa_cls_hm_nat_params *nat_params) { unsigned int ip_ver = 0; |