Added kernel v5.2 support

This commit is contained in:
kimocoder 2019-05-24 17:32:24 +02:00
commit 898696bd98
4 changed files with 34 additions and 4 deletions

View File

@ -63,6 +63,9 @@ unmanaged-devices=mac:A7:A7:A7:A7:A7
* Check code with checkpatch.pl (found in "tools")
* There is a bug in monitor mode related to Network-Manager.
This needs priority because it causes interferrence.
* Add more VID/PIDS for all 3 chipsets supported.
* Remove unused functions
<br>

View File

@ -775,6 +775,10 @@ u32 rtw_free_stainfo(_adapter *padapter , struct sta_info *psta)
pstapriv->sta_aid[psta->cmn.aid - 1] = NULL;
psta->cmn.aid = 0;
}
if (psta->aid > 31) {
pr_err("***** psta->aid (%d) out of bounds\n", psta->aid);
return _FAIL;
}
}
#endif /* CONFIG_NATIVEAP_MLME */

View File

@ -4137,6 +4137,7 @@ void rtw_cfg80211_indicate_sta_assoc(_adapter *padapter, u8 *pmgmt_frame, uint f
#if defined(RTW_USE_CFG80211_STA_EVENT) || defined(COMPAT_KERNEL_RELEASE)
{
struct station_info sinfo;
_rtw_memset(&sinfo, 0, sizeof(struct station_info));
u8 ie_offset;
if (get_frame_sub_type(pmgmt_frame) == WIFI_ASSOCREQ)
ie_offset = _ASOCREQ_IE_OFFSET_;
@ -4426,7 +4427,11 @@ static const struct net_device_ops rtw_cfg80211_monitor_if_ops = {
};
#endif
static int rtw_cfg80211_add_monitor_if(_adapter *padapter, char *name, struct net_device **ndev)
static int rtw_cfg80211_add_monitor_if(_adapter *padapter, char *name,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
unsigned char name_assign_type,
#endif
struct net_device **ndev)
{
int ret = 0;
struct net_device *mon_ndev = NULL;
@ -4457,6 +4462,9 @@ static int rtw_cfg80211_add_monitor_if(_adapter *padapter, char *name, struct ne
mon_ndev->type = ARPHRD_IEEE80211_RADIOTAP;
strncpy(mon_ndev->name, name, IFNAMSIZ);
mon_ndev->name[IFNAMSIZ - 1] = 0;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
mon_ndev->name_assign_type = name_assign_type;
#endif
#if (LINUX_VERSION_CODE > KERNEL_VERSION(4, 11, 8))
mon_ndev->priv_destructor = rtw_ndev_destructor;
#else
@ -4546,7 +4554,11 @@ static int
switch (type) {
case NL80211_IFTYPE_MONITOR:
padapter = wiphy_to_adapter(wiphy); /* TODO: get ap iface ? */
ret = rtw_cfg80211_add_monitor_if(padapter, (char *)name, &ndev);
ret = rtw_cfg80211_add_monitor_if(padapter, (char *)name,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
name_assign_type,
#endif
&ndev);
if (ret == 0)
wdev = ndev->ieee80211_ptr;
break;
@ -8826,7 +8838,13 @@ static void rtw_cfg80211_init_ht_capab(_adapter *padapter
ht_cap->ht_supported = _TRUE;
ht_cap->cap = IEEE80211_HT_CAP_SUP_WIDTH_20_40 |
/* According to the comment in rtw_ap.c:
* "Note: currently we switch to the MIXED op mode if HT non-greenfield
* station is associated. Probably it's a theoretical case, since
* it looks like all known HT STAs support greenfield."
* Therefore Greenfield is added to ht_cap
*/
ht_cap->cap = IEEE80211_HT_CAP_SUP_WIDTH_20_40 | IEEE80211_HT_CAP_GRN_FLD |
IEEE80211_HT_CAP_SGI_40 | IEEE80211_HT_CAP_SGI_20 |
IEEE80211_HT_CAP_DSSSCCK40 | IEEE80211_HT_CAP_MAX_AMSDU;
rtw_cfg80211_init_ht_capab_ex(padapter, ht_cap, band, rf_type);

View File

@ -1676,6 +1676,10 @@ void rtw_os_ndev_unregister(_adapter *adapter)
#endif
if ((adapter->DriverState != DRIVER_DISAPPEAR) && netdev) {
#ifdef CONFIG_IOCTL_CFG80211
struct wireless_dev *wdev = padapter->rtw_wdev;
wdev->current_bss = NULL;
#endif
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
u8 rtnl_lock_needed = rtw_rtnl_lock_needed(dvobj);
@ -3553,10 +3557,11 @@ static int netdev_close(struct net_device *pnetdev)
#endif /* CONFIG_P2P */
#ifdef CONFIG_IOCTL_CFG80211
wdev->iftype = NL80211_IFTYPE_STATION;
rtw_scan_abort(padapter);
rtw_cfg80211_wait_scan_req_empty(padapter, 200);
adapter_wdev_data(padapter)->bandroid_scan = _FALSE;
//padapter->rtw_wdev->iftype = NL80211_IFTYPE_MONITOR; /* set this at the end */
padapter->rtw_wdev->iftype = NL80211_IFTYPE_STATION; /* set this at the end */
#endif /* CONFIG_IOCTL_CFG80211 */
#ifdef CONFIG_WAPI_SUPPORT