Update upstream source from tag 'upstream/5.3.9_git20201227'

Update to upstream version '5.3.9~git20201227'
with Debian dir 26f5989d84
This commit is contained in:
Sophie Brun 2021-01-26 17:02:05 +01:00
commit f074eb5844
3 changed files with 40 additions and 16 deletions

View File

@ -23,14 +23,14 @@
# Howto build/install # Howto build/install
1. You will need to blacklist another driver in order to use this one. 1. You will need to blacklist another driver in order to use this one.
2. "echo "blacklist r8188eu" > "/etc/modprobe.d/realtek.conf" 2. `echo "blacklist r8188eu" >> "/etc/modprobe.d/realtek.conf"`
3. "make && make install"<br> 3. `make && make install`
4. Reboot in order to blacklist and load the new driver/module. 4. Reboot in order to blacklist and load the new driver/module.
# MONITOR MODE howto # MONITOR MODE howto
Use these steps to enter monitor mode. Use these steps to enter monitor mode.
``` ```
$ sudo airmon-ng check-kill $ sudo airmon-ng check kill
$ sudo ip link set <interface> down $ sudo ip link set <interface> down
$ sudo iw dev <interface> set type monitor $ sudo iw dev <interface> set type monitor
``` ```
@ -42,7 +42,7 @@ $ aireplay -9 <interface>
# NetworkManager configuration # NetworkManager configuration
Add these lines below to "NetworkManager.conf" and ADD YOUR ADAPTER MAC below [keyfile] Add these lines below to "NetworkManager.conf" and ADD YOUR ADAPTER MAC below [keyfile]
This will make the Network-Manager ignore the device, and therefor don't cause problems. This will make the Network-Manager ignore the device, and therefore don't cause problems.
``` ```
[device] [device]
wifi.scan-rand-mac-address=no wifi.scan-rand-mac-address=no

View File

@ -7088,18 +7088,16 @@ exit:
return ret; return ret;
} }
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0))
static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy, static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
struct wireless_dev *wdev, struct wireless_dev *wdev,
#else #else
struct net_device *ndev, struct net_device *ndev,
#endif #endif
u16 frame_type, bool reg) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
struct mgmt_frame_regs *upd)
#else #else
static void cfg80211_rtw_update_mgmt_frame_register(struct wiphy *wiphy, u16 frame_type, bool reg)
struct wireless_dev *wdev,
struct mgmt_frame_regs *upd)
#endif #endif
{ {
@ -7110,6 +7108,12 @@ static void cfg80211_rtw_update_mgmt_frame_register(struct wiphy *wiphy,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
struct net_device *ndev = wdev_to_ndev(wdev); struct net_device *ndev = wdev_to_ndev(wdev);
#endif #endif
/* hardcoded always true, to make it pass compilation */
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
bool reg = true;
#endif
_adapter *adapter; _adapter *adapter;
struct rtw_wdev_priv *pwdev_priv; struct rtw_wdev_priv *pwdev_priv;
@ -7132,8 +7136,13 @@ static void cfg80211_rtw_update_mgmt_frame_register(struct wiphy *wiphy,
/* Wait QC Verify */ /* Wait QC Verify */
return; return;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0))
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
switch (upd->interface_stypes) {
#else
switch (frame_type) { switch (frame_type) {
#endif
case IEEE80211_STYPE_PROBE_REQ: /* 0x0040 */ case IEEE80211_STYPE_PROBE_REQ: /* 0x0040 */
SET_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_PROBE_REQ, reg); SET_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_PROBE_REQ, reg);
break; break;
@ -9454,10 +9463,10 @@ static struct cfg80211_ops rtw_cfg80211_ops = {
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE)
.mgmt_tx = cfg80211_rtw_mgmt_tx, .mgmt_tx = cfg80211_rtw_mgmt_tx,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
.mgmt_frame_register = cfg80211_rtw_mgmt_frame_register, .update_mgmt_frame_registrations = cfg80211_rtw_mgmt_frame_register,
#else #else
.update_mgmt_frame_registrations = cfg80211_rtw_update_mgmt_frame_register, .mgmt_frame_register = cfg80211_rtw_mgmt_frame_register,
#endif #endif
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34) && LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35)) #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34) && LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35))
.action = cfg80211_rtw_mgmt_tx, .action = cfg80211_rtw_mgmt_tx,
@ -9792,5 +9801,3 @@ void rtw_cfg80211_dev_res_unregister(struct dvobj_priv *dvobj)
rtw_wiphy_unregister(dvobj_to_wiphy(dvobj)); rtw_wiphy_unregister(dvobj_to_wiphy(dvobj));
#endif #endif
} }
#endif /* CONFIG_IOCTL_CFG80211 */

