On Mon, Mar 30, 2015 at 12:23 PM, Petri Savolainen < [email protected]> wrote:
> Structure tells which packet io control operation are permitted > on the interface. Some control operations may not be permitted > from all interfaces (virtual functions). > > Signed-off-by: Petri Savolainen <[email protected]> > --- > include/odp/api/packet_io.h | 31 +++++++++++++++++++++++++++++++ > 1 file changed, 31 insertions(+) > > diff --git a/include/odp/api/packet_io.h b/include/odp/api/packet_io.h > index 7e84fe1..dc76270 100644 > --- a/include/odp/api/packet_io.h > +++ b/include/odp/api/packet_io.h > @@ -48,6 +48,24 @@ extern "C" { > * Actual MAC address sizes may be different. > */ > > +/** > + * Packet IO interface control information > + * > + * A collection of flags that indicate interface control operation > availability. > + * A packet IO interface control operation is permitted when the > corresponding > + * flag is set. Otherwise, the operation is not permitted on the > interface. > + */ > +typedef struct odp_pktio_ctrl_info_t { > + struct { > + uint32_t mtu:1; /**< Set MTU */ > + uint32_t promisc:1; /**< Set promiscuous mode */ > + uint32_t max_frame:1; /**< Set maximum frame length */ > + uint32_t min_frame:1; /**< Set minimum frame length */ > + uint32_t link:1; /**< Set link status*/ > + > + uint32_t _reserved:27; /**< Reserved for future use */ > + } flag; /**< Operation flags */ > +} odp_pktio_ctrl_info_t; > We've used unions for these sort of flags in things like packet_flags, which I think makes for more convenient manipulation. So better might be: typedef struct odp_pktio_ctrl_info_t { union { uint32_t all; struct { ...individual flags as bits }; }; } odp_pktio_ctrl_info_t; > > /** > * Packet input mode > @@ -276,6 +294,19 @@ int odp_pktio_inq_remdef(odp_pktio_t pktio); > odp_queue_t odp_pktio_outq_getdef(odp_pktio_t pktio); > > /** > + * Retrieve information about packet IO control > + * > + * Outputs information structure about packet IO control operations. > + * > + * @param pktio Packet IO handle > + * @param[out] info Pointer to control info structure for output > + * > + * @retval 0 on success > + * @retval <0 on failure > + */ > +int odp_pktio_ctrl_info(odp_pktio_t pktio, odp_pktio_ctrl_info_t *info); > + > +/** > * Return the currently configured MTU value of a packet IO interface. > * > * @param[in] pktio Packet IO handle. > -- > 2.3.4 > > _______________________________________________ > lng-odp mailing list > [email protected] > https://lists.linaro.org/mailman/listinfo/lng-odp >
_______________________________________________ lng-odp mailing list [email protected] https://lists.linaro.org/mailman/listinfo/lng-odp
