On 14.04.2017 17:35, Bill Fischofer wrote: > Perhaps something like: > > typedef enum odp_feature_t { > ODP_FEATURE_UNSUPPORTED = 0, > ODP_FEATURE_SUPPORTED = 1, > ODP_FEATURE_PREFERRED = 2, > } odp_feature_t;
I've asked for the advice about the header file, where to place this definition. > > On Fri, Apr 14, 2017 at 8:49 AM, Dmitry Eremin-Solenikov > <dmitry.ereminsoleni...@linaro.org> wrote: >> On 14.04.2017 16:25, Bill Fischofer wrote: >>> On Fri, Apr 14, 2017 at 6:53 AM, Bala Manoharan >>> <bala.manoha...@linaro.org> wrote: >>>> Regards, >>>> Bala >>>> >>>> >>>> On 14 April 2017 at 16:52, Bill Fischofer <bill.fischo...@linaro.org> >>>> wrote: >>>>> On Fri, Apr 14, 2017 at 5:58 AM, Dmitry Eremin-Solenikov >>>>> <dmitry.ereminsoleni...@linaro.org> wrote: >>>>>> Instead of having magic 0-1-2 numbers, let's have the special enum for >>>>>> feature support levels (unsupported/supported/preferred). >>>>>> >>>>>> Signed-off-by: Dmitry Eremin-Solenikov >>>>>> <dmitry.ereminsoleni...@linaro.org> >>>>>> --- >>>>>> include/odp/api/spec/ipsec.h | 56 >>>>>> +++++++++++++++++++++++--------------------- >>>>>> 1 file changed, 29 insertions(+), 27 deletions(-) >>>>>> >>>>>> diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h >>>>>> index a0ceb11a..7011e3cf 100644 >>>>>> --- a/include/odp/api/spec/ipsec.h >>>>>> +++ b/include/odp/api/spec/ipsec.h >>>>>> @@ -224,44 +224,46 @@ typedef struct odp_ipsec_outbound_config_t { >>>>>> } odp_ipsec_outbound_config_t; >>>>>> >>>>>> /** >>>>>> + * IPSEC operation mode support >>>>>> + */ >>>>>> +typedef enum odp_ipsec_op_mode_support_t { >>>>>> + /** >>>>>> + * Mode is not supported >>>>>> + */ >>>>>> + ODP_IPSEC_OP_MODE_UNSUPPORTED = 0, >>>>> >>>>> This looks good, but can this be shortened from >>>>> odp_ipsec_op_mode_support_t to something like odp_ipsec_support_t? The >>>>> enums could then be ODP_IPSEC_UNSUPPORTED / SUPPORTED / PREFERRED. >>>>> That's a lot less typing and just as clear, it seems. >>>>> >>>>>> + /** >>>>>> + * Mode is supported >>>>>> + */ >>>>>> + ODP_IPSEC_OP_MODE_SUPPORTED, >>>>>> + /** >>>>>> + * Mode is supported and preferred >>>>>> + */ >>>>>> + ODP_IPSEC_OP_MODE_PREFERRED, >>>>>> +} odp_ipsec_op_mode_support_t; >>>> >>>> There is a generic use for this support mode eg in cryto sync vs async >>>> so maybe we can create a generic enum ODP_MODE_SUPPORTED to be used in >>>> different modules. >>>> >>> >>> +1 for Bala's suggestion. >> >> Any suggestion for the header? I can't find one generic enough. >> >> >> -- >> With best wishes >> Dmitry -- With best wishes Dmitry