Skip to content

Commit

Permalink
Added RHEL9 build support
Browse files Browse the repository at this point in the history
  • Loading branch information
virer committed Jan 4, 2024
1 parent 70bdde2 commit eb99b50
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
6 changes: 3 additions & 3 deletions include/osdep_service_linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -484,10 +484,10 @@ static inline void rtw_thread_enter(char *name)

static inline void rtw_thread_exit(_completion *comp)
{
#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
}

Expand Down
34 changes: 17 additions & 17 deletions os_dep/linux/ioctl_cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ u8 rtw_cfg80211_ch_switch_notify(_adapter *adapter, u8 ch, u8 bw, u8 offset,
*/

cfg80211_ch_switch_started_notify(adapter->pnetdev, &chdef,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0) || (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 0)))
0, 0, false, 0);
#else
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
Expand All @@ -484,7 +484,7 @@ 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)
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 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 @@ -1174,10 +1174,10 @@ void rtw_cfg80211_indicate_connect(_adapter *padapter)
#endif

#if defined(CPTCFG_VERSION) || LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0)
roam_info.bssid = cur_network->network.MacAddress;
#else
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 0)))
roam_info.links[0].bssid = cur_network->network.MacAddress;
#else
roam_info.bssid = cur_network->network.MacAddress;
#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;
Expand Down Expand Up @@ -1922,7 +1922,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 @@ -2087,7 +2087,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 @@ -2279,7 +2279,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(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE)
#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, bool pairwise, const u8 *mac_addr)
Expand All @@ -2302,7 +2302,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 @@ -2354,7 +2354,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 @@ -5433,10 +5433,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 @@ -6386,7 +6386,7 @@ static int cfg80211_rtw_set_monitor_channel(struct wiphy *wiphy
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0))
static int cfg80211_rtw_get_channel(struct wiphy *wiphy,
struct wireless_dev *wdev,
#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)))
u32 link_id,
#endif
struct cfg80211_chan_def *chandef)
Expand Down Expand Up @@ -10551,10 +10551,10 @@ 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 (wdev->current_bss) {
#else
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2) || (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 0)))
if (wdev->connected) {
#else
if (wdev->current_bss) {
#endif
RTW_INFO(FUNC_ADPT_FMT" clear current_bss by cfg80211_disconnected\n", FUNC_ADPT_ARG(adapter));
rtw_cfg80211_indicate_disconnect(adapter, 0, 1);
Expand Down
6 changes: 3 additions & 3 deletions os_dep/linux/os_intfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -595,10 +595,10 @@ 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)
netif_napi_add(ndev, &adapter->napi, rtw_recv_napi_poll, RTL_NAPI_WEIGHT);
#else
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1,0) || (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 0))
netif_napi_add(ndev, &adapter->napi, rtw_recv_napi_poll);
#else
netif_napi_add(ndev, &adapter->napi, rtw_recv_napi_poll, RTL_NAPI_WEIGHT);
#endif
#endif /* CONFIG_RTW_NAPI */

Expand Down

0 comments on commit eb99b50

Please sign in to comment.