summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqctecmdr <qctecmdr@localhost>2019-05-17 12:30:10 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2019-05-17 12:30:10 -0700
commit16762ab162d2cf4960eb921ceba8b1afbd566027 (patch)
treedf0ca269fa1993bea0ab188fa84f5f962fb69f60
parenteb26a95ee08414bf0b891f887a528f1a1cbe7ea9 (diff)
parentd8cb0c44c66e89fa67a9f9ea5465cbe5887d9c73 (diff)
downloadipacfg-mgr-16762ab162d2cf4960eb921ceba8b1afbd566027.tar.gz
Merge "ipacm: add support on softap intra-bss hw-offload"
-rw-r--r--ipacm/inc/IPACM_LanToLan.h3
-rw-r--r--ipacm/src/Android.mk5
-rw-r--r--ipacm/src/IPACM_Lan.cpp11
-rw-r--r--ipacm/src/IPACM_LanToLan.cpp33
-rw-r--r--ipacm/src/IPACM_Main.cpp4
5 files changed, 36 insertions, 20 deletions
diff --git a/ipacm/inc/IPACM_LanToLan.h b/ipacm/inc/IPACM_LanToLan.h
index 66a1835..f1b7aae 100644
--- a/ipacm/inc/IPACM_LanToLan.h
+++ b/ipacm/inc/IPACM_LanToLan.h
@@ -45,9 +45,8 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef FEATURE_IPA_ANDROID
#include <libxml/list.h>
-#else/* defined(FEATURE_IPA_ANDROID) */
+#endif /* defined(FEATURE_IPA_ANDROID) */
#include <list>
-#endif /* ndefined(FEATURE_IPA_ANDROID)*/
#define MAX_NUM_CACHED_CLIENT_ADD_EVENT 10
#define MAX_NUM_IFACE 10
diff --git a/ipacm/src/Android.mk b/ipacm/src/Android.mk
index ad78975..78753b4 100644
--- a/ipacm/src/Android.mk
+++ b/ipacm/src/Android.mk
@@ -28,6 +28,8 @@ LOCAL_ADDITIONAL_DEPENDENCIES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
LOCAL_CFLAGS := -v
LOCAL_CFLAGS += -DFEATURE_IPA_ANDROID
LOCAL_CFLAGS += -DFEATURE_IPACM_RESTART
+LOCAL_CFLAGS += -DFEATURE_ETH_BRIDGE_LE
+
LOCAL_CFLAGS += -DFEATURE_IPACM_HAL -Wall -Werror -Wno-error=macro-redefined
ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
LOCAL_CFLAGS += -DDEBUG
@@ -61,7 +63,8 @@ LOCAL_SRC_FILES := IPACM_Main.cpp \
IPACM_ConntrackClient.cpp \
IPACM_ConntrackListener.cpp \
IPACM_Log.cpp \
- IPACM_OffloadManager.cpp
+ IPACM_OffloadManager.cpp \
+ IPACM_LanToLan.cpp
LOCAL_MODULE := ipacm
LOCAL_INIT_RC := ipacm.rc
diff --git a/ipacm/src/IPACM_Lan.cpp b/ipacm/src/IPACM_Lan.cpp
index 0ad772d..827839b 100644
--- a/ipacm/src/IPACM_Lan.cpp
+++ b/ipacm/src/IPACM_Lan.cpp
@@ -4619,6 +4619,17 @@ void IPACM_Lan::eth_bridge_post_event(ipa_cm_event_id evt, ipa_ip_type iptype, u
#ifdef FEATURE_L2TP
ipacm_event_data_all *evt_data_all;
#endif
+
+
+/* not enable rndis for lan2lan HW-offload due to android limitation */
+#ifdef FEATURE_IPA_ANDROID
+ if(ipa_if_cate == LAN_IF)
+ {
+ IPACMDBG_H("This is LAN IF (%s):ipa_index (%d) skip lan2lan events for Android \n", IPACM_Iface::ipacmcfg->iface_table[ipa_if_num].iface_name, ipa_if_num);
+ return;
+ }
+#endif
+
if(ipv6_addr)
{
IPACMDBG_H("IPv6 addr: %08x:%08x:%08x:%08x \n", ipv6_addr[0],
diff --git a/ipacm/src/IPACM_LanToLan.cpp b/ipacm/src/IPACM_LanToLan.cpp
index ca39327..ea016ef 100644
--- a/ipacm/src/IPACM_LanToLan.cpp
+++ b/ipacm/src/IPACM_LanToLan.cpp
@@ -143,14 +143,15 @@ bool IPACM_LanToLan::has_l2tp_iface()
void IPACM_LanToLan::event_callback(ipa_cm_event_id event, void* param)
{
ipacm_event_eth_bridge *eth_bridge_data;
- ipa_ioc_vlan_iface_info *vlan_iface_data;
-
+ const char *eventName = IPACM_Iface::ipacmcfg->getEventName(event);
#ifdef FEATURE_L2TP
+ ipa_ioc_vlan_iface_info *vlan_iface_data;
ipa_ioc_l2tp_vlan_mapping_info *l2tp_vlan_mapping_data;
-#endif
ipacm_event_data_all *vlan_data;
+#endif
- IPACMDBG_H("Get %s event.\n", IPACM_Iface::ipacmcfg->getEventName(event));
+ if (eventName != NULL)
+ IPACMDBG_H("Get %s event.\n", eventName);
switch(event)
{
@@ -240,7 +241,9 @@ void IPACM_LanToLan::handle_iface_up(ipacm_event_eth_bridge *data)
{
list<IPACM_LanToLan_Iface>::iterator it;
list<l2tp_vlan_mapping_info>::iterator it_mapping;
+#ifdef FEATURE_L2TP
bool has_l2tp_iface = false;
+#endif
IPACMDBG_H("Interface name: %s IP type: %d\n", data->p_iface->dev_name, data->iptype);
for(it = m_iface.begin(); it != m_iface.end(); it++)
@@ -290,7 +293,7 @@ void IPACM_LanToLan::handle_iface_up(ipacm_event_eth_bridge *data)
new_iface.set_m_is_ip_addr_assigned(data->iptype, true);
m_iface.push_front(new_iface);
- IPACMDBG_H("Now the total number of interfaces is %d.\n", m_iface.size());
+ IPACMDBG_H("Now the total number of interfaces is %zu.\n", m_iface.size());
IPACM_LanToLan_Iface &front_iface = m_iface.front();
#ifdef FEATURE_L2TP
@@ -350,7 +353,9 @@ void IPACM_LanToLan::handle_iface_up(ipacm_event_eth_bridge *data)
void IPACM_LanToLan::handle_iface_down(ipacm_event_eth_bridge *data)
{
list<IPACM_LanToLan_Iface>::iterator it_target_iface;
+#ifdef FEATURE_L2TP
bool has_l2tp_iface = false;
+#endif
IPACMDBG_H("Interface name: %s\n", data->p_iface->dev_name);
@@ -822,7 +827,7 @@ void IPACM_LanToLan::print_data_structure_info()
IPACMDBG_H("Is there l2tp interface? %d\n", m_has_l2tp_iface);
#ifdef FEATURE_L2TP
- IPACMDBG_H("There are %d vlan interfaces.\n", m_vlan_iface.size());
+ IPACMDBG_H("There are %zu vlan interfaces.\n", m_vlan_iface.size());
for(it_vlan = m_vlan_iface.begin(); it_vlan != m_vlan_iface.end(); it_vlan++)
{
IPACMDBG_H("Vlan iface: %s, id: %d, ipv6 addr: 0x%08x%08x%08x%08x\n", it_vlan->vlan_iface_name,
@@ -835,7 +840,7 @@ void IPACM_LanToLan::print_data_structure_info()
it_vlan->vlan_client_ipv6_addr[3]);
}
- IPACMDBG_H("There are %d vlan-l2tp mapping.\n", m_l2tp_vlan_mapping.size());
+ IPACMDBG_H("There are %zu vlan-l2tp mapping.\n", m_l2tp_vlan_mapping.size());
for(it_mapping = m_l2tp_vlan_mapping.begin(); it_mapping != m_l2tp_vlan_mapping.end(); it_mapping++)
{
IPACMDBG_H("L2tp iface: %s, session id: %d\n", it_mapping->l2tp_iface_name, it_mapping->l2tp_session_id);
@@ -851,13 +856,13 @@ void IPACM_LanToLan::print_data_structure_info()
it_mapping->l2tp_client_mac[2], it_mapping->l2tp_client_mac[3], it_mapping->l2tp_client_mac[4], it_mapping->l2tp_client_mac[5]);
}
#endif
- IPACMDBG_H("There are %d interfaces in total.\n", m_iface.size());
+ IPACMDBG_H("There are %zu interfaces in total.\n", m_iface.size());
for(it = m_iface.begin(); it != m_iface.end(); it++)
{
it->print_data_structure_info();
}
- IPACMDBG_H("There are %d cached client add events in total.\n", m_cached_client_add_event.size());
+ IPACMDBG_H("There are %zu cached client add events in total.\n", m_cached_client_add_event.size());
i = 1;
for(it_event = m_cached_client_add_event.begin(); it_event != m_cached_client_add_event.end(); it_event++)
@@ -1775,10 +1780,10 @@ void IPACM_LanToLan_Iface::print_data_structure_info()
IPACMDBG_H("Hdr proc ctx for l2tp: %d\n", hdr_proc_ctx_for_l2tp);
i = 1;
- IPACMDBG_H("There are %d clients in total.\n", m_client_info.size());
+ IPACMDBG_H("There are %zu clients in total.\n", m_client_info.size());
for(it_client = m_client_info.begin(); it_client != m_client_info.end(); it_client++)
{
- IPACMDBG_H("Client %d MAC: 0x%02x%02x%02x%02x%02x%02x Pointer: 0x%08x\n", i, it_client->mac_addr[0], it_client->mac_addr[1],
+ IPACMDBG_H("Client %d MAC: 0x%02x%02x%02x%02x%02x%02x Pointer: 0x%p\n", i, it_client->mac_addr[0], it_client->mac_addr[1],
it_client->mac_addr[2], it_client->mac_addr[3], it_client->mac_addr[4], it_client->mac_addr[5], &(*it_client));
IPACMDBG_H("Is l2tp client? %d\n", it_client->is_l2tp_client);
if(it_client->is_l2tp_client && it_client->mapping_info)
@@ -1877,7 +1882,7 @@ void IPACM_LanToLan_Iface::print_data_structure_info()
i++;
}
- IPACMDBG_H("There are %d peer interfaces in total.\n", m_peer_iface_info.size());
+ IPACMDBG_H("There are %zu peer interfaces in total.\n", m_peer_iface_info.size());
for(it_peer = m_peer_iface_info.begin(); it_peer != m_peer_iface_info.end(); it_peer++)
{
print_peer_info(&(*it_peer));
@@ -1899,10 +1904,10 @@ void IPACM_LanToLan_Iface::print_peer_info(peer_iface_info *peer_info)
IPACMDBG_H("Printing peer info for iface %s:\n", peer_info->peer->m_p_iface->dev_name);
- IPACMDBG_H("There are %d flt info in total.\n", peer_info->flt_rule.size());
+ IPACMDBG_H("There are %zu flt info in total.\n", peer_info->flt_rule.size());
for(it_flt = peer_info->flt_rule.begin(); it_flt != peer_info->flt_rule.end(); it_flt++)
{
- IPACMDBG_H("Flt rule handle for client 0x%08x:\n", it_flt->p_client);
+ IPACMDBG_H("Flt rule handle for client 0x%p:\n", it_flt->p_client);
if(m_is_ip_addr_assigned[IPA_IP_v4])
{
IPACMDBG_H("IPv4 %d\n", it_flt->flt_rule_hdl[IPA_IP_v4]);
diff --git a/ipacm/src/IPACM_Main.cpp b/ipacm/src/IPACM_Main.cpp
index f17a951..04f8a89 100644
--- a/ipacm/src/IPACM_Main.cpp
+++ b/ipacm/src/IPACM_Main.cpp
@@ -74,10 +74,7 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <HAL.h>
#endif
-/* not defined(FEATURE_IPA_ANDROID)*/
-#ifndef FEATURE_IPA_ANDROID
#include "IPACM_LanToLan.h"
-#endif
#define IPA_DRIVER "/dev/ipa"
@@ -907,6 +904,7 @@ int main(int argc, char **argv)
#ifdef FEATURE_ETH_BRIDGE_LE
IPACM_LanToLan* lan2lan = IPACM_LanToLan::get_instance();
+ IPACMDBG_H("Staring IPACM_LanToLan instance %p\n", lan2lan);
#endif
CtList = new IPACM_ConntrackListener();