diff options
| author | Chandrasekaran, Manishekar <cmshekar@qti.qualcomm.com> | 2015-04-30 19:15:00 +0530 |
|---|---|---|
| committer | AnjaneeDevi Kapparapu <c_akappa@qti.qualcomm.com> | 2015-05-14 18:04:53 +0530 |
| commit | dfec0a1c474d348b765413d2dcbfe6f64a94e872 (patch) | |
| tree | 5ab3a79483ace709df8f83b0320e9e7badd6c5f3 | |
| parent | 92b20bf456722ac259fe7e435ddea2e226a11eb0 (diff) | |
qcacld: Always multicast host and fw messages irrespective of registration
Make sure the host's and fw's debug messages, diag events, log messages
are always mutlticast irrespective of any registration by any user space
entity, when INI item gMulticastHostFwMsgs is set. This INI item will be
enabled by default and has to be set to 0 to disable this behaviour.
Change-Id: I9f677e680d5032c0fe29d78eca0ae7a70cc2ae69
CRs-Fixed: 830997
| -rw-r--r-- | CORE/HDD/inc/wlan_hdd_cfg.h | 6 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_cfg.c | 9 | ||||
| -rwxr-xr-x | CORE/HDD/src/wlan_hdd_main.c | 2 | ||||
| -rw-r--r-- | CORE/SVC/inc/wlan_logging_sock_svc.h | 2 | ||||
| -rw-r--r-- | CORE/SVC/src/logging/wlan_logging_sock_svc.c | 136 | ||||
| -rw-r--r-- | CORE/UTILS/FWLOG/dbglog_host.c | 42 | ||||
| -rw-r--r-- | CORE/VOSS/inc/vos_api.h | 2 | ||||
| -rw-r--r-- | CORE/VOSS/src/vos_api.c | 46 | ||||
| -rw-r--r-- | CORE/VOSS/src/vos_diag.c | 38 | ||||
| -rw-r--r-- | CORE/VOSS/src/vos_sched.h | 3 |
10 files changed, 188 insertions, 98 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_cfg.h b/CORE/HDD/inc/wlan_hdd_cfg.h index 9d13ddf8a97f..9ba06f7da923 100644 --- a/CORE/HDD/inc/wlan_hdd_cfg.h +++ b/CORE/HDD/inc/wlan_hdd_cfg.h @@ -2786,6 +2786,11 @@ enum dot11p_mode { #define CFG_SET_TSF_GPIO_PIN_MAX (255) #define CFG_SET_TSF_GPIO_PIN_DEFAULT (34) +#define CFG_MULTICAST_HOST_FW_MSGS "gMulticastHostFwMsgs" +#define CFG_MULTICAST_HOST_FW_MSGS_MIN (0) +#define CFG_MULTICAST_HOST_FW_MSGS_MAX (1) +#define CFG_MULTICAST_HOST_FW_MSGS_DEFAULT (1) + /*--------------------------------------------------------------------------- Type declarations -------------------------------------------------------------------------*/ @@ -3388,6 +3393,7 @@ typedef struct uint8_t prefer_non_dfs_on_radar; uint8_t inform_bss_rssi_raw; uint32_t tsf_gpio_pin; + uint8_t multicast_host_fw_msgs; } hdd_config_t; #ifdef WLAN_FEATURE_MBSSID diff --git a/CORE/HDD/src/wlan_hdd_cfg.c b/CORE/HDD/src/wlan_hdd_cfg.c index 19bcc901c13c..036f622ac6b3 100644 --- a/CORE/HDD/src/wlan_hdd_cfg.c +++ b/CORE/HDD/src/wlan_hdd_cfg.c @@ -3673,6 +3673,13 @@ REG_TABLE_ENTRY mbssid_sap_dyn_ini_reg_table[] = CFG_P2P_LISTEN_DEFER_INTERVAL_MIN, CFG_P2P_LISTEN_DEFER_INTERVAL_MAX), + REG_VARIABLE(CFG_MULTICAST_HOST_FW_MSGS, WLAN_PARAM_Integer, + hdd_config_t, multicast_host_fw_msgs, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_MULTICAST_HOST_FW_MSGS_DEFAULT, + CFG_MULTICAST_HOST_FW_MSGS_MIN, + CFG_MULTICAST_HOST_FW_MSGS_MAX), + }; #endif @@ -6105,6 +6112,8 @@ VOS_STATUS hdd_set_sme_config( hdd_context_t *pHddCtx ) smeConfig->f_prefer_non_dfs_on_radar = pHddCtx->cfg_ini->prefer_non_dfs_on_radar; + vos_set_multicast_logging(pHddCtx->cfg_ini->multicast_host_fw_msgs); + halStatus = sme_UpdateConfig( pHddCtx->hHal, smeConfig); if ( !HAL_STATUS_SUCCESS( halStatus ) ) { diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c index d72dfcd013f6..77246c80d8bf 100755 --- a/CORE/HDD/src/wlan_hdd_main.c +++ b/CORE/HDD/src/wlan_hdd_main.c @@ -11911,6 +11911,8 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) } } #endif + if (vos_is_multicast_logging()) + wlan_logging_set_log_level(); hdd_register_mcast_bcast_filter(pHddCtx); if (VOS_STA_SAP_MODE != hdd_get_conparam()) diff --git a/CORE/SVC/inc/wlan_logging_sock_svc.h b/CORE/SVC/inc/wlan_logging_sock_svc.h index 205d7ac0b2af..df5a05cb5071 100644 --- a/CORE/SVC/inc/wlan_logging_sock_svc.h +++ b/CORE/SVC/inc/wlan_logging_sock_svc.h @@ -45,5 +45,5 @@ int wlan_logging_sock_activate_svc(int log_fe_to_console, int num_buf); int wlan_logging_sock_deactivate_svc(void); int wlan_log_to_user(VOS_TRACE_LEVEL log_level, char *to_be_sent, int length); void wlan_logging_set_per_pkt_stats(void); - +void wlan_logging_set_log_level(void); #endif /* WLAN_LOGGING_SOCK_SVC_H */ diff --git a/CORE/SVC/src/logging/wlan_logging_sock_svc.c b/CORE/SVC/src/logging/wlan_logging_sock_svc.c index 45a9ef7bf745..2eb66f3fa8ae 100644 --- a/CORE/SVC/src/logging/wlan_logging_sock_svc.c +++ b/CORE/SVC/src/logging/wlan_logging_sock_svc.c @@ -218,7 +218,7 @@ static int wlan_queue_logmsg_for_app(void) gwlan_logging.pcur_node = (struct log_msg *)(gwlan_logging.filled_list.next); ++gwlan_logging.drop_count; - if (gapp_pid != INVALID_PID && !gwlan_logging.is_buffer_free) { + if (vos_is_multicast_logging() && !gwlan_logging.is_buffer_free) { pr_err("%s: drop_count = %u index = %d filled_length = %d\n", __func__, gwlan_logging.drop_count, gwlan_logging.pcur_node->index, @@ -249,7 +249,7 @@ int wlan_log_to_user(VOS_TRACE_LEVEL log_level, char *to_be_sent, int length) uint64_t ts; uint32_t rem; - if (gapp_pid == INVALID_PID) { + if (!vos_is_multicast_logging()) { /* * This is to make sure that we print the logs to kmsg console * when no logger app is running. This is also needed to @@ -259,76 +259,80 @@ int wlan_log_to_user(VOS_TRACE_LEVEL log_level, char *to_be_sent, int length) * messages. */ pr_info("%s\n", to_be_sent); - } - - /* Format the Log time [Seconds.microseconds] */ - ts = adf_get_boottime(); - rem = do_div(ts, VOS_TIMER_TO_SEC_UNIT); - tlen = snprintf(tbuf, sizeof(tbuf), "[%s][%lu.%06lu] ", current->comm, - (unsigned long) ts, (unsigned long)rem); + } else { - /* 1+1 indicate '\n'+'\0' */ - total_log_len = length + tlen + 1 + 1; + /* Format the Log time [Seconds.microseconds] */ + ts = adf_get_boottime(); + rem = do_div(ts, VOS_TIMER_TO_SEC_UNIT); + tlen = snprintf(tbuf, sizeof(tbuf), "[%s][%lu.%06lu] ", + current->comm, + (unsigned long) ts, (unsigned long)rem); - spin_lock_irqsave(&gwlan_logging.spin_lock, flags); - // wlan logging svc resources are not yet initialized - if (!gwlan_logging.pcur_node) { - spin_unlock_irqrestore(&gwlan_logging.spin_lock, flags); - return -EIO; - } + /* 1+1 indicate '\n'+'\0' */ + total_log_len = length + tlen + 1 + 1; - pfilled_length = &gwlan_logging.pcur_node->filled_length; + spin_lock_irqsave(&gwlan_logging.spin_lock, flags); + // wlan logging svc resources are not yet initialized + if (!gwlan_logging.pcur_node) { + spin_unlock_irqrestore(&gwlan_logging.spin_lock, flags); + return -EIO; + } - /* Check if we can accomodate more log into current node/buffer */ - if ((MAX_LOGMSG_LENGTH - (*pfilled_length + sizeof(tAniNlHdr))) < - total_log_len) { - wake_up_thread = true; - wlan_queue_logmsg_for_app(); pfilled_length = &gwlan_logging.pcur_node->filled_length; - } - ptr = &gwlan_logging.pcur_node->logbuf[sizeof(tAniHdr)]; + /* Check if we can accomodate more log into current + * node/buffer + */ + if ((MAX_LOGMSG_LENGTH - + (*pfilled_length + sizeof(tAniNlHdr))) < total_log_len) { + wake_up_thread = true; + wlan_queue_logmsg_for_app(); + pfilled_length = + &gwlan_logging.pcur_node->filled_length; + } - /* Assumption here is that we receive logs which is always less than - * MAX_LOGMSG_LENGTH, where we can accomodate the - * tAniNlHdr + [context][timestamp] + log - * VOS_ASSERT if we cannot accomodate the the complete log into - * the available buffer. - * - * Continue and copy logs to the available length and discard the rest. - */ - if (MAX_LOGMSG_LENGTH < (sizeof(tAniNlHdr) + total_log_len)) { - VOS_ASSERT(0); - total_log_len = MAX_LOGMSG_LENGTH - sizeof(tAniNlHdr) - 2; - } + ptr = &gwlan_logging.pcur_node->logbuf[sizeof(tAniHdr)]; - memcpy(&ptr[*pfilled_length], tbuf, tlen); - memcpy(&ptr[*pfilled_length + tlen], to_be_sent, - min(length, (total_log_len - tlen))); - *pfilled_length += tlen + min(length, total_log_len - tlen); - ptr[*pfilled_length] = '\n'; - *pfilled_length += 1; + /* Assumption here is that we receive logs which is always + * less than MAX_LOGMSG_LENGTH, where we can accomodate the + * tAniNlHdr + [context][timestamp] + log + * VOS_ASSERT if we cannot accomodate the the complete log into + * the available buffer. + * + * Continue and copy logs to the available length and + * discard the rest. + */ + if (MAX_LOGMSG_LENGTH < (sizeof(tAniNlHdr) + total_log_len)) { + VOS_ASSERT(0); + total_log_len = MAX_LOGMSG_LENGTH - + sizeof(tAniNlHdr) - 2; + } - spin_unlock_irqrestore(&gwlan_logging.spin_lock, flags); + memcpy(&ptr[*pfilled_length], tbuf, tlen); + memcpy(&ptr[*pfilled_length + tlen], to_be_sent, + min(length, (total_log_len - tlen))); + *pfilled_length += tlen + min(length, total_log_len - tlen); + ptr[*pfilled_length] = '\n'; + *pfilled_length += 1; - /* Wakeup logger thread */ - if ((true == wake_up_thread)) { - /* If there is logger app registered wakeup the logging - * thread - */ - if (gapp_pid != INVALID_PID) { + spin_unlock_irqrestore(&gwlan_logging.spin_lock, flags); + + /* Wakeup logger thread */ + if ((true == wake_up_thread)) { + /* If there is logger app registered wakeup the logging + * thread (or) if always multicasting of host messages + * is enabled, wake up the logging thread + */ set_bit(HOST_LOG_DRIVER_MSG, &gwlan_logging.eventFlag); wake_up_interruptible(&gwlan_logging.wait_queue); } - } - if ((gapp_pid != INVALID_PID) - && gwlan_logging.log_fe_to_console - && ((VOS_TRACE_LEVEL_FATAL == log_level) - || (VOS_TRACE_LEVEL_ERROR == log_level))) { - pr_info("%s\n", to_be_sent); + if (gwlan_logging.log_fe_to_console + && ((VOS_TRACE_LEVEL_FATAL == log_level) + || (VOS_TRACE_LEVEL_ERROR == log_level))) { + pr_info("%s\n", to_be_sent); + } } - return 0; } @@ -372,7 +376,7 @@ static int send_filled_buffers_to_user(void) sizeof(wnl->radio) + sizeof(tAniHdr); tot_msg_len = NLMSG_SPACE(payload_len); - nlh = nlmsg_put(skb, gapp_pid, nlmsg_seq++, + nlh = nlmsg_put(skb, 0, nlmsg_seq++, ANI_NL_MSG_LOG, payload_len, NLM_F_REQUEST); if (NULL == nlh) { @@ -402,13 +406,11 @@ static int send_filled_buffers_to_user(void) &gwlan_logging.free_list); spin_unlock_irqrestore(&gwlan_logging.spin_lock, flags); - ret = nl_srv_ucast(skb, gapp_pid, 0); + ret = nl_srv_bcast(skb); if (ret < 0) { pr_err("%s: Send Failed %d drop_count = %u\n", __func__, ret, ++gwlan_logging.drop_count); skb = NULL; - gapp_pid = INVALID_PID; - clear_default_logtoapp_log_level(); } else { skb = NULL; ret = 0; @@ -655,4 +657,16 @@ void wlan_logging_set_per_pkt_stats(void) set_bit(HOST_LOG_PER_PKT_STATS, &gwlan_logging.eventFlag); wake_up_interruptible(&gwlan_logging.wait_queue); } + +/** + * wlan_logging_set_log_level() - Set the logging level + * + * This function is used to set the logging level of host debug messages + * + * Return: None + */ +void wlan_logging_set_log_level(void) +{ + set_default_logtoapp_log_level(); +} #endif /* WLAN_LOGGING_SOCK_SVC_ENABLE */ diff --git a/CORE/UTILS/FWLOG/dbglog_host.c b/CORE/UTILS/FWLOG/dbglog_host.c index 1a0590b65f8d..87f786219b60 100644 --- a/CORE/UTILS/FWLOG/dbglog_host.c +++ b/CORE/UTILS/FWLOG/dbglog_host.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -1647,7 +1647,10 @@ send_fw_diag_nl_data(wmi_unified_t wmi_handle, const u_int8_t *buffer, if (WARN_ON(len > ATH6KL_FWLOG_PAYLOAD_SIZE)) return -ENODEV; - if (cnss_diag_pid != INVALID_PID) + if (nl_srv_is_initialized() != 0) + return -EIO; + + if (vos_is_multicast_logging()) { skb_out = nlmsg_new(len, 0); if (!skb_out) @@ -1655,16 +1658,14 @@ send_fw_diag_nl_data(wmi_unified_t wmi_handle, const u_int8_t *buffer, AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Failed to allocate new skb\n")); return -1; } - nlh = nlmsg_put(skb_out, 0, 0, NLMSG_DONE, len, 0); + nlh = nlmsg_put(skb_out, 0, 0, WLAN_NL_MSG_CNSS_DIAG, len, 0); memcpy(nlmsg_data(nlh), buffer, len); - NETLINK_CB(skb_out).dst_group = 0; /* not in mcast group */ - res = nl_srv_ucast(skb_out, cnss_diag_pid, MSG_DONTWAIT); + res = nl_srv_bcast(skb_out); if (res < 0) { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, - ("nl_srv_ucast failed 0x%x \n", res)); - cnss_diag_pid = INVALID_PID; + AR_DEBUG_PRINTF(ATH_DEBUG_RSVD1, + ("%s: nl_srv_bcast failed 0x%x \n", __func__, res)); return res; } } @@ -1684,7 +1685,10 @@ send_diag_netlink_data(const u_int8_t *buffer, if (WARN_ON(len > ATH6KL_FWLOG_PAYLOAD_SIZE)) return -ENODEV; - if (cnss_diag_pid != INVALID_PID) { + if (nl_srv_is_initialized() != 0) + return -EIO; + + if (vos_is_multicast_logging()) { slot_len = sizeof(*slot) + ATH6KL_FWLOG_PAYLOAD_SIZE; skb_out = nlmsg_new(slot_len, 0); @@ -1705,9 +1709,8 @@ send_diag_netlink_data(const u_int8_t *buffer, res = nl_srv_bcast(skb_out); if (res < 0) { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, - ("nl_srv_bcast failed 0x%x \n", res)); - cnss_diag_pid = INVALID_PID; + AR_DEBUG_PRINTF(ATH_DEBUG_RSVD1, + ("%s: nl_srv_bcast failed 0x%x \n", __func__, res)); return res; } } @@ -1728,7 +1731,10 @@ dbglog_process_netlink_data(wmi_unified_t wmi_handle, const u_int8_t *buffer, if (WARN_ON(len > ATH6KL_FWLOG_PAYLOAD_SIZE)) return -ENODEV; - if (cnss_diag_pid != INVALID_PID) + if (nl_srv_is_initialized() != 0) + return -EIO; + + if (vos_is_multicast_logging()) { slot_len = sizeof(*slot) + ATH6KL_FWLOG_PAYLOAD_SIZE; @@ -1739,21 +1745,19 @@ dbglog_process_netlink_data(wmi_unified_t wmi_handle, const u_int8_t *buffer, return -1; } - nlh = nlmsg_put(skb_out, 0, 0, NLMSG_DONE, slot_len, 0); + nlh = nlmsg_put(skb_out, 0, 0, WLAN_NL_MSG_CNSS_DIAG, slot_len, 0); slot = (struct dbglog_slot *) nlmsg_data(nlh); slot->diag_type = (A_UINT32)DIAG_TYPE_FW_DEBUG_MSG; slot->timestamp = cpu_to_le32(jiffies); slot->length = cpu_to_le32(len); slot->dropped = cpu_to_le32(dropped); memcpy(slot->payload, buffer, len); - NETLINK_CB(skb_out).dst_group = 0; /* not in mcast group */ - res = nl_srv_ucast(skb_out, cnss_diag_pid, MSG_DONTWAIT); + res = nl_srv_bcast(skb_out); if (res < 0) { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, - ("nl_srv_ucast failed 0x%x \n", res)); - cnss_diag_pid = INVALID_PID; + AR_DEBUG_PRINTF(ATH_DEBUG_RSVD1, + ("%s: nl_srv_bcast failed 0x%x \n", __func__, res)); return res; } } diff --git a/CORE/VOSS/inc/vos_api.h b/CORE/VOSS/inc/vos_api.h index b65b37b2fc87..0fbfc5843111 100644 --- a/CORE/VOSS/inc/vos_api.h +++ b/CORE/VOSS/inc/vos_api.h @@ -341,5 +341,7 @@ void vos_set_wakelock_logging(bool value); bool vos_is_wakelock_enabled(void); void vos_set_ring_log_level(uint32_t ring_id, uint32_t log_level); enum wifi_driver_log_level vos_get_ring_log_level(uint32_t ring_id); +void vos_set_multicast_logging(uint8_t value); +uint8_t vos_is_multicast_logging(void); #endif // if !defined __VOS_API_H diff --git a/CORE/VOSS/src/vos_api.c b/CORE/VOSS/src/vos_api.c index 72ac8a6e9c45..3a784ccdd8bf 100644 --- a/CORE/VOSS/src/vos_api.c +++ b/CORE/VOSS/src/vos_api.c @@ -2518,3 +2518,49 @@ enum wifi_driver_log_level vos_get_ring_log_level(uint32_t ring_id) return WLAN_LOG_LEVEL_OFF; } + +/** + * vos_set_multicast_logging() - Set mutlicast logging value + * @value: Value of multicast logging + * + * Set the multicast logging value which will indicate + * whether to multicast host and fw messages even + * without any registration by userspace entity + * + * Return: None + */ +void vos_set_multicast_logging(uint8_t value) +{ + VosContextType *vos_context; + + vos_context = vos_get_global_context(VOS_MODULE_ID_SYS, NULL); + if (!vos_context) { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: vos context is Invald", __func__); + return; + } + vos_context->multicast_logging = value; +} + +/** + * vos_is_multicast_logging() - Get multicast logging value + * + * Get the multicast logging value which will indicate + * whether to multicast host and fw messages even + * without any registration by userspace entity + * + * Return: 0 - Multicast logging disabled, 1 - Multicast logging enabled + */ +uint8_t vos_is_multicast_logging(void) +{ + VosContextType *vos_context; + + vos_context = vos_get_global_context(VOS_MODULE_ID_SYS, NULL); + if (!vos_context) { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: vos context is Invald", __func__); + return 0; + } + + return vos_context->multicast_logging; +} diff --git a/CORE/VOSS/src/vos_diag.c b/CORE/VOSS/src/vos_diag.c index d740c4a1a20f..dd9398511ae1 100644 --- a/CORE/VOSS/src/vos_diag.c +++ b/CORE/VOSS/src/vos_diag.c @@ -143,8 +143,13 @@ void vos_log_submit(v_VOID_t *plog_hdr_ptr) return; } - /* Send the log data to the ptt app only if it is registered with the wlan driver*/ - if(pHddCtx->ptt_pid) + if (nl_srv_is_initialized() != 0) + return; + + /* Send the log data to the ptt app only if it is registered + * with the wlan driver + */ + if (vos_is_multicast_logging()) { data_len = pHdr->len; @@ -154,7 +159,8 @@ void vos_log_submit(v_VOID_t *plog_hdr_ptr) if(!pBuf) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "vos_mem_malloc failed"); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "vos_mem_malloc failed"); return; } @@ -173,17 +179,13 @@ void vos_log_submit(v_VOID_t *plog_hdr_ptr) vos_mem_copy(pBuf, pHdr, data_len); - if(pHddCtx->ptt_pid != INVALID_PID) - { - if( ptt_sock_send_msg_to_app(wmsg, 0, ANI_NL_MSG_PUMAC, -1) < 0) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - ("Ptt Socket error sending message to the app!!")); + if( ptt_sock_send_msg_to_app(wmsg, 0, ANI_NL_MSG_PUMAC, -1) < 0) { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + ("Ptt Socket error sending message to the app!!")); vos_mem_free((v_VOID_t *)wmsg); - pHddCtx->ptt_pid = INVALID_PID; return; - } - } + vos_mem_free((v_VOID_t*)wmsg); } return; @@ -237,7 +239,6 @@ void vos_log_wlock_diag(uint32_t reason, const char *wake_lock_name, void vos_event_report_payload(v_U16_t event_Id, v_U16_t length, v_VOID_t *pPayload) { - tAniHdr *wmsg = NULL; v_U8_t *pBuf; struct hdd_context_s *pHddCtx; @@ -261,8 +262,13 @@ void vos_event_report_payload(v_U16_t event_Id, v_U16_t length, v_VOID_t *pPaylo return; } - /* Send the log data to the ptt app only if it is registered with the wlan driver*/ - if(pHddCtx->ptt_pid != INVALID_PID) + if (nl_srv_is_initialized() != 0) + return; + + /* Send the log data to the ptt app only if it is registered + * with the wlan driver + */ + if (vos_is_multicast_logging()) { total_len = sizeof(tAniHdr)+sizeof(event_report_t)+length; @@ -270,7 +276,8 @@ void vos_event_report_payload(v_U16_t event_Id, v_U16_t length, v_VOID_t *pPaylo if(!pBuf) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "vos_mem_malloc failed"); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "vos_mem_malloc failed"); return; } wmsg = (tAniHdr*)pBuf; @@ -292,7 +299,6 @@ void vos_event_report_payload(v_U16_t event_Id, v_U16_t length, v_VOID_t *pPaylo VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, ("Ptt Socket error sending message to the app!!")); vos_mem_free((v_VOID_t*)wmsg); - pHddCtx->ptt_pid = INVALID_PID; return; } diff --git a/CORE/VOSS/src/vos_sched.h b/CORE/VOSS/src/vos_sched.h index 05d660b4758e..6191356c2b78 100644 --- a/CORE/VOSS/src/vos_sched.h +++ b/CORE/VOSS/src/vos_sched.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -415,6 +415,7 @@ typedef struct _VosContextType uint32_t wakelock_log_level; uint32_t connectivity_log_level; uint32_t packet_stats_log_level; + uint8_t multicast_logging; } VosContextType, *pVosContextType; |
