summaryrefslogtreecommitdiff
path: root/msm8998/ipacm/src/IPACM_Wan.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'msm8998/ipacm/src/IPACM_Wan.cpp')
-rw-r--r--msm8998/ipacm/src/IPACM_Wan.cpp66
1 files changed, 28 insertions, 38 deletions
diff --git a/msm8998/ipacm/src/IPACM_Wan.cpp b/msm8998/ipacm/src/IPACM_Wan.cpp
index 43bffe3..0a52ad5 100644
--- a/msm8998/ipacm/src/IPACM_Wan.cpp
+++ b/msm8998/ipacm/src/IPACM_Wan.cpp
@@ -714,13 +714,14 @@ void IPACM_Wan::event_callback(ipa_cm_event_id event, void *param)
{
ipacm_event_data_iptype *data = (ipacm_event_data_iptype *)param;
ipa_interface_index = iface_ipa_index_query(data->if_index);
+#ifndef FEATURE_IPACM_HAL
/* add the check see if tether_iface is valid or not */
if (iface_ipa_index_query(data->if_index_tether) == INVALID_IFACE)
{
IPACMERR("UPSTREAM_ROUTE_ADD tether_if(%d), not valid ignore\n", INVALID_IFACE);
return;
}
-
+#endif
if (ipa_interface_index == ipa_if_num)
{
IPACMDBG_H("Received IPA_WAN_UPSTREAM_ROUTE_ADD_EVENT (Android) for ip-type (%d)\n", data->iptype);
@@ -738,12 +739,16 @@ void IPACM_Wan::event_callback(ipa_cm_event_id event, void *param)
#else
IPACMDBG_H("adding routing table(upstream), dev (%s) ip-type(%d)\n", dev_name,data->iptype);
#endif
- handle_route_add_evt(data->iptype);
+ handle_route_add_evt(data->iptype); //sky
}
#ifdef FEATURE_IPA_ANDROID
+#ifdef FEATURE_IPACM_HAL
+ post_wan_up_tether_evt(data->iptype, 0);
+#else
/* using ipa_if_index, not netdev_index */
post_wan_up_tether_evt(data->iptype, iface_ipa_index_query(data->if_index_tether));
#endif
+#endif
}
else if ((data->iptype == IPA_IP_v6) && (ip_type == IPA_IP_v6 || ip_type == IPA_IP_MAX))
{
@@ -770,9 +775,13 @@ void IPACM_Wan::event_callback(ipa_cm_event_id event, void *param)
handle_route_add_evt(data->iptype);
}
#ifdef FEATURE_IPA_ANDROID
+#ifdef FEATURE_IPACM_HAL
+ post_wan_up_tether_evt(data->iptype, 0);
+#else
/* using ipa_if_index, not netdev_index */
post_wan_up_tether_evt(data->iptype, iface_ipa_index_query(data->if_index_tether));
#endif
+#endif
}
}
else /* double check if current default iface is not itself */
@@ -818,13 +827,14 @@ void IPACM_Wan::event_callback(ipa_cm_event_id event, void *param)
{
ipacm_event_data_iptype *data = (ipacm_event_data_iptype *)param;
ipa_interface_index = iface_ipa_index_query(data->if_index);
+#ifndef FEATURE_IPACM_HAL
/* add the check see if tether_iface is valid or not */
if (iface_ipa_index_query(data->if_index_tether) == INVALID_IFACE)
{
IPACMERR("UPSTREAM_ROUTE_DEL tether_if(%d), not valid ignore\n", INVALID_IFACE);
return;
}
-
+#endif
if (ipa_interface_index == ipa_if_num)
{
IPACMDBG_H("Received IPA_WAN_UPSTREAM_ROUTE_DEL_EVENT\n");
@@ -833,6 +843,9 @@ void IPACM_Wan::event_callback(ipa_cm_event_id event, void *param)
IPACMDBG_H("get del default v4 route (dst:0.0.0.0)\n");
wan_v4_addr_gw_set = false;
#ifdef FEATURE_IPA_ANDROID
+#ifdef FEATURE_IPACM_HAL
+ post_wan_down_tether_evt(data->iptype, 0);
+#else
/* using ipa_if_index, not netdev_index */
post_wan_down_tether_evt(data->iptype, iface_ipa_index_query(data->if_index_tether));
/* no any ipv4 tether iface support*/
@@ -842,6 +855,7 @@ void IPACM_Wan::event_callback(ipa_cm_event_id event, void *param)
return;
}
#endif
+#endif
if(m_is_sta_mode == Q6_WAN)
{
del_wan_firewall_rule(IPA_IP_v4);
@@ -857,6 +871,10 @@ void IPACM_Wan::event_callback(ipa_cm_event_id event, void *param)
else if ((data->iptype == IPA_IP_v6) && (active_v6 == true))
{
#ifdef FEATURE_IPA_ANDROID
+#ifdef FEATURE_IPACM_HAL
+ post_wan_down_tether_evt(data->iptype, 0);
+#else
+
/* using ipa_if_index, not netdev_index */
post_wan_down_tether_evt(data->iptype, iface_ipa_index_query(data->if_index_tether));
/* no any ipv6 tether iface support*/
@@ -866,6 +884,7 @@ void IPACM_Wan::event_callback(ipa_cm_event_id event, void *param)
return;
}
#endif
+#endif
if(m_is_sta_mode == Q6_WAN)
{
del_wan_firewall_rule(IPA_IP_v6);
@@ -4291,8 +4310,7 @@ int IPACM_Wan::config_dft_embms_rules(ipa_ioc_add_flt_rule *pFilteringTable_v4,
int IPACM_Wan::handle_down_evt()
{
int res = IPACM_SUCCESS;
- int i, tether_total;
- int ipa_if_num_tether_tmp[IPA_MAX_IFACE_ENTRIES];
+ int i;
IPACMDBG_H(" wan handle_down_evt \n");
@@ -4313,50 +4331,22 @@ int IPACM_Wan::handle_down_evt()
/* make sure default routing rules and firewall rules are deleted*/
if (active_v4)
{
- if (rx_prop != NULL)
- {
+ if (rx_prop != NULL)
+ {
del_dft_firewall_rules(IPA_IP_v4);
}
handle_route_del_evt(IPA_IP_v4);
IPACMDBG_H("Delete default v4 routing rules\n");
-#ifdef IPA_WAN_MSG_IPv6_ADDR_GW_LEN
- /* posting wan_down_tether for all lan clients */
- for (i=0; i < IPACM_Wan::ipa_if_num_tether_v4_total; i++)
- {
- ipa_if_num_tether_tmp[i] = IPACM_Wan::ipa_if_num_tether_v4[i];
- }
- tether_total = IPACM_Wan::ipa_if_num_tether_v4_total;
- for (i=0; i < tether_total; i++)
- {
- post_wan_down_tether_evt(IPA_IP_v4, ipa_if_num_tether_tmp[i]);
- IPACMDBG_H("post_wan_down_tether_v4 iface(%d: %s)\n", i,
- IPACM_Iface::ipacmcfg->iface_table[ipa_if_num_tether_tmp[i]].iface_name);
- }
-#endif
}
if (active_v6)
{
- if (rx_prop != NULL)
- {
+ if (rx_prop != NULL)
+ {
del_dft_firewall_rules(IPA_IP_v6);
}
handle_route_del_evt(IPA_IP_v6);
IPACMDBG_H("Delete default v6 routing rules\n");
-#ifdef IPA_WAN_MSG_IPv6_ADDR_GW_LEN
- /* posting wan_down_tether for all lan clients */
- for (i=0; i < IPACM_Wan::ipa_if_num_tether_v6_total; i++)
- {
- ipa_if_num_tether_tmp[i] = IPACM_Wan::ipa_if_num_tether_v6[i];
- }
- tether_total = IPACM_Wan::ipa_if_num_tether_v6_total;
- for (i=0; i < tether_total; i++)
- {
- post_wan_down_tether_evt(IPA_IP_v6, ipa_if_num_tether_tmp[i]);
- IPACMDBG_H("post_wan_down_tether_v6 iface(%d: %s)\n", i,
- IPACM_Iface::ipacmcfg->iface_table[ipa_if_num_tether_tmp[i]].iface_name);
- }
-#endif
}
/* Delete default v4 RT rule */
@@ -4637,7 +4627,7 @@ int IPACM_Wan::handle_down_evt_ex()
del_wan_firewall_rule(IPA_IP_v6);
install_wan_filtering_rule(false);
handle_route_del_evt_ex(IPA_IP_v6);
-#ifdef FEATURE_IPA_ANDROID //sky
+#ifdef FEATURE_IPA_ANDROID
/* posting wan_down_tether for all lan clients */
for (i=0; i < IPACM_Wan::ipa_if_num_tether_v6_total; i++)
{