[API-NEXT,v5,1/3] api: packet_io: add MAC address set function

Message ID 1507626011-15870-2-git-send-email-odpbot@yandex.ru
State New
Headers show
Series
  • linux-gen: pktio: add MAC address set function
Related show

Commit Message

Github ODP bot Oct. 10, 2017, 9 a.m.
From: Bogdan Pricope <bogdan.pricope@linaro.org>


Add support for setting default MAC address of a
packet IO interface and for reporting availability
of this operation.

Signed-off-by: Bogdan Pricope <bogdan.pricope@linaro.org>

---
/** Email created from pull request 203 (bogdanPricope:set_mac_pr)
 ** https://github.com/Linaro/odp/pull/203
 ** Patch: https://github.com/Linaro/odp/pull/203.patch
 ** Base sha: bf803098eb1518dfb9e719071256fe22700b8c72
 ** Merge commit sha: 9741b2bb193f1cb28f8dd4bf382bc598e1dbd5ef
 **/
 include/odp/api/spec/packet_io.h | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

Patch

diff --git a/include/odp/api/spec/packet_io.h b/include/odp/api/spec/packet_io.h
index b56a5205d..52af646a6 100644
--- a/include/odp/api/spec/packet_io.h
+++ b/include/odp/api/spec/packet_io.h
@@ -482,6 +482,8 @@  typedef union odp_pktio_set_op_t {
 	struct {
 		/** Promiscuous mode */
 		uint32_t promisc_mode : 1;
+		/** MAC address  */
+		uint32_t mac_addr : 1;
 	} op;
 	/** All bits of the bit field structure.
 	  * This field can be used to set/clear all flags, or bitwise
@@ -979,6 +981,22 @@  int odp_pktio_promisc_mode(odp_pktio_t pktio);
 int odp_pktio_mac_addr(odp_pktio_t pktio, void *mac_addr, int size);
 
 /**
+ * Set the default MAC address of a packet IO interface.
+ *
+ * Support of this operation on a packet IO interface is reported
+ * through ‘mac_addr’ set operation capability.
+ *
+ * @param	pktio     Packet IO handle
+ * @param	mac_addr  MAC address to be set as default address
+ * @param	size      Size of the MAC address
+ *
+ * @return 0 on success
+ * @retval <0 on failure
+ */
+int odp_pktio_mac_addr_set(odp_pktio_t pktio, const void *mac_addr,
+			   int size);
+
+/**
  * Setup per-port default class-of-service.
  *
  * @param[in]	pktio		Ingress port pktio handle.