@@ -454,7 +454,8 @@ static void inform_bss(struct vwifi_vif *vif)
454
454
struct cfg80211_inform_bss data = {
455
455
/* the only channel */
456
456
.chan = & ap -> wdev .wiphy -> bands [NL80211_BAND_2GHZ ]-> channels [0 ],
457
- #if LINUX_VERSION_CODE < KERNEL_VERSION (6 , 7 , 0 )
457
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION (6 , 7 , 0 )
458
+ #else
458
459
.scan_width = NL80211_BSS_CHAN_WIDTH_20 ,
459
460
#endif
460
461
.signal = DBM_TO_MBM (rand_int_smooth (-100 , -30 , jiffies )),
@@ -531,7 +532,8 @@ static enum hrtimer_restart vwifi_beacon(struct hrtimer *timer)
531
532
.boottime_ns = ktime_get_boottime_ns (),
532
533
.chan = vif -> channel ,
533
534
};
534
- #if LINUX_VERSION_CODE < KERNEL_VERSION (6 , 7 , 0 )
535
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION (6 , 7 , 0 )
536
+ #else
535
537
switch (vif -> bw ) {
536
538
case NL80211_CHAN_WIDTH_5 :
537
539
bss_meta .scan_width = NL80211_BSS_CHAN_WIDTH_5 ;
@@ -1582,10 +1584,10 @@ static int vwifi_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
1582
1584
1583
1585
static int vwifi_change_beacon (struct wiphy * wiphy ,
1584
1586
struct net_device * ndev ,
1585
- #if LINUX_VERSION_CODE < KERNEL_VERSION (6 , 7 , 0 )
1586
- struct cfg80211_beacon_data * info
1587
- #else
1587
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION (6 , 7 , 0 )
1588
1588
struct cfg80211_ap_update * info
1589
+ #else
1590
+ struct cfg80211_beacon_data * info
1589
1591
#endif
1590
1592
)
1591
1593
{
@@ -1598,22 +1600,22 @@ static int vwifi_change_beacon(struct wiphy *wiphy,
1598
1600
* 2. tail: beacon IEs after TIM IE
1599
1601
* We combine them and store them in vif->beacon_ie.
1600
1602
*/
1601
- #if LINUX_VERSION_CODE < KERNEL_VERSION (6 , 7 , 0 )
1602
- head_ie_len = info -> head_len - ie_offset ;
1603
- tail_ie_len = info -> tail_len ;
1604
- #else
1603
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION (6 , 7 , 0 )
1605
1604
head_ie_len = info -> beacon .head_len - ie_offset ;
1606
1605
tail_ie_len = info -> beacon .tail_len ;
1606
+ #else
1607
+ head_ie_len = info -> head_len - ie_offset ;
1608
+ tail_ie_len = info -> tail_len ;
1607
1609
#endif
1608
1610
if (likely (head_ie_len + tail_ie_len <= IE_MAX_LEN )) {
1609
1611
vif -> beacon_ie_len = head_ie_len + tail_ie_len ;
1610
1612
memset (vif -> beacon_ie , 0 , IE_MAX_LEN );
1611
- #if LINUX_VERSION_CODE < KERNEL_VERSION (6 , 7 , 0 )
1612
- memcpy (vif -> beacon_ie , & info -> head [ie_offset ], head_ie_len );
1613
- memcpy (vif -> beacon_ie + head_ie_len , info -> tail , tail_ie_len );
1614
- #else
1613
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION (6 , 7 , 0 )
1615
1614
memcpy (vif -> beacon_ie , & info -> beacon .head [ie_offset ], head_ie_len );
1616
1615
memcpy (vif -> beacon_ie + head_ie_len , info -> beacon .tail , tail_ie_len );
1616
+ #else
1617
+ memcpy (vif -> beacon_ie , & info -> head [ie_offset ], head_ie_len );
1618
+ memcpy (vif -> beacon_ie + head_ie_len , info -> tail , tail_ie_len );
1617
1619
#endif
1618
1620
pr_info (
1619
1621
"%s: head_ie_len (before TIM IE) = %d, tail_ie_len = "
@@ -2565,7 +2567,8 @@ static void vwifi_virtio_mgmt_rx_scan_response(
2565
2567
};
2566
2568
struct cfg80211_inform_bss data = {
2567
2569
.chan = & rx_channel ,
2568
- #if LINUX_VERSION_CODE < KERNEL_VERSION (6 , 7 , 0 )
2570
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION (6 , 7 , 0 )
2571
+ #else
2569
2572
.scan_width = NL80211_BSS_CHAN_WIDTH_20 ,
2570
2573
#endif
2571
2574
.signal = DBM_TO_MBM (rand_int_smooth (-100 , -30 , jiffies )),
0 commit comments