Skip to content

Commit a06ca17

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 9d563a6 commit a06ca17

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

vwifi.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2395,11 +2395,19 @@ 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 */
2399+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)
23982400
static int vwifi_set_bitrate_mask(struct wiphy *wiphy,
23992401
struct net_device *dev,
24002402
unsigned int link_id,
24012403
const u8 *peer,
24022404
const struct cfg80211_bitrate_mask *mask)
2405+
#else
2406+
static int vwifi_set_bitrate_mask(struct wiphy *wiphy,
2407+
struct net_device *dev,
2408+
const u8 *peer,
2409+
const struct cfg80211_bitrate_mask *mask)
2410+
#endif
24032411
{
24042412
struct vwifi_vif *vif = netdev_priv(dev);
24052413
int i;

0 commit comments

Comments
 (0)