Skip to content

Commit

Permalink
Merge pull request #4 from rhssk/master
Browse files Browse the repository at this point in the history
Fix build on >=6.7 kernels
  • Loading branch information
raphaelscholle authored Mar 23, 2024
2 parents aad91d6 + abe7399 commit 4e07c13
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
15 changes: 13 additions & 2 deletions os_dep/linux/ioctl_cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -5404,14 +5404,25 @@ static int cfg80211_rtw_start_ap(struct wiphy *wiphy, struct net_device *ndev,
}

static int cfg80211_rtw_change_beacon(struct wiphy *wiphy, struct net_device *ndev,
struct cfg80211_beacon_data *info)
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 7, 0))
struct cfg80211_ap_update *info
#else
struct cfg80211_beacon_data *info
#endif
)
{
int ret = 0;
_adapter *adapter = (_adapter *)rtw_netdev_priv(ndev);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 7, 0))
struct cfg80211_beacon_data *beacon_info = &info->beacon;
#else
struct cfg80211_beacon_data *beacon_info = info;
#endif

RTW_INFO(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));

ret = rtw_add_beacon(adapter, info->head, info->head_len, info->tail, info->tail_len);
ret = rtw_add_beacon(adapter, beacon_info->head, beacon_info->head_len,
beacon_info->tail, beacon_info->tail_len);

return ret;
}
Expand Down
10 changes: 5 additions & 5 deletions os_dep/linux/os_intfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2042,13 +2042,13 @@ static void rtw_ethtool_get_drvinfo(struct net_device *dev, struct ethtool_drvin

wdev = dev->ieee80211_ptr;
if (wdev) {
strlcpy(info->driver, wiphy_dev(wdev->wiphy)->driver->name,
strscpy(info->driver, wiphy_dev(wdev->wiphy)->driver->name,
sizeof(info->driver));
} else {
strlcpy(info->driver, "N/A", sizeof(info->driver));
strscpy(info->driver, "N/A", sizeof(info->driver));
}

strlcpy(info->version, DRIVERVERSION, sizeof(info->version));
strscpy(info->version, DRIVERVERSION, sizeof(info->version));

padapter = (_adapter *)rtw_netdev_priv(dev);
if (padapter) {
Expand All @@ -2059,10 +2059,10 @@ static void rtw_ethtool_get_drvinfo(struct net_device *dev, struct ethtool_drvin
scnprintf(info->fw_version, sizeof(info->fw_version), "%d.%d",
hal_data->firmware_version, hal_data->firmware_sub_version);
} else {
strlcpy(info->fw_version, "N/A", sizeof(info->fw_version));
strscpy(info->fw_version, "N/A", sizeof(info->fw_version));
}

strlcpy(info->bus_info, dev_name(wiphy_dev(wdev->wiphy)),
strscpy(info->bus_info, dev_name(wiphy_dev(wdev->wiphy)),
sizeof(info->bus_info));
}

Expand Down
2 changes: 1 addition & 1 deletion os_dep/linux/usb_intf.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ struct rtw_usb_drv usb_drv = {
.usbdrv.reset_resume = rtw_resume,
#endif

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19))
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19) && LINUX_VERSION_CODE < KERNEL_VERSION(6, 8, 0))
.usbdrv.drvwrap.driver.shutdown = rtw_dev_shutdown,
#else
.usbdrv.driver.shutdown = rtw_dev_shutdown,
Expand Down

0 comments on commit 4e07c13

Please sign in to comment.