@@ -577,7 +577,11 @@ int rtw_cfg80211_check_bss(_adapter *padapter)
577
577
bss = cfg80211_get_bss (padapter -> rtw_wdev -> wiphy , notify_channel ,
578
578
pnetwork -> MacAddress , pnetwork -> Ssid .Ssid ,
579
579
pnetwork -> Ssid .SsidLength ,
580
+ #if LINUX_VERSION_CODE < KERNEL_VERSION (4 , 1 , 0 )
580
581
WLAN_CAPABILITY_ESS , WLAN_CAPABILITY_ESS );
582
+ #else
583
+ IEEE80211_BSS_TYPE_ESS , IEEE80211_PRIVACY_ANY );
584
+ #endif
581
585
582
586
return (bss != NULL );
583
587
}
@@ -700,13 +704,16 @@ void rtw_cfg80211_indicate_disconnect(_adapter *padapter)
700
704
if (!padapter -> mlmepriv .not_indic_disco ) {
701
705
DBG_8192C ("pwdev->sme_state(b)=%d\n" , pwdev -> sme_state );
702
706
703
- if ( pwdev -> sme_state == CFG80211_SME_CONNECTING )
707
+ if ( check_fwstate ( pmlmepriv , WIFI_UNDER_LINKING )) {
704
708
cfg80211_connect_result (padapter -> pnetdev , NULL , NULL , 0 , NULL , 0 ,
705
709
WLAN_STATUS_UNSPECIFIED_FAILURE , GFP_ATOMIC /*GFP_KERNEL*/ );
706
- else if (pwdev -> sme_state == CFG80211_SME_CONNECTED )
710
+ } else {
711
+ #if LINUX_VERSION_CODE < KERNEL_VERSION (4 ,2 ,0 )
707
712
cfg80211_disconnected (padapter -> pnetdev , 0 , NULL , 0 , GFP_ATOMIC );
708
- //else
709
- //DBG_8192C("pwdev->sme_state=%d\n", pwdev->sme_state);
713
+ #else
714
+ cfg80211_disconnected (padapter -> pnetdev , 0 , NULL , 0 , false, GFP_ATOMIC );
715
+ #endif
716
+ }
710
717
711
718
DBG_8192C ("pwdev->sme_state(a)=%d\n" , pwdev -> sme_state );
712
719
}
@@ -1549,7 +1556,7 @@ static int cfg80211_rtw_set_default_key(struct wiphy *wiphy,
1549
1556
1550
1557
static int cfg80211_rtw_get_station (struct wiphy * wiphy ,
1551
1558
struct net_device * ndev ,
1552
- u8 * mac , struct station_info * sinfo )
1559
+ const u8 * mac , struct station_info * sinfo )
1553
1560
{
1554
1561
int ret = 0 ;
1555
1562
_adapter * padapter = wiphy_to_adapter (wiphy );
@@ -1589,16 +1596,32 @@ static int cfg80211_rtw_get_station(struct wiphy *wiphy,
1589
1596
goto exit ;
1590
1597
}
1591
1598
1599
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION (4 ,0 ,0 ))
1600
+ sinfo -> filled |= BIT (NL80211_STA_INFO_SIGNAL );
1601
+ #else
1592
1602
sinfo -> filled |= STATION_INFO_SIGNAL ;
1603
+ #endif
1593
1604
sinfo -> signal = translate_percentage_to_dbm (padapter -> recvpriv .signal_strength );
1594
1605
1606
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION (4 ,0 ,0 ))
1607
+ sinfo -> filled |= BIT (NL80211_STA_INFO_TX_BITRATE );
1608
+ #else
1595
1609
sinfo -> filled |= STATION_INFO_TX_BITRATE ;
1610
+ #endif
1596
1611
sinfo -> txrate .legacy = rtw_get_cur_max_rate (padapter );
1597
1612
1613
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION (4 ,0 ,0 ))
1614
+ sinfo -> filled |= BIT (NL80211_STA_INFO_RX_PACKETS );
1615
+ #else
1598
1616
sinfo -> filled |= STATION_INFO_RX_PACKETS ;
1617
+ #endif
1599
1618
sinfo -> rx_packets = sta_rx_data_pkts (psta );
1600
1619
1620
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION (4 ,0 ,0 ))
1621
+ sinfo -> filled |= BIT (NL80211_STA_INFO_TX_PACKETS );
1622
+ #else
1601
1623
sinfo -> filled |= STATION_INFO_TX_PACKETS ;
1624
+ #endif
1602
1625
sinfo -> tx_packets = psta -> sta_stats .tx_pkts ;
1603
1626
1604
1627
}
@@ -2419,7 +2442,7 @@ static int rtw_cfg80211_set_key_mgt(struct security_priv *psecuritypriv, u32 key
2419
2442
return 0 ;
2420
2443
}
2421
2444
2422
- static int rtw_cfg80211_set_wpa_ie (_adapter * padapter , u8 * pie , size_t ielen )
2445
+ static int rtw_cfg80211_set_wpa_ie (_adapter * padapter , const u8 * pie , size_t ielen )
2423
2446
{
2424
2447
u8 * buf = NULL , * pos = NULL ;
2425
2448
u32 left ;
@@ -3089,7 +3112,9 @@ void rtw_cfg80211_indicate_sta_assoc(_adapter *padapter, u8 *pmgmt_frame, uint f
3089
3112
ie_offset = _REASOCREQ_IE_OFFSET_ ;
3090
3113
3091
3114
sinfo .filled = 0 ;
3115
+ #if (LINUX_VERSION_CODE < KERNEL_VERSION (4 ,0 ,0 ))
3092
3116
sinfo .filled = STATION_INFO_ASSOC_REQ_IES ;
3117
+ #endif
3093
3118
sinfo .assoc_req_ies = pmgmt_frame + WLAN_HDR_A3_LEN + ie_offset ;
3094
3119
sinfo .assoc_req_ies_len = frame_len - WLAN_HDR_A3_LEN - ie_offset ;
3095
3120
cfg80211_new_sta (ndev , GetAddr2Ptr (pmgmt_frame ), & sinfo , GFP_ATOMIC );
@@ -3387,7 +3412,11 @@ static const struct net_device_ops rtw_cfg80211_monitor_if_ops = {
3387
3412
};
3388
3413
#endif
3389
3414
3415
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION (4 ,1 ,0 ))
3416
+ static int rtw_cfg80211_add_monitor_if (_adapter * padapter , char * name , unsigned char name_assign_type , struct net_device * * ndev )
3417
+ #else
3390
3418
static int rtw_cfg80211_add_monitor_if (_adapter * padapter , char * name , struct net_device * * ndev )
3419
+ #endif
3391
3420
{
3392
3421
int ret = 0 ;
3393
3422
struct net_device * mon_ndev = NULL ;
@@ -3418,6 +3447,9 @@ static int rtw_cfg80211_add_monitor_if(_adapter *padapter, char *name, struct ne
3418
3447
mon_ndev -> type = ARPHRD_IEEE80211_RADIOTAP ;
3419
3448
strncpy (mon_ndev -> name , name , IFNAMSIZ );
3420
3449
mon_ndev -> name [IFNAMSIZ - 1 ] = 0 ;
3450
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION (4 ,1 ,0 ))
3451
+ mon_ndev -> name_assign_type = name_assign_type ;
3452
+ #endif
3421
3453
mon_ndev -> destructor = rtw_ndev_destructor ;
3422
3454
3423
3455
#if (LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,29 ))
@@ -3482,6 +3514,9 @@ static int
3482
3514
#else
3483
3515
char * name ,
3484
3516
#endif
3517
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION (4 ,1 ,0 ))
3518
+ unsigned char name_assign_type ,
3519
+ #endif
3485
3520
enum nl80211_iftype type , u32 * flags , struct vif_params * params )
3486
3521
{
3487
3522
int ret = 0 ;
@@ -3499,7 +3534,11 @@ static int
3499
3534
ret = - ENODEV ;
3500
3535
break ;
3501
3536
case NL80211_IFTYPE_MONITOR :
3537
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION (4 ,1 ,0 ))
3538
+ ret = rtw_cfg80211_add_monitor_if (padapter , (char * )name , name_assign_type , & ndev );
3539
+ #else
3502
3540
ret = rtw_cfg80211_add_monitor_if (padapter , (char * )name , & ndev );
3541
+ #endif
3503
3542
break ;
3504
3543
3505
3544
#if (LINUX_VERSION_CODE >= KERNEL_VERSION (2 ,6 ,37 )) || defined(COMPAT_KERNEL_RELEASE )
@@ -3760,16 +3799,23 @@ static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
3760
3799
#endif //(LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0))
3761
3800
3762
3801
static int cfg80211_rtw_add_station (struct wiphy * wiphy , struct net_device * ndev ,
3763
- u8 * mac , struct station_parameters * params )
3802
+ const u8 * mac , struct station_parameters * params )
3764
3803
{
3765
3804
DBG_871X (FUNC_NDEV_FMT "\n" , FUNC_NDEV_ARG (ndev ));
3766
3805
3767
3806
return 0 ;
3768
3807
}
3769
3808
3770
3809
static int cfg80211_rtw_del_station (struct wiphy * wiphy , struct net_device * ndev ,
3771
- u8 * mac )
3810
+ #if (LINUX_VERSION_CODE < KERNEL_VERSION (3 ,15 ,0 ))
3811
+ u8 * mac ) {
3812
+ #elif (LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0))
3813
+ const u8 * mac ) {
3814
+ #else
3815
+ struct station_del_parameters * params )
3772
3816
{
3817
+ const u8 * mac = params -> mac ;
3818
+ #endif
3773
3819
int ret = 0 ;
3774
3820
_irqL irqL ;
3775
3821
_list * phead , * plist ;
@@ -3859,7 +3905,7 @@ static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev
3859
3905
}
3860
3906
3861
3907
static int cfg80211_rtw_change_station (struct wiphy * wiphy , struct net_device * ndev ,
3862
- u8 * mac , struct station_parameters * params )
3908
+ const u8 * mac , struct station_parameters * params )
3863
3909
{
3864
3910
DBG_871X (FUNC_NDEV_FMT "\n" , FUNC_NDEV_ARG (ndev ));
3865
3911
@@ -4643,6 +4689,9 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy,
4643
4689
#else
4644
4690
struct net_device * ndev ,
4645
4691
#endif
4692
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION (3 ,14 ,0 ))
4693
+ struct cfg80211_mgmt_tx_params * params ,
4694
+ #else
4646
4695
struct ieee80211_channel * chan ,
4647
4696
#if (LINUX_VERSION_CODE >= KERNEL_VERSION (2 ,6 ,38 )) || defined(COMPAT_KERNEL_RELEASE )
4648
4697
bool offchan ,
@@ -4662,9 +4711,16 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy,
4662
4711
#endif
4663
4712
#if (LINUX_VERSION_CODE >= KERNEL_VERSION (3 ,3 ,0 ))
4664
4713
bool dont_wait_for_ack ,
4714
+ #endif
4665
4715
#endif
4666
4716
u64 * cookie )
4667
4717
{
4718
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION (3 ,14 ,0 ))
4719
+ struct ieee80211_channel * chan = params -> chan ;
4720
+ const u8 * buf = params -> buf ;
4721
+ size_t len = params -> len ;
4722
+ #endif
4723
+
4668
4724
_adapter * padapter = (_adapter * )wiphy_to_adapter (wiphy );
4669
4725
struct rtw_wdev_priv * pwdev_priv = wdev_to_priv (padapter -> rtw_wdev );
4670
4726
int ret = 0 ;
0 commit comments