Add support for etherType field for netapi_netcpCfgCraeteMacInterface
[keystone-rtos/netapi.git] / ti / runtime / netapi / src / netcp_cfg.c
index 55a75bf28eee5f931a9f6257c90be5e958e5cc6f..823b28bca2bef1066653626d9b55241e8506a2df 100755 (executable)
@@ -782,6 +782,7 @@ NETCP_CFG_MACIF_T  netapi_netcpCfgCreateMacInterface(NETAPI_T  h,
                                                      int switch_port, 
                                                      NETCP_CFG_ROUTE_HANDLE_T  route,
                                                      NETCP_CFG_VLAN_T  vlan,  //future
+                                                     uint16_t etherType,
                                                      int state,  //0=down, 1=up  //ignored
                                                      int * err)
 {
@@ -797,6 +798,7 @@ NETCP_CFG_MACIF_T  netapi_netcpCfgCreateMacInterface(NETAPI_T  h,
         NWAL_NEXT_ROUTE_FAIL_ACTION_HOST,            /* For next route fail action by default is route to host */
         CPPI_PARAM_NOT_SPECIFIED,                    /* Use default flow configured to NWAL  if packet is routed to host */
         QMSS_PARAM_NOT_SPECIFIED,                     /* Use default queue configured to NWAL if packet is routed to host */
+        0,
         0
     };
 
@@ -831,7 +833,13 @@ NETCP_CFG_MACIF_T  netapi_netcpCfgCreateMacInterface(NETAPI_T  h,
     if (switch_port)
     {
         macInfo.validParams |= NWAL_SET_MAC_VALID_PARAM_IFNUM ;
-        macInfo.ifNum = switch_port;  /* */
+        macInfo.ifNum = switch_port;
+    }
+
+    if(etherType)
+    {
+        macInfo.validParams |= NWAL_SET_MAC_VALID_PARAM_ETHER_TYPE;
+        macInfo.etherType = etherType;
     }
 
     if (route != NULL)