From b22da3d8526a935aa31e086e63f60ff3246cb61c Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Sat, 09 Dec 2023 07:24:11 +0000
Subject: [PATCH] add stmac read mac form eeprom
---
kernel/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_linux_exportfs.c | 26 ++++++++++++--------------
1 files changed, 12 insertions(+), 14 deletions(-)
diff --git a/kernel/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_linux_exportfs.c b/kernel/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_linux_exportfs.c
old mode 100644
new mode 100755
index b74df3d..7025531
--- a/kernel/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_linux_exportfs.c
+++ b/kernel/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_linux_exportfs.c
@@ -59,9 +59,7 @@
{
int ret = BCME_ERROR;
if (inode) {
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0))
- ret = single_open(file, 0, pde_data(inode));
-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0))
ret = single_open(file, 0, PDE_DATA(inode));
#else
/* This feature is not supported for lower kernel versions */
@@ -1193,8 +1191,8 @@
int ret = 0;
/* Read memdump info from the file */
- fp = dhd_filp_open(filepath, O_RDONLY, 0);
- if (IS_ERR(fp) || (fp == NULL)) {
+ fp = filp_open(filepath, O_RDONLY, 0);
+ if (IS_ERR(fp)) {
DHD_ERROR(("%s: File [%s] doesn't exist\n", __FUNCTION__, filepath));
#if defined(CONFIG_X86) && defined(OEM_ANDROID)
/* Check if it is Live Brix Image */
@@ -1204,8 +1202,8 @@
/* Try if it is Installed Brix Image */
filepath = MEMDUMPINFO_INST;
DHD_ERROR(("%s: Try File [%s]\n", __FUNCTION__, filepath));
- fp = dhd_filp_open(filepath, O_RDONLY, 0);
- if (IS_ERR(fp) || (fp == NULL)) {
+ fp = filp_open(filepath, O_RDONLY, 0);
+ if (IS_ERR(fp)) {
DHD_ERROR(("%s: File [%s] doesn't exist\n", __FUNCTION__, filepath));
goto done;
}
@@ -1215,10 +1213,10 @@
}
/* Handle success case */
- ret = dhd_kernel_read_compat(fp, 0, (char *)&mem_val, sizeof(uint32));
+ ret = kernel_read_compat(fp, 0, (char *)&mem_val, sizeof(uint32));
if (ret < 0) {
DHD_ERROR(("%s: File read error, ret=%d\n", __FUNCTION__, ret));
- dhd_filp_close(fp, NULL);
+ filp_close(fp, NULL);
goto done;
}
@@ -1226,7 +1224,7 @@
p_mem_val[sizeof(uint32) - 1] = '\0';
mem_val = bcm_atoi(p_mem_val);
- dhd_filp_close(fp, NULL);
+ filp_close(fp, NULL);
done:
return mem_val;
@@ -1337,11 +1335,11 @@
* 2: Trigger Kernel crash by BUG()
* File doesn't exist: Keep default value (1).
*/
- fp = dhd_filp_open(filepath, O_RDONLY, 0);
- if (IS_ERR(fp) || (fp == NULL)) {
+ fp = filp_open(filepath, O_RDONLY, 0);
+ if (IS_ERR(fp)) {
DHD_ERROR(("%s: File [%s] doesn't exist\n", __FUNCTION__, filepath));
} else {
- int ret = dhd_kernel_read_compat(fp, 0, (char *)&mem_val, sizeof(uint32));
+ int ret = kernel_read_compat(fp, 0, (char *)&mem_val, sizeof(uint32));
if (ret < 0) {
DHD_ERROR(("%s: File read error, ret=%d\n", __FUNCTION__, ret));
} else {
@@ -1350,7 +1348,7 @@
mem_val = bcm_atoi(p_mem_val);
DHD_ERROR(("%s: ASSERT ENABLED = %d\n", __FUNCTION__, mem_val));
}
- dhd_filp_close(fp, NULL);
+ filp_close(fp, NULL);
}
#ifdef CUSTOMER_HW4_DEBUG
--
Gitblit v1.6.2