diff options
| author | Dundi Raviteja <dundi@codeaurora.org> | 2018-08-17 17:05:12 +0530 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2018-09-05 00:33:56 -0700 |
| commit | eeb00890fa8e2d2101bb1501d8637e9df3447232 (patch) | |
| tree | 3a6db0d182b34f0af9ab98acf9919d3aa8356233 | |
| parent | beb17c75f0ca4ef5b9c1a16d0e9a32d4898a8274 (diff) | |
qcacld-2.0: Handle error cases cleanly, during wlan loading
prima to qcacld-2.0 propagation
On wlan load failure, make sure BTC, OEM, PTT and CESIUM services
are unregistered.
Change-Id: I15b32fdb5cfae5785311af0960277bd360b49c1b
CRs-Fixed: 2107850
| -rw-r--r-- | CORE/HDD/inc/wlan_hdd_oemdata.h | 3 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_main.c | 14 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_oemdata.c | 19 | ||||
| -rw-r--r-- | CORE/SVC/inc/wlan_ptt_sock_svc.h | 3 | ||||
| -rw-r--r-- | CORE/SVC/src/ptt/wlan_ptt_sock_svc.c | 11 |
5 files changed, 45 insertions, 5 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_oemdata.h b/CORE/HDD/inc/wlan_hdd_oemdata.h index d507ba81fae3..3cb9fc045926 100644 --- a/CORE/HDD/inc/wlan_hdd_oemdata.h +++ b/CORE/HDD/inc/wlan_hdd_oemdata.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014, 2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2018, The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -71,6 +71,7 @@ typedef enum } eOemErrorCode; int oem_activate_service(void *pAdapter); +void oem_deactivate_service(void); int iw_get_oem_data_cap(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra); diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c index 289a3a68ee1f..d7701dfdb602 100644 --- a/CORE/HDD/src/wlan_hdd_main.c +++ b/CORE/HDD/src/wlan_hdd_main.c @@ -17289,12 +17289,14 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) if(ptt_sock_activate_svc(pHddCtx) != 0) { hddLog(VOS_TRACE_LEVEL_FATAL,"%s: ptt_sock_activate_svc failed",__func__); - goto err_reg_netdev; + goto err_oem_activate_service; } #endif - if (hdd_open_cesium_nl_sock() < 0) + if (hdd_open_cesium_nl_sock() < 0) { hddLog(VOS_TRACE_LEVEL_WARN, FL("hdd_open_cesium_nl_sock failed")); + goto err_ptt_sock_activate_svc; + } //Initialize the CNSS-DIAG service if (cnss_diag_activate_service() < 0) @@ -17612,6 +17614,14 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) err_close_cesium: hdd_close_cesium_nl_sock(); +err_ptt_sock_activate_svc: +#ifdef PTT_SOCK_SVC_ENABLE + ptt_sock_deactivate_svc(); +#endif +err_oem_activate_service: +#ifdef FEATURE_OEM_DATA_SUPPORT + oem_deactivate_service(); +#endif err_reg_netdev: if (rtnl_lock_enable == TRUE) { rtnl_lock_enable = FALSE; diff --git a/CORE/HDD/src/wlan_hdd_oemdata.c b/CORE/HDD/src/wlan_hdd_oemdata.c index 2e6072fab834..9e474f80588c 100644 --- a/CORE/HDD/src/wlan_hdd_oemdata.c +++ b/CORE/HDD/src/wlan_hdd_oemdata.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -1283,5 +1283,22 @@ int oem_activate_service(void *hdd_ctx) nl_srv_register(WLAN_NL_MSG_OEM, __oem_msg_callback); return 0; } + +/**--------------------------------------------------------------------------- + + \brief oem_deactivate_service() - Deactivate oem message handler + + This function unregisters a handler to receive netlink message from + an OEM application process. + + \return - none + --------------------------------------------------------------------------*/ +void oem_deactivate_service() +{ + /* unregister the msg handler for msgs addressed to WLAN_NL_MSG_OEM */ + nl_srv_unregister(WLAN_NL_MSG_OEM, __oem_msg_callback); +} + + #endif #endif diff --git a/CORE/SVC/inc/wlan_ptt_sock_svc.h b/CORE/SVC/inc/wlan_ptt_sock_svc.h index bede9141829e..60bc99e9dc89 100644 --- a/CORE/SVC/inc/wlan_ptt_sock_svc.h +++ b/CORE/SVC/inc/wlan_ptt_sock_svc.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -98,6 +98,7 @@ * Payload : LEN_PAYLOAD bytes */ int ptt_sock_activate_svc(void *hdd_ctx); +void ptt_sock_deactivate_svc(void); int ptt_sock_send_msg_to_app(tAniHdr *wmsg, int radio, int src_mod, int pid); typedef struct sAniAppRegReq { diff --git a/CORE/SVC/src/ptt/wlan_ptt_sock_svc.c b/CORE/SVC/src/ptt/wlan_ptt_sock_svc.c index 39d3a4b1acc7..1bbcb9a73033 100644 --- a/CORE/SVC/src/ptt/wlan_ptt_sock_svc.c +++ b/CORE/SVC/src/ptt/wlan_ptt_sock_svc.c @@ -306,6 +306,11 @@ int ptt_sock_activate_svc(void *hdd_ctx) register_cld_cmd_cb(ANI_NL_MSG_PTT, ptt_cmd_handler, NULL); return 0; } + +void ptt_sock_deactivate_svc() +{ +} + #else int ptt_sock_activate_svc(void *hdd_ctx) { @@ -315,5 +320,11 @@ int ptt_sock_activate_svc(void *hdd_ctx) nl_srv_register(ANI_NL_MSG_PTT, ptt_sock_rx_nlink_msg); return 0; } + +void ptt_sock_deactivate_svc() +{ + nl_srv_unregister(ANI_NL_MSG_PUMAC, ptt_sock_rx_nlink_msg); + nl_srv_unregister(ANI_NL_MSG_PTT, ptt_sock_rx_nlink_msg); +} #endif #endif // PTT_SOCK_SVC_ENABLE |
