@@ -846,8 +846,13 @@ static int set_default_key(struct wiphy *wiphy, struct net_device *netdev,
846846 return 0 ;
847847}
848848
849+ #if KERNEL_VERSION (3 , 16 , 0 ) <= LINUX_VERSION_CODE
849850static int get_station (struct wiphy * wiphy , struct net_device * dev ,
850851 const u8 * mac , struct station_info * sinfo )
852+ #else
853+ static int get_station (struct wiphy * wiphy , struct net_device * dev ,
854+ u8 * mac , struct station_info * sinfo )
855+ #endif
851856{
852857 struct wilc_vif * vif = netdev_priv (dev );
853858 struct wilc_priv * priv = & vif -> priv ;
@@ -873,7 +878,11 @@ static int get_station(struct wiphy *wiphy, struct net_device *dev,
873878 return - ENOENT ;
874879 }
875880
881+ #if KERNEL_VERSION (3 , 19 , 0 ) <= LINUX_VERSION_CODE
876882 sinfo -> filled |= BIT (NL80211_STA_INFO_INACTIVE_TIME );
883+ #else
884+ sinfo -> filled |= STATION_INFO_INACTIVE_TIME ;
885+ #endif
877886
878887 wilc_get_inactive_time (vif , mac , & inactive_time );
879888 sinfo -> inactive_time = 1000 * inactive_time ;
@@ -889,13 +898,19 @@ static int get_station(struct wiphy *wiphy, struct net_device *dev,
889898 }
890899
891900 wilc_get_statistics (vif , & stats );
892-
901+ #if KERNEL_VERSION ( 3 , 19 , 0 ) <= LINUX_VERSION_CODE
893902 sinfo -> filled |= BIT (NL80211_STA_INFO_SIGNAL ) |
894- BIT (NL80211_STA_INFO_RX_PACKETS ) |
895- BIT (NL80211_STA_INFO_TX_PACKETS ) |
896- BIT (NL80211_STA_INFO_TX_FAILED ) |
897- BIT (NL80211_STA_INFO_TX_BITRATE );
898-
903+ BIT (NL80211_STA_INFO_RX_PACKETS ) |
904+ BIT (NL80211_STA_INFO_TX_PACKETS ) |
905+ BIT (NL80211_STA_INFO_TX_FAILED ) |
906+ BIT (NL80211_STA_INFO_TX_BITRATE );
907+ #else
908+ sinfo -> filled |= STATION_INFO_SIGNAL |
909+ STATION_INFO_RX_PACKETS |
910+ STATION_INFO_TX_PACKETS |
911+ STATION_INFO_TX_FAILED |
912+ STATION_INFO_TX_BITRATE ;
913+ #endif
899914 sinfo -> signal = stats .rssi ;
900915 sinfo -> rx_packets = stats .rx_cnt ;
901916 sinfo -> tx_packets = stats .tx_cnt + stats .tx_fail_cnt ;
@@ -1310,15 +1325,25 @@ static int cancel_remain_on_channel(struct wiphy *wiphy,
13101325 return wilc_listen_state_expired (vif , cookie );
13111326}
13121327
1328+ #if KERNEL_VERSION (3 , 14 , 0 ) <= LINUX_VERSION_CODE
13131329static int mgmt_tx (struct wiphy * wiphy ,
13141330 struct wireless_dev * wdev ,
13151331 struct cfg80211_mgmt_tx_params * params ,
13161332 u64 * cookie )
1333+ #else
1334+ static int mgmt_tx (struct wiphy * wiphy ,
1335+ struct wireless_dev * wdev ,
1336+ struct ieee80211_channel * chan , bool offchan ,
1337+ unsigned int wait , const u8 * buf , size_t len ,
1338+ bool no_cck , bool dont_wait_for_ack , u64 * cookie )
1339+ #endif
13171340{
1341+ #if KERNEL_VERSION (3 , 14 , 0 ) <= LINUX_VERSION_CODE
13181342 struct ieee80211_channel * chan = params -> chan ;
13191343 unsigned int wait = params -> wait ;
13201344 const u8 * buf = params -> buf ;
13211345 size_t len = params -> len ;
1346+ #endif
13221347 const struct ieee80211_mgmt * mgmt ;
13231348 struct wilc_p2p_mgmt_data * mgmt_tx ;
13241349 struct wilc_vif * vif = netdev_priv (wdev -> netdev );
@@ -1497,7 +1522,11 @@ static int dump_station(struct wiphy *wiphy, struct net_device *dev,
14971522 if (ret )
14981523 return ret ;
14991524
1500- sinfo -> filled |= BIT (NL80211_STA_INFO_SIGNAL );
1525+ #if KERNEL_VERSION (3 , 19 , 0 ) <= LINUX_VERSION_CODE
1526+ sinfo -> filled |= BIT (NL80211_STA_INFO_SIGNAL );
1527+ #else
1528+ sinfo -> filled |= STATION_INFO_SIGNAL ;
1529+ #endif
15011530
15021531 return 0 ;
15031532}
@@ -1670,8 +1699,13 @@ static int stop_ap(struct wiphy *wiphy, struct net_device *dev)
16701699 return ret ;
16711700}
16721701
1702+ #if KERNEL_VERSION (3 , 16 , 0 ) <= LINUX_VERSION_CODE
16731703static int add_station (struct wiphy * wiphy , struct net_device * dev ,
16741704 const u8 * mac , struct station_parameters * params )
1705+ #else
1706+ static int add_station (struct wiphy * wiphy , struct net_device * dev ,
1707+ u8 * mac , struct station_parameters * params )
1708+ #endif
16751709{
16761710 int ret = 0 ;
16771711 struct wilc_vif * vif = netdev_priv (dev );
@@ -1725,10 +1759,20 @@ static int add_station(struct wiphy *wiphy, struct net_device *dev,
17251759 return ret ;
17261760}
17271761
1762+ #if KERNEL_VERSION (3 , 19 , 0 ) <= LINUX_VERSION_CODE
17281763static int del_station (struct wiphy * wiphy , struct net_device * dev ,
17291764 struct station_del_parameters * params )
1765+ #elif KERNEL_VERSION (3 , 16 , 0 ) <= LINUX_VERSION_CODE
1766+ static int del_station (struct wiphy * wiphy , struct net_device * dev ,
1767+ const u8 * mac )
1768+ #else
1769+ static int del_station (struct wiphy * wiphy , struct net_device * dev ,
1770+ u8 * mac )
1771+ #endif
17301772{
1773+ #if KERNEL_VERSION (3 , 19 , 0 ) <= LINUX_VERSION_CODE
17311774 const u8 * mac = params -> mac ;
1775+ #endif
17321776 int ret = 0 ;
17331777 struct wilc_vif * vif = netdev_priv (dev );
17341778 struct wilc_priv * priv = & vif -> priv ;
@@ -1757,8 +1801,13 @@ static int del_station(struct wiphy *wiphy, struct net_device *dev,
17571801 return ret ;
17581802}
17591803
1804+ #if KERNEL_VERSION (3 , 16 , 0 ) <= LINUX_VERSION_CODE
17601805static int change_station (struct wiphy * wiphy , struct net_device * dev ,
17611806 const u8 * mac , struct station_parameters * params )
1807+ #else
1808+ static int change_station (struct wiphy * wiphy , struct net_device * dev ,
1809+ u8 * mac , struct station_parameters * params )
1810+ #endif
17621811{
17631812 int ret = 0 ;
17641813 struct wilc_vif * vif = netdev_priv (dev );
@@ -1815,11 +1864,32 @@ struct wilc_vif *wilc_get_vif_from_type(struct wilc *wl, int type)
18151864 return NULL ;
18161865}
18171866
1867+ #if KERNEL_VERSION (4 , 12 , 0 ) <= LINUX_VERSION_CODE
1868+ static struct wireless_dev * add_virtual_intf (struct wiphy * wiphy ,
1869+ const char * name ,
1870+ unsigned char name_assign_type ,
1871+ enum nl80211_iftype type ,
1872+ struct vif_params * params )
1873+ #elif KERNEL_VERSION (4 , 1 , 0 ) <= LINUX_VERSION_CODE
18181874static struct wireless_dev * add_virtual_intf (struct wiphy * wiphy ,
18191875 const char * name ,
18201876 unsigned char name_assign_type ,
18211877 enum nl80211_iftype type ,
1878+ u32 * flags ,
1879+ struct vif_params * params )
1880+ #elif KERNEL_VERSION (3 , 7 , 0 ) <= LINUX_VERSION_CODE
1881+ static struct wireless_dev * add_virtual_intf (struct wiphy * wiphy ,
1882+ const char * name ,
1883+ enum nl80211_iftype type ,
1884+ u32 * flags ,
1885+ struct vif_params * params )
1886+ #else
1887+ static struct wireless_dev * add_virtual_intf (struct wiphy * wiphy ,
1888+ char * name ,
1889+ enum nl80211_iftype type ,
1890+ u32 * flags ,
18221891 struct vif_params * params )
1892+ #endif
18231893{
18241894 struct wilc * wl = wiphy_priv (wiphy );
18251895 struct wilc_vif * vif ;
@@ -2206,7 +2276,11 @@ struct wilc *wilc_create_wiphy(struct device *dev)
22062276
22072277 wiphy -> max_scan_ssids = WILC_MAX_NUM_PROBED_SSID ;
22082278#ifdef CONFIG_PM
2279+ #if KERNEL_VERSION (3 , 11 , 0 ) <= LINUX_VERSION_CODE
22092280 wiphy -> wowlan = & wowlan_support ;
2281+ #else
2282+ wiphy -> wowlan = wowlan_support ;
2283+ #endif
22102284#endif
22112285 wiphy -> max_num_pmkids = WILC_MAX_NUM_PMKIDS ;
22122286 wiphy -> max_scan_ie_len = 1000 ;
0 commit comments