Skip to content

Commit 049ab83

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 049ab83

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

vwifi.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2395,9 +2395,12 @@ static int vwifi_leave_ibss(struct wiphy *wiphy, struct net_device *ndev)
23952395

23962396
/* Callback to handle manual MCS and GI of related bitrate configuration via iw
23972397
*/
2398+
/* Define vwifi_set_bitrate_mask based on kernel version */
23982399
static int vwifi_set_bitrate_mask(struct wiphy *wiphy,
23992400
struct net_device *dev,
2401+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)
24002402
unsigned int link_id,
2403+
#endif
24012404
const u8 *peer,
24022405
const struct cfg80211_bitrate_mask *mask)
24032406
{

0 commit comments

Comments
 (0)