Fix build for newer kernels

This commit is contained in:
Juan José Gutiérrez de Quevedo Pérez 2022-11-20 22:29:23 +01:00
parent 530f10b9e5
commit d95287c99d
4 changed files with 43 additions and 8 deletions

18
os_dep/linux/addr_utils.c Normal file
View file

@ -0,0 +1,18 @@
#include <linux/ctype.h> /* tolower() */
int is_multicast_mac_addr(const u8 *addr)
{
return ((addr[0] != 0xff) && (0x01 & addr[0]));
}
int is_broadcast_mac_addr(const u8 *addr)
{
return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \
(addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff));
}
int is_zero_mac_addr(const u8 *addr)
{
return ((addr[0] == 0x00) && (addr[1] == 0x00) && (addr[2] == 0x00) && \
(addr[3] == 0x00) && (addr[4] == 0x00) && (addr[5] == 0x00));
}

View file

@ -4302,7 +4302,7 @@ static int cfg80211_rtw_change_beacon(struct wiphy *wiphy, struct net_device *nd
return ret;
}
static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev, unsigned int notify)
{
DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));
return 0;
@ -6812,7 +6812,7 @@ void rtw_wdev_unregister(struct wireless_dev *wdev)
rtw_cfg80211_indicate_scan_done(adapter, _TRUE);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)) || defined(COMPAT_KERNEL_RELEASE)
if (wdev->current_bss) {
if (wdev->u.ibss.current_bss) {
DBG_871X(FUNC_ADPT_FMT" clear current_bss by cfg80211_disconnected\n", FUNC_ADPT_ARG(adapter));
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0)
cfg80211_disconnected(adapter->pnetdev, 0, NULL, 0, GFP_ATOMIC);