From 4aad0f7daa7f62a61229ab9221c95f75e58dcda9 Mon Sep 17 00:00:00 2001 From: Abhishek Singh Date: Wed, 27 Apr 2016 13:43:29 +0530 Subject: [PATCH] qcacld-3.0: Add diag event for offload requests qcacld-2.0 to qcacld-3.0 propagation Add diag event for EVENT_OFFLOAD_REQ. This events contains info if host has enabled or disabled the offload. Change-Id: I19fe216ac0900dedbcb7b247cf0d171979308dc5 CRs-Fixed: 934455 --- core/hdd/inc/wlan_hdd_host_offload.h | 9 +++++ core/hdd/src/wlan_hdd_power.c | 33 ++++++++++++++++++- .../host_diag_log/inc/host_diag_core_event.h | 12 +++++++ .../host_diag_log/inc/host_diag_event_defs.h | 1 + 4 files changed, 54 insertions(+), 1 deletion(-) diff --git a/core/hdd/inc/wlan_hdd_host_offload.h b/core/hdd/inc/wlan_hdd_host_offload.h index 79d52ab3dbc9..873b6a73d1e3 100644 --- a/core/hdd/inc/wlan_hdd_host_offload.h +++ b/core/hdd/inc/wlan_hdd_host_offload.h @@ -57,4 +57,13 @@ typedef struct { struct qdf_mac_addr bssId; } tHostOffloadRequest, *tpHostOffloadRequest; +#ifdef FEATURE_WLAN_DIAG_SUPPORT +void hdd_wlan_offload_event(uint8_t type, uint8_t state); +#else +static inline +void hdd_wlan_offload_event(uint8_t type, uint8_t state) +{ +} +#endif /* FEATURE_WLAN_DIAG_SUPPORT */ + #endif /* __WLAN_HDD_HOST_OFFLOAD_H__ */ diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index a78ef1174af2..117413611818 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -104,6 +104,27 @@ void hdd_wlan_suspend_resume_event(uint8_t state) suspend_state.state = state; WLAN_HOST_DIAG_EVENT_REPORT(&suspend_state, EVENT_WLAN_SUSPEND_RESUME); } + +/** + * hdd_wlan_offload_event()- send offloads event + * @type: offload type + * @state: enabled or disabled + * + * This Function send offloads enable/disable diag event + * + * Return: void. + */ + +void hdd_wlan_offload_event(uint8_t type, uint8_t state) +{ + WLAN_HOST_DIAG_EVENT_DEF(host_offload, struct host_event_offload_req); + qdf_mem_zero(&host_offload, sizeof(host_offload)); + + host_offload.offload_type = type; + host_offload.state = state; + + WLAN_HOST_DIAG_EVENT_REPORT(&host_offload, EVENT_WLAN_OFFLOAD_REQ); +} #endif /* Function and variables declarations */ @@ -406,6 +427,8 @@ static void hdd_conf_ns_offload(hdd_adapter_t *pAdapter, bool fenable) &offLoadRequest.nsOffloadInfo.selfIPv6Addr[i], &offLoadRequest.nsOffloadInfo.targetIPv6Addr[i], i); } + hdd_wlan_offload_event(SIR_IPV6_NS_OFFLOAD, + SIR_OFFLOAD_ENABLE); offLoadRequest.offloadType = SIR_IPV6_NS_OFFLOAD; offLoadRequest.enableOrDisable = SIR_OFFLOAD_ENABLE; qdf_copy_macaddr(&offLoadRequest.nsOffloadInfo.self_macaddr, @@ -424,6 +447,8 @@ static void hdd_conf_ns_offload(hdd_adapter_t *pAdapter, bool fenable) return; } } else { + hdd_wlan_offload_event(SIR_IPV6_NS_OFFLOAD, + SIR_OFFLOAD_DISABLE); /* Disable NSOffload */ qdf_mem_zero((void *)&offLoadRequest, sizeof(tSirHostOffloadReq)); offLoadRequest.enableOrDisable = SIR_OFFLOAD_DISABLE; @@ -739,6 +764,8 @@ QDF_STATUS hdd_conf_arp_offload(hdd_adapter_t *pAdapter, bool fenable) if (ifa && ifa->ifa_local) { offLoadRequest.offloadType = SIR_IPV4_ARP_REPLY_OFFLOAD; offLoadRequest.enableOrDisable = SIR_OFFLOAD_ENABLE; + hdd_wlan_offload_event(SIR_IPV4_ARP_REPLY_OFFLOAD, + SIR_OFFLOAD_ENABLE); hddLog(QDF_TRACE_LEVEL_INFO, "%s: Enabled", __func__); @@ -753,7 +780,9 @@ QDF_STATUS hdd_conf_arp_offload(hdd_adapter_t *pAdapter, bool fenable) hddLog(QDF_TRACE_LEVEL_INFO, "offload: inside arp offload conditional check"); } - + hdd_wlan_offload_event( + SIR_OFFLOAD_ARP_AND_BCAST_FILTER_ENABLE, + SIR_OFFLOAD_ENABLE); hddLog(QDF_TRACE_LEVEL_INFO, "offload: arp filter programmed = %d", offLoadRequest.enableOrDisable); @@ -786,6 +815,8 @@ QDF_STATUS hdd_conf_arp_offload(hdd_adapter_t *pAdapter, bool fenable) return QDF_STATUS_SUCCESS; } else { + hdd_wlan_offload_event(SIR_IPV4_ARP_REPLY_OFFLOAD, + SIR_OFFLOAD_DISABLE); qdf_mem_zero((void *)&offLoadRequest, sizeof(tSirHostOffloadReq)); offLoadRequest.enableOrDisable = SIR_OFFLOAD_DISABLE; diff --git a/core/utils/host_diag_log/inc/host_diag_core_event.h b/core/utils/host_diag_log/inc/host_diag_core_event.h index 91d87f90e527..997b29599974 100644 --- a/core/utils/host_diag_log/inc/host_diag_core_event.h +++ b/core/utils/host_diag_log/inc/host_diag_core_event.h @@ -337,6 +337,18 @@ struct host_event_suspend { uint8_t state; }; +/** + * struct host_event_offload_req - offload state + * @offload_type: offload type + * @state: enabled or disabled state + * + * This structure contains offload diag event info + */ +struct host_event_offload_req { + uint8_t offload_type; + uint8_t state; +}; + /*------------------------------------------------------------------------- Function declarations and documenation ------------------------------------------------------------------------*/ diff --git a/core/utils/host_diag_log/inc/host_diag_event_defs.h b/core/utils/host_diag_log/inc/host_diag_event_defs.h index 65dcab2d07f6..2ca73cfe6876 100644 --- a/core/utils/host_diag_log/inc/host_diag_event_defs.h +++ b/core/utils/host_diag_log/inc/host_diag_event_defs.h @@ -57,6 +57,7 @@ typedef enum { EVENT_WLAN_TDLS_TEARDOWN = 0xAB5, EVENT_WLAN_TDLS_ENABLE_LINK = 0XAB6, EVENT_WLAN_SUSPEND_RESUME = 0xAB7, + EVENT_WLAN_OFFLOAD_REQ = 0xAB8, EVENT_MAX_ID = 0x0FFF } event_id_enum_type;