diff --git a/include/ioctl_cfg80211.h b/include/ioctl_cfg80211.h index df878ea..b3431c3 100644 --- a/include/ioctl_cfg80211.h +++ b/include/ioctl_cfg80211.h @@ -143,8 +143,11 @@ bool rtw_cfg80211_pwr_mgmt(_adapter *adapter); #define rtw_cfg80211_rx_mgmt(adapter, freq, sig_dbm, buf, len, gfp) cfg80211_rx_mgmt((adapter)->pnetdev, freq, buf, len, gfp) #elif (LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0)) #define rtw_cfg80211_rx_mgmt(adapter, freq, sig_dbm, buf, len, gfp) cfg80211_rx_mgmt((adapter)->pnetdev, freq, sig_dbm, buf, len, gfp) -#else +#elif (LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0)) #define rtw_cfg80211_rx_mgmt(adapter, freq, sig_dbm, buf, len, gfp) cfg80211_rx_mgmt((adapter)->rtw_wdev, freq, sig_dbm, buf, len, gfp) +#else +// 3.12 added a flags argument which is just set to zero +#define rtw_cfg80211_rx_mgmt(adapter, freq, sig_dbm, buf, len, gfp) cfg80211_rx_mgmt((adapter)->rtw_wdev, freq, sig_dbm, buf, len, 0, gfp) #endif #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) && !defined(COMPAT_KERNEL_RELEASE) diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index 3abcad9..3a5f667 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -642,6 +642,11 @@ void rtw_cfg80211_ibss_indicate_connect(_adapter *padapter) struct wlan_network *cur_network = &(pmlmepriv->cur_network); struct wireless_dev *pwdev = padapter->rtw_wdev; struct cfg80211_bss *bss = NULL; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0) + WLAN_BSSID_EX *pnetwork = &(padapter->mlmeextpriv.mlmext_info.network); + struct ieee80211_channel *chan = NULL; + u32 freq; +#endif DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(padapter)); if (pwdev->iftype != NL80211_IFTYPE_ADHOC) @@ -693,7 +698,20 @@ void rtw_cfg80211_ibss_indicate_connect(_adapter *padapter) DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" BSS not found !!\n", FUNC_ADPT_ARG(padapter)); } //notify cfg80211 that device joined an IBSS +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0) + if (!(pnetwork) || !(padapter->rtw_wdev)) + return; + + if (pnetwork->Configuration.DSConfig <= RTW_CH_MAX_2G_CHANNEL) + freq = rtw_ieee80211_channel_to_frequency(pnetwork->Configuration.DSConfig, IEEE80211_BAND_2GHZ); + else + freq = rtw_ieee80211_channel_to_frequency(pnetwork->Configuration.DSConfig, IEEE80211_BAND_5GHZ); + + chan = ieee80211_get_channel(padapter->rtw_wdev->wiphy, freq); + cfg80211_ibss_joined(padapter->pnetdev, cur_network->network.MacAddress, chan, GFP_ATOMIC); +#else cfg80211_ibss_joined(padapter->pnetdev, cur_network->network.MacAddress, GFP_ATOMIC); +#endif } void rtw_cfg80211_indicate_connect(_adapter *padapter) @@ -792,14 +810,18 @@ check_bss: } else { +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0) DBG_8192C("pwdev->sme_state(b)=%d\n", pwdev->sme_state); +#endif cfg80211_connect_result(padapter->pnetdev, cur_network->network.MacAddress , pmlmepriv->assoc_req+sizeof(struct rtw_ieee80211_hdr_3addr)+2 , pmlmepriv->assoc_req_len-sizeof(struct rtw_ieee80211_hdr_3addr)-2 , pmlmepriv->assoc_rsp+sizeof(struct rtw_ieee80211_hdr_3addr)+6 , pmlmepriv->assoc_rsp_len-sizeof(struct rtw_ieee80211_hdr_3addr)-6 , WLAN_STATUS_SUCCESS, GFP_ATOMIC); +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0) DBG_8192C("pwdev->sme_state(a)=%d\n", pwdev->sme_state); +#endif } } @@ -1666,7 +1692,11 @@ static int cfg80211_rtw_set_default_key(struct wiphy *wiphy, static int cfg80211_rtw_get_station(struct wiphy *wiphy, struct net_device *ndev, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) + const u8 *mac, struct station_info *sinfo) +#else u8 *mac, struct station_info *sinfo) +#endif { int ret = 0; _adapter *padapter = (_adapter *)rtw_netdev_priv(ndev); @@ -4070,7 +4096,11 @@ static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev) #endif //(LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) static int cfg80211_rtw_add_station(struct wiphy *wiphy, struct net_device *ndev, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) + const u8 *mac, struct station_parameters *params) +#else u8 *mac, struct station_parameters *params) +#endif { DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev)); @@ -4078,7 +4104,11 @@ static int cfg80211_rtw_add_station(struct wiphy *wiphy, struct net_device *ndev } static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) + const u8 *mac) +#else u8 *mac) +#endif { int ret=0; _irqL irqL; @@ -4169,7 +4195,11 @@ static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev } static int cfg80211_rtw_change_station(struct wiphy *wiphy, struct net_device *ndev, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) + const u8 *mac, struct station_parameters *params) +#else u8 *mac, struct station_parameters *params) +#endif { DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev)); @@ -4997,6 +5023,9 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy, #else struct net_device *ndev, #endif +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) + struct cfg80211_mgmt_tx_params *params, +#else struct ieee80211_channel *chan, #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) || defined(COMPAT_KERNEL_RELEASE) bool offchan, @@ -5017,11 +5046,17 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy, #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) bool dont_wait_for_ack, #endif +#endif u64 *cookie) { #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) struct net_device *ndev = wdev_to_ndev(wdev); #endif +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) + struct ieee80211_channel *chan = params->chan; + const u8 *buf = params->buf; + size_t len = params->len; +#endif int ret = 0; int tx_ret; u32 dump_limit = RTW_MAX_MGMT_TX_CNT; @@ -5897,7 +5932,11 @@ static void rtw_cfg80211_preinit_wiphy(_adapter *padapter, struct wiphy *wiphy) #endif #if defined(CONFIG_PM) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0)) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) + wiphy->wowlan = &wowlan_stub; +#else wiphy->wowlan = wowlan_stub; +#endif #endif #if defined(CONFIG_TDLS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) diff --git a/os_dep/linux/wifi_regd.c b/os_dep/linux/wifi_regd.c index faa2c14..6c1b90d 100644 --- a/os_dep/linux/wifi_regd.c +++ b/os_dep/linux/wifi_regd.c @@ -270,9 +270,14 @@ static void _rtw_reg_apply_radar_flags(struct wiphy *wiphy) #ifdef CONFIG_DFS if (!(ch->flags & IEEE80211_CHAN_DISABLED)) ch->flags |= IEEE80211_CHAN_RADAR | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0) + IEEE80211_CHAN_NO_IR; +#else IEEE80211_CHAN_NO_IBSS; #endif +#endif + #if 0 /* * We always enable radar detection/DFS on this @@ -357,7 +362,11 @@ static void _rtw_reg_apply_flags(struct wiphy *wiphy) ch = ieee80211_get_channel(wiphy, freq); if (ch) { if (channel_set[i].ScanType == SCAN_PASSIVE) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0) + ch->flags = IEEE80211_CHAN_NO_IR; +#else ch->flags = IEEE80211_CHAN_PASSIVE_SCAN; +#endif else ch->flags = 0; } @@ -484,9 +493,16 @@ static void _rtw_regd_init_wiphy(struct rtw_regulatory *reg, wiphy->reg_notifier = reg_notifier; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0) + wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG; + wiphy->regulatory_flags &= ~REGULATORY_DISABLE_BEACON_HINTS; + wiphy->regulatory_flags &= ~REGULATORY_STRICT_REG; + +#else wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY; wiphy->flags &= ~WIPHY_FLAG_STRICT_REGULATORY; wiphy->flags &= ~WIPHY_FLAG_DISABLE_BEACON_HINTS; +#endif regd = _rtw_regdomain_select(reg); wiphy_apply_custom_regulatory(wiphy, regd);