Skip to content

Commit 2fd8e42

Browse files
Ensure set_bitrate_mask compatibility across kernel versions
Resolve type mismatch error in vwifi_set_bitrate_mask for kernels < 5.19.2, where cfg80211_ops. set_bitrate_mask lacks the link_id parameter, causing a build failure. Add conditional compilation using LINUX_VERSION_CODE to define vwifi_set_bitrate_mask with or without link_id, ensuring compatibility with kernels >= 5.19.2 and older. Preserve all MCS and GI functionality. Changes: - Define vwifi_set_bitrate_mask with link_id for kernels >= 5.19.2 and without for older kernels. - Update logging to include link_id only for newer kernels. - Retain vwifi_vif fields (manual_mcs, manual_mcs_set, spatial_streams) and MCS logic (log all enabled MCSs, select highest, default to MCS 0). Fixes: Type mismatch error for set_bitrate_mask on kernels < 5.19.2
1 parent 75fc59c commit 2fd8e42

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

vwifi.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2397,7 +2397,9 @@ static int vwifi_leave_ibss(struct wiphy *wiphy, struct net_device *ndev)
23972397
*/
23982398
static int vwifi_set_bitrate_mask(struct wiphy *wiphy,
23992399
struct net_device *dev,
2400+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)
24002401
unsigned int link_id,
2402+
#endif
24012403
const u8 *peer,
24022404
const struct cfg80211_bitrate_mask *mask)
24032405
{
@@ -2414,8 +2416,13 @@ static int vwifi_set_bitrate_mask(struct wiphy *wiphy,
24142416
return -EINVAL;
24152417
}
24162418

2419+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)
24172420
pr_info("vwifi: set_bitrate_mask called for dev %s, link_id %u, peer %pM\n",
24182421
dev->name, link_id, peer ? peer : vif->bssid);
2422+
#else
2423+
pr_info("vwifi: set_bitrate_mask called for dev %s, peer %pM\n", dev->name,
2424+
peer ? peer : vif->bssid);
2425+
#endif
24192426
pr_info("vwifi: 2.4GHz MCS mask: %02x %02x %02x %02x\n",
24202427
mask->control[NL80211_BAND_2GHZ].ht_mcs[0],
24212428
mask->control[NL80211_BAND_2GHZ].ht_mcs[1],

0 commit comments

Comments
 (0)