@@ -1579,10 +1579,15 @@ static int vwifi_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
1579
1579
1580
1580
return 0 ;
1581
1581
}
1582
- #if LINUX_VERSION_CODE < KERNEL_VERSION ( 6 , 7 , 0 )
1582
+
1583
1583
static int vwifi_change_beacon (struct wiphy * wiphy ,
1584
1584
struct net_device * ndev ,
1585
- struct cfg80211_beacon_data * info )
1585
+ #if LINUX_VERSION_CODE < KERNEL_VERSION (6 , 7 , 0 )
1586
+ struct cfg80211_beacon_data * info
1587
+ #else
1588
+ struct cfg80211_ap_update * info
1589
+ #endif
1590
+ )
1586
1591
{
1587
1592
struct vwifi_vif * vif = ndev_get_vwifi_vif (ndev );
1588
1593
int ie_offset = DOT11_MGMT_HDR_LEN + DOT11_BCN_PRB_FIXED_LEN ;
@@ -1593,49 +1598,23 @@ static int vwifi_change_beacon(struct wiphy *wiphy,
1593
1598
* 2. tail: beacon IEs after TIM IE
1594
1599
* We combine them and store them in vif->beacon_ie.
1595
1600
*/
1601
+ #if LINUX_VERSION_CODE < KERNEL_VERSION (6 , 7 , 0 )
1596
1602
head_ie_len = info -> head_len - ie_offset ;
1597
1603
tail_ie_len = info -> tail_len ;
1598
-
1599
- if (likely (head_ie_len + tail_ie_len <= IE_MAX_LEN )) {
1600
- vif -> beacon_ie_len = head_ie_len + tail_ie_len ;
1601
- memset (vif -> beacon_ie , 0 , IE_MAX_LEN );
1602
- memcpy (vif -> beacon_ie , & info -> head [ie_offset ], head_ie_len );
1603
- memcpy (vif -> beacon_ie + head_ie_len , info -> tail , tail_ie_len );
1604
-
1605
- pr_info (
1606
- "%s: head_ie_len (before TIM IE) = %d, tail_ie_len = "
1607
- "%d" ,
1608
- __func__ , head_ie_len , tail_ie_len );
1609
- } else {
1610
- pr_info ("%s: IE exceed %d bytes!\n" , __func__ , IE_MAX_LEN );
1611
- return 1 ;
1612
- }
1613
-
1614
- return 0 ;
1615
- }
1616
1604
#else
1617
- static int vwifi_change_beacon (struct wiphy * wiphy ,
1618
- struct net_device * ndev ,
1619
- struct cfg80211_ap_update * info )
1620
- {
1621
- struct vwifi_vif * vif = ndev_get_vwifi_vif (ndev );
1622
- int ie_offset = DOT11_MGMT_HDR_LEN + DOT11_BCN_PRB_FIXED_LEN ;
1623
- int head_ie_len , tail_ie_len ;
1624
-
1625
- /* cfg80211 and some user-space programs treat IEs as two-part:
1626
- * 1. head: 802.11 beacon frame header + beacon IEs before TIM IE
1627
- * 2. tail: beacon IEs after TIM IE
1628
- * We combine them and store them in vif->beacon_ie.
1629
- */
1630
1605
head_ie_len = info -> beacon .head_len - ie_offset ;
1631
1606
tail_ie_len = info -> beacon .tail_len ;
1632
-
1607
+ #endif
1633
1608
if (likely (head_ie_len + tail_ie_len <= IE_MAX_LEN )) {
1634
1609
vif -> beacon_ie_len = head_ie_len + tail_ie_len ;
1635
1610
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
1636
1615
memcpy (vif -> beacon_ie , & info -> beacon .head [ie_offset ], head_ie_len );
1637
1616
memcpy (vif -> beacon_ie + head_ie_len , info -> beacon .tail , tail_ie_len );
1638
-
1617
+ #endif
1639
1618
pr_info (
1640
1619
"%s: head_ie_len (before TIM IE) = %d, tail_ie_len = "
1641
1620
"%d" ,
@@ -1647,7 +1626,7 @@ static int vwifi_change_beacon(struct wiphy *wiphy,
1647
1626
1648
1627
return 0 ;
1649
1628
}
1650
- #endif
1629
+
1651
1630
#if LINUX_VERSION_CODE >= KERNEL_VERSION (6 , 1 , 0 )
1652
1631
static int vwifi_add_key (struct wiphy * wiphy ,
1653
1632
struct net_device * ndev ,
0 commit comments