summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Yi <byi@google.com>2018-11-28 18:34:32 -0800
committerBill Yi <byi@google.com>2018-11-28 18:34:32 -0800
commit0084ce4a05cdb2d55495beee2ab51b3949d8bff1 (patch)
treea7532e9e9c560a566d831821d6f4c1ff6c75c623
parentc55897bd5cd54e9014a8bce22324a72bd4d63873 (diff)
parent1881ba372e760e1281d01cb899132731751f7f41 (diff)
downloadipacfg-mgr-0084ce4a05cdb2d55495beee2ab51b3949d8bff1.tar.gz
Merge pi-qpr1-release PQ1A.181105.017.A1 to pi-platform-releasepie-platform-release
Change-Id: I6bb0fb88cf4e244b6fb43bb18fe659e2edb44640
-rw-r--r--ipacm/inc/IPACM_Iface.h3
-rw-r--r--ipacm/src/Android.mk2
-rw-r--r--ipacm/src/IPACM_Iface.cpp9
-rw-r--r--ipacm/src/IPACM_IfaceManager.cpp24
-rw-r--r--ipacm/src/IPACM_OffloadManager.cpp8
-rw-r--r--ipacm/src/IPACM_Wlan.cpp2
-rw-r--r--os_pickup.bp3
7 files changed, 42 insertions, 9 deletions
diff --git a/ipacm/inc/IPACM_Iface.h b/ipacm/inc/IPACM_Iface.h
index 2e18f51..8ff7450 100644
--- a/ipacm/inc/IPACM_Iface.h
+++ b/ipacm/inc/IPACM_Iface.h
@@ -1,5 +1,5 @@
/*
-Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
+Copyright (c) 2013-2018, The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@@ -144,6 +144,7 @@ public:
/* software routing disable */
virtual int handle_software_routing_disable(void);
+ void delete_iface(void);
private:
diff --git a/ipacm/src/Android.mk b/ipacm/src/Android.mk
index ab8dd17..596e040 100644
--- a/ipacm/src/Android.mk
+++ b/ipacm/src/Android.mk
@@ -2,7 +2,7 @@ BOARD_PLATFORM_LIST := test
BOARD_PLATFORM_LIST += msmnile
BOARD_IPAv3_LIST := msm8998
BOARD_IPAv3_LIST += sdm845
-BOARD_IPAv3_LIST += sdm670
+BOARD_IPAv3_LIST += sdm710
ifneq ($(call is-board-platform-in-list,$(BOARD_PLATFORM_LIST)),true)
ifneq (,$(filter $(QCOM_BOARD_PLATFORMS),$(TARGET_BOARD_PLATFORM)))
ifneq (, $(filter aarch64 arm arm64, $(TARGET_ARCH)))
diff --git a/ipacm/src/IPACM_Iface.cpp b/ipacm/src/IPACM_Iface.cpp
index e24f7d9..bee69ed 100644
--- a/ipacm/src/IPACM_Iface.cpp
+++ b/ipacm/src/IPACM_Iface.cpp
@@ -1,5 +1,5 @@
/*
-Copyright (c) 2013, The Linux Foundation. All rights reserved.
+Copyright (c) 2013-2018, The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@@ -1026,3 +1026,10 @@ void IPACM_Iface::config_ip_type(ipa_ip_type iptype)
return;
}
+
+void IPACM_Iface::delete_iface(void)
+{
+ IPACMDBG_H("netdev (%s):ipa_index (%d) instance close \n",
+ IPACM_Iface::ipacmcfg->iface_table[ipa_if_num].iface_name, ipa_if_num);
+ delete this;
+} \ No newline at end of file
diff --git a/ipacm/src/IPACM_IfaceManager.cpp b/ipacm/src/IPACM_IfaceManager.cpp
index 85033a3..e7660b1 100644
--- a/ipacm/src/IPACM_IfaceManager.cpp
+++ b/ipacm/src/IPACM_IfaceManager.cpp
@@ -1,5 +1,5 @@
/*
-Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
+Copyright (c) 2013-2018, The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@@ -257,6 +257,12 @@ int IPACM_IfaceManager::create_iface_instance(ipacm_ifacemgr_data *param)
{
IPACMDBG_H("Creating Lan interface\n");
IPACM_Lan *lan = new IPACM_Lan(ipa_interface_index);
+ if (lan->rx_prop == NULL && lan->tx_prop == NULL)
+ {
+ /* close the netdev instance if IPA not support*/
+ lan->delete_iface();
+ return IPACM_FAILURE;
+ }
IPACM_EvtDispatcher::registr(IPA_ADDR_ADD_EVENT, lan);
//IPACM_EvtDispatcher::registr(IPA_ROUTE_ADD_EVENT, lan);
//IPACM_EvtDispatcher::registr(IPA_ROUTE_DEL_EVENT, lan);
@@ -365,6 +371,14 @@ int IPACM_IfaceManager::create_iface_instance(ipacm_ifacemgr_data *param)
{
IPACMDBG_H("Creating WLan interface\n");
IPACM_Wlan *wl = new IPACM_Wlan(ipa_interface_index);
+ if (wl->rx_prop == NULL && wl->tx_prop == NULL)
+ {
+ /* reset the AP-iface category to unknown */
+ IPACM_Iface::ipacmcfg->iface_table[ipa_interface_index].if_cat = UNKNOWN_IF;
+ /* close the netdev instance if IPA not support*/
+ wl->delete_iface();
+ return IPACM_FAILURE;
+ }
IPACM_EvtDispatcher::registr(IPA_ADDR_ADD_EVENT, wl);
IPACM_EvtDispatcher::registr(IPA_ROUTE_DEL_EVENT, wl);
IPACM_EvtDispatcher::registr(IPA_WLAN_CLIENT_ADD_EVENT, wl);
@@ -421,6 +435,14 @@ int IPACM_IfaceManager::create_iface_instance(ipacm_ifacemgr_data *param)
if(is_sta_mode == WLAN_WAN)
{
w = new IPACM_Wan(ipa_interface_index, is_sta_mode, param->mac_addr);
+ if (w->rx_prop == NULL && w->tx_prop == NULL)
+ {
+ /* reset the AP-iface category to unknown */
+ IPACM_Iface::ipacmcfg->iface_table[ipa_interface_index].if_cat = UNKNOWN_IF;
+ /* close the netdev instance if IPA not support*/
+ w->delete_iface();
+ return IPACM_FAILURE;
+ }
}
else
{
diff --git a/ipacm/src/IPACM_OffloadManager.cpp b/ipacm/src/IPACM_OffloadManager.cpp
index 5efe20f..571df8a 100644
--- a/ipacm/src/IPACM_OffloadManager.cpp
+++ b/ipacm/src/IPACM_OffloadManager.cpp
@@ -573,7 +573,7 @@ RET IPACM_OffloadManager::stopAllOffload()
RET IPACM_OffloadManager::setQuota(const char * upstream_name /* upstream */, uint64_t mb/* limit */)
{
wan_ioctl_set_data_quota quota;
- int fd = -1,rc = 0;
+ int fd = -1, rc = 0, err_type = 0;
if ((fd = open(DEVICE_NAME, O_RDWR)) < 0)
{
@@ -597,10 +597,10 @@ RET IPACM_OffloadManager::setQuota(const char * upstream_name /* upstream */, ui
if(rc != 0)
{
+ err_type = errno;
close(fd);
- IPACMERR("IOCTL WAN_IOCTL_SET_DATA_QUOTA call failed: %s rc: %d\n", strerror(errno),rc);
- if (errno == ENODEV) {
- IPACMDBG_H("Invalid argument.\n");
+ IPACMERR("IOCTL WAN_IOCTL_SET_DATA_QUOTA call failed: %s err_type: %d\n", strerror(errno), err_type);
+ if (err_type == ENODEV) {
return FAIL_UNSUPPORTED;
}
else {
diff --git a/ipacm/src/IPACM_Wlan.cpp b/ipacm/src/IPACM_Wlan.cpp
index 090aee2..829416d 100644
--- a/ipacm/src/IPACM_Wlan.cpp
+++ b/ipacm/src/IPACM_Wlan.cpp
@@ -133,6 +133,7 @@ IPACM_Wlan::~IPACM_Wlan()
{
IPACM_EvtDispatcher::deregistr(this);
IPACM_IfaceManager::deregistr(this);
+ IPACM_Wlan::num_wlan_ap_iface--;
return;
}
@@ -196,7 +197,6 @@ void IPACM_Wlan::event_callback(ipa_cm_event_id event, void *param)
ipacm_event_data_fid *data = (ipacm_event_data_fid *)param;
if(data->if_index == ipa_if_num)
{
- IPACM_Wlan::num_wlan_ap_iface--;
IPACMDBG_H("Now the number of wlan AP iface is %d\n", IPACM_Wlan::num_wlan_ap_iface);
IPACMDBG_H("Received IPA_LAN_DELETE_SELF event.\n");
diff --git a/os_pickup.bp b/os_pickup.bp
new file mode 100644
index 0000000..693a60c
--- /dev/null
+++ b/os_pickup.bp
@@ -0,0 +1,3 @@
+//we are creating the namespace hardware/qcom/sdm845, hardware/qcom/sdm845/Android.bp links to this file
+soong_namespace {
+}