@@ -700,13 +700,16 @@ void rtw_cfg80211_indicate_disconnect(_adapter *padapter)
700
700
if (!padapter -> mlmepriv .not_indic_disco ) {
701
701
DBG_8192C ("pwdev->sme_state(b)=%d\n" , pwdev -> sme_state );
702
702
703
- if ( pwdev -> sme_state == CFG80211_SME_CONNECTING )
703
+ if ( check_fwstate ( pmlmepriv , WIFI_UNDER_LINKING )) {
704
704
cfg80211_connect_result (padapter -> pnetdev , NULL , NULL , 0 , NULL , 0 ,
705
705
WLAN_STATUS_UNSPECIFIED_FAILURE , GFP_ATOMIC /*GFP_KERNEL*/ );
706
- else if (pwdev -> sme_state == CFG80211_SME_CONNECTED )
706
+ } else {
707
+ #if LINUX_VERSION_CODE < KERNEL_VERSION (4 ,2 ,0 )
707
708
cfg80211_disconnected (padapter -> pnetdev , 0 , NULL , 0 , GFP_ATOMIC );
708
- //else
709
- //DBG_8192C("pwdev->sme_state=%d\n", pwdev->sme_state);
709
+ #else
710
+ cfg80211_disconnected (padapter -> pnetdev , 0 , NULL , 0 , false, GFP_ATOMIC );
711
+ #endif
712
+ }
710
713
711
714
DBG_8192C ("pwdev->sme_state(a)=%d\n" , pwdev -> sme_state );
712
715
}
@@ -1549,7 +1552,7 @@ static int cfg80211_rtw_set_default_key(struct wiphy *wiphy,
1549
1552
1550
1553
static int cfg80211_rtw_get_station (struct wiphy * wiphy ,
1551
1554
struct net_device * ndev ,
1552
- u8 * mac , struct station_info * sinfo )
1555
+ const u8 * mac , struct station_info * sinfo )
1553
1556
{
1554
1557
int ret = 0 ;
1555
1558
_adapter * padapter = wiphy_to_adapter (wiphy );
@@ -1589,16 +1592,32 @@ static int cfg80211_rtw_get_station(struct wiphy *wiphy,
1589
1592
goto exit ;
1590
1593
}
1591
1594
1595
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION (4 ,0 ,0 ))
1596
+ sinfo -> filled |= BIT (NL80211_STA_INFO_SIGNAL );
1597
+ #else
1592
1598
sinfo -> filled |= STATION_INFO_SIGNAL ;
1599
+ #endif
1593
1600
sinfo -> signal = translate_percentage_to_dbm (padapter -> recvpriv .signal_strength );
1594
1601
1602
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION (4 ,0 ,0 ))
1603
+ sinfo -> filled |= BIT (NL80211_STA_INFO_TX_BITRATE );
1604
+ #else
1595
1605
sinfo -> filled |= STATION_INFO_TX_BITRATE ;
1606
+ #endif
1596
1607
sinfo -> txrate .legacy = rtw_get_cur_max_rate (padapter );
1597
1608
1609
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION (4 ,0 ,0 ))
1610
+ sinfo -> filled |= BIT (NL80211_STA_INFO_RX_PACKETS );
1611
+ #else
1598
1612
sinfo -> filled |= STATION_INFO_RX_PACKETS ;
1613
+ #endif
1599
1614
sinfo -> rx_packets = sta_rx_data_pkts (psta );
1600
1615
1616
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION (4 ,0 ,0 ))
1617
+ sinfo -> filled |= BIT (NL80211_STA_INFO_TX_PACKETS );
1618
+ #else
1601
1619
sinfo -> filled |= STATION_INFO_TX_PACKETS ;
1620
+ #endif
1602
1621
sinfo -> tx_packets = psta -> sta_stats .tx_pkts ;
1603
1622
1604
1623
}
@@ -2419,7 +2438,7 @@ static int rtw_cfg80211_set_key_mgt(struct security_priv *psecuritypriv, u32 key
2419
2438
return 0 ;
2420
2439
}
2421
2440
2422
- static int rtw_cfg80211_set_wpa_ie (_adapter * padapter , u8 * pie , size_t ielen )
2441
+ static int rtw_cfg80211_set_wpa_ie (_adapter * padapter , const u8 * pie , size_t ielen )
2423
2442
{
2424
2443
u8 * buf = NULL , * pos = NULL ;
2425
2444
u32 left ;
@@ -3089,7 +3108,9 @@ void rtw_cfg80211_indicate_sta_assoc(_adapter *padapter, u8 *pmgmt_frame, uint f
3089
3108
ie_offset = _REASOCREQ_IE_OFFSET_ ;
3090
3109
3091
3110
sinfo .filled = 0 ;
3111
+ #if (LINUX_VERSION_CODE < KERNEL_VERSION (4 ,0 ,0 ))
3092
3112
sinfo .filled = STATION_INFO_ASSOC_REQ_IES ;
3113
+ #endif
3093
3114
sinfo .assoc_req_ies = pmgmt_frame + WLAN_HDR_A3_LEN + ie_offset ;
3094
3115
sinfo .assoc_req_ies_len = frame_len - WLAN_HDR_A3_LEN - ie_offset ;
3095
3116
cfg80211_new_sta (ndev , GetAddr2Ptr (pmgmt_frame ), & sinfo , GFP_ATOMIC );
@@ -3387,7 +3408,11 @@ static const struct net_device_ops rtw_cfg80211_monitor_if_ops = {
3387
3408
};
3388
3409
#endif
3389
3410
3411
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION (4 ,1 ,0 ))
3412
+ static int rtw_cfg80211_add_monitor_if (_adapter * padapter , char * name , unsigned char name_assign_type , struct net_device * * ndev )
3413
+ #else
3390
3414
static int rtw_cfg80211_add_monitor_if (_adapter * padapter , char * name , struct net_device * * ndev )
3415
+ #endif
3391
3416
{
3392
3417
int ret = 0 ;
3393
3418
struct net_device * mon_ndev = NULL ;
@@ -3418,6 +3443,9 @@ static int rtw_cfg80211_add_monitor_if(_adapter *padapter, char *name, struct ne
3418
3443
mon_ndev -> type = ARPHRD_IEEE80211_RADIOTAP ;
3419
3444
strncpy (mon_ndev -> name , name , IFNAMSIZ );
3420
3445
mon_ndev -> name [IFNAMSIZ - 1 ] = 0 ;
3446
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION (4 ,1 ,0 ))
3447
+ mon_ndev -> name_assign_type = name_assign_type ;
3448
+ #endif
3421
3449
mon_ndev -> destructor = rtw_ndev_destructor ;
3422
3450
3423
3451
#if (LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,29 ))
@@ -3482,6 +3510,9 @@ static int
3482
3510
#else
3483
3511
char * name ,
3484
3512
#endif
3513
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION (4 ,1 ,0 ))
3514
+ unsigned char name_assign_type ,
3515
+ #endif
3485
3516
enum nl80211_iftype type , u32 * flags , struct vif_params * params )
3486
3517
{
3487
3518
int ret = 0 ;
@@ -3499,7 +3530,11 @@ static int
3499
3530
ret = - ENODEV ;
3500
3531
break ;
3501
3532
case NL80211_IFTYPE_MONITOR :
3533
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION (4 ,1 ,0 ))
3534
+ ret = rtw_cfg80211_add_monitor_if (padapter , (char * )name , name_assign_type , & ndev );
3535
+ #else
3502
3536
ret = rtw_cfg80211_add_monitor_if (padapter , (char * )name , & ndev );
3537
+ #endif
3503
3538
break ;
3504
3539
3505
3540
#if (LINUX_VERSION_CODE >= KERNEL_VERSION (2 ,6 ,37 )) || defined(COMPAT_KERNEL_RELEASE )
@@ -3760,16 +3795,23 @@ static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
3760
3795
#endif //(LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0))
3761
3796
3762
3797
static int cfg80211_rtw_add_station (struct wiphy * wiphy , struct net_device * ndev ,
3763
- u8 * mac , struct station_parameters * params )
3798
+ const u8 * mac , struct station_parameters * params )
3764
3799
{
3765
3800
DBG_871X (FUNC_NDEV_FMT "\n" , FUNC_NDEV_ARG (ndev ));
3766
3801
3767
3802
return 0 ;
3768
3803
}
3769
3804
3770
3805
static int cfg80211_rtw_del_station (struct wiphy * wiphy , struct net_device * ndev ,
3771
- u8 * mac )
3806
+ #if (LINUX_VERSION_CODE < KERNEL_VERSION (3 ,15 ,0 ))
3807
+ u8 * mac ) {
3808
+ #elif (LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0))
3809
+ const u8 * mac ) {
3810
+ #else
3811
+ struct station_del_parameters * params )
3772
3812
{
3813
+ const u8 * mac = params -> mac ;
3814
+ #endif
3773
3815
int ret = 0 ;
3774
3816
_irqL irqL ;
3775
3817
_list * phead , * plist ;
@@ -3859,7 +3901,7 @@ static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev
3859
3901
}
3860
3902
3861
3903
static int cfg80211_rtw_change_station (struct wiphy * wiphy , struct net_device * ndev ,
3862
- u8 * mac , struct station_parameters * params )
3904
+ const u8 * mac , struct station_parameters * params )
3863
3905
{
3864
3906
DBG_871X (FUNC_NDEV_FMT "\n" , FUNC_NDEV_ARG (ndev ));
3865
3907
@@ -4643,6 +4685,9 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy,
4643
4685
#else
4644
4686
struct net_device * ndev ,
4645
4687
#endif
4688
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION (3 ,14 ,0 ))
4689
+ struct cfg80211_mgmt_tx_params * params ,
4690
+ #else
4646
4691
struct ieee80211_channel * chan ,
4647
4692
#if (LINUX_VERSION_CODE >= KERNEL_VERSION (2 ,6 ,38 )) || defined(COMPAT_KERNEL_RELEASE )
4648
4693
bool offchan ,
@@ -4662,9 +4707,16 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy,
4662
4707
#endif
4663
4708
#if (LINUX_VERSION_CODE >= KERNEL_VERSION (3 ,3 ,0 ))
4664
4709
bool dont_wait_for_ack ,
4710
+ #endif
4665
4711
#endif
4666
4712
u64 * cookie )
4667
4713
{
4714
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION (3 ,14 ,0 ))
4715
+ struct ieee80211_channel * chan = params -> chan ;
4716
+ const u8 * buf = params -> buf ;
4717
+ size_t len = params -> len ;
4718
+ #endif
4719
+
4668
4720
_adapter * padapter = (_adapter * )wiphy_to_adapter (wiphy );
4669
4721
struct rtw_wdev_priv * pwdev_priv = wdev_to_priv (padapter -> rtw_wdev );
4670
4722
int ret = 0 ;
0 commit comments