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

Message ID 1507528810-26008-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. 9, 2017, 6 a.m.
From: Bogdan Pricope <bogdan.pricope@linaro.org>


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: b2330885d3eb101d2b618264e0bc830f93ba54e7
 **/
 include/odp/api/spec/packet_io.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

Patch

diff --git a/include/odp/api/spec/packet_io.h b/include/odp/api/spec/packet_io.h
index b56a5205d..4ce108592 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,20 @@  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.
+ *
+ * @param	pktio     Packet IO handle
+ * @param[in]	mac_addr  Input buffer containing MAC address
+ * @param[in]	size      Size of the MAC address contained in
+ *			  input buffer
+ *
+ * @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.