View File

@ -2139,15 +2139,19 @@ static int isFileReadable(const char *path, u32 *sz)
{ {
struct file *fp; struct file *fp;
int ret = 0; int ret = 0;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
mm_segment_t oldfs; mm_segment_t oldfs;
#endif
char buf; char buf;
fp = filp_open(path, O_RDONLY, 0); fp = filp_open(path, O_RDONLY, 0);
if (IS_ERR(fp)) if (IS_ERR(fp))
ret = PTR_ERR(fp); ret = PTR_ERR(fp);
else { else {
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
oldfs = get_fs(); oldfs = get_fs();
set_fs(KERNEL_DS); set_fs(KERNEL_DS);
#endif
if (1 != readFile(fp, &buf, 1)) if (1 != readFile(fp, &buf, 1))
ret = PTR_ERR(fp); ret = PTR_ERR(fp);
@ -2159,8 +2163,9 @@ static int isFileReadable(const char *path, u32 *sz)
*sz = i_size_read(fp->f_dentry->d_inode); *sz = i_size_read(fp->f_dentry->d_inode);
#endif #endif
} }
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
set_fs(oldfs); set_fs(oldfs);
#endif
filp_close(fp, NULL); filp_close(fp, NULL);
} }
return ret; return ret;
@ -2176,7 +2181,9 @@ static int isFileReadable(const char *path, u32 *sz)
static int retriveFromFile(const char *path, u8 *buf, u32 sz) static int retriveFromFile(const char *path, u8 *buf, u32 sz)
{ {
int ret = -1; int ret = -1;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
mm_segment_t oldfs; mm_segment_t oldfs;
#endif
struct file *fp; struct file *fp;
if (path && buf) { if (path && buf) {
@ -2184,10 +2191,14 @@ static int retriveFromFile(const char *path, u8 *buf, u32 sz)
if (0 == ret) { if (0 == ret) {
RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp); RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp);
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
oldfs = get_fs(); oldfs = get_fs();
set_fs(KERNEL_DS); set_fs(KERNEL_DS);
#endif
ret = readFile(fp, buf, sz); ret = readFile(fp, buf, sz);
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
set_fs(oldfs); set_fs(oldfs);
#endif
closeFile(fp); closeFile(fp);
RTW_INFO("%s readFile, ret:%d\n", __FUNCTION__, ret); RTW_INFO("%s readFile, ret:%d\n", __FUNCTION__, ret);
@ -2211,7 +2222,9 @@ static int retriveFromFile(const char *path, u8 *buf, u32 sz)
static int storeToFile(const char *path, u8 *buf, u32 sz) static int storeToFile(const char *path, u8 *buf, u32 sz)
{ {
int ret = 0; int ret = 0;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
mm_segment_t oldfs; mm_segment_t oldfs;
#endif
struct file *fp; struct file *fp;
if (path && buf) { if (path && buf) {
@ -2219,10 +2232,14 @@ static int storeToFile(const char *path, u8 *buf, u32 sz)
if (0 == ret) { if (0 == ret) {
RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp); RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp);
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
oldfs = get_fs(); oldfs = get_fs();
set_fs(KERNEL_DS); set_fs(KERNEL_DS);
#endif
ret = writeFile(fp, buf, sz); ret = writeFile(fp, buf, sz);
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
set_fs(oldfs); set_fs(oldfs);
#endif
closeFile(fp); closeFile(fp);
RTW_INFO("%s writeFile, ret:%d\n", __FUNCTION__, ret); RTW_INFO("%s writeFile, ret:%d\n", __FUNCTION__, ret);