Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support to build on rocky9.4 #1167

Open
wants to merge 1 commit into
base: v5.6.4.2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 19 additions & 14 deletions os_dep/linux/ioctl_cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,8 @@ u8 rtw_cfg80211_ch_switch_notify(_adapter *adapter, u8 ch, u8 bw, u8 offset,

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0))
if (started) {
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 9, 0))
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 9, 0)) \
|| (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 0))
cfg80211_ch_switch_started_notify(adapter->pnetdev, &chdef, 0, 0, false, 0);
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
cfg80211_ch_switch_started_notify(adapter->pnetdev, &chdef, 0, 0, false);
Expand All @@ -476,7 +477,8 @@ u8 rtw_cfg80211_ch_switch_notify(_adapter *adapter, u8 ch, u8 bw, u8 offset,
if (!rtw_cfg80211_allow_ch_switch_notify(adapter))
goto exit;

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 9, 0))
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 9, 0)) \
|| (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 0))
cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0, 0);
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2))
cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0);
Expand Down Expand Up @@ -1155,10 +1157,13 @@ void rtw_cfg80211_indicate_connect(_adapter *padapter)
#endif

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0)
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0)
#if RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 0)
#else
roam_info.channel = notify_channel;
roam_info.bssid = cur_network->network.MacAddress;
#endif
#endif
roam_info.req_ie = pmlmepriv->assoc_req + sizeof(struct rtw_ieee80211_hdr_3addr) + 2;
roam_info.req_ie_len = pmlmepriv->assoc_req_len - sizeof(struct rtw_ieee80211_hdr_3addr) - 2;
roam_info.resp_ie = pmlmepriv->assoc_rsp + sizeof(struct rtw_ieee80211_hdr_3addr) + 6;
Expand Down Expand Up @@ -1738,7 +1743,7 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, struct ieee_param
}

static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) || (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 0))
, int link_id
#endif
, u8 key_index
Expand Down Expand Up @@ -1885,7 +1890,7 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev
}

static int cfg80211_rtw_get_key(struct wiphy *wiphy, struct net_device *ndev
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) || (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 0))
, int link_id
#endif
, u8 keyid
Expand Down Expand Up @@ -2053,7 +2058,7 @@ static int cfg80211_rtw_get_key(struct wiphy *wiphy, struct net_device *ndev
}

static int cfg80211_rtw_del_key(struct wiphy *wiphy, struct net_device *ndev,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) || (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 0))
int link_id,
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE)
Expand All @@ -2077,7 +2082,7 @@ static int cfg80211_rtw_del_key(struct wiphy *wiphy, struct net_device *ndev,

static int cfg80211_rtw_set_default_key(struct wiphy *wiphy,
struct net_device *ndev,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) || (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 0))
int link_id,
#endif
u8 key_index
Expand Down Expand Up @@ -2129,7 +2134,7 @@ static int cfg80211_rtw_set_default_key(struct wiphy *wiphy,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30))
int cfg80211_rtw_set_default_mgmt_key(struct wiphy *wiphy,
struct net_device *ndev,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) || (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 0))
int link_id,
#endif
u8 key_index)
Expand Down Expand Up @@ -5286,7 +5291,7 @@ static int cfg80211_rtw_start_ap(struct wiphy *wiphy, struct net_device *ndev,
return ret;
}

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 7, 0))
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 7, 0)) || (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 0))
static int cfg80211_rtw_change_beacon(struct wiphy *wiphy, struct net_device *ndev,
struct cfg80211_ap_update *params)
{
Expand Down Expand Up @@ -5318,10 +5323,10 @@ static int cfg80211_rtw_change_beacon(struct wiphy *wiphy, struct net_device *nd
return ret;
}

#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 19, 2))
static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
#else
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 0))
static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev, unsigned int link_id)
#else
static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
#endif
{
_adapter *adapter = (_adapter *)rtw_netdev_priv(ndev);
Expand Down Expand Up @@ -6194,7 +6199,7 @@ static int cfg80211_rtw_set_channel(struct wiphy *wiphy
return 0;
}

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2))
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 0))
static int cfg80211_rtw_get_channel(struct wiphy *wiphy, struct wireless_dev *wdev, unsigned int link_id, struct cfg80211_chan_def *chandef){
#else
static int cfg80211_rtw_get_channel(struct wiphy *wiphy, struct wireless_dev *wdev, struct cfg80211_chan_def *chandef){
Expand Down Expand Up @@ -10487,7 +10492,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 (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2))
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 0))
if (wdev->links[0].client.current_bss) {
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2))
if (wdev->connected) {
Expand Down
2 changes: 1 addition & 1 deletion os_dep/linux/os_intfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1703,7 +1703,7 @@ int rtw_os_ndev_register(_adapter *adapter, const char *name)
u8 rtnl_lock_needed = rtw_rtnl_lock_needed(dvobj);

#ifdef CONFIG_RTW_NAPI
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) || (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 0))
netif_napi_add_weight(ndev, &adapter->napi, rtw_recv_napi_poll, RTL_NAPI_WEIGHT);
#else
netif_napi_add(ndev, &adapter->napi, rtw_recv_napi_poll, RTL_NAPI_WEIGHT);
Expand Down
36 changes: 18 additions & 18 deletions os_dep/linux/rtw_proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,10 @@ const int drv_proc_hdls_num = sizeof(drv_proc_hdls) / sizeof(struct rtw_proc_hdl
static int rtw_drv_proc_open(struct inode *inode, struct file *file)
{
/* struct net_device *dev = proc_get_parent_data(inode); */
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
ssize_t index = (ssize_t)PDE_DATA(inode);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0) || (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 0))
ssize_t index = (ssize_t)inode->i_private;
#else
ssize_t index = (ssize_t)inode->i_private;
ssize_t index = (ssize_t)PDE_DATA(inode);
#endif
const struct rtw_proc_hdl *hdl = drv_proc_hdls + index;
void *private = NULL;
Expand All @@ -239,10 +239,10 @@ static int rtw_drv_proc_open(struct inode *inode, struct file *file)

