Merge "IPACM: Add support for IHL based filtering of IPv6 fragement packets"
diff --git a/ipacm/inc/IPACM_Config.h b/ipacm/inc/IPACM_Config.h
index 5a79849..fa705e2 100644
--- a/ipacm/inc/IPACM_Config.h
+++ b/ipacm/inc/IPACM_Config.h
@@ -132,8 +132,8 @@
struct ipa_ioc_get_rt_tbl rt_tbl_wan_dl;
struct ipa_ioc_get_rt_tbl rt_tbl_lan2lan_v4, rt_tbl_lan2lan_v6;
struct ipa_ioc_get_rt_tbl rt_tbl_odu_v4, rt_tbl_odu_v6;
- struct ipa_ioc_get_rt_tbl rt_tbl_eth_bridge_usb_wlan_v4, rt_tbl_eth_bridge_wlan_wlan_v4;
- struct ipa_ioc_get_rt_tbl rt_tbl_eth_bridge_usb_wlan_v6, rt_tbl_eth_bridge_wlan_wlan_v6;
+ struct ipa_ioc_get_rt_tbl rt_tbl_eth_bridge_lan_wlan_v4, rt_tbl_eth_bridge_wlan_wlan_v4;
+ struct ipa_ioc_get_rt_tbl rt_tbl_eth_bridge_lan_wlan_v6, rt_tbl_eth_bridge_wlan_wlan_v6;
bool isMCC_Mode;
diff --git a/ipacm/inc/IPACM_Defs.h b/ipacm/inc/IPACM_Defs.h
index e47f590..f90ada4 100644
--- a/ipacm/inc/IPACM_Defs.h
+++ b/ipacm/inc/IPACM_Defs.h
@@ -85,9 +85,9 @@
#define V4_ODU_ROUTE_TABLE_NAME "ODURTBLv4"
#define V6_ODU_ROUTE_TABLE_NAME "ODURTBLv6"
-#define ETH_BRIDGE_USB_WLAN_ROUTE_TABLE_NAME_V4 "ETH_BRIDGE_USB_WLAN_RTBLv4"
+#define ETH_BRIDGE_USB_WLAN_ROUTE_TABLE_NAME_V4 "ETH_BRIDGE_LAN_WLAN_RTBLv4"
#define ETH_BRIDGE_WLAN_WLAN_ROUTE_TABLE_NAME_V4 "ETH_BRIDGE_WLAN_WLAN_RTBLv4"
-#define ETH_BRIDGE_USB_WLAN_ROUTE_TABLE_NAME_V6 "ETH_BRIDGE_USB_WLAN_RTBLv6"
+#define ETH_BRIDGE_USB_WLAN_ROUTE_TABLE_NAME_V6 "ETH_BRIDGE_LAN_WLAN_RTBLv6"
#define ETH_BRIDGE_WLAN_WLAN_ROUTE_TABLE_NAME_V6 "ETH_BRIDGE_WLAN_WLAN_RTBLv6"
#define WWAN_QMI_IOCTL_DEVICE_NAME "/dev/wwan_ioctl"
@@ -100,8 +100,8 @@
#define IPA_LAN_TO_LAN_USB_HDR_NAME_V6 "Lan2Lan_USB_v6"
#define IPA_LAN_TO_LAN_WLAN_HDR_NAME_V4 "Lan2Lan_Wlan_v4"
#define IPA_LAN_TO_LAN_WLAN_HDR_NAME_V6 "Lan2Lan_Wlan_v6"
-#define IPA_LAN_TO_LAN_MAX_WLAN_CLIENT 32
-#define IPA_LAN_TO_LAN_MAX_USB_CLIENT 15
+#define IPA_LAN_TO_LAN_MAX_WLAN_CLIENT 16
+#define IPA_LAN_TO_LAN_MAX_LAN_CLIENT 16
#define TCP_FIN_SHIFT 16
#define TCP_SYN_SHIFT 17
#define TCP_RST_SHIFT 18
@@ -171,12 +171,12 @@
IPA_WAN_UPSTREAM_ROUTE_ADD_EVENT, /* 41 ipacm_event_data_fid */
IPA_WAN_UPSTREAM_ROUTE_DEL_EVENT, /* 42 ipacm_event_data_fid */
IPA_WAN_EMBMS_LINK_UP_EVENT, /* 43 ipacm_event_data_mac */
- IPA_ETH_BRIDGE_USB_CLIENT_ADD_EVENT, /* 44 ipacm_event_data_mac */
+ IPA_ETH_BRIDGE_LAN_CLIENT_ADD_EVENT, /* 44 ipacm_event_data_mac */
IPA_ETH_BRIDGE_WLAN_CLIENT_ADD_EVENT, /* 45 ipacm_event_data_mac */
- IPA_ETH_BRIDGE_USB_CLIENT_DEL_EVENT, /* 46 ipacm_event_data_mac */
+ IPA_ETH_BRIDGE_LAN_CLIENT_DEL_EVENT, /* 46 ipacm_event_data_mac */
IPA_ETH_BRIDGE_WLAN_CLIENT_DEL_EVENT, /* 47 ipacm_event_data_mac */
- IPA_ETH_BRIDGE_HDR_PROC_CTX_SET_EVENT, /* 48 ipacm_event_data_fid */
- IPA_ETH_BRIDGE_HDR_PROC_CTX_UNSET_EVENT, /* 49 ipacm_event_data_fid */
+ IPA_ETH_BRIDGE_HDR_PROC_CTX_SET_EVENT, /* 48 ipacm_event_data_if_cat */
+ IPA_ETH_BRIDGE_HDR_PROC_CTX_UNSET_EVENT, /* 49 ipacm_event_data_if_cat */
IPA_WLAN_SWITCH_TO_SCC, /* 50 No Data */
IPA_WLAN_SWITCH_TO_MCC, /* 51 No Data */
IPA_CRADLE_WAN_MODE_SWITCH, /* 52 ipacm_event_cradle_wan_mode */
@@ -268,6 +268,11 @@
int if_index;
} ipacm_event_data_fid;
+typedef struct
+{
+ ipacm_iface_type if_cat;
+} ipacm_event_data_if_cat;
+
typedef struct _ipacm_event_data_iptype
{
int if_index;
diff --git a/ipacm/inc/IPACM_Lan.h b/ipacm/inc/IPACM_Lan.h
index 42fd29b..53bf2f3 100644
--- a/ipacm/inc/IPACM_Lan.h
+++ b/ipacm/inc/IPACM_Lan.h
@@ -189,20 +189,24 @@
int install_ipv4_icmp_flt_rule();
- static ipa_hdr_l2_type usb_hdr_type;
+ static ipa_hdr_l2_type lan_hdr_type;
static ipa_hdr_l2_type wlan_hdr_type;
static uint32_t usb_hdr_template_hdl;
static uint32_t wlan_hdr_template_hdl;
+ static uint32_t cpe_hdr_template_hdl;
- static hdr_proc_ctx_info usb_to_wlan_hdr_proc_ctx, wlan_to_usb_hdr_proc_ctx;
+ static hdr_proc_ctx_info lan_to_wlan_hdr_proc_ctx, wlan_to_usb_hdr_proc_ctx, wlan_to_cpe_hdr_proc_ctx;
static hdr_proc_ctx_info wlan_to_wlan_hdr_proc_ctx;
static eth_bridge_subnet_client_info eth_bridge_wlan_client[IPA_LAN_TO_LAN_MAX_WLAN_CLIENT];
- static eth_bridge_subnet_client_info eth_bridge_usb_client[IPA_LAN_TO_LAN_MAX_USB_CLIENT];
+ static eth_bridge_subnet_client_info eth_bridge_lan_client[IPA_LAN_TO_LAN_MAX_LAN_CLIENT];
static int num_wlan_client;
- static int num_usb_client;
+ static int num_lan_client;
+
+ static bool is_usb_up;
+ static bool is_cpe_up;
protected:
@@ -212,10 +216,10 @@
eth_bridge_client_flt_info eth_bridge_wlan_client_flt_info[IPA_LAN_TO_LAN_MAX_WLAN_CLIENT];
int wlan_client_flt_info_count;
- eth_bridge_client_rt_info* eth_bridge_usb_client_rt_info_v4;
- eth_bridge_client_rt_info* eth_bridge_usb_client_rt_info_v6;
- int usb_client_rt_info_count_v4;
- int usb_client_rt_info_count_v6;
+ eth_bridge_client_rt_info* eth_bridge_lan_client_rt_info_v4;
+ eth_bridge_client_rt_info* eth_bridge_lan_client_rt_info_v6;
+ int lan_client_rt_info_count_v4;
+ int lan_client_rt_info_count_v6;
int client_rt_info_size_v4;
int client_rt_info_size_v6;
@@ -226,7 +230,7 @@
virtual int eth_bridge_add_wlan_guest_ap_flt_rule(ipa_ip_type iptype);
- virtual int eth_bridge_handle_dummy_usb_client_flt_rule(ipa_ip_type iptype);
+ virtual int eth_bridge_handle_dummy_lan_client_flt_rule(ipa_ip_type iptype);
int eth_bridge_add_wlan_client_flt_rule(uint8_t* mac, ipa_ip_type iptype);
@@ -242,17 +246,17 @@
virtual int eth_bridge_install_cache_wlan_client_flt_rule(ipa_ip_type iptype);
- virtual int eth_bridge_install_cache_usb_client_flt_rule(ipa_ip_type iptype);
+ virtual int eth_bridge_install_cache_lan_client_flt_rule(ipa_ip_type iptype);
- int eth_bridge_add_usb_client_rt_rule(uint8_t* mac, ipa_ip_type iptype);
+ int eth_bridge_add_lan_client_rt_rule(uint8_t* mac, ipa_ip_type iptype);
- int eth_bridge_del_usb_client_rt_rule(uint8_t* mac);
+ int eth_bridge_del_lan_client_rt_rule(uint8_t* mac);
eth_bridge_client_rt_info* eth_bridge_get_client_rt_info_ptr(uint8_t index, ipa_ip_type iptype);
- void eth_bridge_add_usb_client(uint8_t* mac);
+ void eth_bridge_add_lan_client(uint8_t* mac);
- void eth_bridge_del_usb_client(uint8_t* mac);
+ void eth_bridge_del_lan_client(uint8_t* mac);
int eth_bridge_get_hdr_template_hdl(uint32_t* hdr_hdl);
diff --git a/ipacm/inc/IPACM_Wan.h b/ipacm/inc/IPACM_Wan.h
index 1aaafaa..127b195 100644
--- a/ipacm/inc/IPACM_Wan.h
+++ b/ipacm/inc/IPACM_Wan.h
@@ -149,8 +149,6 @@
bool header_partial_default_wan_v4;
bool header_partial_default_wan_v6;
uint8_t ext_router_mac_addr[IPA_MAC_ADDR_SIZE];
- uint16_t eth2_ofst_v4;
- uint16_t eth2_ofst_v6;
static int num_ipv4_modem_pdn;
diff --git a/ipacm/inc/IPACM_Wlan.h b/ipacm/inc/IPACM_Wlan.h
index d49215f..cbbb4c2 100644
--- a/ipacm/inc/IPACM_Wlan.h
+++ b/ipacm/inc/IPACM_Wlan.h
@@ -77,7 +77,7 @@
typedef enum
{
SRC_WLAN,
- SRC_USB
+ SRC_LAN
} eth_bridge_src_iface;
@@ -99,8 +99,8 @@
private:
- eth_bridge_client_flt_info eth_bridge_usb_client_flt_info[IPA_LAN_TO_LAN_MAX_USB_CLIENT];
- int num_usb_client;
+ eth_bridge_client_flt_info eth_bridge_lan_client_flt_info[IPA_LAN_TO_LAN_MAX_LAN_CLIENT];
+ int lan_client_flt_info_count;
uint32_t wlan_guest_ap_flt_rule_hdl_v4[IPA_MAX_PRIVATE_SUBNET_ENTRIES];
@@ -109,15 +109,15 @@
static lan2lan_flt_rule_hdl self_client_flt_rule_hdl_v4[IPA_LAN_TO_LAN_MAX_WLAN_CLIENT];
static lan2lan_flt_rule_hdl self_client_flt_rule_hdl_v6[IPA_LAN_TO_LAN_MAX_WLAN_CLIENT];
- static lan2lan_flt_rule_hdl usb_client_flt_rule_hdl_v4[IPA_LAN_TO_LAN_MAX_USB_CLIENT];
- static lan2lan_flt_rule_hdl usb_client_flt_rule_hdl_v6[IPA_LAN_TO_LAN_MAX_USB_CLIENT];
+ static lan2lan_flt_rule_hdl lan_client_flt_rule_hdl_v4[IPA_LAN_TO_LAN_MAX_LAN_CLIENT];
+ static lan2lan_flt_rule_hdl lan_client_flt_rule_hdl_v6[IPA_LAN_TO_LAN_MAX_LAN_CLIENT];
bool is_guest_ap;
- eth_bridge_client_rt_info* eth_bridge_wlan_client_rt_from_usb_info_v4;
- int wlan_client_rt_from_usb_info_count_v4;
- eth_bridge_client_rt_info* eth_bridge_wlan_client_rt_from_usb_info_v6;
- int wlan_client_rt_from_usb_info_count_v6;
+ eth_bridge_client_rt_info* eth_bridge_wlan_client_rt_from_lan_info_v4;
+ int wlan_client_rt_from_lan_info_count_v4;
+ eth_bridge_client_rt_info* eth_bridge_wlan_client_rt_from_lan_info_v6;
+ int wlan_client_rt_from_lan_info_count_v6;
eth_bridge_client_rt_info* eth_bridge_wlan_client_rt_from_wlan_info_v4;
int wlan_client_rt_from_wlan_info_count_v4;
@@ -130,11 +130,11 @@
virtual int eth_bridge_handle_dummy_wlan_client_flt_rule(ipa_ip_type iptype);
- virtual int eth_bridge_handle_dummy_usb_client_flt_rule(ipa_ip_type iptype);
+ virtual int eth_bridge_handle_dummy_lan_client_flt_rule(ipa_ip_type iptype);
- int eth_bridge_add_usb_client_flt_rule(uint8_t* mac, ipa_ip_type iptype);
+ int eth_bridge_add_lan_client_flt_rule(uint8_t* mac, ipa_ip_type iptype);
- int eth_bridge_del_usb_client_flt_rule(uint8_t* mac);
+ int eth_bridge_del_lan_client_flt_rule(uint8_t* mac);
int eth_bridge_add_self_client_flt_rule(uint8_t* mac, ipa_ip_type iptype);
@@ -142,7 +142,7 @@
virtual int eth_bridge_install_cache_wlan_client_flt_rule(ipa_ip_type iptype);
- virtual int eth_bridge_install_cache_usb_client_flt_rule(ipa_ip_type iptype);
+ virtual int eth_bridge_install_cache_lan_client_flt_rule(ipa_ip_type iptype);
int eth_bridge_add_wlan_client_rt_rule(uint8_t* mac, eth_bridge_src_iface src, ipa_ip_type iptype);
diff --git a/ipacm/src/IPACM_Config.cpp b/ipacm/src/IPACM_Config.cpp
index 7ed3ade..0bd47ce 100644
--- a/ipacm/src/IPACM_Config.cpp
+++ b/ipacm/src/IPACM_Config.cpp
@@ -78,9 +78,9 @@
memset(&ext_prop_v4, 0, sizeof(ext_prop_v4));
memset(&ext_prop_v6, 0, sizeof(ext_prop_v6));
- memset(&rt_tbl_eth_bridge_usb_wlan_v4, 0, sizeof(rt_tbl_eth_bridge_usb_wlan_v4));
+ memset(&rt_tbl_eth_bridge_lan_wlan_v4, 0, sizeof(rt_tbl_eth_bridge_lan_wlan_v4));
memset(&rt_tbl_eth_bridge_wlan_wlan_v4, 0, sizeof(rt_tbl_eth_bridge_wlan_wlan_v4));
- memset(&rt_tbl_eth_bridge_usb_wlan_v6, 0, sizeof(rt_tbl_eth_bridge_usb_wlan_v6));
+ memset(&rt_tbl_eth_bridge_lan_wlan_v6, 0, sizeof(rt_tbl_eth_bridge_lan_wlan_v6));
memset(&rt_tbl_eth_bridge_wlan_wlan_v6, 0, sizeof(rt_tbl_eth_bridge_wlan_wlan_v6));
qmap_id = ~0;
@@ -267,14 +267,14 @@
rt_tbl_lan2lan_v6.ip = IPA_IP_v6;
strncpy(rt_tbl_lan2lan_v6.name, V6_LAN_TO_LAN_ROUTE_TABLE_NAME, sizeof(rt_tbl_lan2lan_v6.name));
- rt_tbl_eth_bridge_usb_wlan_v4.ip = IPA_IP_v4;
- strncpy(rt_tbl_eth_bridge_usb_wlan_v4.name, ETH_BRIDGE_USB_WLAN_ROUTE_TABLE_NAME_V4, sizeof(rt_tbl_eth_bridge_usb_wlan_v4.name));
+ rt_tbl_eth_bridge_lan_wlan_v4.ip = IPA_IP_v4;
+ strncpy(rt_tbl_eth_bridge_lan_wlan_v4.name, ETH_BRIDGE_USB_WLAN_ROUTE_TABLE_NAME_V4, sizeof(rt_tbl_eth_bridge_lan_wlan_v4.name));
rt_tbl_eth_bridge_wlan_wlan_v4.ip = IPA_IP_v4;
strncpy(rt_tbl_eth_bridge_wlan_wlan_v4.name, ETH_BRIDGE_WLAN_WLAN_ROUTE_TABLE_NAME_V4, sizeof(rt_tbl_eth_bridge_wlan_wlan_v4.name));
- rt_tbl_eth_bridge_usb_wlan_v6.ip = IPA_IP_v6;
- strncpy(rt_tbl_eth_bridge_usb_wlan_v6.name, ETH_BRIDGE_USB_WLAN_ROUTE_TABLE_NAME_V6, sizeof(rt_tbl_eth_bridge_usb_wlan_v6.name));
+ rt_tbl_eth_bridge_lan_wlan_v6.ip = IPA_IP_v6;
+ strncpy(rt_tbl_eth_bridge_lan_wlan_v6.name, ETH_BRIDGE_USB_WLAN_ROUTE_TABLE_NAME_V6, sizeof(rt_tbl_eth_bridge_lan_wlan_v6.name));
rt_tbl_eth_bridge_wlan_wlan_v6.ip = IPA_IP_v6;
strncpy(rt_tbl_eth_bridge_wlan_wlan_v6.name, ETH_BRIDGE_WLAN_WLAN_ROUTE_TABLE_NAME_V6, sizeof(rt_tbl_eth_bridge_wlan_wlan_v6.name));
diff --git a/ipacm/src/IPACM_IfaceManager.cpp b/ipacm/src/IPACM_IfaceManager.cpp
index c3bc6bd..b2e7ea7 100644
--- a/ipacm/src/IPACM_IfaceManager.cpp
+++ b/ipacm/src/IPACM_IfaceManager.cpp
@@ -271,6 +271,12 @@
IPACM_EvtDispatcher::registr(IPA_HANDLE_WAN_UP_V6, odu);
IPACM_EvtDispatcher::registr(IPA_HANDLE_WAN_DOWN, odu);
IPACM_EvtDispatcher::registr(IPA_HANDLE_WAN_DOWN_V6, odu);
+#ifdef FEATURE_ETH_BRIDGE_LE
+ IPACM_EvtDispatcher::registr(IPA_ETH_BRIDGE_WLAN_CLIENT_ADD_EVENT, odu);
+ IPACM_EvtDispatcher::registr(IPA_ETH_BRIDGE_WLAN_CLIENT_DEL_EVENT, odu);
+ IPACM_EvtDispatcher::registr(IPA_ETH_BRIDGE_HDR_PROC_CTX_SET_EVENT, odu);
+ IPACM_EvtDispatcher::registr(IPA_ETH_BRIDGE_HDR_PROC_CTX_UNSET_EVENT, odu);
+#endif
IPACM_EvtDispatcher::registr(IPA_CRADLE_WAN_MODE_SWITCH, odu);
IPACM_EvtDispatcher::registr(IPA_LINK_DOWN_EVENT, odu);
IPACM_EvtDispatcher::registr(IPA_LAN_DELETE_SELF, odu);
@@ -317,8 +323,8 @@
IPACM_EvtDispatcher::registr(IPA_HANDLE_WAN_DOWN_V6, wl);
IPACM_EvtDispatcher::registr(IPA_PRIVATE_SUBNET_CHANGE_EVENT, wl); // register for IPA_PRIVATE_SUBNET_CHANGE_EVENT event
#ifdef FEATURE_ETH_BRIDGE_LE
- IPACM_EvtDispatcher::registr(IPA_ETH_BRIDGE_USB_CLIENT_ADD_EVENT, wl);
- IPACM_EvtDispatcher::registr(IPA_ETH_BRIDGE_USB_CLIENT_DEL_EVENT, wl);
+ IPACM_EvtDispatcher::registr(IPA_ETH_BRIDGE_LAN_CLIENT_ADD_EVENT, wl);
+ IPACM_EvtDispatcher::registr(IPA_ETH_BRIDGE_LAN_CLIENT_DEL_EVENT, wl);
IPACM_EvtDispatcher::registr(IPA_ETH_BRIDGE_HDR_PROC_CTX_SET_EVENT, wl);
IPACM_EvtDispatcher::registr(IPA_ETH_BRIDGE_HDR_PROC_CTX_UNSET_EVENT, wl);
#endif
diff --git a/ipacm/src/IPACM_Lan.cpp b/ipacm/src/IPACM_Lan.cpp
index 3d7f712..e8551ba 100644
--- a/ipacm/src/IPACM_Lan.cpp
+++ b/ipacm/src/IPACM_Lan.cpp
@@ -55,21 +55,25 @@
bool IPACM_Lan::odu_up = false;
-ipa_hdr_l2_type IPACM_Lan::usb_hdr_type = IPA_HDR_L2_NONE;
+ipa_hdr_l2_type IPACM_Lan::lan_hdr_type = IPA_HDR_L2_NONE;
ipa_hdr_l2_type IPACM_Lan::wlan_hdr_type = IPA_HDR_L2_NONE;
uint32_t IPACM_Lan::usb_hdr_template_hdl = 0;
uint32_t IPACM_Lan::wlan_hdr_template_hdl = 0;
+uint32_t IPACM_Lan::cpe_hdr_template_hdl = 0;
-hdr_proc_ctx_info IPACM_Lan::usb_to_wlan_hdr_proc_ctx;
+hdr_proc_ctx_info IPACM_Lan::lan_to_wlan_hdr_proc_ctx;
hdr_proc_ctx_info IPACM_Lan::wlan_to_usb_hdr_proc_ctx;
+hdr_proc_ctx_info IPACM_Lan::wlan_to_cpe_hdr_proc_ctx;
hdr_proc_ctx_info IPACM_Lan::wlan_to_wlan_hdr_proc_ctx;
eth_bridge_subnet_client_info IPACM_Lan::eth_bridge_wlan_client[IPA_LAN_TO_LAN_MAX_WLAN_CLIENT];
-eth_bridge_subnet_client_info IPACM_Lan::eth_bridge_usb_client[IPA_LAN_TO_LAN_MAX_USB_CLIENT];
+eth_bridge_subnet_client_info IPACM_Lan::eth_bridge_lan_client[IPA_LAN_TO_LAN_MAX_LAN_CLIENT];
int IPACM_Lan::num_wlan_client = 0;
-int IPACM_Lan::num_usb_client = 0;
+int IPACM_Lan::num_lan_client = 0;
+bool IPACM_Lan::is_usb_up = false;
+bool IPACM_Lan::is_cpe_up = false;
IPACM_Lan::IPACM_Lan(int iface_index) : IPACM_Iface(iface_index)
{
@@ -82,6 +86,7 @@
odu_route_rule_v6_hdl = NULL;
eth_client = NULL;
int m_fd_odu, ret = IPACM_SUCCESS;
+ uint32_t* hdr_template_ptr;
Nat_App = NatApp::GetInstance();
if (Nat_App == NULL)
@@ -107,21 +112,33 @@
IPACMDBG_H(" IPACM->IPACM_Lan(%d) constructor: Tx:%d Rx:%d\n", ipa_if_num,
iface_query->num_tx_props, iface_query->num_rx_props);
#ifdef FEATURE_ETH_BRIDGE_LE
- if(IPACM_Iface::ipacmcfg->iface_table[ipa_if_num].if_cat == LAN_IF && tx_prop != NULL)
+ if((IPACM_Iface::ipacmcfg->iface_table[ipa_if_num].if_cat == LAN_IF
+ || IPACM_Iface::ipacmcfg->iface_table[ipa_if_num].if_cat == ODU_IF) && tx_prop != NULL)
{
- if(IPACM_Lan::usb_hdr_type != IPA_HDR_L2_NONE && tx_prop->tx[0].hdr_l2_type != IPACM_Lan::usb_hdr_type)
+ if(IPACM_Lan::lan_hdr_type != IPA_HDR_L2_NONE && tx_prop->tx[0].hdr_l2_type != IPACM_Lan::lan_hdr_type)
{
- IPACMERR("The USB header format is not consistent! Now header format is %d.\n", tx_prop->tx[0].hdr_l2_type);
+ IPACMERR("The LAN header format is not consistent! Now header format is %d.\n", tx_prop->tx[0].hdr_l2_type);
}
else
{
- if(eth_bridge_get_hdr_template_hdl(&IPACM_Lan::usb_hdr_template_hdl) == IPACM_FAILURE)
+ if(IPACM_Iface::ipacmcfg->iface_table[ipa_if_num].if_cat == LAN_IF)
{
- IPACMERR("Failed to setup usb hdr template.\n");
+ hdr_template_ptr = &IPACM_Lan::usb_hdr_template_hdl;
+ IPACM_Lan::is_usb_up = true;
+ }
+ else //else it is ODU_IF (cpe)
+ {
+ hdr_template_ptr = &IPACM_Lan::cpe_hdr_template_hdl;
+ IPACM_Lan::is_cpe_up = true;
+ }
+
+ if(eth_bridge_get_hdr_template_hdl(hdr_template_ptr) == IPACM_FAILURE)
+ {
+ IPACMERR("Failed to setup lan hdr template.\n");
}
else
{
- IPACM_Lan::usb_hdr_type = tx_prop->tx[0].hdr_l2_type;
+ IPACM_Lan::lan_hdr_type = tx_prop->tx[0].hdr_l2_type;
add_hdr_proc_ctx();
}
}
@@ -240,19 +257,19 @@
memset(eth_bridge_wlan_client_flt_info, 0, IPA_LAN_TO_LAN_MAX_WLAN_CLIENT * sizeof(eth_bridge_client_flt_info));
wlan_client_flt_info_count = 0;
- eth_bridge_usb_client_rt_info_v4 = NULL;
- eth_bridge_usb_client_rt_info_v6 = NULL;
+ eth_bridge_lan_client_rt_info_v4 = NULL;
+ eth_bridge_lan_client_rt_info_v6 = NULL;
#ifdef FEATURE_ETH_BRIDGE_LE
if(tx_prop != NULL)
{
client_rt_info_size_v4 = sizeof(eth_bridge_client_rt_info) + each_client_rt_rule_count_v4 * sizeof(uint32_t);
- eth_bridge_usb_client_rt_info_v4 = (eth_bridge_client_rt_info*)calloc(IPA_LAN_TO_LAN_MAX_USB_CLIENT, client_rt_info_size_v4);
+ eth_bridge_lan_client_rt_info_v4 = (eth_bridge_client_rt_info*)calloc(IPA_LAN_TO_LAN_MAX_LAN_CLIENT, client_rt_info_size_v4);
client_rt_info_size_v6 = sizeof(eth_bridge_client_rt_info) + each_client_rt_rule_count_v6 * sizeof(uint32_t);
- eth_bridge_usb_client_rt_info_v6 = (eth_bridge_client_rt_info*)calloc(IPA_LAN_TO_LAN_MAX_USB_CLIENT, client_rt_info_size_v6);
+ eth_bridge_lan_client_rt_info_v6 = (eth_bridge_client_rt_info*)calloc(IPA_LAN_TO_LAN_MAX_LAN_CLIENT, client_rt_info_size_v6);
}
#endif
- usb_client_rt_info_count_v4 = 0;
- usb_client_rt_info_count_v6 = 0;
+ lan_client_rt_info_count_v4 = 0;
+ lan_client_rt_info_count_v6 = 0;
return;
}
@@ -649,13 +666,20 @@
CtList->HandleNeighIpAddrAddEvt(data);
}
#ifdef FEATURE_ETH_BRIDGE_LE
- if(IPACM_Lan::wlan_to_usb_hdr_proc_ctx.valid == true)
+ if(IPACM_Iface::ipacmcfg->iface_table[ipa_if_num].if_cat == LAN_IF
+ && IPACM_Lan::wlan_to_usb_hdr_proc_ctx.valid == true)
{
- eth_bridge_add_usb_client_rt_rule(data->mac_addr, IPA_IP_v4);
- eth_bridge_add_usb_client_rt_rule(data->mac_addr, IPA_IP_v6);
+ eth_bridge_add_lan_client_rt_rule(data->mac_addr, IPA_IP_v4);
+ eth_bridge_add_lan_client_rt_rule(data->mac_addr, IPA_IP_v6);
}
- eth_bridge_post_lan_client_event(data->mac_addr, IPA_ETH_BRIDGE_USB_CLIENT_ADD_EVENT);
- eth_bridge_add_usb_client(data->mac_addr);
+ if(IPACM_Iface::ipacmcfg->iface_table[ipa_if_num].if_cat == ODU_IF
+ && IPACM_Lan::wlan_to_cpe_hdr_proc_ctx.valid == true)
+ {
+ eth_bridge_add_lan_client_rt_rule(data->mac_addr, IPA_IP_v4);
+ eth_bridge_add_lan_client_rt_rule(data->mac_addr, IPA_IP_v6);
+ }
+ eth_bridge_post_lan_client_event(data->mac_addr, IPA_ETH_BRIDGE_LAN_CLIENT_ADD_EVENT);
+ eth_bridge_add_lan_client(data->mac_addr);
#endif
return;
}
@@ -734,22 +758,25 @@
{
IPACMDBG_H("Received IPA_ETH_BRIDGE_HDR_PROC_CTX_SET_EVENT event.\n");
int i;
- ipacm_event_data_fid* fid = (ipacm_event_data_fid*)param;
- if(fid == NULL)
+ ipacm_event_data_if_cat* cat = (ipacm_event_data_if_cat*)param;
+ if(cat == NULL)
{
IPACMERR("Event data is empty.\n");
return;
}
- if(fid->if_index == ipa_if_num)
+ if(cat->if_cat != WLAN_IF)
{
- IPACMDBG_H("The event was sent by the same interface, ignore.\n");
+ IPACMDBG_H("The event was not sent by WLAN interface, ignore.\n");
return;
}
- for(i=0; i<IPACM_Lan::num_usb_client; i++)
+ for(i=0; i<IPACM_Lan::num_lan_client; i++)
{
- eth_bridge_add_usb_client_rt_rule(IPACM_Lan::eth_bridge_usb_client[i].mac, IPA_IP_v4);
- eth_bridge_add_usb_client_rt_rule(IPACM_Lan::eth_bridge_usb_client[i].mac, IPA_IP_v6);
+ if(IPACM_Lan::eth_bridge_lan_client[i].ipa_if_num == ipa_if_num)
+ {
+ eth_bridge_add_lan_client_rt_rule(IPACM_Lan::eth_bridge_lan_client[i].mac, IPA_IP_v4);
+ eth_bridge_add_lan_client_rt_rule(IPACM_Lan::eth_bridge_lan_client[i].mac, IPA_IP_v6);
+ }
}
}
break;
@@ -758,21 +785,24 @@
{
IPACMDBG_H("Received IPA_ETH_BRIDGE_HDR_PROC_CTX_UNSET_EVENT event.\n");
int i;
- ipacm_event_data_fid* fid = (ipacm_event_data_fid*)param;
- if(fid == NULL)
+ ipacm_event_data_if_cat* cat = (ipacm_event_data_if_cat*)param;
+ if(cat == NULL)
{
IPACMERR("Event data is empty.\n");
return;
}
- if(fid->if_index == ipa_if_num)
+ if(cat->if_cat != WLAN_IF)
{
- IPACMDBG_H("The event was sent by the same interface, ignore.\n");
+ IPACMDBG_H("The event was not sent by WLAN interface, ignore.\n");
return;
}
- for(i=0; i<IPACM_Lan::num_usb_client; i++)
+ for(i=0; i<IPACM_Lan::num_lan_client; i++)
{
- eth_bridge_del_usb_client_rt_rule(IPACM_Lan::eth_bridge_usb_client[i].mac);
+ if(IPACM_Lan::eth_bridge_lan_client[i].ipa_if_num == ipa_if_num)
+ {
+ eth_bridge_del_lan_client_rt_rule(IPACM_Lan::eth_bridge_lan_client[i].mac);
+ }
}
}
break;
@@ -937,9 +967,9 @@
init_fl_rule(data->iptype);
eth_bridge_add_wlan_guest_ap_flt_rule(data->iptype);
eth_bridge_handle_dummy_wlan_client_flt_rule(data->iptype);
- eth_bridge_handle_dummy_usb_client_flt_rule(data->iptype);
+ eth_bridge_handle_dummy_lan_client_flt_rule(data->iptype);
eth_bridge_install_cache_wlan_client_flt_rule(data->iptype);
- eth_bridge_install_cache_usb_client_flt_rule(data->iptype);
+ eth_bridge_install_cache_lan_client_flt_rule(data->iptype);
#else
#ifdef CT_OPT
install_tcp_ctl_flt_rule(IPA_IP_v4);
@@ -1035,9 +1065,9 @@
#ifdef FEATURE_ETH_BRIDGE_LE
eth_bridge_add_wlan_guest_ap_flt_rule(data->iptype);
eth_bridge_handle_dummy_wlan_client_flt_rule(data->iptype);
- eth_bridge_handle_dummy_usb_client_flt_rule(data->iptype);
+ eth_bridge_handle_dummy_lan_client_flt_rule(data->iptype);
eth_bridge_install_cache_wlan_client_flt_rule(data->iptype);
- eth_bridge_install_cache_usb_client_flt_rule(data->iptype);
+ eth_bridge_install_cache_lan_client_flt_rule(data->iptype);
init_fl_rule(data->iptype);
#else
#ifdef CT_OPT
@@ -1754,9 +1784,11 @@
/* Add corresponding ipa_rm_resource_name of TX-endpoint up before IPV6 RT-rule set */
IPACMDBG_H("dev %s add producer dependency\n", dev_name);
- IPACMDBG_H("depend Got pipe %d rm index : %d \n", tx_prop->tx[0].dst_pipe, IPACM_Iface::ipacmcfg->ipa_client_rm_map_tbl[tx_prop->tx[0].dst_pipe]);
- IPACM_Iface::ipacmcfg->AddRmDepend(IPACM_Iface::ipacmcfg->ipa_client_rm_map_tbl[tx_prop->tx[0].dst_pipe],false);
-
+ if (tx_prop != NULL)
+ {
+ IPACMDBG_H("depend Got pipe %d rm index : %d \n", tx_prop->tx[0].dst_pipe, IPACM_Iface::ipacmcfg->ipa_client_rm_map_tbl[tx_prop->tx[0].dst_pipe]);
+ IPACM_Iface::ipacmcfg->AddRmDepend(IPACM_Iface::ipacmcfg->ipa_client_rm_map_tbl[tx_prop->tx[0].dst_pipe],false);
+ }
rt_rule = (struct ipa_ioc_add_rt_rule *)
calloc(1, sizeof(struct ipa_ioc_add_rt_rule) +
NUM * sizeof(struct ipa_rt_rule_add));
@@ -1807,7 +1839,6 @@
/* Replace the v4 header in ODU interface */
if (IPACM_Iface::ipacmcfg->iface_table[ipa_if_num].if_cat == ODU_IF)
- rt_rule_entry->rule.hdr_hdl = ODU_hdr_hdl_v4;
if (false == m_routing.AddRoutingRule(rt_rule))
{
@@ -1835,10 +1866,6 @@
IPACM_Iface::ipacmcfg->rt_tbl_v6.name,
sizeof(rt_rule->rt_tbl_name));
- /* Replace v6 header in ODU interface */
- if (IPACM_Iface::ipacmcfg->iface_table[ipa_if_num].if_cat == ODU_IF)
- rt_rule_entry->rule.hdr_hdl = ODU_hdr_hdl_v6;
-
/* Support QCMAP LAN traffic feature, send to A5 */
rt_rule_entry->rule.dst = IPA_CLIENT_APPS_LAN_CONS;
memset(&rt_rule_entry->rule.attrib, 0, sizeof(rt_rule_entry->rule.attrib));
@@ -2342,8 +2369,11 @@
{
/* Delete corresponding ipa_rm_resource_name of TX-endpoint after delete all IPV4V6 RT-rule*/
IPACMDBG_H("dev %s add producer dependency\n", dev_name);
- IPACMDBG_H("depend Got pipe %d rm index : %d \n", tx_prop->tx[0].dst_pipe, IPACM_Iface::ipacmcfg->ipa_client_rm_map_tbl[tx_prop->tx[0].dst_pipe]);
- IPACM_Iface::ipacmcfg->DelRmDepend(IPACM_Iface::ipacmcfg->ipa_client_rm_map_tbl[tx_prop->tx[0].dst_pipe]);
+ if (tx_prop != NULL)
+ {
+ IPACMDBG_H("depend Got pipe %d rm index : %d \n", tx_prop->tx[0].dst_pipe, IPACM_Iface::ipacmcfg->ipa_client_rm_map_tbl[tx_prop->tx[0].dst_pipe]);
+ IPACM_Iface::ipacmcfg->DelRmDepend(IPACM_Iface::ipacmcfg->ipa_client_rm_map_tbl[tx_prop->tx[0].dst_pipe]);
+ }
}
return IPACM_SUCCESS;
@@ -2399,8 +2429,24 @@
IPACMDBG_H("lan handle_down_evt\n ");
#ifdef FEATURE_ETH_BRIDGE_LE
- IPACM_Lan::usb_hdr_type = IPA_HDR_L2_NONE;
- IPACM_Lan::usb_hdr_template_hdl = 0;
+ if(IPACM_Iface::ipacmcfg->iface_table[ipa_if_num].if_cat == LAN_IF)
+ {
+ IPACM_Lan::usb_hdr_template_hdl = 0;
+ IPACM_Lan::is_usb_up = false;
+ if(IPACM_Lan::is_cpe_up == false) //if all LAN ifaces are down
+ {
+ IPACM_Lan::lan_hdr_type = IPA_HDR_L2_NONE;
+ }
+ }
+ if(IPACM_Iface::ipacmcfg->iface_table[ipa_if_num].if_cat == ODU_IF)
+ {
+ IPACM_Lan::cpe_hdr_template_hdl = 0;
+ IPACM_Lan::is_cpe_up = false;
+ if(IPACM_Lan::is_usb_up == false) //if all LAN ifaces are down
+ {
+ IPACM_Lan::lan_hdr_type = IPA_HDR_L2_NONE;
+ }
+ }
del_hdr_proc_ctx();
#endif
@@ -2588,9 +2634,9 @@
for (i = 0; i < num_eth_client; i++)
{
#ifdef FEATURE_ETH_BRIDGE_LE
- eth_bridge_del_usb_client_rt_rule(get_client_memptr(eth_client, i)->mac);
- eth_bridge_post_lan_client_event(get_client_memptr(eth_client, i)->mac, IPA_ETH_BRIDGE_USB_CLIENT_DEL_EVENT);
- eth_bridge_del_usb_client(get_client_memptr(eth_client, i)->mac);
+ eth_bridge_del_lan_client_rt_rule(get_client_memptr(eth_client, i)->mac);
+ eth_bridge_post_lan_client_event(get_client_memptr(eth_client, i)->mac, IPA_ETH_BRIDGE_LAN_CLIENT_DEL_EVENT);
+ eth_bridge_del_lan_client(get_client_memptr(eth_client, i)->mac);
#endif
/* First reset nat rules and then route rules */
@@ -2642,10 +2688,12 @@
IPACMDBG_H("Free ecm clients cache\n");
/* Delete corresponding ipa_rm_resource_name of TX-endpoint after delete all IPV4V6 RT-rule */
- IPACMDBG_H("dev %s add producer dependency\n", dev_name);
- IPACMDBG_H("depend Got pipe %d rm index : %d \n", tx_prop->tx[0].dst_pipe, IPACM_Iface::ipacmcfg->ipa_client_rm_map_tbl[tx_prop->tx[0].dst_pipe]);
- IPACM_Iface::ipacmcfg->DelRmDepend(IPACM_Iface::ipacmcfg->ipa_client_rm_map_tbl[tx_prop->tx[0].dst_pipe]);
-
+ IPACMDBG_H("dev %s delete producer dependency\n", dev_name);
+ if (tx_prop != NULL)
+ {
+ IPACMDBG_H("depend Got pipe %d rm index : %d \n", tx_prop->tx[0].dst_pipe, IPACM_Iface::ipacmcfg->ipa_client_rm_map_tbl[tx_prop->tx[0].dst_pipe]);
+ IPACM_Iface::ipacmcfg->DelRmDepend(IPACM_Iface::ipacmcfg->ipa_client_rm_map_tbl[tx_prop->tx[0].dst_pipe]);
+ }
/* check software routing fl rule hdl */
if (softwarerouting_act == true && rx_prop != NULL)
{
@@ -2701,13 +2749,13 @@
free(iface_query);
}
#ifdef FEATURE_ETH_BRIDGE_LE
- if(eth_bridge_usb_client_rt_info_v4 != NULL)
+ if(eth_bridge_lan_client_rt_info_v4 != NULL)
{
- free(eth_bridge_usb_client_rt_info_v4);
+ free(eth_bridge_lan_client_rt_info_v4);
}
- if(eth_bridge_usb_client_rt_info_v6 != NULL)
+ if(eth_bridge_lan_client_rt_info_v6 != NULL)
{
- free(eth_bridge_usb_client_rt_info_v6);
+ free(eth_bridge_lan_client_rt_info_v6);
}
#endif
is_active = false;
@@ -4733,7 +4781,7 @@
return IPACM_SUCCESS;
}
-int IPACM_Lan::eth_bridge_handle_dummy_usb_client_flt_rule(ipa_ip_type iptype)
+int IPACM_Lan::eth_bridge_handle_dummy_lan_client_flt_rule(ipa_ip_type iptype)
{
IPACMDBG_H("No need to add USB client specific flt rule on USB pipe.\n");
return IPACM_SUCCESS;
@@ -4784,7 +4832,7 @@
IPACMERR("MAC address is empty.\n");
return IPACM_FAILURE;
}
- if(IPACM_Lan::usb_to_wlan_hdr_proc_ctx.valid == false)
+ if(IPACM_Lan::lan_to_wlan_hdr_proc_ctx.valid == false)
{
IPACMDBG_H("USB to WLAN hdr proc ctx has not been set, don't add client specific flt rule.\n");
return IPACM_FAILURE;
@@ -4839,33 +4887,33 @@
/* point to USB-WLAN routing table */
if(iptype == IPA_IP_v4)
{
- if (false == m_routing.GetRoutingTable(&IPACM_Iface::ipacmcfg->rt_tbl_eth_bridge_usb_wlan_v4))
+ if (false == m_routing.GetRoutingTable(&IPACM_Iface::ipacmcfg->rt_tbl_eth_bridge_lan_wlan_v4))
{
IPACMERR("Failed to get routing table handle.\n");
res = IPACM_FAILURE;
goto fail;
}
- flt_rule.rule.rt_tbl_hdl = IPACM_Iface::ipacmcfg->rt_tbl_eth_bridge_usb_wlan_v4.hdl;
- IPACMDBG_H("USB->WLAN filter rule use table: %s\n",IPACM_Iface::ipacmcfg->rt_tbl_eth_bridge_usb_wlan_v4.name);
+ flt_rule.rule.rt_tbl_hdl = IPACM_Iface::ipacmcfg->rt_tbl_eth_bridge_lan_wlan_v4.hdl;
+ IPACMDBG_H("USB->WLAN filter rule use table: %s\n",IPACM_Iface::ipacmcfg->rt_tbl_eth_bridge_lan_wlan_v4.name);
}
else
{
- if (false == m_routing.GetRoutingTable(&IPACM_Iface::ipacmcfg->rt_tbl_eth_bridge_usb_wlan_v6))
+ if (false == m_routing.GetRoutingTable(&IPACM_Iface::ipacmcfg->rt_tbl_eth_bridge_lan_wlan_v6))
{
IPACMERR("Failed to get routing table handle.\n");
res = IPACM_FAILURE;
goto fail;
}
- flt_rule.rule.rt_tbl_hdl = IPACM_Iface::ipacmcfg->rt_tbl_eth_bridge_usb_wlan_v6.hdl;
- IPACMDBG_H("USB->WLAN filter rule use table: %s\n",IPACM_Iface::ipacmcfg->rt_tbl_eth_bridge_usb_wlan_v6.name);
+ flt_rule.rule.rt_tbl_hdl = IPACM_Iface::ipacmcfg->rt_tbl_eth_bridge_lan_wlan_v6.hdl;
+ IPACMDBG_H("USB->WLAN filter rule use table: %s\n",IPACM_Iface::ipacmcfg->rt_tbl_eth_bridge_lan_wlan_v6.name);
}
memcpy(&flt_rule.rule.attrib, &rx_prop->rx[0].attrib, sizeof(flt_rule.rule.attrib));
- if(IPACM_Lan::usb_hdr_type == IPA_HDR_L2_ETHERNET_II)
+ if(IPACM_Lan::lan_hdr_type == IPA_HDR_L2_ETHERNET_II)
{
flt_rule.rule.attrib.attrib_mask |= IPA_FLT_MAC_DST_ADDR_ETHER_II;
}
- else if(IPACM_Lan::usb_hdr_type == IPA_HDR_L2_802_3)
+ else if(IPACM_Lan::lan_hdr_type == IPA_HDR_L2_802_3)
{
flt_rule.rule.attrib.attrib_mask |= IPA_FLT_MAC_DST_ADDR_802_3;
}
@@ -5070,14 +5118,14 @@
}
}
- if(IPACM_Lan::usb_hdr_type != IPA_HDR_L2_NONE)
+ if(IPACM_Lan::lan_hdr_type != IPA_HDR_L2_NONE)
{
- if(IPACM_Lan::usb_to_wlan_hdr_proc_ctx.valid == false)
+ if(IPACM_Lan::lan_to_wlan_hdr_proc_ctx.valid == false)
{
memset(pHeaderProcTable, 0, len);
pHeaderProcTable->commit = 1;
pHeaderProcTable->num_proc_ctxs = 1;
- pHeaderProcTable->proc_ctx[0].type = get_hdr_proc_type(IPACM_Lan::usb_hdr_type, IPACM_Lan::wlan_hdr_type);
+ pHeaderProcTable->proc_ctx[0].type = get_hdr_proc_type(IPACM_Lan::lan_hdr_type, IPACM_Lan::wlan_hdr_type);
pHeaderProcTable->proc_ctx[0].hdr_hdl = IPACM_Lan::wlan_hdr_template_hdl;
if (m_header.AddHeaderProcCtx(pHeaderProcTable) == false)
{
@@ -5087,41 +5135,39 @@
}
else
{
- IPACM_Lan::usb_to_wlan_hdr_proc_ctx.proc_ctx_hdl = pHeaderProcTable->proc_ctx[0].proc_ctx_hdl;
- IPACM_Lan::usb_to_wlan_hdr_proc_ctx.valid = true;
+ IPACM_Lan::lan_to_wlan_hdr_proc_ctx.proc_ctx_hdl = pHeaderProcTable->proc_ctx[0].proc_ctx_hdl;
+ IPACM_Lan::lan_to_wlan_hdr_proc_ctx.valid = true;
}
ipacm_cmd_q_data evt_data;
memset(&evt_data, 0, sizeof(ipacm_cmd_q_data));
- ipacm_event_data_fid* fid;
- fid = (ipacm_event_data_fid*)malloc(sizeof(ipacm_event_data_fid));
- if(fid == NULL)
+ ipacm_event_data_if_cat* cat;
+ cat = (ipacm_event_data_if_cat*)malloc(sizeof(ipacm_event_data_if_cat));
+ if(cat == NULL)
{
IPACMERR("Unable to allocate memory.\n");
return IPACM_FAILURE;
}
- memset(fid, 0, sizeof(ipacm_event_data_fid));
- fid->if_index = ipa_if_num;
+ memset(cat, 0, sizeof(ipacm_event_data_if_cat));
+ cat->if_cat = IPACM_Iface::ipacmcfg->iface_table[ipa_if_num].if_cat;
- evt_data.evt_data = fid;
+ evt_data.evt_data = cat;
evt_data.event = IPA_ETH_BRIDGE_HDR_PROC_CTX_SET_EVENT;
IPACMDBG_H("Posting event IPA_ETH_BRIDGE_HDR_PROC_CTX_SET_EVENT\n");
IPACM_EvtDispatcher::PostEvt(&evt_data);
}
- if(IPACM_Lan::wlan_to_usb_hdr_proc_ctx.valid == false)
+ if(IPACM_Lan::is_usb_up == true && IPACM_Lan::wlan_to_usb_hdr_proc_ctx.valid == false)
{
memset(pHeaderProcTable, 0, len);
pHeaderProcTable->commit = 1;
pHeaderProcTable->num_proc_ctxs = 1;
- pHeaderProcTable->proc_ctx[0].type = get_hdr_proc_type(IPACM_Lan::wlan_hdr_type, IPACM_Lan::usb_hdr_type);
+ pHeaderProcTable->proc_ctx[0].type = get_hdr_proc_type(IPACM_Lan::wlan_hdr_type, IPACM_Lan::lan_hdr_type);
pHeaderProcTable->proc_ctx[0].hdr_hdl = IPACM_Lan::usb_hdr_template_hdl;
if (m_header.AddHeaderProcCtx(pHeaderProcTable) == false)
{
IPACMERR("Adding WLAN to USB hdr proc ctx failed with status: %d\n", pHeaderProcTable->proc_ctx[0].status);
- m_header.DeleteHeaderProcCtx(IPACM_Lan::usb_to_wlan_hdr_proc_ctx.proc_ctx_hdl);
- IPACM_Lan::usb_to_wlan_hdr_proc_ctx.valid = false;
res = IPACM_FAILURE;
goto fail;
}
@@ -5131,6 +5177,26 @@
IPACM_Lan::wlan_to_usb_hdr_proc_ctx.valid = true;
}
}
+
+ if(IPACM_Lan::is_cpe_up == true && IPACM_Lan::wlan_to_cpe_hdr_proc_ctx.valid == false)
+ {
+ memset(pHeaderProcTable, 0, len);
+ pHeaderProcTable->commit = 1;
+ pHeaderProcTable->num_proc_ctxs = 1;
+ pHeaderProcTable->proc_ctx[0].type = get_hdr_proc_type(IPACM_Lan::wlan_hdr_type, IPACM_Lan::lan_hdr_type);
+ pHeaderProcTable->proc_ctx[0].hdr_hdl = IPACM_Lan::cpe_hdr_template_hdl;
+ if (m_header.AddHeaderProcCtx(pHeaderProcTable) == false)
+ {
+ IPACMERR("Adding WLAN to CPE hdr proc ctx failed with status: %d\n", pHeaderProcTable->proc_ctx[0].status);
+ res = IPACM_FAILURE;
+ goto fail;
+ }
+ else
+ {
+ IPACM_Lan::wlan_to_cpe_hdr_proc_ctx.proc_ctx_hdl = pHeaderProcTable->proc_ctx[0].proc_ctx_hdl;
+ IPACM_Lan::wlan_to_cpe_hdr_proc_ctx.valid = true;
+ }
+ }
}
}
else
@@ -5184,13 +5250,13 @@
return IPACM_SUCCESS;
}
-int IPACM_Lan::eth_bridge_install_cache_usb_client_flt_rule(ipa_ip_type iptype)
+int IPACM_Lan::eth_bridge_install_cache_lan_client_flt_rule(ipa_ip_type iptype)
{
IPACMDBG_H("No need to install usb client specific flt rules on usb pipe.\n");
return IPACM_SUCCESS;
}
-int IPACM_Lan::eth_bridge_add_usb_client_rt_rule(uint8_t* mac, ipa_ip_type iptype)
+int IPACM_Lan::eth_bridge_add_lan_client_rt_rule(uint8_t* mac, ipa_ip_type iptype)
{
if(tx_prop == NULL)
{
@@ -5202,17 +5268,24 @@
IPACMERR("Client MAC address is empty.\n");
return IPACM_FAILURE;
}
- if( (iptype == IPA_IP_v4 && usb_client_rt_info_count_v4 == IPA_LAN_TO_LAN_MAX_USB_CLIENT)
- || (iptype == IPA_IP_v6 && usb_client_rt_info_count_v6 == IPA_LAN_TO_LAN_MAX_USB_CLIENT))
+ if( (iptype == IPA_IP_v4 && lan_client_rt_info_count_v4 == IPA_LAN_TO_LAN_MAX_LAN_CLIENT)
+ || (iptype == IPA_IP_v6 && lan_client_rt_info_count_v6 == IPA_LAN_TO_LAN_MAX_LAN_CLIENT))
{
IPACMDBG_H("USB client number has reached maximum.\n");
return IPACM_FAILURE;
}
- if(IPACM_Lan::wlan_to_usb_hdr_proc_ctx.valid == false)
+ if(IPACM_Iface::ipacmcfg->iface_table[ipa_if_num].if_cat == LAN_IF
+ && IPACM_Lan::wlan_to_usb_hdr_proc_ctx.valid == false)
{
IPACMDBG_H("WLAN to USB hdr proc ctx has not been set, don't add USB routing rule.\n");
return IPACM_FAILURE;
}
+ if(IPACM_Iface::ipacmcfg->iface_table[ipa_if_num].if_cat == ODU_IF
+ && IPACM_Lan::wlan_to_cpe_hdr_proc_ctx.valid == false)
+ {
+ IPACMDBG_H("WLAN to CPE hdr proc ctx has not been set, don't add CPE routing rule.\n");
+ return IPACM_FAILURE;
+ }
IPACMDBG_H("Receive USB client MAC 0x%02x%02x%02x%02x%02x%02x.\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
@@ -5223,7 +5296,7 @@
if(iptype == IPA_IP_v4)
{
- for(i=0; i<usb_client_rt_info_count_v4; i++)
+ for(i=0; i<lan_client_rt_info_count_v4; i++)
{
if(memcmp(eth_bridge_get_client_rt_info_ptr(i, iptype)->mac, mac, sizeof(eth_bridge_get_client_rt_info_ptr(i, iptype)->mac)) == 0)
{
@@ -5231,12 +5304,12 @@
return IPACM_SUCCESS;
}
}
- memcpy(eth_bridge_get_client_rt_info_ptr(usb_client_rt_info_count_v4, iptype)->mac, mac,
- sizeof(eth_bridge_get_client_rt_info_ptr(usb_client_rt_info_count_v4, iptype)->mac));
+ memcpy(eth_bridge_get_client_rt_info_ptr(lan_client_rt_info_count_v4, iptype)->mac, mac,
+ sizeof(eth_bridge_get_client_rt_info_ptr(lan_client_rt_info_count_v4, iptype)->mac));
}
else
{
- for(i=0; i<usb_client_rt_info_count_v6; i++)
+ for(i=0; i<lan_client_rt_info_count_v6; i++)
{
if(memcmp(eth_bridge_get_client_rt_info_ptr(i, iptype)->mac, mac, sizeof(eth_bridge_get_client_rt_info_ptr(i, iptype)->mac)) == 0)
{
@@ -5244,8 +5317,8 @@
return IPACM_SUCCESS;
}
}
- memcpy(eth_bridge_get_client_rt_info_ptr(usb_client_rt_info_count_v6, iptype)->mac, mac,
- sizeof(eth_bridge_get_client_rt_info_ptr(usb_client_rt_info_count_v6, iptype)->mac));
+ memcpy(eth_bridge_get_client_rt_info_ptr(lan_client_rt_info_count_v6, iptype)->mac, mac,
+ sizeof(eth_bridge_get_client_rt_info_ptr(lan_client_rt_info_count_v6, iptype)->mac));
}
if(iptype == IPA_IP_v4)
@@ -5272,11 +5345,11 @@
if(iptype == IPA_IP_v4)
{
- strncpy(rt_rule_table->rt_tbl_name, IPACM_Iface::ipacmcfg->rt_tbl_eth_bridge_usb_wlan_v4.name, sizeof(rt_rule_table->rt_tbl_name));
+ strncpy(rt_rule_table->rt_tbl_name, IPACM_Iface::ipacmcfg->rt_tbl_eth_bridge_lan_wlan_v4.name, sizeof(rt_rule_table->rt_tbl_name));
}
else
{
- strncpy(rt_rule_table->rt_tbl_name, IPACM_Iface::ipacmcfg->rt_tbl_eth_bridge_usb_wlan_v6.name, sizeof(rt_rule_table->rt_tbl_name));
+ strncpy(rt_rule_table->rt_tbl_name, IPACM_Iface::ipacmcfg->rt_tbl_eth_bridge_lan_wlan_v6.name, sizeof(rt_rule_table->rt_tbl_name));
}
memset(&rt_rule, 0, sizeof(ipa_rt_rule_add));
@@ -5285,7 +5358,21 @@
rt_rule.rt_rule_hdl = -1;
rt_rule.rule.hdr_hdl = 0;
- rt_rule.rule.hdr_proc_ctx_hdl = IPACM_Lan::wlan_to_usb_hdr_proc_ctx.proc_ctx_hdl;
+ if(IPACM_Iface::ipacmcfg->iface_table[ipa_if_num].if_cat == LAN_IF)
+ {
+ rt_rule.rule.hdr_proc_ctx_hdl = IPACM_Lan::wlan_to_usb_hdr_proc_ctx.proc_ctx_hdl;
+ }
+ else if(IPACM_Iface::ipacmcfg->iface_table[ipa_if_num].if_cat == ODU_IF)
+ {
+ rt_rule.rule.hdr_proc_ctx_hdl = IPACM_Lan::wlan_to_cpe_hdr_proc_ctx.proc_ctx_hdl;
+ }
+ else
+ {
+ IPACMERR("Iface category is not expected.\n");
+ res = IPACM_FAILURE;
+ goto fail;
+ }
+
position = 0;
for(i=0; i<iface_query->num_tx_props; i++)
{
@@ -5334,24 +5421,24 @@
{
if(iptype == IPA_IP_v4)
{
- eth_bridge_get_client_rt_info_ptr(usb_client_rt_info_count_v4, iptype)->rt_rule_hdl[i] = rt_rule_table->rules[i].rt_rule_hdl;
+ eth_bridge_get_client_rt_info_ptr(lan_client_rt_info_count_v4, iptype)->rt_rule_hdl[i] = rt_rule_table->rules[i].rt_rule_hdl;
}
else
{
- eth_bridge_get_client_rt_info_ptr(usb_client_rt_info_count_v6, iptype)->rt_rule_hdl[i] = rt_rule_table->rules[i].rt_rule_hdl;
+ eth_bridge_get_client_rt_info_ptr(lan_client_rt_info_count_v6, iptype)->rt_rule_hdl[i] = rt_rule_table->rules[i].rt_rule_hdl;
}
}
}
if(iptype == IPA_IP_v4)
{
- usb_client_rt_info_count_v4++;
- IPACMDBG_H("Now the number of IPv4 rt rule info is %d.\n", usb_client_rt_info_count_v4);
+ lan_client_rt_info_count_v4++;
+ IPACMDBG_H("Now the number of IPv4 rt rule info is %d.\n", lan_client_rt_info_count_v4);
}
else
{
- usb_client_rt_info_count_v6++;
- IPACMDBG_H("Now the number of IPv6 rt rule info is %d.\n", usb_client_rt_info_count_v6);
+ lan_client_rt_info_count_v6++;
+ IPACMDBG_H("Now the number of IPv6 rt rule info is %d.\n", lan_client_rt_info_count_v6);
}
fail:
@@ -5362,7 +5449,7 @@
return res;
}
-int IPACM_Lan::eth_bridge_del_usb_client_rt_rule(uint8_t* mac)
+int IPACM_Lan::eth_bridge_del_lan_client_rt_rule(uint8_t* mac)
{
if(tx_prop == NULL)
{
@@ -5379,7 +5466,7 @@
int i, position;
/* delete rule from IPv4 rt table first */
- for(i=0; i<usb_client_rt_info_count_v4; i++)
+ for(i=0; i<lan_client_rt_info_count_v4; i++)
{
if(memcmp(eth_bridge_get_client_rt_info_ptr(i, IPA_IP_v4)->mac, mac, sizeof(eth_bridge_get_client_rt_info_ptr(i, IPA_IP_v4)->mac)) == 0)
{
@@ -5388,7 +5475,7 @@
break;
}
}
- if(i == usb_client_rt_info_count_v4)
+ if(i == lan_client_rt_info_count_v4)
{
IPACMERR("The client is not found.\n");
return IPACM_FAILURE;
@@ -5403,16 +5490,16 @@
}
}
- for(i=position+1; i<usb_client_rt_info_count_v4; i++)
+ for(i=position+1; i<lan_client_rt_info_count_v4; i++)
{
memcpy(eth_bridge_get_client_rt_info_ptr(i-1, IPA_IP_v4), eth_bridge_get_client_rt_info_ptr(i, IPA_IP_v4), client_rt_info_size_v4);
}
- memset(eth_bridge_get_client_rt_info_ptr(usb_client_rt_info_count_v4-1, IPA_IP_v4), 0, client_rt_info_size_v4);
- usb_client_rt_info_count_v4--;
- IPACMDBG_H("Now the number of IPv4 rt rule info is %d.\n", usb_client_rt_info_count_v4);
+ memset(eth_bridge_get_client_rt_info_ptr(lan_client_rt_info_count_v4-1, IPA_IP_v4), 0, client_rt_info_size_v4);
+ lan_client_rt_info_count_v4--;
+ IPACMDBG_H("Now the number of IPv4 rt rule info is %d.\n", lan_client_rt_info_count_v4);
/*delete rule from IPv6 rt table */
- for(i=0; i<usb_client_rt_info_count_v6; i++)
+ for(i=0; i<lan_client_rt_info_count_v6; i++)
{
if(memcmp(eth_bridge_get_client_rt_info_ptr(i, IPA_IP_v6)->mac, mac, sizeof(eth_bridge_get_client_rt_info_ptr(i, IPA_IP_v6)->mac)) == 0)
{
@@ -5421,7 +5508,7 @@
break;
}
}
- if(i == usb_client_rt_info_count_v6)
+ if(i == lan_client_rt_info_count_v6)
{
IPACMERR("The client is not found.\n");
return IPACM_FAILURE;
@@ -5436,13 +5523,13 @@
}
}
- for(i=position+1; i<usb_client_rt_info_count_v6; i++)
+ for(i=position+1; i<lan_client_rt_info_count_v6; i++)
{
memcpy(eth_bridge_get_client_rt_info_ptr(i-1, IPA_IP_v6), eth_bridge_get_client_rt_info_ptr(i, IPA_IP_v6), client_rt_info_size_v6);
}
- memset(eth_bridge_get_client_rt_info_ptr(usb_client_rt_info_count_v6-1, IPA_IP_v6), 0, client_rt_info_size_v6);
- usb_client_rt_info_count_v6--;
- IPACMDBG_H("Now the number of IPv6 rt rule info is %d.\n", usb_client_rt_info_count_v6);
+ memset(eth_bridge_get_client_rt_info_ptr(lan_client_rt_info_count_v6-1, IPA_IP_v6), 0, client_rt_info_size_v6);
+ lan_client_rt_info_count_v6--;
+ IPACMDBG_H("Now the number of IPv6 rt rule info is %d.\n", lan_client_rt_info_count_v6);
return IPACM_SUCCESS;
}
@@ -5452,18 +5539,18 @@
void* result;
if(iptype == IPA_IP_v4)
{
- result = (void*)((void*)eth_bridge_usb_client_rt_info_v4 + index * client_rt_info_size_v4);
+ result = (void*)((void*)eth_bridge_lan_client_rt_info_v4 + index * client_rt_info_size_v4);
}
else
{
- result = (void*)((void*)eth_bridge_usb_client_rt_info_v6 + index * client_rt_info_size_v6);
+ result = (void*)((void*)eth_bridge_lan_client_rt_info_v6 + index * client_rt_info_size_v6);
}
return (eth_bridge_client_rt_info*)result;
}
-void IPACM_Lan::eth_bridge_add_usb_client(uint8_t* mac)
+void IPACM_Lan::eth_bridge_add_lan_client(uint8_t* mac)
{
- if(IPACM_Lan::num_usb_client == IPA_LAN_TO_LAN_MAX_USB_CLIENT)
+ if(IPACM_Lan::num_lan_client == IPA_LAN_TO_LAN_MAX_LAN_CLIENT)
{
IPACMDBG_H("USB client table is already full.\n");
return;
@@ -5475,12 +5562,24 @@
return;
}
- memcpy(IPACM_Lan::eth_bridge_usb_client[IPACM_Lan::num_usb_client].mac, mac, sizeof(IPACM_Lan::eth_bridge_usb_client[IPACM_Lan::num_usb_client].mac));
- IPACM_Lan::num_usb_client++;
+ int i;
+ for(i=0; i<IPACM_Lan::num_lan_client; i++)
+ {
+ if(memcmp(IPACM_Lan::eth_bridge_lan_client[i].mac, mac, sizeof(IPACM_Lan::eth_bridge_lan_client[i].mac)) == 0)
+ {
+ IPACMDBG_H("The lan client mac has been added before at position %d.\n", i);
+ return;
+ }
+ }
+
+ memcpy(IPACM_Lan::eth_bridge_lan_client[IPACM_Lan::num_lan_client].mac, mac, sizeof(IPACM_Lan::eth_bridge_lan_client[IPACM_Lan::num_lan_client].mac));
+ IPACM_Lan::eth_bridge_lan_client[IPACM_Lan::num_lan_client].ipa_if_num = ipa_if_num;
+ IPACM_Lan::num_lan_client++;
+ IPACMDBG_H("Now total num of lan clients is %d\n", IPACM_Lan::num_lan_client);
return;
}
-void IPACM_Lan::eth_bridge_del_usb_client(uint8_t* mac)
+void IPACM_Lan::eth_bridge_del_lan_client(uint8_t* mac)
{
if(mac == NULL)
{
@@ -5489,27 +5588,28 @@
}
int i, j;
- for(i=0; i<IPACM_Lan::num_usb_client; i++)
+ for(i=0; i<IPACM_Lan::num_lan_client; i++)
{
- if(memcmp(IPACM_Lan::eth_bridge_usb_client[i].mac, mac, sizeof(IPACM_Lan::eth_bridge_usb_client[i].mac)) == 0)
+ if(memcmp(IPACM_Lan::eth_bridge_lan_client[i].mac, mac, sizeof(IPACM_Lan::eth_bridge_lan_client[i].mac)) == 0)
{
IPACMDBG_H("Found USB client at position %d.\n", i);
break;
}
}
- if(i == IPACM_Lan::num_usb_client)
+ if(i == IPACM_Lan::num_lan_client)
{
IPACMDBG_H("Not finding the USB client.\n");
return;
}
- for(j=i+1; j<IPACM_Lan::num_usb_client; j++)
+ for(j=i+1; j<IPACM_Lan::num_lan_client; j++)
{
- memcpy(IPACM_Lan::eth_bridge_usb_client[j-1].mac, IPACM_Lan::eth_bridge_usb_client[j].mac, sizeof(IPACM_Lan::eth_bridge_usb_client[j].mac));
- IPACM_Lan::eth_bridge_usb_client[j-1].ipa_if_num = IPACM_Lan::eth_bridge_usb_client[j].ipa_if_num;
+ memcpy(IPACM_Lan::eth_bridge_lan_client[j-1].mac, IPACM_Lan::eth_bridge_lan_client[j].mac, sizeof(IPACM_Lan::eth_bridge_lan_client[j].mac));
+ IPACM_Lan::eth_bridge_lan_client[j-1].ipa_if_num = IPACM_Lan::eth_bridge_lan_client[j].ipa_if_num;
}
- IPACM_Lan::num_usb_client--;
+ IPACM_Lan::num_lan_client--;
+ IPACMDBG_H("Now total num of lan clients is %d\n", IPACM_Lan::num_lan_client);
return;
}
@@ -5537,42 +5637,62 @@
int IPACM_Lan::del_hdr_proc_ctx()
{
- if(IPACM_Lan::usb_to_wlan_hdr_proc_ctx.valid == true)
+ if(IPACM_Lan::lan_to_wlan_hdr_proc_ctx.valid == true)
{
- if(m_header.DeleteHeaderProcCtx(IPACM_Lan::usb_to_wlan_hdr_proc_ctx.proc_ctx_hdl) == false)
+ if((IPACM_Iface::ipacmcfg->iface_table[ipa_if_num].if_cat == WLAN_IF)
+ || (IPACM_Lan::is_usb_up == false && IPACM_Lan::is_cpe_up == false))
{
- IPACMERR("Failed to delete usb to wlan hdr proc ctx.\n");
- return IPACM_FAILURE;
+ if(m_header.DeleteHeaderProcCtx(IPACM_Lan::lan_to_wlan_hdr_proc_ctx.proc_ctx_hdl) == false)
+ {
+ IPACMERR("Failed to delete usb to wlan hdr proc ctx.\n");
+ return IPACM_FAILURE;
+ }
+ IPACM_Lan::lan_to_wlan_hdr_proc_ctx.valid = false;
+
+ ipacm_cmd_q_data evt_data;
+ memset(&evt_data, 0, sizeof(ipacm_cmd_q_data));
+
+ ipacm_event_data_if_cat* cat;
+ cat = (ipacm_event_data_if_cat*)malloc(sizeof(ipacm_event_data_if_cat));
+ if(cat == NULL)
+ {
+ IPACMERR("Unable to allocate memory.\n");
+ return IPACM_FAILURE;
+ }
+ memset(cat, 0, sizeof(ipacm_event_data_if_cat));
+ cat->if_cat = IPACM_Iface::ipacmcfg->iface_table[ipa_if_num].if_cat;
+
+ evt_data.evt_data = cat;
+ evt_data.event = IPA_ETH_BRIDGE_HDR_PROC_CTX_UNSET_EVENT;
+ IPACMDBG_H("Posting event IPA_ETH_BRIDGE_HDR_PROC_CTX_UNSET_EVENT\n");
+ IPACM_EvtDispatcher::PostEvt(&evt_data);
}
- IPACM_Lan::usb_to_wlan_hdr_proc_ctx.valid = false;
-
- ipacm_cmd_q_data evt_data;
- memset(&evt_data, 0, sizeof(ipacm_cmd_q_data));
-
- ipacm_event_data_fid* fid;
- fid = (ipacm_event_data_fid*)malloc(sizeof(ipacm_event_data_fid));
- if(fid == NULL)
- {
- IPACMERR("Unable to allocate memory.\n");
- return IPACM_FAILURE;
- }
- memset(fid, 0, sizeof(ipacm_event_data_fid));
- fid->if_index = ipa_if_num;
-
- evt_data.evt_data = fid;
- evt_data.event = IPA_ETH_BRIDGE_HDR_PROC_CTX_UNSET_EVENT;
- IPACMDBG_H("Posting event IPA_ETH_BRIDGE_HDR_PROC_CTX_UNSET_EVENT\n");
- IPACM_EvtDispatcher::PostEvt(&evt_data);
}
if(IPACM_Lan::wlan_to_usb_hdr_proc_ctx.valid == true)
{
- if(m_header.DeleteHeaderProcCtx(IPACM_Lan::wlan_to_usb_hdr_proc_ctx.proc_ctx_hdl) == false)
+ if(IPACM_Iface::ipacmcfg->iface_table[ipa_if_num].if_cat == WLAN_IF || IPACM_Lan::is_usb_up == false)
{
- IPACMERR("Failed to delete wlan to usb hdr proc ctx.\n");
- return IPACM_FAILURE;
+ if(m_header.DeleteHeaderProcCtx(IPACM_Lan::wlan_to_usb_hdr_proc_ctx.proc_ctx_hdl) == false)
+ {
+ IPACMERR("Failed to delete wlan to usb hdr proc ctx.\n");
+ return IPACM_FAILURE;
+ }
+ IPACM_Lan::wlan_to_usb_hdr_proc_ctx.valid = false;
}
- IPACM_Lan::wlan_to_usb_hdr_proc_ctx.valid = false;
+ }
+
+ if(IPACM_Lan::wlan_to_cpe_hdr_proc_ctx.valid == true)
+ {
+ if(IPACM_Iface::ipacmcfg->iface_table[ipa_if_num].if_cat == WLAN_IF || IPACM_Lan::is_cpe_up == false)
+ {
+ if(m_header.DeleteHeaderProcCtx(IPACM_Lan::wlan_to_cpe_hdr_proc_ctx.proc_ctx_hdl) == false)
+ {
+ IPACMERR("Failed to delete wlan to cpe hdr proc ctx.\n");
+ return IPACM_FAILURE;
+ }
+ IPACM_Lan::wlan_to_cpe_hdr_proc_ctx.valid = false;
+ }
}
if(IPACM_Iface::ipacmcfg->iface_table[ipa_if_num].if_cat == WLAN_IF)
diff --git a/ipacm/src/IPACM_LanToLan.cpp b/ipacm/src/IPACM_LanToLan.cpp
index c3c589b..0abfc42 100644
--- a/ipacm/src/IPACM_LanToLan.cpp
+++ b/ipacm/src/IPACM_LanToLan.cpp
@@ -54,8 +54,8 @@
{
num_offload_pair_v4_ = 0;
num_offload_pair_v6_ = 0;
- client_info_v4_.reserve(IPA_LAN_TO_LAN_MAX_WLAN_CLIENT + IPA_LAN_TO_LAN_MAX_USB_CLIENT);
- client_info_v6_.reserve(3*(IPA_LAN_TO_LAN_MAX_WLAN_CLIENT + IPA_LAN_TO_LAN_MAX_USB_CLIENT));
+ client_info_v4_.reserve(IPA_LAN_TO_LAN_MAX_WLAN_CLIENT + IPA_LAN_TO_LAN_MAX_LAN_CLIENT);
+ client_info_v6_.reserve(3*(IPA_LAN_TO_LAN_MAX_WLAN_CLIENT + IPA_LAN_TO_LAN_MAX_LAN_CLIENT));
p_instance = this;
IPACM_EvtDispatcher::registr(IPA_LAN_CLIENT_ACTIVE, this);
diff --git a/ipacm/src/IPACM_Main.cpp b/ipacm/src/IPACM_Main.cpp
index 1e3cce7..3d4ad5b 100644
--- a/ipacm/src/IPACM_Main.cpp
+++ b/ipacm/src/IPACM_Main.cpp
@@ -627,7 +627,7 @@
IPACMDBG_H("Received WLAN_WDI_DISABLE\n");
if (IPACM_Iface::ipacmcfg->isMCC_Mode == false)
{
- IPACM_Iface::ipacmcfg->isMCC_Mode == true;
+ IPACM_Iface::ipacmcfg->isMCC_Mode = true;
evt_data.event = IPA_WLAN_SWITCH_TO_MCC;
break;
}
diff --git a/ipacm/src/IPACM_Wan.cpp b/ipacm/src/IPACM_Wan.cpp
index 03b5bdc..cc80847 100644
--- a/ipacm/src/IPACM_Wan.cpp
+++ b/ipacm/src/IPACM_Wan.cpp
@@ -3833,8 +3833,11 @@
/* Delete corresponding ipa_rm_resource_name of TX-endpoint after delete IPV4/V6 RT-rule */
IPACMDBG_H("dev %s add producer dependency\n", dev_name);
- IPACMDBG_H("depend Got pipe %d rm index : %d \n", tx_prop->tx[0].dst_pipe, IPACM_Iface::ipacmcfg->ipa_client_rm_map_tbl[tx_prop->tx[0].dst_pipe]);
- IPACM_Iface::ipacmcfg->DelRmDepend(IPACM_Iface::ipacmcfg->ipa_client_rm_map_tbl[tx_prop->tx[0].dst_pipe]);
+ if (tx_prop != NULL)
+ {
+ IPACMDBG_H("depend Got pipe %d rm index : %d \n", tx_prop->tx[0].dst_pipe, IPACM_Iface::ipacmcfg->ipa_client_rm_map_tbl[tx_prop->tx[0].dst_pipe]);
+ IPACM_Iface::ipacmcfg->DelRmDepend(IPACM_Iface::ipacmcfg->ipa_client_rm_map_tbl[tx_prop->tx[0].dst_pipe]);
+ }
/* no iface address up, directly close iface*/
if (ip_type == IPACM_IP_NULL)
@@ -4040,8 +4043,11 @@
embms_is_on = false;
/* Delete corresponding ipa_rm_resource_name of TX-endpoint after delete IPV4/V6 RT-rule */
IPACMDBG_H("dev %s add producer dependency\n", dev_name);
- IPACMDBG_H("depend Got pipe %d rm index : %d \n", tx_prop->tx[0].dst_pipe, IPACM_Iface::ipacmcfg->ipa_client_rm_map_tbl[tx_prop->tx[0].dst_pipe]);
- IPACM_Iface::ipacmcfg->DelRmDepend(IPACM_Iface::ipacmcfg->ipa_client_rm_map_tbl[tx_prop->tx[0].dst_pipe]);
+ if (tx_prop != NULL)
+ {
+ IPACMDBG_H("depend Got pipe %d rm index : %d \n", tx_prop->tx[0].dst_pipe, IPACM_Iface::ipacmcfg->ipa_client_rm_map_tbl[tx_prop->tx[0].dst_pipe]);
+ IPACM_Iface::ipacmcfg->DelRmDepend(IPACM_Iface::ipacmcfg->ipa_client_rm_map_tbl[tx_prop->tx[0].dst_pipe]);
+ }
if (rx_prop != NULL)
{
@@ -4622,7 +4628,19 @@
/* copy client mac_addr to partial header */
IPACMDBG_H("header eth2_ofst_valid: %d, eth2_ofst: %d\n",
sCopyHeader.is_eth2_ofst_valid, sCopyHeader.eth2_ofst);
- memcpy(&pHeaderDescriptor->hdr[0].hdr[eth2_ofst_v4], mac_addr, IPA_MAC_ADDR_SIZE); /* only copy 6 bytes mac-address */
+
+ /* only copy 6 bytes mac-address */
+ if(sCopyHeader.is_eth2_ofst_valid == false)
+ {
+ memcpy(&pHeaderDescriptor->hdr[0].hdr[0],
+ mac_addr, IPA_MAC_ADDR_SIZE);
+ }
+ else
+ {
+ memcpy(&pHeaderDescriptor->hdr[0].hdr[sCopyHeader.eth2_ofst],
+ mac_addr, IPA_MAC_ADDR_SIZE);
+ }
+
pHeaderDescriptor->commit = true;
pHeaderDescriptor->num_hdrs = 1;
@@ -4705,11 +4723,21 @@
{
memcpy(pHeaderDescriptor->hdr[0].hdr,
sCopyHeader.hdr,
- sCopyHeader.hdr_len);
+ sCopyHeader.hdr_len);
}
/* copy client mac_addr to partial header */
- memcpy(&pHeaderDescriptor->hdr[0].hdr[eth2_ofst_v6], mac_addr, IPA_MAC_ADDR_SIZE); /* only copy 6 bytes mac-address */
+ if(sCopyHeader.is_eth2_ofst_valid == false)
+ {
+ memcpy(&pHeaderDescriptor->hdr[0].hdr[0],
+ mac_addr, IPA_MAC_ADDR_SIZE); /* only copy 6 bytes mac-address */
+ }
+ else
+ {
+ memcpy(&pHeaderDescriptor->hdr[0].hdr[sCopyHeader.eth2_ofst],
+ mac_addr, IPA_MAC_ADDR_SIZE); /* only copy 6 bytes mac-address */
+ }
+
pHeaderDescriptor->commit = true;
pHeaderDescriptor->num_hdrs = 1;
diff --git a/ipacm/src/IPACM_Wlan.cpp b/ipacm/src/IPACM_Wlan.cpp
index 909a044..6a5705f 100644
--- a/ipacm/src/IPACM_Wlan.cpp
+++ b/ipacm/src/IPACM_Wlan.cpp
@@ -61,8 +61,8 @@
lan2lan_flt_rule_hdl IPACM_Wlan::self_client_flt_rule_hdl_v4[IPA_LAN_TO_LAN_MAX_WLAN_CLIENT];
lan2lan_flt_rule_hdl IPACM_Wlan::self_client_flt_rule_hdl_v6[IPA_LAN_TO_LAN_MAX_WLAN_CLIENT];
-lan2lan_flt_rule_hdl IPACM_Wlan::usb_client_flt_rule_hdl_v4[IPA_LAN_TO_LAN_MAX_USB_CLIENT];
-lan2lan_flt_rule_hdl IPACM_Wlan::usb_client_flt_rule_hdl_v6[IPA_LAN_TO_LAN_MAX_USB_CLIENT];
+lan2lan_flt_rule_hdl IPACM_Wlan::lan_client_flt_rule_hdl_v4[IPA_LAN_TO_LAN_MAX_LAN_CLIENT];
+lan2lan_flt_rule_hdl IPACM_Wlan::lan_client_flt_rule_hdl_v6[IPA_LAN_TO_LAN_MAX_LAN_CLIENT];
IPACM_Wlan::IPACM_Wlan(int iface_index) : IPACM_Lan(iface_index)
{
@@ -112,8 +112,8 @@
#ifdef FEATURE_ETH_BRIDGE_LE
exp_index_v4 = IPV4_DEFAULT_FILTERTING_RULES + 2 * IPACM_Iface::ipacmcfg->ipa_num_private_subnet
- + IPA_LAN_TO_LAN_MAX_WLAN_CLIENT + IPA_LAN_TO_LAN_MAX_USB_CLIENT + NUM_IPV4_ICMP_FLT_RULE;
- exp_index_v6 = IPV6_DEFAULT_FILTERTING_RULES + 1 + IPA_LAN_TO_LAN_MAX_WLAN_CLIENT + IPA_LAN_TO_LAN_MAX_USB_CLIENT + NUM_IPV6_PREFIX_FLT_RULE
+ + IPA_LAN_TO_LAN_MAX_WLAN_CLIENT + IPA_LAN_TO_LAN_MAX_LAN_CLIENT + NUM_IPV4_ICMP_FLT_RULE;
+ exp_index_v6 = IPV6_DEFAULT_FILTERTING_RULES + 1 + IPA_LAN_TO_LAN_MAX_WLAN_CLIENT + IPA_LAN_TO_LAN_MAX_LAN_CLIENT + NUM_IPV6_PREFIX_FLT_RULE
+ NUM_IPV6_ICMP_FLT_RULE;
#else
#ifndef CT_OPT
@@ -135,28 +135,27 @@
memset(wlan_guest_ap_flt_rule_hdl_v4, 0, IPA_MAX_PRIVATE_SUBNET_ENTRIES * sizeof(uint32_t));
wlan_guest_ap_flt_rule_hdl_v6 = 0;
is_guest_ap = false;
- num_usb_client = 0;
- memset(eth_bridge_usb_client_flt_info, 0, IPA_LAN_TO_LAN_MAX_USB_CLIENT * sizeof(eth_bridge_client_flt_info));
- num_usb_client = 0;
- eth_bridge_wlan_client_rt_from_usb_info_v4 = NULL;
- eth_bridge_wlan_client_rt_from_usb_info_v6 = NULL;
+ memset(eth_bridge_lan_client_flt_info, 0, IPA_LAN_TO_LAN_MAX_LAN_CLIENT * sizeof(eth_bridge_client_flt_info));
+ lan_client_flt_info_count = 0;
+ eth_bridge_wlan_client_rt_from_lan_info_v4 = NULL;
+ eth_bridge_wlan_client_rt_from_lan_info_v6 = NULL;
eth_bridge_wlan_client_rt_from_wlan_info_v4 = NULL;
eth_bridge_wlan_client_rt_from_wlan_info_v6 = NULL;
if(tx_prop != NULL)
{
#ifdef FEATURE_ETH_BRIDGE_LE
client_rt_info_size_v4 = sizeof(eth_bridge_client_rt_info) + each_client_rt_rule_count_v4 * sizeof(uint32_t);
- eth_bridge_wlan_client_rt_from_usb_info_v4 = (eth_bridge_client_rt_info*)calloc(IPA_LAN_TO_LAN_MAX_WLAN_CLIENT, client_rt_info_size_v4);
+ eth_bridge_wlan_client_rt_from_lan_info_v4 = (eth_bridge_client_rt_info*)calloc(IPA_LAN_TO_LAN_MAX_WLAN_CLIENT, client_rt_info_size_v4);
eth_bridge_wlan_client_rt_from_wlan_info_v4 = (eth_bridge_client_rt_info*)calloc(IPA_LAN_TO_LAN_MAX_WLAN_CLIENT, client_rt_info_size_v4);
client_rt_info_size_v6 = sizeof(eth_bridge_client_rt_info) + each_client_rt_rule_count_v6 * sizeof(uint32_t);
- eth_bridge_wlan_client_rt_from_usb_info_v6 = (eth_bridge_client_rt_info*)calloc(IPA_LAN_TO_LAN_MAX_WLAN_CLIENT, client_rt_info_size_v6);
+ eth_bridge_wlan_client_rt_from_lan_info_v6 = (eth_bridge_client_rt_info*)calloc(IPA_LAN_TO_LAN_MAX_WLAN_CLIENT, client_rt_info_size_v6);
eth_bridge_wlan_client_rt_from_wlan_info_v6 = (eth_bridge_client_rt_info*)calloc(IPA_LAN_TO_LAN_MAX_WLAN_CLIENT, client_rt_info_size_v6);
#endif
}
- wlan_client_rt_from_usb_info_count_v4 = 0;
- wlan_client_rt_from_usb_info_count_v6 = 0;
+ wlan_client_rt_from_lan_info_count_v4 = 0;
+ wlan_client_rt_from_lan_info_count_v6 = 0;
wlan_client_rt_from_wlan_info_count_v4 = 0;
wlan_client_rt_from_wlan_info_count_v6 = 0;
#ifdef FEATURE_ETH_BRIDGE_LE
@@ -512,10 +511,10 @@
eth_bridge_add_wlan_client_rt_rule(data->attribs[i].u.mac_addr, SRC_WLAN, IPA_IP_v4);
eth_bridge_add_wlan_client_rt_rule(data->attribs[i].u.mac_addr, SRC_WLAN, IPA_IP_v6);
}
- if(IPACM_Lan::usb_to_wlan_hdr_proc_ctx.valid == true)
+ if(IPACM_Lan::lan_to_wlan_hdr_proc_ctx.valid == true)
{
- eth_bridge_add_wlan_client_rt_rule(data->attribs[i].u.mac_addr, SRC_USB, IPA_IP_v4);
- eth_bridge_add_wlan_client_rt_rule(data->attribs[i].u.mac_addr, SRC_USB, IPA_IP_v6);
+ eth_bridge_add_wlan_client_rt_rule(data->attribs[i].u.mac_addr, SRC_LAN, IPA_IP_v4);
+ eth_bridge_add_wlan_client_rt_rule(data->attribs[i].u.mac_addr, SRC_LAN, IPA_IP_v6);
}
if(ip_type == IPA_IP_v4 || ip_type == IPA_IP_MAX)
{
@@ -546,9 +545,9 @@
IPACMDBG_H("Received IPA_WLAN_CLIENT_DEL_EVENT\n");
#ifdef FEATURE_ETH_BRIDGE_LE
eth_bridge_del_wlan_client_rt_rule(data->mac_addr, SRC_WLAN);
- if(IPACM_Lan::usb_to_wlan_hdr_proc_ctx.valid == true)
+ if(IPACM_Lan::lan_to_wlan_hdr_proc_ctx.valid == true)
{
- eth_bridge_del_wlan_client_rt_rule(data->mac_addr, SRC_USB);
+ eth_bridge_del_wlan_client_rt_rule(data->mac_addr, SRC_LAN);
}
eth_bridge_del_self_client_flt_rule(data->mac_addr);
eth_bridge_post_lan_client_event(data->mac_addr, IPA_ETH_BRIDGE_WLAN_CLIENT_DEL_EVENT);
@@ -656,19 +655,19 @@
IPACM_Iface::handle_software_routing_disable();
break;
- case IPA_ETH_BRIDGE_USB_CLIENT_ADD_EVENT:
+ case IPA_ETH_BRIDGE_LAN_CLIENT_ADD_EVENT:
{
- IPACMDBG_H("Received IPA_ETH_BRIDGE_USB_CLIENT_ADD_EVENT event.\n");
+ IPACMDBG_H("Received IPA_ETH_BRIDGE_LAN_CLIENT_ADD_EVENT event.\n");
ipacm_event_data_mac* mac = (ipacm_event_data_mac*)param;
if(mac != NULL)
{
if(ip_type == IPA_IP_v4 || ip_type == IPA_IP_MAX)
{
- eth_bridge_add_usb_client_flt_rule(mac->mac_addr, IPA_IP_v4);
+ eth_bridge_add_lan_client_flt_rule(mac->mac_addr, IPA_IP_v4);
}
if(ip_type == IPA_IP_v6 || ip_type == IPA_IP_MAX)
{
- eth_bridge_add_usb_client_flt_rule(mac->mac_addr, IPA_IP_v6);
+ eth_bridge_add_lan_client_flt_rule(mac->mac_addr, IPA_IP_v6);
}
}
else
@@ -678,17 +677,17 @@
}
break;
- case IPA_ETH_BRIDGE_USB_CLIENT_DEL_EVENT:
+ case IPA_ETH_BRIDGE_LAN_CLIENT_DEL_EVENT:
{
- IPACMDBG_H("Received IPA_ETH_BRIDGE_USB_CLIENT_DEL_EVENT event.\n");
+ IPACMDBG_H("Received IPA_ETH_BRIDGE_LAN_CLIENT_DEL_EVENT event.\n");
ipacm_event_data_mac* mac = (ipacm_event_data_mac*)param;
if(mac != NULL)
{
if(wlan_ap_index == 0)
{
- if(eth_bridge_del_usb_client_flt_rule(mac->mac_addr) == IPACM_FAILURE)
+ if(eth_bridge_del_lan_client_flt_rule(mac->mac_addr) == IPACM_FAILURE)
{
- IPACMDBG_H("Failed to delete usb client MAC based flt rule.\n");
+ IPACMDBG_H("Failed to delete lan client MAC based flt rule.\n");
}
}
}
@@ -703,23 +702,23 @@
{
IPACMDBG_H("Received IPA_ETH_BRIDGE_HDR_PROC_CTX_SET_EVENT event.\n");
int i;
- ipacm_event_data_fid* fid = (ipacm_event_data_fid*)param;
- if(fid == NULL)
+ ipacm_event_data_if_cat* cat = (ipacm_event_data_if_cat*)param;
+ if(cat == NULL)
{
IPACMERR("Event data is empty.\n");
return;
}
- if(fid->if_index == ipa_if_num)
+ if(cat->if_cat != LAN_IF && cat->if_cat != ODU_IF)
{
- IPACMDBG_H("The event was sent by the same interface, ignore.\n");
+ IPACMDBG_H("The event was not sent by LAN interface, ignore.\n");
return;
}
for(i=0; i<IPACM_Lan::num_wlan_client; i++)
{
if(IPACM_Lan::eth_bridge_wlan_client[i].ipa_if_num == ipa_if_num)
{
- eth_bridge_add_wlan_client_rt_rule(IPACM_Lan::eth_bridge_wlan_client[i].mac, SRC_USB, IPA_IP_v4);
- eth_bridge_add_wlan_client_rt_rule(IPACM_Lan::eth_bridge_wlan_client[i].mac, SRC_USB, IPA_IP_v6);
+ eth_bridge_add_wlan_client_rt_rule(IPACM_Lan::eth_bridge_wlan_client[i].mac, SRC_LAN, IPA_IP_v4);
+ eth_bridge_add_wlan_client_rt_rule(IPACM_Lan::eth_bridge_wlan_client[i].mac, SRC_LAN, IPA_IP_v6);
}
}
}
@@ -729,15 +728,15 @@
{
IPACMDBG_H("Received IPA_ETH_BRIDGE_HDR_PROC_CTX_UNSET_EVENT event.\n");
int i;
- ipacm_event_data_fid* fid = (ipacm_event_data_fid*)param;
- if(fid == NULL)
+ ipacm_event_data_if_cat* cat = (ipacm_event_data_if_cat*)param;
+ if(cat == NULL)
{
IPACMERR("Event data is empty.\n");
return;
}
- if(fid->if_index == ipa_if_num)
+ if(cat->if_cat != LAN_IF && cat->if_cat != ODU_IF)
{
- IPACMDBG_H("The event was sent by the same interface, ignore.\n");
+ IPACMDBG_H("The event was not sent by LAN interface, ignore.\n");
return;
}
@@ -745,7 +744,7 @@
{
if(IPACM_Lan::eth_bridge_wlan_client[i].ipa_if_num == ipa_if_num)
{
- eth_bridge_del_wlan_client_rt_rule(IPACM_Lan::eth_bridge_wlan_client[i].mac, SRC_USB);
+ eth_bridge_del_wlan_client_rt_rule(IPACM_Lan::eth_bridge_wlan_client[i].mac, SRC_LAN);
}
}
}
@@ -982,7 +981,7 @@
return IPACM_FAILURE;
}
#ifdef FEATURE_ETH_BRIDGE_LE
- offset = 1 + IPA_LAN_TO_LAN_MAX_WLAN_CLIENT + IPA_LAN_TO_LAN_MAX_USB_CLIENT;
+ offset = 1 + IPA_LAN_TO_LAN_MAX_WLAN_CLIENT + IPA_LAN_TO_LAN_MAX_LAN_CLIENT;
#else
#ifndef CT_OPT
offset = wlan_ap_index * (IPV6_DEFAULT_FILTERTING_RULES + MAX_OFFLOAD_PAIR) + MAX_OFFLOAD_PAIR;
@@ -1171,7 +1170,7 @@
return IPACM_FAILURE;
}
#ifdef FEATURE_ETH_BRIDGE_LE
- offset = IPV4_DEFAULT_FILTERTING_RULES + IPACM_Iface::ipacmcfg->ipa_num_private_subnet + IPA_LAN_TO_LAN_MAX_WLAN_CLIENT + IPA_LAN_TO_LAN_MAX_USB_CLIENT;
+ offset = IPV4_DEFAULT_FILTERTING_RULES + IPACM_Iface::ipacmcfg->ipa_num_private_subnet + IPA_LAN_TO_LAN_MAX_WLAN_CLIENT + IPA_LAN_TO_LAN_MAX_LAN_CLIENT;
#else
#ifndef CT_OPT
offset = wlan_ap_index * (IPV4_DEFAULT_FILTERTING_RULES + MAX_OFFLOAD_PAIR + IPACM_Iface::ipacmcfg->ipa_num_private_subnet)
@@ -2456,7 +2455,7 @@
eth_bridge_del_self_client_flt_rule(get_client_memptr(wlan_client, i)->mac);
eth_bridge_post_lan_client_event(get_client_memptr(wlan_client, i)->mac, IPA_ETH_BRIDGE_WLAN_CLIENT_DEL_EVENT);
eth_bridge_del_wlan_client_rt_rule(get_client_memptr(wlan_client, i)->mac, SRC_WLAN);
- eth_bridge_del_wlan_client_rt_rule(get_client_memptr(wlan_client, i)->mac, SRC_USB);
+ eth_bridge_del_wlan_client_rt_rule(get_client_memptr(wlan_client, i)->mac, SRC_LAN);
#endif
/* First reset nat rules and then route rules */
if(get_client_memptr(wlan_client, i)->ipv4_set == true)
@@ -2552,21 +2551,21 @@
free(iface_query);
}
#ifdef FEATURE_ETH_BRIDGE_LE
- if(eth_bridge_usb_client_rt_info_v4 != NULL)
+ if(eth_bridge_lan_client_rt_info_v4 != NULL)
{
- free(eth_bridge_usb_client_rt_info_v4);
+ free(eth_bridge_lan_client_rt_info_v4);
}
- if(eth_bridge_usb_client_rt_info_v6 != NULL)
+ if(eth_bridge_lan_client_rt_info_v6 != NULL)
{
- free(eth_bridge_usb_client_rt_info_v6);
+ free(eth_bridge_lan_client_rt_info_v6);
}
- if(eth_bridge_wlan_client_rt_from_usb_info_v4 != NULL)
+ if(eth_bridge_wlan_client_rt_from_lan_info_v4 != NULL)
{
- free(eth_bridge_wlan_client_rt_from_usb_info_v4);
+ free(eth_bridge_wlan_client_rt_from_lan_info_v4);
}
- if(eth_bridge_wlan_client_rt_from_usb_info_v6 != NULL)
+ if(eth_bridge_wlan_client_rt_from_lan_info_v6 != NULL)
{
- free(eth_bridge_wlan_client_rt_from_usb_info_v6);
+ free(eth_bridge_wlan_client_rt_from_lan_info_v6);
}
if(eth_bridge_wlan_client_rt_from_wlan_info_v4 != NULL)
{
@@ -2991,8 +2990,8 @@
return;
}
#ifdef FEATURE_ETH_BRIDGE_LE
- num_v4_dummy_rule = IPV4_DEFAULT_FILTERTING_RULES + IPACM_Iface::ipacmcfg->ipa_num_private_subnet + IPA_LAN_TO_LAN_MAX_WLAN_CLIENT + IPA_LAN_TO_LAN_MAX_USB_CLIENT + IPACM_Iface::ipacmcfg->ipa_num_private_subnet;
- num_v6_dummy_rule = IPV6_DEFAULT_FILTERTING_RULES + 1 + IPA_LAN_TO_LAN_MAX_WLAN_CLIENT + IPA_LAN_TO_LAN_MAX_USB_CLIENT;
+ num_v4_dummy_rule = IPV4_DEFAULT_FILTERTING_RULES + IPACM_Iface::ipacmcfg->ipa_num_private_subnet + IPA_LAN_TO_LAN_MAX_WLAN_CLIENT + IPA_LAN_TO_LAN_MAX_LAN_CLIENT + IPACM_Iface::ipacmcfg->ipa_num_private_subnet;
+ num_v6_dummy_rule = IPV6_DEFAULT_FILTERTING_RULES + 1 + IPA_LAN_TO_LAN_MAX_WLAN_CLIENT + IPA_LAN_TO_LAN_MAX_LAN_CLIENT;
#else
#ifndef CT_OPT
num_v4_dummy_rule = 2*(IPV4_DEFAULT_FILTERTING_RULES + MAX_OFFLOAD_PAIR + IPACM_Iface::ipacmcfg->ipa_num_private_subnet);
@@ -3194,8 +3193,8 @@
#endif
#ifdef FEATURE_ETH_BRIDGE_LE
- num_v4_dummy_rule = IPV4_DEFAULT_FILTERTING_RULES + IPACM_Iface::ipacmcfg->ipa_num_private_subnet + IPA_LAN_TO_LAN_MAX_WLAN_CLIENT + IPA_LAN_TO_LAN_MAX_USB_CLIENT + IPACM_Iface::ipacmcfg->ipa_num_private_subnet;
- num_v6_dummy_rule = IPV6_DEFAULT_FILTERTING_RULES + 1 + IPA_LAN_TO_LAN_MAX_WLAN_CLIENT + IPA_LAN_TO_LAN_MAX_USB_CLIENT;
+ num_v4_dummy_rule = IPV4_DEFAULT_FILTERTING_RULES + IPACM_Iface::ipacmcfg->ipa_num_private_subnet + IPA_LAN_TO_LAN_MAX_WLAN_CLIENT + IPA_LAN_TO_LAN_MAX_LAN_CLIENT + IPACM_Iface::ipacmcfg->ipa_num_private_subnet;
+ num_v6_dummy_rule = IPV6_DEFAULT_FILTERTING_RULES + 1 + IPA_LAN_TO_LAN_MAX_WLAN_CLIENT + IPA_LAN_TO_LAN_MAX_LAN_CLIENT;
#endif
if(m_filtering.DeleteFilteringHdls(IPACM_Wlan::dummy_flt_rule_hdl_v4, IPA_IP_v4, num_v4_dummy_rule) == false)
@@ -3218,8 +3217,8 @@
#ifdef FEATURE_ETH_BRIDGE_LE
memset(self_client_flt_rule_hdl_v4, 0, IPA_LAN_TO_LAN_MAX_WLAN_CLIENT * sizeof(lan2lan_flt_rule_hdl));
memset(self_client_flt_rule_hdl_v6, 0, IPA_LAN_TO_LAN_MAX_WLAN_CLIENT * sizeof(lan2lan_flt_rule_hdl));
- memset(usb_client_flt_rule_hdl_v4, 0, IPA_LAN_TO_LAN_MAX_USB_CLIENT * sizeof(lan2lan_flt_rule_hdl));
- memset(usb_client_flt_rule_hdl_v6, 0, IPA_LAN_TO_LAN_MAX_USB_CLIENT * sizeof(lan2lan_flt_rule_hdl));
+ memset(lan_client_flt_rule_hdl_v4, 0, IPA_LAN_TO_LAN_MAX_LAN_CLIENT * sizeof(lan2lan_flt_rule_hdl));
+ memset(lan_client_flt_rule_hdl_v6, 0, IPA_LAN_TO_LAN_MAX_LAN_CLIENT * sizeof(lan2lan_flt_rule_hdl));
#endif
}
return;
@@ -3593,7 +3592,7 @@
return IPACM_SUCCESS;
}
-int IPACM_Wlan::eth_bridge_handle_dummy_usb_client_flt_rule(ipa_ip_type iptype)
+int IPACM_Wlan::eth_bridge_handle_dummy_lan_client_flt_rule(ipa_ip_type iptype)
{
int i, offset;
if(wlan_ap_index == 0)
@@ -3601,27 +3600,27 @@
if(iptype == IPA_IP_v4)
{
offset = IPV4_DEFAULT_FILTERTING_RULES + IPACM_Iface::ipacmcfg->ipa_num_private_subnet + IPA_LAN_TO_LAN_MAX_WLAN_CLIENT;
- for(i=0; i<IPA_LAN_TO_LAN_MAX_USB_CLIENT; i++)
+ for(i=0; i<IPA_LAN_TO_LAN_MAX_LAN_CLIENT; i++)
{
- usb_client_flt_rule_hdl_v4[i].rule_hdl = IPACM_Wlan::dummy_flt_rule_hdl_v4[offset+i];
- usb_client_flt_rule_hdl_v4[i].valid = true;
+ lan_client_flt_rule_hdl_v4[i].rule_hdl = IPACM_Wlan::dummy_flt_rule_hdl_v4[offset+i];
+ lan_client_flt_rule_hdl_v4[i].valid = true;
}
}
else
{
offset = 1 + IPA_LAN_TO_LAN_MAX_WLAN_CLIENT;
- for(i=0; i<IPA_LAN_TO_LAN_MAX_USB_CLIENT; i++)
+ for(i=0; i<IPA_LAN_TO_LAN_MAX_LAN_CLIENT; i++)
{
- usb_client_flt_rule_hdl_v6[i].rule_hdl = IPACM_Wlan::dummy_flt_rule_hdl_v6[offset+i];
- usb_client_flt_rule_hdl_v6[i].valid = true;
+ lan_client_flt_rule_hdl_v6[i].rule_hdl = IPACM_Wlan::dummy_flt_rule_hdl_v6[offset+i];
+ lan_client_flt_rule_hdl_v6[i].valid = true;
}
}
- IPACMDBG_H("Get %d flt rule hdls for usb clients ip type: %d.\n", IPA_LAN_TO_LAN_MAX_USB_CLIENT, iptype);
+ IPACMDBG_H("Get %d flt rule hdls for lan clients ip type: %d.\n", IPA_LAN_TO_LAN_MAX_LAN_CLIENT, iptype);
}
return IPACM_SUCCESS;
}
-int IPACM_Wlan::eth_bridge_add_usb_client_flt_rule(uint8_t* mac, ipa_ip_type iptype)
+int IPACM_Wlan::eth_bridge_add_lan_client_flt_rule(uint8_t* mac, ipa_ip_type iptype)
{
int i, len, res = IPACM_SUCCESS, client_position;
struct ipa_flt_rule_mdfy flt_rule;
@@ -3643,20 +3642,15 @@
IPACMDBG_H("This is WLAN interface index %d, ignore.\n", wlan_ap_index);
return IPACM_SUCCESS;
}
- if(IPACM_Lan::wlan_to_usb_hdr_proc_ctx.valid == false)
- {
- IPACMDBG_H("WLAN to USB hdr proc ctx has not been set, don't add USB client specific flt rule.\n");
- return IPACM_FAILURE;
- }
- for(i=0; i<num_usb_client; i++)
+ for(i=0; i<lan_client_flt_info_count; i++)
{
- if(memcmp(eth_bridge_usb_client_flt_info[i].mac, mac, sizeof(eth_bridge_usb_client_flt_info[i].mac)) == 0)
+ if(memcmp(eth_bridge_lan_client_flt_info[i].mac, mac, sizeof(eth_bridge_lan_client_flt_info[i].mac)) == 0)
{
client_is_found = true;
client_position = i;
- if( (iptype == IPA_IP_v4 && eth_bridge_usb_client_flt_info[i].flt_rule_set_v4 == true)
- || (iptype == IPA_IP_v6 && eth_bridge_usb_client_flt_info[i].flt_rule_set_v6 == true))
+ if( (iptype == IPA_IP_v4 && eth_bridge_lan_client_flt_info[i].flt_rule_set_v4 == true)
+ || (iptype == IPA_IP_v6 && eth_bridge_lan_client_flt_info[i].flt_rule_set_v6 == true))
{
IPACMDBG_H("Flt rule for iptype %d has been set.\n", iptype);
return IPACM_SUCCESS;
@@ -3665,9 +3659,9 @@
}
}
- if(client_is_found == false && num_usb_client == IPA_LAN_TO_LAN_MAX_USB_CLIENT)
+ if(client_is_found == false && lan_client_flt_info_count == IPA_LAN_TO_LAN_MAX_LAN_CLIENT)
{
- IPACMDBG_H("The usb client flt table is already full.\n");
+ IPACMDBG_H("The lan client flt table is already full.\n");
return IPACM_FAILURE;
}
@@ -3680,14 +3674,14 @@
}
memset(pFilteringTable, 0, len);
- IPACMDBG_H("Receive USB client MAC 0x%02x%02x%02x%02x%02x%02x.\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
+ IPACMDBG_H("Receive LAN client MAC 0x%02x%02x%02x%02x%02x%02x.\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
/* add mac based rule on flt table */
pFilteringTable->commit = 1;
pFilteringTable->ip = iptype;
pFilteringTable->num_rules = 1;
- /* point to USB-WLAN routing table */
+ /* point to LAN-WLAN routing table */
memset(&flt_rule, 0, sizeof(struct ipa_flt_rule_mdfy));
flt_rule.status = -1;
@@ -3698,25 +3692,25 @@
if(iptype == IPA_IP_v4)
{
- if (false == m_routing.GetRoutingTable(&IPACM_Iface::ipacmcfg->rt_tbl_eth_bridge_usb_wlan_v4))
+ if (false == m_routing.GetRoutingTable(&IPACM_Iface::ipacmcfg->rt_tbl_eth_bridge_lan_wlan_v4))
{
IPACMERR("Failed to get routing table handle.\n");
res = IPACM_FAILURE;
goto fail;
}
- flt_rule.rule.rt_tbl_hdl = IPACM_Iface::ipacmcfg->rt_tbl_eth_bridge_usb_wlan_v4.hdl;
- IPACMDBG_H("WLAN->USB IPv4 filter rule use table: %s\n",IPACM_Iface::ipacmcfg->rt_tbl_eth_bridge_usb_wlan_v4.name);
+ flt_rule.rule.rt_tbl_hdl = IPACM_Iface::ipacmcfg->rt_tbl_eth_bridge_lan_wlan_v4.hdl;
+ IPACMDBG_H("WLAN->LAN IPv4 filter rule use table: %s\n",IPACM_Iface::ipacmcfg->rt_tbl_eth_bridge_lan_wlan_v4.name);
}
else
{
- if (false == m_routing.GetRoutingTable(&IPACM_Iface::ipacmcfg->rt_tbl_eth_bridge_usb_wlan_v6))
+ if (false == m_routing.GetRoutingTable(&IPACM_Iface::ipacmcfg->rt_tbl_eth_bridge_lan_wlan_v6))
{
IPACMERR("Failed to get routing table handle.\n");
res = IPACM_FAILURE;
goto fail;
}
- flt_rule.rule.rt_tbl_hdl = IPACM_Iface::ipacmcfg->rt_tbl_eth_bridge_usb_wlan_v6.hdl;
- IPACMDBG_H("WLAN->USB IPv6 filter rule use table: %s\n",IPACM_Iface::ipacmcfg->rt_tbl_eth_bridge_usb_wlan_v6.name);
+ flt_rule.rule.rt_tbl_hdl = IPACM_Iface::ipacmcfg->rt_tbl_eth_bridge_lan_wlan_v6.hdl;
+ IPACMDBG_H("WLAN->LAN IPv6 filter rule use table: %s\n",IPACM_Iface::ipacmcfg->rt_tbl_eth_bridge_lan_wlan_v6.name);
}
memcpy(&flt_rule.rule.attrib, &rx_prop->rx[0].attrib, sizeof(flt_rule.rule.attrib));
@@ -3740,16 +3734,16 @@
if(iptype == IPA_IP_v4)
{
- for(i=0; i<IPA_LAN_TO_LAN_MAX_USB_CLIENT; i++)
+ for(i=0; i<IPA_LAN_TO_LAN_MAX_LAN_CLIENT; i++)
{
- if(usb_client_flt_rule_hdl_v4[i].valid == true)
+ if(lan_client_flt_rule_hdl_v4[i].valid == true)
{
- flt_rule.rule_hdl = usb_client_flt_rule_hdl_v4[i].rule_hdl;
- usb_client_flt_rule_hdl_v4[i].valid = false;
+ flt_rule.rule_hdl = lan_client_flt_rule_hdl_v4[i].rule_hdl;
+ lan_client_flt_rule_hdl_v4[i].valid = false;
break;
}
}
- if(i == IPA_LAN_TO_LAN_MAX_USB_CLIENT)
+ if(i == IPA_LAN_TO_LAN_MAX_LAN_CLIENT)
{
IPACMDBG_H("Cannot find a valid flt rule hdl.\n");
res = IPACM_FAILURE;
@@ -3758,16 +3752,16 @@
}
else
{
- for(i=0; i<IPA_LAN_TO_LAN_MAX_USB_CLIENT; i++)
+ for(i=0; i<IPA_LAN_TO_LAN_MAX_LAN_CLIENT; i++)
{
- if(usb_client_flt_rule_hdl_v6[i].valid == true)
+ if(lan_client_flt_rule_hdl_v6[i].valid == true)
{
- flt_rule.rule_hdl = usb_client_flt_rule_hdl_v6[i].rule_hdl;
- usb_client_flt_rule_hdl_v6[i].valid = false;
+ flt_rule.rule_hdl = lan_client_flt_rule_hdl_v6[i].rule_hdl;
+ lan_client_flt_rule_hdl_v6[i].valid = false;
break;
}
}
- if(i == IPA_LAN_TO_LAN_MAX_USB_CLIENT)
+ if(i == IPA_LAN_TO_LAN_MAX_LAN_CLIENT)
{
IPACMDBG_H("Cannot find a valid flt rule hdl.\n");
res = IPACM_FAILURE;
@@ -3785,20 +3779,20 @@
if(client_is_found == false)
{
- client_position = num_usb_client;
- num_usb_client++;
+ client_position = lan_client_flt_info_count;
+ lan_client_flt_info_count++;
}
- memcpy(eth_bridge_usb_client_flt_info[client_position].mac, mac, sizeof(eth_bridge_usb_client_flt_info[client_position].mac));
+ memcpy(eth_bridge_lan_client_flt_info[client_position].mac, mac, sizeof(eth_bridge_lan_client_flt_info[client_position].mac));
if(iptype == IPA_IP_v4)
{
- eth_bridge_usb_client_flt_info[client_position].flt_rule_set_v4 = true;
- eth_bridge_usb_client_flt_info[client_position].flt_rule_hdl_v4 = usb_client_flt_rule_hdl_v4[i].rule_hdl;
+ eth_bridge_lan_client_flt_info[client_position].flt_rule_set_v4 = true;
+ eth_bridge_lan_client_flt_info[client_position].flt_rule_hdl_v4 = lan_client_flt_rule_hdl_v4[i].rule_hdl;
}
else
{
- eth_bridge_usb_client_flt_info[client_position].flt_rule_set_v6 = true;
- eth_bridge_usb_client_flt_info[client_position].flt_rule_hdl_v6 = usb_client_flt_rule_hdl_v6[i].rule_hdl;
+ eth_bridge_lan_client_flt_info[client_position].flt_rule_set_v6 = true;
+ eth_bridge_lan_client_flt_info[client_position].flt_rule_hdl_v6 = lan_client_flt_rule_hdl_v6[i].rule_hdl;
}
fail:
@@ -3809,7 +3803,7 @@
return res;
}
-int IPACM_Wlan::eth_bridge_del_usb_client_flt_rule(uint8_t* mac)
+int IPACM_Wlan::eth_bridge_del_lan_client_flt_rule(uint8_t* mac)
{
if(mac == NULL)
{
@@ -3817,36 +3811,36 @@
return IPACM_FAILURE;
}
- IPACMDBG_H("Receive USB client MAC 0x%02x%02x%02x%02x%02x%02x.\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
+ IPACMDBG_H("Receive LAN client MAC 0x%02x%02x%02x%02x%02x%02x.\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
int i, j, res = IPACM_SUCCESS;
- for(i=0; i<num_usb_client; i++)
+ for(i=0; i<lan_client_flt_info_count; i++)
{
- if(memcmp(eth_bridge_usb_client_flt_info[i].mac, mac, sizeof(eth_bridge_usb_client_flt_info[i].mac)) == 0)
+ if(memcmp(eth_bridge_lan_client_flt_info[i].mac, mac, sizeof(eth_bridge_lan_client_flt_info[i].mac)) == 0)
{
break;
}
}
- if(i == num_usb_client)
+ if(i == lan_client_flt_info_count)
{
- IPACMERR("Do not find the usb client.\n");
+ IPACMERR("Do not find the lan client.\n");
return IPACM_FAILURE;
}
- if(eth_bridge_usb_client_flt_info[i].flt_rule_set_v4 == true)
+ if(eth_bridge_lan_client_flt_info[i].flt_rule_set_v4 == true)
{
- if(reset_to_dummy_flt_rule(IPA_IP_v4, eth_bridge_usb_client_flt_info[i].flt_rule_hdl_v4) == IPACM_SUCCESS)
+ if(reset_to_dummy_flt_rule(IPA_IP_v4, eth_bridge_lan_client_flt_info[i].flt_rule_hdl_v4) == IPACM_SUCCESS)
{
- for(j=0; j<IPA_LAN_TO_LAN_MAX_USB_CLIENT; j++)
+ for(j=0; j<IPA_LAN_TO_LAN_MAX_LAN_CLIENT; j++)
{
- if(usb_client_flt_rule_hdl_v4[j].rule_hdl == eth_bridge_usb_client_flt_info[i].flt_rule_hdl_v4)
+ if(lan_client_flt_rule_hdl_v4[j].rule_hdl == eth_bridge_lan_client_flt_info[i].flt_rule_hdl_v4)
{
- usb_client_flt_rule_hdl_v4[j].valid = true;
+ lan_client_flt_rule_hdl_v4[j].valid = true;
break;
}
}
- if(j == IPA_LAN_TO_LAN_MAX_USB_CLIENT)
+ if(j == IPA_LAN_TO_LAN_MAX_LAN_CLIENT)
{
IPACMERR("Not finding the rule handle in handle pool.\n");
return IPACM_FAILURE;
@@ -3854,23 +3848,23 @@
}
else
{
- IPACMERR("Failed to delete the usb client specific flt rule.\n");
+ IPACMERR("Failed to delete the lan client specific flt rule.\n");
return IPACM_FAILURE;
}
}
- if(eth_bridge_usb_client_flt_info[i].flt_rule_set_v6 == true)
+ if(eth_bridge_lan_client_flt_info[i].flt_rule_set_v6 == true)
{
- if(reset_to_dummy_flt_rule(IPA_IP_v6, eth_bridge_usb_client_flt_info[i].flt_rule_hdl_v6) == IPACM_SUCCESS)
+ if(reset_to_dummy_flt_rule(IPA_IP_v6, eth_bridge_lan_client_flt_info[i].flt_rule_hdl_v6) == IPACM_SUCCESS)
{
- for(j=0; j<IPA_LAN_TO_LAN_MAX_USB_CLIENT; j++)
+ for(j=0; j<IPA_LAN_TO_LAN_MAX_LAN_CLIENT; j++)
{
- if(usb_client_flt_rule_hdl_v6[j].rule_hdl == eth_bridge_usb_client_flt_info[i].flt_rule_hdl_v6)
+ if(lan_client_flt_rule_hdl_v6[j].rule_hdl == eth_bridge_lan_client_flt_info[i].flt_rule_hdl_v6)
{
- usb_client_flt_rule_hdl_v6[j].valid = true;
+ lan_client_flt_rule_hdl_v6[j].valid = true;
break;
}
}
- if(j == IPA_LAN_TO_LAN_MAX_USB_CLIENT)
+ if(j == IPA_LAN_TO_LAN_MAX_LAN_CLIENT)
{
IPACMERR("Not finding the rule handle in handle pool.\n");
return IPACM_FAILURE;
@@ -3878,17 +3872,17 @@
}
else
{
- IPACMERR("Failed to delete the usb client specific flt rule.\n");
+ IPACMERR("Failed to delete the lan client specific flt rule.\n");
return IPACM_FAILURE;
}
}
- for(j=i+1; j<num_usb_client; j++)
+ for(j=i+1; j<lan_client_flt_info_count; j++)
{
- memcpy(&(eth_bridge_usb_client_flt_info[j-1]), &(eth_bridge_usb_client_flt_info[j]), sizeof(eth_bridge_client_flt_info));
+ memcpy(&(eth_bridge_lan_client_flt_info[j-1]), &(eth_bridge_lan_client_flt_info[j]), sizeof(eth_bridge_client_flt_info));
}
- memset(&(eth_bridge_usb_client_flt_info[num_usb_client-1]), 0, sizeof(eth_bridge_client_flt_info));
- num_usb_client--;
+ memset(&(eth_bridge_lan_client_flt_info[lan_client_flt_info_count-1]), 0, sizeof(eth_bridge_client_flt_info));
+ lan_client_flt_info_count--;
return res;
}
@@ -3954,7 +3948,7 @@
pFilteringTable->ip = iptype;
pFilteringTable->num_rules = 1;
- /* point to USB-WLAN routing table */
+ /* point to LAN-WLAN routing table */
memset(&flt_rule, 0, sizeof(struct ipa_flt_rule_mdfy));
flt_rule.status = -1;
@@ -4160,14 +4154,14 @@
return res;
}
-int IPACM_Wlan::eth_bridge_install_cache_usb_client_flt_rule(ipa_ip_type iptype)
+int IPACM_Wlan::eth_bridge_install_cache_lan_client_flt_rule(ipa_ip_type iptype)
{
int i;
- IPACMDBG_H("There are %d usb clients cached.\n", IPACM_Lan::num_usb_client);
- for(i=0; i<IPACM_Lan::num_usb_client; i++)
+ IPACMDBG_H("There are %d lan clients cached.\n", IPACM_Lan::num_lan_client);
+ for(i=0; i<IPACM_Lan::num_lan_client; i++)
{
- eth_bridge_add_usb_client_flt_rule(IPACM_Lan::eth_bridge_usb_client[i].mac, iptype);
+ eth_bridge_add_lan_client_flt_rule(IPACM_Lan::eth_bridge_lan_client[i].mac, iptype);
}
return IPACM_SUCCESS;
}
@@ -4199,7 +4193,7 @@
if(iptype == IPA_IP_v4)
{
if( (src == SRC_WLAN && wlan_client_rt_from_wlan_info_count_v4 == IPA_LAN_TO_LAN_MAX_WLAN_CLIENT)
- || (src == SRC_USB && wlan_client_rt_from_usb_info_count_v4 == IPA_LAN_TO_LAN_MAX_WLAN_CLIENT))
+ || (src == SRC_LAN && wlan_client_rt_from_lan_info_count_v4 == IPA_LAN_TO_LAN_MAX_WLAN_CLIENT))
{
IPACMDBG_H("WLAN client number has reached maximum.\n");
return IPACM_FAILURE;
@@ -4208,14 +4202,14 @@
else
{
if( (src == SRC_WLAN && wlan_client_rt_from_wlan_info_count_v6 == IPA_LAN_TO_LAN_MAX_WLAN_CLIENT)
- || (src == SRC_USB && wlan_client_rt_from_usb_info_count_v6 == IPA_LAN_TO_LAN_MAX_WLAN_CLIENT))
+ || (src == SRC_LAN && wlan_client_rt_from_lan_info_count_v6 == IPA_LAN_TO_LAN_MAX_WLAN_CLIENT))
{
IPACMDBG_H("WLAN client number has reached maximum.\n");
return IPACM_FAILURE;
}
}
if( (src == SRC_WLAN && IPACM_Lan::wlan_to_wlan_hdr_proc_ctx.valid == false)
- || (src == SRC_USB && IPACM_Lan::usb_to_wlan_hdr_proc_ctx.valid == false) )
+ || (src == SRC_LAN && IPACM_Lan::lan_to_wlan_hdr_proc_ctx.valid == false) )
{
IPACMDBG_H("Hdr proc ctx has not been set for source %d, don't add WLAN client routing rule.\n", src);
return IPACM_FAILURE;
@@ -4261,29 +4255,29 @@
{
if(iptype == IPA_IP_v4)
{
- for(i=0; i<wlan_client_rt_from_usb_info_count_v4; i++)
+ for(i=0; i<wlan_client_rt_from_lan_info_count_v4; i++)
{
- if(memcmp(eth_bridge_get_client_rt_info_ptr(i, SRC_USB, iptype)->mac, mac, sizeof(eth_bridge_get_client_rt_info_ptr(i, SRC_USB, iptype)->mac)) == 0)
+ if(memcmp(eth_bridge_get_client_rt_info_ptr(i, SRC_LAN, iptype)->mac, mac, sizeof(eth_bridge_get_client_rt_info_ptr(i, SRC_LAN, iptype)->mac)) == 0)
{
IPACMDBG_H("The client's routing rule was added before.\n");
return IPACM_SUCCESS;
}
}
- memcpy(eth_bridge_get_client_rt_info_ptr(wlan_client_rt_from_usb_info_count_v4, src, iptype)->mac, mac,
- sizeof(eth_bridge_get_client_rt_info_ptr(wlan_client_rt_from_usb_info_count_v4, src, iptype)->mac));
+ memcpy(eth_bridge_get_client_rt_info_ptr(wlan_client_rt_from_lan_info_count_v4, src, iptype)->mac, mac,
+ sizeof(eth_bridge_get_client_rt_info_ptr(wlan_client_rt_from_lan_info_count_v4, src, iptype)->mac));
}
else
{
- for(i=0; i<wlan_client_rt_from_usb_info_count_v6; i++)
+ for(i=0; i<wlan_client_rt_from_lan_info_count_v6; i++)
{
- if(memcmp(eth_bridge_get_client_rt_info_ptr(i, SRC_USB, iptype)->mac, mac, sizeof(eth_bridge_get_client_rt_info_ptr(i, SRC_USB, iptype)->mac)) == 0)
+ if(memcmp(eth_bridge_get_client_rt_info_ptr(i, SRC_LAN, iptype)->mac, mac, sizeof(eth_bridge_get_client_rt_info_ptr(i, SRC_LAN, iptype)->mac)) == 0)
{
IPACMDBG_H("The client's routing rule was added before.\n");
return IPACM_SUCCESS;
}
}
- memcpy(eth_bridge_get_client_rt_info_ptr(wlan_client_rt_from_usb_info_count_v6, src, iptype)->mac, mac,
- sizeof(eth_bridge_get_client_rt_info_ptr(wlan_client_rt_from_usb_info_count_v6, src, iptype)->mac));
+ memcpy(eth_bridge_get_client_rt_info_ptr(wlan_client_rt_from_lan_info_count_v6, src, iptype)->mac, mac,
+ sizeof(eth_bridge_get_client_rt_info_ptr(wlan_client_rt_from_lan_info_count_v6, src, iptype)->mac));
}
}
@@ -4323,11 +4317,11 @@
{
if(iptype == IPA_IP_v4)
{
- strncpy(rt_rule_table->rt_tbl_name, IPACM_Iface::ipacmcfg->rt_tbl_eth_bridge_usb_wlan_v4.name, sizeof(rt_rule_table->rt_tbl_name));
+ strncpy(rt_rule_table->rt_tbl_name, IPACM_Iface::ipacmcfg->rt_tbl_eth_bridge_lan_wlan_v4.name, sizeof(rt_rule_table->rt_tbl_name));
}
else
{
- strncpy(rt_rule_table->rt_tbl_name, IPACM_Iface::ipacmcfg->rt_tbl_eth_bridge_usb_wlan_v6.name, sizeof(rt_rule_table->rt_tbl_name));
+ strncpy(rt_rule_table->rt_tbl_name, IPACM_Iface::ipacmcfg->rt_tbl_eth_bridge_lan_wlan_v6.name, sizeof(rt_rule_table->rt_tbl_name));
}
}
@@ -4343,7 +4337,7 @@
}
else
{
- rt_rule.rule.hdr_proc_ctx_hdl = IPACM_Lan::usb_to_wlan_hdr_proc_ctx.proc_ctx_hdl;
+ rt_rule.rule.hdr_proc_ctx_hdl = IPACM_Lan::lan_to_wlan_hdr_proc_ctx.proc_ctx_hdl;
}
position = 0;
for(i=0; i<iface_query->num_tx_props; i++)
@@ -4380,9 +4374,9 @@
rt_rule.rule.attrib.attrib_mask |= IPA_FLT_MAC_DST_ADDR_802_3;
}
}
- else //packet is from USB
+ else //packet is from LAN
{
- if(IPACM_Lan::usb_hdr_type == IPA_HDR_L2_ETHERNET_II)
+ if(IPACM_Lan::lan_hdr_type == IPA_HDR_L2_ETHERNET_II)
{
rt_rule.rule.attrib.attrib_mask |= IPA_FLT_MAC_DST_ADDR_ETHER_II;
}
@@ -4437,22 +4431,22 @@
{
if(iptype == IPA_IP_v4)
{
- eth_bridge_get_client_rt_info_ptr(wlan_client_rt_from_usb_info_count_v4, src, iptype)->rt_rule_hdl[i] = rt_rule_table->rules[i].rt_rule_hdl;
+ eth_bridge_get_client_rt_info_ptr(wlan_client_rt_from_lan_info_count_v4, src, iptype)->rt_rule_hdl[i] = rt_rule_table->rules[i].rt_rule_hdl;
}
else
{
- eth_bridge_get_client_rt_info_ptr(wlan_client_rt_from_usb_info_count_v6, src, iptype)->rt_rule_hdl[i] = rt_rule_table->rules[i].rt_rule_hdl;
+ eth_bridge_get_client_rt_info_ptr(wlan_client_rt_from_lan_info_count_v6, src, iptype)->rt_rule_hdl[i] = rt_rule_table->rules[i].rt_rule_hdl;
}
}
if(iptype == IPA_IP_v4)
{
- wlan_client_rt_from_usb_info_count_v4++;
- IPACMDBG_H("Now the number of IPv4 rt rule on usb-wlan rt table is %d.\n", wlan_client_rt_from_usb_info_count_v4);
+ wlan_client_rt_from_lan_info_count_v4++;
+ IPACMDBG_H("Now the number of IPv4 rt rule on lan-wlan rt table is %d.\n", wlan_client_rt_from_lan_info_count_v4);
}
else
{
- wlan_client_rt_from_usb_info_count_v6++;
- IPACMDBG_H("Now the number of IPv6 rt rule on usb-wlan rt table is %d.\n", wlan_client_rt_from_usb_info_count_v6);
+ wlan_client_rt_from_lan_info_count_v6++;
+ IPACMDBG_H("Now the number of IPv6 rt rule on lan-wlan rt table is %d.\n", wlan_client_rt_from_lan_info_count_v6);
}
}
}
@@ -4502,7 +4496,7 @@
}
else
{
- for(i=0; i<wlan_client_rt_from_usb_info_count_v4; i++)
+ for(i=0; i<wlan_client_rt_from_lan_info_count_v4; i++)
{
if(memcmp(eth_bridge_get_client_rt_info_ptr(i, src, IPA_IP_v4)->mac, mac, sizeof(eth_bridge_get_client_rt_info_ptr(i, src, IPA_IP_v4)->mac)) == 0)
{
@@ -4511,7 +4505,7 @@
break;
}
}
- if(i == wlan_client_rt_from_usb_info_count_v4)
+ if(i == wlan_client_rt_from_lan_info_count_v4)
{
IPACMERR("The client is not found.\n");
return IPACM_FAILURE;
@@ -4539,13 +4533,13 @@
}
else
{
- for(i=position+1; i<wlan_client_rt_from_usb_info_count_v4; i++)
+ for(i=position+1; i<wlan_client_rt_from_lan_info_count_v4; i++)
{
memcpy(eth_bridge_get_client_rt_info_ptr(i-1, src, IPA_IP_v4), eth_bridge_get_client_rt_info_ptr(i, src, IPA_IP_v4), client_rt_info_size_v4);
}
- memset(eth_bridge_get_client_rt_info_ptr(wlan_client_rt_from_usb_info_count_v4-1, src, IPA_IP_v4), 0, client_rt_info_size_v4);
- wlan_client_rt_from_usb_info_count_v4--;
- IPACMDBG_H("Now the number of IPv4 rt rule from usb info is %d.\n", wlan_client_rt_from_usb_info_count_v4);
+ memset(eth_bridge_get_client_rt_info_ptr(wlan_client_rt_from_lan_info_count_v4-1, src, IPA_IP_v4), 0, client_rt_info_size_v4);
+ wlan_client_rt_from_lan_info_count_v4--;
+ IPACMDBG_H("Now the number of IPv4 rt rule from lan info is %d.\n", wlan_client_rt_from_lan_info_count_v4);
}
/*delete rt rules from IPv6 rt table */
@@ -4568,7 +4562,7 @@
}
else
{
- for(i=0; i<wlan_client_rt_from_usb_info_count_v6; i++)
+ for(i=0; i<wlan_client_rt_from_lan_info_count_v6; i++)
{
if(memcmp(eth_bridge_get_client_rt_info_ptr(i, src, IPA_IP_v6)->mac, mac, sizeof(eth_bridge_get_client_rt_info_ptr(i, src, IPA_IP_v6)->mac)) == 0)
{
@@ -4577,7 +4571,7 @@
break;
}
}
- if(i == wlan_client_rt_from_usb_info_count_v6)
+ if(i == wlan_client_rt_from_lan_info_count_v6)
{
IPACMERR("The client is not found.\n");
return IPACM_FAILURE;
@@ -4605,13 +4599,13 @@
}
else
{
- for(i=position+1; i<wlan_client_rt_from_usb_info_count_v6; i++)
+ for(i=position+1; i<wlan_client_rt_from_lan_info_count_v6; i++)
{
memcpy(eth_bridge_get_client_rt_info_ptr(i-1, src, IPA_IP_v6), eth_bridge_get_client_rt_info_ptr(i, src, IPA_IP_v6), client_rt_info_size_v6);
}
- memset(eth_bridge_get_client_rt_info_ptr(wlan_client_rt_from_usb_info_count_v6-1, src, IPA_IP_v6), 0, client_rt_info_size_v6);
- wlan_client_rt_from_usb_info_count_v6--;
- IPACMDBG_H("Now the number of IPv6 rt rule from usb info is %d.\n", wlan_client_rt_from_usb_info_count_v6);
+ memset(eth_bridge_get_client_rt_info_ptr(wlan_client_rt_from_lan_info_count_v6-1, src, IPA_IP_v6), 0, client_rt_info_size_v6);
+ wlan_client_rt_from_lan_info_count_v6--;
+ IPACMDBG_H("Now the number of IPv6 rt rule from lan info is %d.\n", wlan_client_rt_from_lan_info_count_v6);
}
return IPACM_SUCCESS;
@@ -4635,11 +4629,11 @@
{
if(iptype == IPA_IP_v4)
{
- result = (void*)((void*)eth_bridge_wlan_client_rt_from_usb_info_v4 + index * client_rt_info_size_v4);
+ result = (void*)((void*)eth_bridge_wlan_client_rt_from_lan_info_v4 + index * client_rt_info_size_v4);
}
else
{
- result = (void*)((void*)eth_bridge_wlan_client_rt_from_usb_info_v6 + index * client_rt_info_size_v6);
+ result = (void*)((void*)eth_bridge_wlan_client_rt_from_lan_info_v6 + index * client_rt_info_size_v6);
}
}
return (eth_bridge_client_rt_info*)result;
@@ -4659,9 +4653,20 @@
return;
}
+ int i;
+ for(i=0; i<IPACM_Lan::num_wlan_client; i++)
+ {
+ if(memcmp(IPACM_Lan::eth_bridge_wlan_client[i].mac, mac, sizeof(IPACM_Lan::eth_bridge_wlan_client[i].mac)) == 0)
+ {
+ IPACMDBG_H("The wlan client mac has been added before at position %d.\n", i);
+ return;
+ }
+ }
+
memcpy(IPACM_Lan::eth_bridge_wlan_client[IPACM_Lan::num_wlan_client].mac, mac, sizeof(IPACM_Lan::eth_bridge_wlan_client[IPACM_Lan::num_wlan_client].mac));
IPACM_Lan::eth_bridge_wlan_client[IPACM_Lan::num_wlan_client].ipa_if_num = if_num;
IPACM_Lan::num_wlan_client++;
+ IPACMDBG_H("Now the total num of wlan clients is %d", IPACM_Lan::num_wlan_client);
return;
}
@@ -4695,6 +4700,7 @@
IPACM_Lan::eth_bridge_wlan_client[j-1].ipa_if_num = IPACM_Lan::eth_bridge_wlan_client[j].ipa_if_num;
}
IPACM_Lan::num_wlan_client--;
+ IPACMDBG_H("Now the total num of wlan clients is %d", IPACM_Lan::num_wlan_client);
return;
}
@@ -4920,11 +4926,11 @@
return;
}
}
- if (IPACM_Lan::usb_to_wlan_hdr_proc_ctx.valid == true)
+ if (IPACM_Lan::lan_to_wlan_hdr_proc_ctx.valid == true)
{
- if (eth_bridge_modify_wlan_rt_rule(IPACM_Lan::eth_bridge_wlan_client[i].mac, SRC_USB, iptype) == IPACM_FAILURE)
+ if (eth_bridge_modify_wlan_rt_rule(IPACM_Lan::eth_bridge_wlan_client[i].mac, SRC_LAN, iptype) == IPACM_FAILURE)
{
- IPACMDBG_H("SCC/MCC switch is failed for iptype: %d src_iface: %d \n", iptype, SRC_USB);
+ IPACMDBG_H("SCC/MCC switch is failed for iptype: %d src_iface: %d \n", iptype, SRC_LAN);
return;
}
}
@@ -5007,7 +5013,7 @@
{
if (iptype == IPA_IP_v4)
{
- for (index = 0; index < wlan_client_rt_from_usb_info_count_v4; index++)
+ for (index = 0; index < wlan_client_rt_from_lan_info_count_v4; index++)
{
if (memcmp(eth_bridge_get_client_rt_info_ptr(index, src_iface, IPA_IP_v4)->mac, mac,
sizeof(eth_bridge_get_client_rt_info_ptr(index, src_iface, IPA_IP_v4)->mac)) == 0)
@@ -5017,7 +5023,7 @@
break;
}
}
- if (index == wlan_client_rt_from_usb_info_count_v4)
+ if (index == wlan_client_rt_from_lan_info_count_v4)
{
IPACMERR("The client is not found.\n");
return IPACM_FAILURE;
@@ -5025,7 +5031,7 @@
}
else
{
- for (index = 0; index < wlan_client_rt_from_usb_info_count_v6; index++)
+ for (index = 0; index < wlan_client_rt_from_lan_info_count_v6; index++)
{
if (memcmp(eth_bridge_get_client_rt_info_ptr(index, src_iface, IPA_IP_v6)->mac, mac,
sizeof(eth_bridge_get_client_rt_info_ptr(index, src_iface, IPA_IP_v6)->mac)) == 0)
@@ -5035,7 +5041,7 @@
break;
}
}
- if (index == wlan_client_rt_from_usb_info_count_v6)
+ if (index == wlan_client_rt_from_lan_info_count_v6)
{
IPACMERR("The client is not found.\n");
return IPACM_FAILURE;
@@ -5092,7 +5098,7 @@
else
{
rt_rule_entry->rule.hdr_proc_ctx_hdl =
- IPACM_Lan::usb_to_wlan_hdr_proc_ctx.proc_ctx_hdl;
+ IPACM_Lan::lan_to_wlan_hdr_proc_ctx.proc_ctx_hdl;
}
memcpy(&rt_rule_entry->rule.attrib,
@@ -5110,9 +5116,9 @@
rt_rule_entry->rule.attrib.attrib_mask |= IPA_FLT_MAC_DST_ADDR_802_3;
}
}
- else //packet is from USB
+ else //packet is from LAN
{
- if (IPACM_Lan::usb_hdr_type == IPA_HDR_L2_ETHERNET_II)
+ if (IPACM_Lan::lan_hdr_type == IPA_HDR_L2_ETHERNET_II)
{
rt_rule_entry->rule.attrib.attrib_mask |= IPA_FLT_MAC_DST_ADDR_ETHER_II;
}