diff options
author | Bruno Martins <bgcngm@gmail.com> | 2016-11-17 22:53:39 +0000 |
---|---|---|
committer | davidevinavil <davidevinavil@gmail.com> | 2017-01-21 18:22:21 +0100 |
commit | 818d87b312de5d56937381b551abe084bba72c9f (patch) | |
tree | df5fa61d4888d405451457a06fdf579f6cffc79c /data-ipa-cfg-mgr/ipacm/src/IPACM_IfaceManager.cpp | |
parent | e92469a9912251fcc57cc8f97390c72d8078adfa (diff) |
z2_plus: Update IPACM from upstream
* Tag LA.UM.5.5.r1-00100-8x96.0
Change-Id: Ia960f038ffcec1a7d93b1bd205b777d05c786cf3
Diffstat (limited to 'data-ipa-cfg-mgr/ipacm/src/IPACM_IfaceManager.cpp')
-rw-r--r-- | data-ipa-cfg-mgr/ipacm/src/IPACM_IfaceManager.cpp | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/data-ipa-cfg-mgr/ipacm/src/IPACM_IfaceManager.cpp b/data-ipa-cfg-mgr/ipacm/src/IPACM_IfaceManager.cpp index d6ad9a5..ef5e0a0 100644 --- a/data-ipa-cfg-mgr/ipacm/src/IPACM_IfaceManager.cpp +++ b/data-ipa-cfg-mgr/ipacm/src/IPACM_IfaceManager.cpp @@ -83,6 +83,11 @@ void IPACM_IfaceManager::event_callback(ipa_cm_event_id event, void *param) case IPA_BRIDGE_LINK_UP_EVENT: IPACMDBG_H(" Save the bridge0 mac info in IPACM_cfg \n"); ipa_interface_index = IPACM_Iface::iface_ipa_index_query(data_all->if_index); + /* check for failure return */ + if (IPACM_FAILURE == ipa_interface_index) { + IPACMERR("IPA_BRIDGE_LINK_UP_EVENT: not supported iface id: %d\n", data_all->if_index); + break; + } /* check if iface is bridge interface*/ if (strcmp(IPACM_Iface::ipacmcfg->ipa_virtual_iface_name, IPACM_Iface::ipacmcfg->iface_table[ipa_interface_index].iface_name) == 0) { @@ -98,6 +103,11 @@ void IPACM_IfaceManager::event_callback(ipa_cm_event_id event, void *param) case IPA_LINK_UP_EVENT: IPACMDBG_H("Recieved IPA_LINK_UP_EVENT event: link up %d: \n", evt_data->if_index); ipa_interface_index = IPACM_Iface::iface_ipa_index_query(evt_data->if_index); + /* check for failure return */ + if (IPACM_FAILURE == ipa_interface_index) { + IPACMERR("IPA_LINK_UP_EVENT: not supported iface id: %d\n", evt_data->if_index); + break; + } /* LTE-backhaul */ if(IPACM_Iface::ipacmcfg->iface_table[ipa_interface_index].if_cat == EMBMS_IF) { @@ -115,6 +125,11 @@ void IPACM_IfaceManager::event_callback(ipa_cm_event_id event, void *param) case IPA_USB_LINK_UP_EVENT: IPACMDBG_H("Recieved IPA_USB_LINK_UP_EVENT event: link up %d: \n", evt_data->if_index); ipa_interface_index = IPACM_Iface::iface_ipa_index_query(evt_data->if_index); + /* check for failure return */ + if (IPACM_FAILURE == ipa_interface_index) { + IPACMERR("IPA_USB_LINK_UP_EVENT: not supported iface id: %d\n", evt_data->if_index); + break; + } /* check if it's WAN_IF */ if(IPACM_Iface::ipacmcfg->iface_table[ipa_interface_index].if_cat == WAN_IF) { @@ -134,6 +149,11 @@ void IPACM_IfaceManager::event_callback(ipa_cm_event_id event, void *param) case IPA_WLAN_AP_LINK_UP_EVENT: ipa_interface_index = IPACM_Iface::iface_ipa_index_query(evt_data->if_index); + /* check for failure return */ + if (IPACM_FAILURE == ipa_interface_index) { + IPACMERR("IPA_WLAN_AP_LINK_UP_EVENT: not supported iface id: %d\n", evt_data->if_index); + break; + } /* change iface category from unknown to WLAN_IF */ if(IPACM_Iface::ipacmcfg->iface_table[ipa_interface_index].if_cat == UNKNOWN_IF) { @@ -151,6 +171,11 @@ void IPACM_IfaceManager::event_callback(ipa_cm_event_id event, void *param) case IPA_WLAN_STA_LINK_UP_EVENT: ipa_interface_index = IPACM_Iface::iface_ipa_index_query(StaData->if_index); + /* check for failure return */ + if (IPACM_FAILURE == ipa_interface_index) { + IPACMERR("IPA_WLAN_STA_LINK_UP_EVENT: not supported iface id: %d\n", StaData->if_index); + break; + } /* change iface category from unknown to WAN_IF */ if(IPACM_Iface::ipacmcfg->iface_table[ipa_interface_index].if_cat == UNKNOWN_IF) { @@ -175,6 +200,11 @@ void IPACM_IfaceManager::event_callback(ipa_cm_event_id event, void *param) /* Add new instance open for eMBMS iface and wan iface */ case IPA_WAN_EMBMS_LINK_UP_EVENT: ipa_interface_index = IPACM_Iface::iface_ipa_index_query(evt_data->if_index); + /* check for failure return */ + if (IPACM_FAILURE == ipa_interface_index) { + IPACMERR("IPA_WAN_EMBMS_LINK_UP_EVENT: not supported iface id: %d\n", evt_data->if_index); + break; + } /* change iface category from unknown to EMBMS_IF */ if ((IPACM_Iface::ipacmcfg->ipacm_odu_enable == true) && (IPACM_Iface::ipacmcfg->ipacm_odu_embms_enable == true)) { @@ -250,6 +280,7 @@ int IPACM_IfaceManager::create_iface_instance(ipacm_ifacemgr_data *param) #endif IPACM_EvtDispatcher::registr(IPA_CRADLE_WAN_MODE_SWITCH, lan); IPACM_EvtDispatcher::registr(IPA_LINK_DOWN_EVENT, lan); + /* IPA_LAN_DELETE_SELF should be always last */ IPACM_EvtDispatcher::registr(IPA_LAN_DELETE_SELF, lan); IPACMDBG_H("ipa_LAN (%s):ipa_index (%d) instance open/registr ok\n", lan->dev_name, lan->ipa_if_num); registr(ipa_interface_index, lan); @@ -272,6 +303,7 @@ int IPACM_IfaceManager::create_iface_instance(ipacm_ifacemgr_data *param) IPACM_EvtDispatcher::registr(IPA_HANDLE_WAN_DOWN_V6, ETH); IPACM_EvtDispatcher::registr(IPA_CRADLE_WAN_MODE_SWITCH, ETH); IPACM_EvtDispatcher::registr(IPA_LINK_DOWN_EVENT, ETH); + /* IPA_LAN_DELETE_SELF should be always last */ IPACM_EvtDispatcher::registr(IPA_LAN_DELETE_SELF, ETH); IPACMDBG_H("ipa_LAN (%s):ipa_index (%d) instance open/registr ok\n", ETH->dev_name, ETH->ipa_if_num); registr(ipa_interface_index, ETH); @@ -297,6 +329,7 @@ int IPACM_IfaceManager::create_iface_instance(ipacm_ifacemgr_data *param) IPACM_EvtDispatcher::registr(IPA_HANDLE_WAN_DOWN_V6, odu); IPACM_EvtDispatcher::registr(IPA_CRADLE_WAN_MODE_SWITCH, odu); IPACM_EvtDispatcher::registr(IPA_LINK_DOWN_EVENT, odu); + /* IPA_LAN_DELETE_SELF should be always last */ IPACM_EvtDispatcher::registr(IPA_LAN_DELETE_SELF, odu); IPACMDBG_H("ipa_LAN (%s):ipa_index (%d) instance open/registr ok\n", odu->dev_name, odu->ipa_if_num); registr(ipa_interface_index, odu); @@ -312,6 +345,7 @@ int IPACM_IfaceManager::create_iface_instance(ipacm_ifacemgr_data *param) IPACM_EvtDispatcher::registr(IPA_SW_ROUTING_ENABLE, odu); IPACM_EvtDispatcher::registr(IPA_SW_ROUTING_DISABLE, odu); IPACM_EvtDispatcher::registr(IPA_LINK_DOWN_EVENT, odu); + /* IPA_LAN_DELETE_SELF should be always last */ IPACM_EvtDispatcher::registr(IPA_LAN_DELETE_SELF, odu); IPACMDBG_H("ipa_LAN (%s):ipa_index (%d) instance open/registr ok\n", odu->dev_name, odu->ipa_if_num); registr(ipa_interface_index, odu); @@ -352,17 +386,18 @@ int IPACM_IfaceManager::create_iface_instance(ipacm_ifacemgr_data *param) #endif IPACM_EvtDispatcher::registr(IPA_CRADLE_WAN_MODE_SWITCH, wl); IPACM_EvtDispatcher::registr(IPA_WLAN_LINK_DOWN_EVENT, wl); - IPACM_EvtDispatcher::registr(IPA_LAN_DELETE_SELF, wl); #ifndef FEATURE_IPA_ANDROID IPACM_EvtDispatcher::registr(IPA_WLAN_SWITCH_TO_SCC, wl); IPACM_EvtDispatcher::registr(IPA_WLAN_SWITCH_TO_MCC, wl); #else IPACM_EvtDispatcher::registr(IPA_TETHERING_STATS_UPDATE_EVENT, wl); #endif + /* IPA_LAN_DELETE_SELF should be always last */ + IPACM_EvtDispatcher::registr(IPA_LAN_DELETE_SELF, wl); IPACMDBG_H("ipa_WLAN (%s):ipa_index (%d) instance open/registr ok\n", wl->dev_name, wl->ipa_if_num); registr(ipa_interface_index, wl); /* solve the new_addr comes earlier issue */ - IPACM_Iface::iface_addr_query(if_index); + IPACM_Iface::iface_addr_query(if_index); } break; |