diff options
author | Aurelian Zanoschi <Aurelian.Zanoschi@freescale.com> | 2014-04-17 13:15:55 (GMT) |
---|---|---|
committer | Jose Rivera <German.Rivera@freescale.com> | 2014-04-18 03:59:03 (GMT) |
commit | 0dfc5833cea4f87c5a640aff8a8ecb079af4dde2 (patch) | |
tree | e654faf1b42a443fb67779794eeb821bae419630 | |
parent | 079c2217ab32340438798bc8f3b1512f32591c58 (diff) | |
download | linux-fsl-qoriq-0dfc5833cea4f87c5a640aff8a8ecb079af4dde2.tar.xz |
dpa_offload: Fix compat support for SA per DSCP
In case of 64bit platforms SA per DSCP feature needs some structure data
members in order to correctly copy parameters from user-space to
kernel-space. Also values for the three feature parameters need to be
correctly copied from one space to another.
Change-Id: I2d31813431b87be6e61651597acf7ad56ae60148
Signed-off-by: Aurelian Zanoschi <Aurelian.Zanoschi@freescale.com>
Reviewed-on: http://git.am.freescale.net:8181/11104
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Marian-Cornel Chereji <marian.chereji@freescale.com>
Reviewed-by: Jose Rivera <German.Rivera@freescale.com>
-rw-r--r-- | drivers/staging/fsl_dpa_offload/dpa_ipsec_ioctl.h | 3 | ||||
-rw-r--r-- | drivers/staging/fsl_dpa_offload/wrp_dpa_ipsec.c | 4 |
2 files changed, 7 insertions, 0 deletions
diff --git a/drivers/staging/fsl_dpa_offload/dpa_ipsec_ioctl.h b/drivers/staging/fsl_dpa_offload/dpa_ipsec_ioctl.h index 9d1da46..d76b0ff 100644 --- a/drivers/staging/fsl_dpa_offload/dpa_ipsec_ioctl.h +++ b/drivers/staging/fsl_dpa_offload/dpa_ipsec_ioctl.h @@ -95,6 +95,8 @@ struct ioc_compat_sa_out_params { compat_uptr_t outer_ip_header; compat_uptr_t outer_udp_header; uint16_t post_sec_flow_id; + uint8_t dscp_start; + uint8_t dscp_end; }; struct ioc_compat_sa_in_params { @@ -158,6 +160,7 @@ struct ioc_compat_policy_params { uint8_t dest_prefix_len; uint8_t protocol; bool masked_proto; + bool use_dscp; union { struct dpa_ipsec_l4_params l4; struct dpa_ipsec_icmp_params icmp; diff --git a/drivers/staging/fsl_dpa_offload/wrp_dpa_ipsec.c b/drivers/staging/fsl_dpa_offload/wrp_dpa_ipsec.c index f4b081f..5d04f84 100644 --- a/drivers/staging/fsl_dpa_offload/wrp_dpa_ipsec.c +++ b/drivers/staging/fsl_dpa_offload/wrp_dpa_ipsec.c @@ -118,6 +118,8 @@ static void compat_copy_sa_out_params(struct dpa_ipsec_sa_out_params *prm, prm->outer_udp_header = (void *) compat_ptr(compat_prm->outer_udp_header); prm->post_sec_flow_id = compat_prm->post_sec_flow_id; + prm->dscp_start = compat_prm->dscp_start; + prm->dscp_end = compat_prm->dscp_end; } static void compat_copy_sa_crypto_params(struct dpa_ipsec_sa_crypto_params *prm, @@ -205,6 +207,7 @@ static void compat_copy_dpa_ipsec_add_rem_policy( prm->pol_params.protocol = compat_prm->pol_params.protocol; prm->pol_params.masked_proto = compat_prm->pol_params.masked_proto; + prm->pol_params.use_dscp = compat_prm->pol_params.use_dscp; prm->pol_params.l4 = compat_prm->pol_params.l4; if (compat_prm->pol_params.dir_params.type == DPA_IPSEC_POL_DIR_PARAMS_MANIP) @@ -231,6 +234,7 @@ static void compat_copy_dpa_ipsec_add_rem_policy( compat_prm->pol_params.protocol = prm->pol_params.protocol; compat_prm->pol_params.masked_proto = prm->pol_params.masked_proto; + compat_prm->pol_params.use_dscp = prm->pol_params.use_dscp; compat_prm->pol_params.l4 = prm->pol_params.l4; if (prm->pol_params.dir_params.type == DPA_IPSEC_POL_DIR_PARAMS_MANIP) |