From a053d2a304d875bc07a153fc3d8e351589cde899 Mon Sep 17 00:00:00 2001 From: Hangtian Zhu Date: Fri, 27 Sep 2019 15:02:23 +0800 Subject: [PATCH] qcacld-3.0: Fix compile issue while WLAN_LOGGING_SOCK_SVC_ENABLE disabled Fix compile issue while WLAN_LOGGING_SOCK_SVC_ENABLE disabled. Change-Id: If83e0172f15aa856bf02d875e35aa54bcb0b6cc5 CRs-Fixed: 2536691 --- core/hdd/inc/wlan_hdd_main.h | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 99cc0c962c1a..29c307e37a72 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -2936,6 +2936,26 @@ static inline void hdd_set_tso_flags(struct hdd_context *hdd_ctx, } #endif /* FEATURE_TSO */ +/** + * wlan_hdd_get_host_log_nl_proto() - Get host log netlink protocol + * @hdd_ctx: HDD context + * + * This function returns with host log netlink protocol settings + * + * Return: none + */ +#ifdef WLAN_LOGGING_SOCK_SVC_ENABLE +static inline int wlan_hdd_get_host_log_nl_proto(struct hdd_context *hdd_ctx) +{ + return hdd_ctx->config->host_log_custom_nl_proto; +} +#else +static inline int wlan_hdd_get_host_log_nl_proto(struct hdd_context *hdd_ctx) +{ + return NETLINK_USERSOCK; +} +#endif + #ifdef CONFIG_CNSS_LOGGER /** * wlan_hdd_nl_init() - wrapper function to CNSS_LOGGER case @@ -2954,7 +2974,7 @@ static inline int wlan_hdd_nl_init(struct hdd_context *hdd_ctx) { int proto; - proto = hdd_ctx->config->host_log_custom_nl_proto; + proto = wlan_hdd_get_host_log_nl_proto(hdd_ctx); hdd_ctx->radio_index = nl_srv_init(hdd_ctx->wiphy, proto); /* radio_index is assigned from 0, so only >=0 will be valid index */ @@ -2977,7 +2997,7 @@ static inline int wlan_hdd_nl_init(struct hdd_context *hdd_ctx) { int proto; - proto = hdd_ctx->config->host_log_custom_nl_proto; + proto = wlan_hdd_get_host_log_nl_proto(hdd_ctx); return nl_srv_init(hdd_ctx->wiphy, proto); } #endif