summaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorRadu Bulie <radu.bulie@freescale.com>2013-07-12 11:20:19 (GMT)
committerFleming Andrew-AFLEMING <AFLEMING@freescale.com>2013-07-18 22:34:43 (GMT)
commitbfcf069ea1681a1174bfdcca2d108110e3841b18 (patch)
tree6226dc20cbc8ed3ad6af786cda9ee98e67bfd387 /drivers/staging
parent6e34f244911c9e32c3ce9fefb64144987fef2c4a (diff)
downloadlinux-fsl-qoriq-bfcf069ea1681a1174bfdcca2d108110e3841b18.tar.xz
dpa_offload: Add separate resource pointer for multicast group import operation
When multicast group was preallocated from a xml PCD file, the handle to the group was given as a multicast group parameter. To align the multicast component with header manipulation and classifier components, the group handle will be given as a resource input parameter to the function that creates a multicast group. Signed-off-by: Radu Bulie <radu.bulie@freescale.com> Change-Id: I254d1c681cc016513d4cb569e0dfcf5c56478163 Reviewed-on: http://git.am.freescale.net:8181/3279 Reviewed-by: Chereji Marian-Cornel-R27762 <marian.chereji@freescale.com> Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com> Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/fsl_dpa_offload/dpa_classifier.c7
-rw-r--r--drivers/staging/fsl_dpa_offload/dpa_classifier_ioctl.h12
-rw-r--r--drivers/staging/fsl_dpa_offload/wrp_dpa_classifier.c18
3 files changed, 21 insertions, 16 deletions
diff --git a/drivers/staging/fsl_dpa_offload/dpa_classifier.c b/drivers/staging/fsl_dpa_offload/dpa_classifier.c
index 89aaa2e..34758c7 100644
--- a/drivers/staging/fsl_dpa_offload/dpa_classifier.c
+++ b/drivers/staging/fsl_dpa_offload/dpa_classifier.c
@@ -7226,7 +7226,8 @@ EXPORT_SYMBOL(dpa_classif_free_hm);
#if (DPAA_VERSION >= 11)
int dpa_classif_mcast_create_group(
const struct dpa_cls_mcast_group_params *group_params,
- int *grpd)
+ int *grpd,
+ const struct dpa_cls_mcast_group_resources *res)
{
t_Error err = 0;
@@ -7321,7 +7322,7 @@ int dpa_classif_mcast_create_group(
}
/* Group is not imported */
- if (group_params->group == NULL) {
+ if (!res) {
/*
* set parameters for the first member
*/
@@ -7439,7 +7440,7 @@ int dpa_classif_mcast_create_group(
kfree(replic_grp_params);
} else {
- pgroup->group = group_params->group;
+ pgroup->group = res->group_node;
/* mark prefilled members in index array member */
for (member_id = 0; member_id < group_params->prefilled_members;
member_id++) {
diff --git a/drivers/staging/fsl_dpa_offload/dpa_classifier_ioctl.h b/drivers/staging/fsl_dpa_offload/dpa_classifier_ioctl.h
index cc5f007..df0fee2 100644
--- a/drivers/staging/fsl_dpa_offload/dpa_classifier_ioctl.h
+++ b/drivers/staging/fsl_dpa_offload/dpa_classifier_ioctl.h
@@ -176,11 +176,7 @@ struct ioc_dpa_cls_hm_mpls_params {
struct ioc_dpa_cls_mcast_group_params {
struct dpa_cls_mcast_group_params mcast_grp_params;
int grpd;
-};
-
-struct ioc_dpa_cls_mcast_import_params {
- void *group;
- int grpd;
+ struct dpa_cls_mcast_group_resources res;
};
struct ioc_dpa_cls_mcast_member_params {
@@ -487,14 +483,18 @@ struct dpa_cls_compat_mcast_group_params {
compat_uptr_t fm_pcd;
struct dpa_cls_compat_tbl_enq_action_desc first_member_params;
unsigned int prefilled_members;
- compat_uptr_t group;
compat_uptr_t distribution;
compat_uptr_t classification;
};
+struct dpa_cls_compat_mcast_group_resources {
+ compat_uptr_t group_node;
+};
+
struct compat_ioc_dpa_cls_mcast_group_params {
struct dpa_cls_compat_mcast_group_params mcast_grp_params;
int grpd;
+ struct dpa_cls_compat_mcast_group_resources res;
};
struct compat_ioc_dpa_cls_mcast_member_params {
diff --git a/drivers/staging/fsl_dpa_offload/wrp_dpa_classifier.c b/drivers/staging/fsl_dpa_offload/wrp_dpa_classifier.c
index dadf609..6d59682 100644
--- a/drivers/staging/fsl_dpa_offload/wrp_dpa_classifier.c
+++ b/drivers/staging/fsl_dpa_offload/wrp_dpa_classifier.c
@@ -1541,6 +1541,7 @@ static long do_ioctl_mcast_create_group(unsigned long args, bool compat_mode)
long ret = 0;
struct ioc_dpa_cls_mcast_group_params kparam;
struct dpa_cls_tbl_policer_params policer_params;
+ struct dpa_cls_mcast_group_resources *p_res = NULL;
#ifdef CONFIG_COMPAT
struct compat_ioc_dpa_cls_mcast_group_params uparam;
if (compat_mode) {
@@ -1580,10 +1581,13 @@ static long do_ioctl_mcast_create_group(unsigned long args, bool compat_mode)
&policer_params;
}
}
+
+ if (kparam.res.group_node)
+ p_res = &kparam.res;
/*
* Translate FM_PCD file descriptor
*/
- if (!kparam.mcast_grp_params.group) {
+ if (!p_res) {
kparam.mcast_grp_params.fm_pcd =
translate_fm_pcd_handle(kparam.
mcast_grp_params.fm_pcd);
@@ -1593,7 +1597,7 @@ static long do_ioctl_mcast_create_group(unsigned long args, bool compat_mode)
#if (DPAA_VERSION >= 11)
ret = dpa_classif_mcast_create_group(&kparam.mcast_grp_params,
- &kparam.grpd);
+ &kparam.grpd, p_res);
#else
log_err("Multicast not supported on this platform.\n");
return -EINVAL;
@@ -2972,12 +2976,12 @@ int dpa_cls_mcast_group_params_compatcpy(
kparam->mcast_grp_params.prefilled_members =
uparam->mcast_grp_params.prefilled_members;
- if (uparam->mcast_grp_params.group)
- kparam->mcast_grp_params.group = compat_get_id2ptr(
- uparam->mcast_grp_params.group,
- FM_MAP_TYPE_PCD_NODE);
+ if (uparam->res.group_node)
+ kparam->res.group_node = compat_get_id2ptr(
+ uparam->res.group_node,
+ FM_MAP_TYPE_PCD_NODE);
else
- kparam->mcast_grp_params.group = NULL;
+ kparam->res.group_node = NULL;
if (compat_ptr(uparam->mcast_grp_params.distribution))
kparam->mcast_grp_params.distribution = compat_get_id2ptr(