summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/hdd/inc/wlan_hdd_nan.h19
-rw-r--r--core/hdd/src/wlan_hdd_cfg80211.c2
-rw-r--r--core/hdd/src/wlan_hdd_nan.c15
3 files changed, 18 insertions, 18 deletions
diff --git a/core/hdd/inc/wlan_hdd_nan.h b/core/hdd/inc/wlan_hdd_nan.h
index 7e178bd6a1ae..aba426584520 100644
--- a/core/hdd/inc/wlan_hdd_nan.h
+++ b/core/hdd/inc/wlan_hdd_nan.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -36,7 +36,20 @@ int wlan_hdd_cfg80211_nan_request(struct wiphy *wiphy,
const void *data,
int data_len);
-bool wlan_hdd_nan_is_supported(void);
+/**
+ * wlan_hdd_nan_is_supported() - HDD NAN support query function
+ *
+ * This function is called to determine if NAN is supported by the
+ * driver and by the firmware.
+ *
+ * Return: true if NAN is supported by the driver and firmware
+ */
+static inline bool wlan_hdd_nan_is_supported(hdd_context_t *hdd_ctx)
+{
+ return hdd_ctx->config->enable_nan_support &&
+ sme_is_feature_supported_by_fw(NAN);
+}
+
/**
* hdd_nan_populate_cds_config() - Populate NAN cds configuration
* @cds_cfg: CDS Configuration
@@ -51,7 +64,7 @@ static inline void hdd_nan_populate_cds_config(struct cds_config_info *cds_cfg,
}
void wlan_hdd_cfg80211_nan_callback(void *ctx, tSirNanEvent *msg);
#else
-static inline bool wlan_hdd_nan_is_supported(void)
+static inline bool wlan_hdd_nan_is_supported(hdd_context_t *hdd_ctx)
{
return false;
}
diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c
index e477668a1871..0e1c618f9884 100644
--- a/core/hdd/src/wlan_hdd_cfg80211.c
+++ b/core/hdd/src/wlan_hdd_cfg80211.c
@@ -2126,7 +2126,7 @@ __wlan_hdd_cfg80211_get_supported_features(struct wiphy *wiphy,
fset |= WIFI_FEATURE_EXTSCAN | WIFI_FEATURE_HAL_EPNO;
}
#endif
- if (wlan_hdd_nan_is_supported()) {
+ if (wlan_hdd_nan_is_supported(pHddCtx)) {
hdd_debug("NAN is supported by firmware");
fset |= WIFI_FEATURE_NAN;
}
diff --git a/core/hdd/src/wlan_hdd_nan.c b/core/hdd/src/wlan_hdd_nan.c
index 47e28a8c39dc..d3b99b579491 100644
--- a/core/hdd/src/wlan_hdd_nan.c
+++ b/core/hdd/src/wlan_hdd_nan.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.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -155,16 +155,3 @@ void wlan_hdd_cfg80211_nan_callback(void *ctx, tSirNanEvent *msg)
}
cfg80211_vendor_event(vendor_event, GFP_KERNEL);
}
-
-/**
- * wlan_hdd_nan_is_supported() - HDD NAN support query function
- *
- * This function is called to determine if NAN is supported by the
- * driver and by the firmware.
- *
- * Return: true if NAN is supported by the driver and firmware
- */
-bool wlan_hdd_nan_is_supported(void)
-{
- return sme_is_feature_supported_by_fw(NAN);
-}