summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAhmed ElArabawy <arabawy@google.com>2020-10-05 10:02:15 -0700
committerAhmed ElArabawy <arabawy@google.com>2020-10-05 13:20:43 -0700
commitc20ac55c6e29db9c6e480aaeabd866862d9576ac (patch)
tree124d852282053fa9604a0dde22c1c13aa76a0a9e
parentad8cf57918f614e334c5f88f34f2fa670212d31d (diff)
downloadbcm43752-c20ac55c6e29db9c6e480aaeabd866862d9576ac.tar.gz
Changes to upgrade dhd to build with Kernel 5.9
This commit has some changes to upgrade dhd to Kernel 5.9 This includes: 1. Replace argument of proc_create_data from file_operations to proc_ops 2. Replace the wait_queue_head for pno state into a swait_queue_head 3. Remove the duplicate definition of WLAN_AKM_SUITE_FT_8021X_SHA384 4. Replace ioremap_nocache with ioremap (it is no-cache by default) 5. Removed the use of smp_read_barrier_depends() 6. Remove mgmt_frame_register from cfg80211_ops 7. Replace getnstimeofday() with ktime_get_real_ts64() Bug: 169622740 Test: Build successful in mainline kernel branch Change-Id: If5f427e2420f4cc28448462343322e36b27ed265 Signed-off-by: Ahmed ElArabawy <arabawy@google.com>
-rwxr-xr-xdhd_linux_exportfs.c16
-rw-r--r--dhd_pno.c10
-rw-r--r--include/linux_osl.h10
-rw-r--r--include/linuxver.h4
-rwxr-xr-xwl_cfg80211.c4
-rw-r--r--wl_cfg80211.h5
6 files changed, 38 insertions, 11 deletions
diff --git a/dhd_linux_exportfs.c b/dhd_linux_exportfs.c
index 36eed8b..8c0e0ee 100755
--- a/dhd_linux_exportfs.c
+++ b/dhd_linux_exportfs.c
@@ -42,11 +42,19 @@ extern dhd_pub_t* g_dhd_pub;
static int dhd_ring_proc_open(struct inode *inode, struct file *file);
ssize_t dhd_ring_proc_read(struct file *file, char *buffer, size_t tt, loff_t *loff);
-static const struct file_operations dhd_ring_proc_fops = {
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 6, 0))
+static const struct file_operations dhd_ring_proc_ops = {
.open = dhd_ring_proc_open,
.read = dhd_ring_proc_read,
.release = single_release,
};
+#else
+static const struct proc_ops dhd_ring_proc_ops = {
+ .proc_open = dhd_ring_proc_open,
+ .proc_read = dhd_ring_proc_read,
+ .proc_release = single_release,
+};
+#endif
static int
dhd_ring_proc_open(struct inode *inode, struct file *file)
@@ -109,7 +117,7 @@ dhd_dbg_ring_proc_create(dhd_pub_t *dhdp)
dbg_verbose_ring = dhd_dbg_get_ring_from_ring_id(dhdp, FW_VERBOSE_RING_ID);
if (dbg_verbose_ring) {
- if (!proc_create_data("dhd_trace", S_IRUSR, NULL, &dhd_ring_proc_fops,
+ if (!proc_create_data("dhd_trace", S_IRUSR, NULL, &dhd_ring_proc_ops,
dbg_verbose_ring)) {
DHD_ERROR(("Failed to create /proc/dhd_trace procfs interface\n"));
} else {
@@ -121,7 +129,7 @@ dhd_dbg_ring_proc_create(dhd_pub_t *dhdp)
#endif /* DEBUGABILITY */
#ifdef EWP_ECNTRS_LOGGING
- if (!proc_create_data("dhd_ecounters", S_IRUSR, NULL, &dhd_ring_proc_fops,
+ if (!proc_create_data("dhd_ecounters", S_IRUSR, NULL, &dhd_ring_proc_ops,
dhdp->ecntr_dbg_ring)) {
DHD_ERROR(("Failed to create /proc/dhd_ecounters procfs interface\n"));
} else {
@@ -130,7 +138,7 @@ dhd_dbg_ring_proc_create(dhd_pub_t *dhdp)
#endif /* EWP_ECNTRS_LOGGING */
#ifdef EWP_RTT_LOGGING
- if (!proc_create_data("dhd_rtt", S_IRUSR, NULL, &dhd_ring_proc_fops,
+ if (!proc_create_data("dhd_rtt", S_IRUSR, NULL, &dhd_ring_proc_ops,
dhdp->rtt_dbg_ring)) {
DHD_ERROR(("Failed to create /proc/dhd_rtt procfs interface\n"));
} else {
diff --git a/dhd_pno.c b/dhd_pno.c
index d2d94d7..33ab29c 100644
--- a/dhd_pno.c
+++ b/dhd_pno.c
@@ -72,6 +72,12 @@
#define dtohchanspec(i) (i)
#endif /* IL_BIGENDINA */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0))
+#define COMPLETION_WAIT_QUEUE_ACTIVE swait_active
+#else
+#define COMPLETION_WAIT_QUEUE_ACTIVE waitqueue_active
+#endif
+
#define NULL_CHECK(p, s, err) \
do { \
if (!(p)) { \
@@ -3438,7 +3444,7 @@ exit:
}
mutex_unlock(&_pno_state->pno_mutex);
exit_no_unlock:
- if (waitqueue_active(&_pno_state->get_batch_done.wait))
+ if (COMPLETION_WAIT_QUEUE_ACTIVE(&_pno_state->get_batch_done.wait))
complete(&_pno_state->get_batch_done);
return err;
}
@@ -4317,7 +4323,7 @@ dhd_pno_event_handler(dhd_pub_t *dhd, wl_event_msg_t *event, void *event_data)
{
struct dhd_pno_batch_params *params_batch;
params_batch = &_pno_state->pno_params_arr[INDEX_OF_BATCH_PARAMS].params_batch;
- if (!waitqueue_active(&_pno_state->get_batch_done.wait)) {
+ if (!COMPLETION_WAIT_QUEUE_ACTIVE(&_pno_state->get_batch_done.wait)) {
DHD_PNO(("%s : WLC_E_PFN_BEST_BATCHING\n", __FUNCTION__));
params_batch->get_batch.buf = NULL;
params_batch->get_batch.bufsize = 0;
diff --git a/include/linux_osl.h b/include/linux_osl.h
index d58cfe9..7e7d787 100644
--- a/include/linux_osl.h
+++ b/include/linux_osl.h
@@ -446,9 +446,17 @@ extern int exynos_pcie_l1_exit(int ch_num);
/* dereference an address that may cause a bus exception */
#define BUSPROBE(val, addr) ({ (val) = R_REG(NULL, (addr)); 0; })
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)
+ /* 'ioremap_nocache' was deprecated in kernels >= 5.6, so instead we use 'ioremap' which
+ is no-cache by default since kernels 2.6.25. */
+#define IOREMAP_NO_CACHE(address, size) ioremap(address, size)
+#else /* KERNEL_VERSION < 2.6.25 */
+#define IOREMAP_NO_CACHE(address, size) ioremap_nocache(address, size)
+#endif
+
/* map/unmap physical to virtual I/O */
#if !defined(CONFIG_MMC_MSM7X00A)
-#define REG_MAP(pa, size) ioremap_nocache((unsigned long)(pa), (unsigned long)(size))
+#define REG_MAP(pa, size) IOREMAP_NO_CACHE((unsigned long)(pa), (unsigned long)(size))
#else
#define REG_MAP(pa, size) (void *)(0)
#endif /* !defined(CONFIG_MMC_MSM7X00A */
diff --git a/include/linuxver.h b/include/linuxver.h
index 2388f36..ecd2211 100644
--- a/include/linuxver.h
+++ b/include/linuxver.h
@@ -666,7 +666,9 @@ static inline bool binary_sema_up(tsk_ctl_t *tsk)
return sem_up;
}
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0))
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(5, 6, 0))
+#define SMP_RD_BARRIER_DEPENDS(x)
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0))
#define SMP_RD_BARRIER_DEPENDS(x) smp_read_barrier_depends(x)
#else
#define SMP_RD_BARRIER_DEPENDS(x) smp_rmb(x)
diff --git a/wl_cfg80211.c b/wl_cfg80211.c
index 6123d69..86e0c10 100755
--- a/wl_cfg80211.c
+++ b/wl_cfg80211.c
@@ -9885,6 +9885,7 @@ exit:
return err;
}
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0))
static void
wl_cfg80211_mgmt_frame_register(struct wiphy *wiphy, bcm_struct_cfgdev *cfgdev,
u16 frame, bool reg)
@@ -9897,6 +9898,7 @@ wl_cfg80211_mgmt_frame_register(struct wiphy *wiphy, bcm_struct_cfgdev *cfgdev,
return;
}
+#endif
static s32
wl_cfg80211_change_bss(struct wiphy *wiphy,
@@ -13045,7 +13047,9 @@ static struct cfg80211_ops wl_cfg80211_ops = {
.remain_on_channel = wl_cfgscan_remain_on_channel,
.cancel_remain_on_channel = wl_cfgscan_cancel_remain_on_channel,
.mgmt_tx = wl_cfg80211_mgmt_tx,
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0))
.mgmt_frame_register = wl_cfg80211_mgmt_frame_register,
+#endif
.change_bss = wl_cfg80211_change_bss,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0)) || defined(WL_COMPAT_WIRELESS)
.set_channel = wl_cfg80211_set_channel,
diff --git a/wl_cfg80211.h b/wl_cfg80211.h
index b0f0f3a..fe7d7ae 100644
--- a/wl_cfg80211.h
+++ b/wl_cfg80211.h
@@ -501,10 +501,9 @@ do { \
#define WLAN_AKM_SUITE_8021X_SUITE_B_192 0x000FAC0C
#endif /* WLAN_AKM_SUITE_8021X_SUITE_B */
-/* TODO: even in upstream linux(v5.0), FT-1X-SHA384 isn't defined and supported yet.
- * need to revisit here to sync correct name later.
- */
+#ifndef WLAN_AKM_SUITE_FT_8021X_SHA384
#define WLAN_AKM_SUITE_FT_8021X_SHA384 0x000FAC0D
+#endif
#define WL_AKM_SUITE_SHA256_1X 0x000FAC05
#define WL_AKM_SUITE_SHA256_PSK 0x000FAC06