diff options
| author | Krishna Kumaar Natarajan <kknatara@qca.qualcomm.com> | 2015-04-27 11:41:10 -0700 |
|---|---|---|
| committer | AnjaneeDevi Kapparapu <c_akappa@qti.qualcomm.com> | 2015-04-28 19:29:11 +0530 |
| commit | 1f79e1b3d65de5259798024e56f717f02af7ec21 (patch) | |
| tree | 85a2d7376dc28bdec15ce7e301d607f19775ecd9 | |
| parent | 5067879a8fa285221f891fd941f9ab1add05da5c (diff) | |
qcacld: Fix compilation errors in SDIO platform
Fix compilation error for proc fs related function
calls in SDIO platform
Change-Id: I9b962f4e3846845c50482ff26f36323030481f4a
CRs-Fixed: 822917
| -rwxr-xr-x | CORE/HDD/src/wlan_hdd_main.c | 2 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_memdump.c | 36 |
2 files changed, 36 insertions, 2 deletions
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c index 97b3587cbb58..7e8481de59ee 100755 --- a/CORE/HDD/src/wlan_hdd_main.c +++ b/CORE/HDD/src/wlan_hdd_main.c @@ -110,7 +110,6 @@ #ifdef CONFIG_CNSS #include <net/cnss.h> #endif -#include "wlan_hdd_memdump.h" extern int hdd_hostapd_stop (struct net_device *dev); void hdd_ch_avoid_cb(void *hdd_context,void *indi_param); @@ -122,6 +121,7 @@ void hdd_ch_avoid_cb(void *hdd_context,void *indi_param); #include "wlan_hdd_debugfs.h" #include "epping_main.h" +#include "wlan_hdd_memdump.h" #ifdef IPA_OFFLOAD #include <wlan_hdd_ipa.h> diff --git a/CORE/HDD/src/wlan_hdd_memdump.c b/CORE/HDD/src/wlan_hdd_memdump.c index 2dba7df3c24a..8192d1e69318 100644 --- a/CORE/HDD/src/wlan_hdd_memdump.c +++ b/CORE/HDD/src/wlan_hdd_memdump.c @@ -35,6 +35,11 @@ #include <sme_Api.h> #include <wlan_hdd_includes.h> #include "wlan_hdd_memdump.h" +#include <linux/module.h> +#include <linux/kernel.h> +#include <linux/version.h> +#include <linux/proc_fs.h> /* Necessary because we use the proc fs */ +#include <linux/uaccess.h> /* for copy_to_user */ /** * memdump_cleanup_timer_cb() - Timer callback function for memory dump cleanup. @@ -265,6 +270,33 @@ int wlan_hdd_cfg80211_get_fw_mem_dump(struct wiphy *wiphy, static struct proc_dir_entry *proc_file, *proc_dir; +/** memdump_get_file_data() - get data available in proc file + * + * @file - handle for the proc file. + * + * This function is used to retrieve the data passed while + * creating proc file entry. + * + * Return: void pointer to hdd_context + */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)) || defined(WITH_BACKPORTS) +static void *memdump_get_file_data(struct file *file) +{ + void *hdd_ctx; + + hdd_ctx = PDE_DATA(file_inode(file)); + return hdd_ctx; +} +#else +static void *memdump_get_file_data(struct file *file) +{ + void *hdd_ctx; + + hdd_ctx = PDE(file->f_path.dentry->d_inode)->data; + return hdd_ctx; +} +#endif + /** * memdump_read() - perform read operation in memory dump proc file * @@ -281,11 +313,13 @@ static ssize_t memdump_read(struct file *file, char __user *buf, size_t count, loff_t *pos) { int status; - hdd_context_t *hdd_ctx = (hdd_context_t *)PDE_DATA(file_inode(file)); + hdd_context_t *hdd_ctx; adf_os_dma_addr_t paddr; adf_os_dma_addr_t dma_ctx; adf_os_device_t adf_ctx; + hdd_ctx = memdump_get_file_data(file); + hddLog(LOG1, FL("Read req for size:%zu pos:%llu"), count, *pos); status = wlan_hdd_validate_context(hdd_ctx); if (0 != status) { |