static ssize_t rtw_drv_proc_write(struct file *file, const char __user *buffer, size_t count, loff_t *pos)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
ssize_t index = (ssize_t)PDE_DATA(file_inode(file));
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0) || (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 0))
ssize_t index = (ssize_t)file_inode(file)->i_private;
#else
ssize_t index = (ssize_t)file_inode(file)->i_private;
ssize_t index = (ssize_t)PDE_DATA(file_inode(file));
#endif
const struct rtw_proc_hdl *hdl = drv_proc_hdls + index;
ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *, void *) = hdl->write;
Expand Down Expand Up @@ -4163,10 +4163,10 @@ const int adapter_proc_hdls_num = sizeof(adapter_proc_hdls) / sizeof(struct rtw_

static int rtw_adapter_proc_open(struct inode *inode, struct file *file)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
ssize_t index = (ssize_t)PDE_DATA(inode);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0) || (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 0))
ssize_t index = (ssize_t)inode->i_private;
#else
ssize_t index = (ssize_t)inode->i_private;
ssize_t index = (ssize_t)PDE_DATA(inode);
#endif
const struct rtw_proc_hdl *hdl = adapter_proc_hdls + index;
void *private = proc_get_parent_data(inode);
Expand All @@ -4189,10 +4189,10 @@ static int rtw_adapter_proc_open(struct inode *inode, struct file *file)

static ssize_t rtw_adapter_proc_write(struct file *file, const char __user *buffer, size_t count, loff_t *pos)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
ssize_t index = (ssize_t)PDE_DATA(file_inode(file));
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0) || (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 0))
ssize_t index = (ssize_t)file_inode(file)->i_private;
#else
ssize_t index = (ssize_t)file_inode(file)->i_private;
ssize_t index = (ssize_t)PDE_DATA(file_inode(file));
#endif
const struct rtw_proc_hdl *hdl = adapter_proc_hdls + index;
ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *, void *) = hdl->write;
Expand Down Expand Up @@ -4358,10 +4358,10 @@ const int odm_proc_hdls_num = sizeof(odm_proc_hdls) / sizeof(struct rtw_proc_hdl

static int rtw_odm_proc_open(struct inode *inode, struct file *file)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
ssize_t index = (ssize_t)PDE_DATA(inode);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0) || (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 0))
ssize_t index = (ssize_t)inode->i_private;
#else
ssize_t index = (ssize_t)inode->i_private;
ssize_t index = (ssize_t)PDE_DATA(inode);
#endif
const struct rtw_proc_hdl *hdl = odm_proc_hdls + index;
void *private = proc_get_parent_data(inode);
Expand All @@ -4384,10 +4384,10 @@ static int rtw_odm_proc_open(struct inode *inode, struct file *file)

static ssize_t rtw_odm_proc_write(struct file *file, const char __user *buffer, size_t count, loff_t *pos)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
ssize_t index = (ssize_t)PDE_DATA(file_inode(file));
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0) || (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 0))
ssize_t index = (ssize_t)file_inode(file)->i_private;
#else
ssize_t index = (ssize_t)file_inode(file)->i_private;
ssize_t index = (ssize_t)PDE_DATA(file_inode(file));
#endif
const struct rtw_proc_hdl *hdl = odm_proc_hdls + index;
ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *, void *) = hdl->write;
Expand Down
3 changes: 2 additions & 1 deletion os_dep/linux/wifi_regd.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,11 +401,12 @@ static void _rtw_regd_init_wiphy(struct rtw_regulatory *reg, struct wiphy *wiphy
* If build fails on kernel 6.2.x and you're not using Ubuntu,
* try changing the version "(6, 3, 0)" below to "(6, 2, 0)".
*/

#if (! RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 0))
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 39)) \
|| (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 13)) \
|| (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 4))
wiphy->regulatory_flags |= REGULATORY_IGNORE_STALE_KICKOFF;
#endif
#endif

regd = _rtw_regdomain_select(reg);
Expand Down
6 changes: 3 additions & 3 deletions os_dep/osdep_service.c
Original file line number Diff line number Diff line change
Expand Up @@ -1201,10 +1201,10 @@ inline void kthread_thread_exit(_completion *comp)
#endif
{
#ifdef PLATFORM_LINUX
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
complete_and_exit(comp, 0);
#else
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0)) || (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 0))
kthread_complete_and_exit(comp, 0);
#else
complete_and_exit(comp, 0);
#endif
#endif

Expand Down