Add support for etherType field for netapi_netcpCfgCraeteMacInterface
authorTinku Mannan <tmannan@ti.com>
Tue, 5 Aug 2014 13:55:15 +0000 (09:55 -0400)
committerTinku Mannan <tmannan@ti.com>
Tue, 5 Aug 2014 15:02:05 +0000 (11:02 -0400)
ti/runtime/netapi/netcp_cfg.h
ti/runtime/netapi/src/netcp_cfg.c

index c6b8f140871595fe6fc4f949dd0e4c4bbfae5144..5ad7b5b409caa3a5dc31c3c207f826a99462ba50 100755 (executable)
@@ -630,6 +630,8 @@ void netapi_netcpCfgDelIp(NETAPI_T          h,
  *  @param[in]  switch_port     (0 don't care, 1 switch port 1, 1 switch port 2) [only 0 supported currenly] 
  *  @param[in]  route   handle of a created route or NULL to use internal default route, @ref NETCP_CFG_ROUTE_HANDLE_T
  *  @param[in]  vlan    [future[ vlan configuration . Set to NULL, @ref NETCP_CFG_VLAN_T
+ *  @param[in]  etherType  Ethertype field.
+
  *  @param[in]  state   [future] interface state (0=down, 1= up)
  *  @param[out] err     pointer to error return
  *  @retval     returns AppID for interface (this is returned in meta data for received packets matching this rule an no others, @ref NETCP_CFG_MACIF_T
@@ -642,6 +644,7 @@ NETCP_CFG_MACIF_T  netapi_netcpCfgCreateMacInterface(NETAPI_T
                                                      int                        switch_port,
                                                      NETCP_CFG_ROUTE_HANDLE_T   route,
                                                      NETCP_CFG_VLAN_T           vlan,
+                                                     uint16_t                   etherType,
                                                      int                        state,
                                                      int *                      err);
 
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)