Skip to content

Commit

Permalink
fix build works with kernel 5.15.89
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Blais webmaster@jbsky.fr
  • Loading branch information
root authored and jbsky committed Mar 10, 2023
1 parent 111118d commit 0d6bd0d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Kconfig
Expand Up @@ -2,7 +2,7 @@ config MWLWIFI
tristate "Marvell Avastar 88W8864/88W8897 PCIe driver (mac80211 compatible)"
depends on PCI && MAC80211
select FW_LOADER
---help---
help
Select to build the driver supporting the:

Marvell Wireless Wi-Fi 88W8864 modules
Expand Down
15 changes: 15 additions & 0 deletions hif/pcie/pcie.c
Expand Up @@ -31,7 +31,9 @@
#include "hif/pcie/rx_ndp.h"

#define PCIE_DRV_DESC "Marvell Mac80211 Wireless PCIE Network Driver"
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,15,30)
#define PCIE_DEV_NAME "Marvell 802.11ac PCIE Adapter"
#endif

#define MAX_WAIT_FW_COMPLETE_ITERATIONS 10000
#define CHECK_BA_TRAFFIC_TIME 300 /* msec */
Expand Down Expand Up @@ -1294,8 +1296,15 @@ static void pcie_bf_mimo_ctrl_decode(struct mwl_priv *priv,
char *buf = &str_buf[0];
mm_segment_t oldfs;

#if LINUX_VERSION_CODE < KERNEL_VERSION(5,0,0)
oldfs = get_fs();
set_fs( get_ds() );
#elif LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0)
oldfs = get_fs();
set_fs(KERNEL_DS);
#else
oldfs = force_uaccess_begin();
#endif

buf += sprintf(buf, "\nMAC: %pM\n", bf_mimo_ctrl->rec_mac);
buf += sprintf(buf, "SU_0_MU_1: %d\n", bf_mimo_ctrl->type);
Expand All @@ -1315,7 +1324,11 @@ static void pcie_bf_mimo_ctrl_decode(struct mwl_priv *priv,
filename, (unsigned int)fp_data);
}

#if LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0)
set_fs(oldfs);
#else
force_uaccess_end(oldfs);
#endif
}

static void pcie_process_account(struct ieee80211_hw *hw)
Expand Down Expand Up @@ -1641,5 +1654,7 @@ MODULE_DESCRIPTION(PCIE_DRV_DESC);
MODULE_VERSION(PCIE_DRV_VERSION);
MODULE_AUTHOR("Marvell Semiconductor, Inc.");
MODULE_LICENSE("GPL v2");
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,15,30)
MODULE_SUPPORTED_DEVICE(PCIE_DEV_NAME);
#endif
MODULE_DEVICE_TABLE(pci, pcie_id_tbl);

0 comments on commit 0d6bd0d

Please sign in to comment.