struct cfg80211_ibss_params *params);
static s32 wl_cfg80211_leave_ibss(struct wiphy *wiphy,
struct net_device *dev);
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
+static s32 wl_cfg80211_get_station(struct wiphy *wiphy,
+ struct net_device *dev, const u8 *mac,
+ struct station_info *sinfo);
+#else
static s32 wl_cfg80211_get_station(struct wiphy *wiphy,
struct net_device *dev, u8 *mac,
struct station_info *sinfo);
+#endif
static s32 wl_cfg80211_set_power_mgmt(struct wiphy *wiphy,
struct net_device *dev, bool enabled,
s32 timeout);
2, 0))
static s32 wl_cfg80211_mgmt_tx_cancel_wait(struct wiphy *wiphy,
bcm_struct_cfgdev *cfgdev, u64 cookie);
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0))
+static s32 wl_cfg80211_del_station(
+ struct wiphy *wiphy, struct net_device *ndev,
+ struct station_del_parameters *params);
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
+static s32 wl_cfg80211_del_station(struct wiphy *wiphy,
+ struct net_device *ndev, const u8* mac_addr);
+#else
static s32 wl_cfg80211_del_station(struct wiphy *wiphy,
struct net_device *ndev, u8* mac_addr);
+#endif
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
+static s32 wl_cfg80211_change_station(struct wiphy *wiphy,
+ struct net_device *dev, const u8 *mac, struct station_parameters *params);
+#else
static s32 wl_cfg80211_change_station(struct wiphy *wiphy,
struct net_device *dev, u8 *mac, struct station_parameters *params);
+#endif
+
#endif /* WL_SUPPORT_BACKPORTED_KPATCHES || KERNEL_VER >= KERNEL_VERSION(3, 2, 0)) */
static s32
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 39)) || defined(WL_COMPAT_WIRELESS)
static s32 wl_notify_escan_complete(struct bcm_cfg80211 *cfg,
struct net_device *ndev, bool aborted, bool fw_abort);
#if (LINUX_VERSION_CODE > KERNEL_VERSION(3, 2, 0)) || defined(WL_COMPAT_WIRELESS)
-#if defined(CONFIG_ARCH_MSM) && defined(TDLS_MGMT_VERSION2)
+#if (defined(CONFIG_ARCH_MSM) && defined(TDLS_MGMT_VERSION2)) || (LINUX_VERSION_CODE < \
+ KERNEL_VERSION(3, 16, 0) && LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0))
static s32 wl_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev,
u8 *peer, u8 action_code, u8 dialog_token, u16 status_code,
u32 peer_capability, const u8 *data, size_t len);
+#elif ((LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)) && \
+ (LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0)))
+static s32 wl_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev,
+ const u8 *peer, u8 action_code, u8 dialog_token, u16 status_code,
+ u32 peer_capability, const u8 *data, size_t len);
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0))
+static s32 wl_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev,
+ const u8 *peer, u8 action_code, u8 dialog_token, u16 status_code,
+ u32 peer_capability, bool initiator, const u8 *data, size_t len);
#else
static s32 wl_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev,
u8 *peer, u8 action_code, u8 dialog_token, u16 status_code, const u8 *data,
size_t len);
#endif /* CONFIG_ARCH_MSM && TDLS_MGMT_VERSION2 */
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
+static s32 wl_cfg80211_tdls_oper(struct wiphy *wiphy, struct net_device *dev,
+ const u8 *peer, enum nl80211_tdls_operation oper);
+#else
static s32 wl_cfg80211_tdls_oper(struct wiphy *wiphy, struct net_device *dev,
u8 *peer, enum nl80211_tdls_operation oper);
+#endif
+
#endif /* LINUX_VERSION > KERNEL_VERSION(3,2,0) || WL_COMPAT_WIRELESS */
#ifdef WL_SCHED_SCAN
static int wl_cfg80211_sched_scan_stop(struct wiphy *wiphy, struct net_device *dev);
};
#endif /* WL_DBG_LEVEL */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0))
+#define ieee80211_band nl80211_band
+#define IEEE80211_BAND_2GHZ NL80211_BAND_2GHZ
+#define IEEE80211_BAND_5GHZ NL80211_BAND_5GHZ
+#define IEEE80211_NUM_BANDS NUM_NL80211_BANDS
+#endif
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0))
+#define CFG80211_DISCONNECTED(dev, reason, ie, len, loc_gen, gfp) \
+ cfg80211_disconnected(dev, reason, ie, len, gfp);
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0))
+#define CFG80211_DISCONNECTED(dev, reason, ie, len, loc_gen, gfp) \
+ cfg80211_disconnected(dev, reason, ie, len, loc_gen, gfp);
+#endif
+
#define CHAN2G(_channel, _freq, _flags) { \
.band = IEEE80211_BAND_2GHZ, \
.center_freq = (_freq), \
#else
char *name,
#endif /* WL_CFG80211_P2P_DEV_IF */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
+ unsigned char name_assign_type,
+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0)) */
enum nl80211_iftype type, u32 *flags,
struct vif_params *params)
{
swap_key_to_BE(&key);
memset(¶ms, 0, sizeof(params));
params.key_len = (u8) min_t(u8, DOT11_MAX_KEY_SIZE, key.len);
- memcpy(params.key, key.data, params.key_len);
+ memcpy((void*)params.key, key.data, params.key_len);
err = wldev_iovar_getint_bsscfg(dev, "wsec", &wsec, bssidx);
if (unlikely(err)) {
}
static s32
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
+wl_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
+ const u8 *mac, struct station_info *sinfo)
+#else
wl_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
u8 *mac, struct station_info *sinfo)
+#endif
{
struct bcm_cfg80211 *cfg = wiphy_priv(wiphy);
scb_val_t scb_val;
WL_ERR(("GET STA INFO failed, %d\n", err));
return err;
}
- sinfo->filled = STATION_INFO_INACTIVE_TIME;
+ sinfo->filled = STA_INFO_BIT(INFO_INACTIVE_TIME);
sta = (sta_info_t *)cfg->ioctl_buf;
sta->len = dtoh16(sta->len);
sta->cap = dtoh16(sta->cap);
sinfo->inactive_time = sta->idle * 1000;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0)) || defined(WL_COMPAT_WIRELESS)
if (sta->flags & WL_STA_ASSOC) {
- sinfo->filled |= STATION_INFO_CONNECTED_TIME;
+ sinfo->filled |= STA_INFO_BIT(INFO_CONNECTED_TIME);
sinfo->connected_time = sta->in;
}
WL_INFORM(("STA %s : idle time : %d sec, connected time :%d ms\n",
int rxpktglom;
#endif
rate = dtoh32(rate);
- sinfo->filled |= STATION_INFO_TX_BITRATE;
+ sinfo->filled |= STA_INFO_BIT(INFO_TX_BITRATE);
sinfo->txrate.legacy = rate * 5;
WL_DBG(("Rate %d Mbps\n", (rate / 2)));
#if defined(USE_DYNAMIC_MAXPKT_RXGLOM)
// terence 20150419: limit the max. rssi to -2 or the bss will be filtered out in android OS
rssi = MIN(rssi, RSSI_MAXVAL);
#endif
- sinfo->filled |= STATION_INFO_SIGNAL;
+ sinfo->filled |= STA_INFO_BIT(INFO_SIGNAL);
sinfo->signal = rssi;
WL_DBG(("RSSI %d dBm\n", rssi));
err = wldev_ioctl(dev, WLC_GET_PKTCNTS, &pktcnt,
sizeof(pktcnt), false);
if (!err) {
- sinfo->filled |= (STATION_INFO_RX_PACKETS |
- STATION_INFO_RX_DROP_MISC |
- STATION_INFO_TX_PACKETS |
- STATION_INFO_TX_FAILED);
+ sinfo->filled |= (STA_INFO_BIT(INFO_RX_PACKETS) |
+ STA_INFO_BIT(INFO_RX_DROP_MISC) |
+ STA_INFO_BIT(INFO_TX_PACKETS) |
+ STA_INFO_BIT(INFO_TX_FAILED));
sinfo->rx_packets = pktcnt.rx_good_pkt;
sinfo->rx_dropped_misc = pktcnt.rx_bad_pkt;
sinfo->tx_packets = pktcnt.tx_good_pkt;
/* Disconnect due to zero BSSID or error to get RSSI */
WL_ERR(("force cfg80211_disconnected: %d\n", err));
wl_clr_drv_status(cfg, CONNECTED, dev);
- cfg80211_disconnected(dev, 0, NULL, 0, GFP_KERNEL);
+ //cfg80211_disconnected(dev, 0, NULL, 0, GFP_KERNEL);
+ CFG80211_DISCONNECTED(dev, 0, NULL, 0, false, GFP_KERNEL);
wl_link_down(cfg);
}
}
struct net_info *iter, *next;
struct net_device *ndev = bcmcfg_to_prmry_ndev(cfg);
unsigned long flags;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0))
+ struct cfg80211_scan_info info;
+#endif
if (unlikely(!wl_get_drv_status(cfg, READY, ndev))) {
WL_INFORM(("device is not ready : status (%d)\n",
(int)cfg->status));
wl_set_drv_status(cfg, SCAN_ABORTING, iter->ndev);
spin_lock_irqsave(&cfg->cfgdrv_lock, flags);
if (cfg->scan_request) {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0))
+ info.aborted = true;
+ cfg80211_scan_done(cfg->scan_request, &info);
+#else
cfg80211_scan_done(cfg->scan_request, true);
+#endif
cfg->scan_request = NULL;
}
for_each_ndev(cfg, iter, next) {
if (dev == wl_to_p2p_bss_ndev(cfg, P2PAPI_BSSCFG_CONNECTION))
dev = bcmcfg_to_prmry_ndev(cfg);
#endif
- if ((dev == bcmcfg_to_prmry_ndev(cfg)) && cfg->p2p)
+ if ((dev == bcmcfg_to_prmry_ndev(cfg)) && cfg->p2p) {
bssidx = wl_to_p2p_bss_bssidx(cfg, P2PAPI_BSSCFG_DEVICE);
+ }
wl_cfgp2p_set_management_ie(cfg, dev, bssidx,
VNDR_IE_PRBRSP_FLAG, (u8 *)(buf + ie_offset), ie_len);
cfg80211_mgmt_tx_status(cfgdev, *cookie, buf, len, true, GFP_KERNEL);
#if defined(WL_SUPPORT_BACKPORTED_KPATCHES) || (LINUX_VERSION_CODE >= KERNEL_VERSION(3, \
2, 0))
static s32
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0))
+wl_cfg80211_del_station(
+ struct wiphy *wiphy, struct net_device *ndev,
+ struct station_del_parameters *params)
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
+wl_cfg80211_del_station(
+ struct wiphy *wiphy,
+ struct net_device *ndev,
+ const u8* mac_addr)
+#else
wl_cfg80211_del_station(
struct wiphy *wiphy,
struct net_device *ndev,
u8* mac_addr)
+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)) */
{
struct net_device *dev;
struct bcm_cfg80211 *cfg = wiphy_priv(wiphy);
sizeof(struct ether_addr) + sizeof(uint)] = {0};
struct maclist *assoc_maclist = (struct maclist *)mac_buf;
int num_associated = 0;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0))
+ const u8 *mac_addr = params->mac;
+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)) */
WL_DBG(("Entry\n"));
if (mac_addr == NULL) {
}
static s32
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
+wl_cfg80211_change_station(
+ struct wiphy *wiphy,
+ struct net_device *dev,
+ const u8 *mac,
+ struct station_parameters *params)
+#else
wl_cfg80211_change_station(
struct wiphy *wiphy,
struct net_device *dev,
u8 *mac,
struct station_parameters *params)
+#endif
{
int err;
struct bcm_cfg80211 *cfg = wiphy_priv(wiphy);
return -ENOTSUPP;
if (!(params->sta_flags_set & BIT(NL80211_STA_FLAG_AUTHORIZED))) {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
+ err = wldev_ioctl(primary_ndev, WLC_SCB_DEAUTHORIZE, (u8 *)mac, ETH_ALEN, true);
+#else
err = wldev_ioctl(primary_ndev, WLC_SCB_DEAUTHORIZE, mac, ETH_ALEN, true);
+#endif
if (err)
WL_ERR(("WLC_SCB_DEAUTHORIZE error (%d)\n", err));
return err;
}
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
+ err = wldev_ioctl(primary_ndev, WLC_SCB_AUTHORIZE, (u8 *)mac, ETH_ALEN, true);
+#else
err = wldev_ioctl(primary_ndev, WLC_SCB_AUTHORIZE, mac, ETH_ALEN, true);
+#endif
if (err)
WL_ERR(("WLC_SCB_AUTHORIZE error (%d)\n", err));
return err;
sinfo.filled = 0;
if (((event == WLC_E_ASSOC_IND) || (event == WLC_E_REASSOC_IND)) &&
reason == DOT11_SC_SUCCESS) {
- sinfo.filled = STATION_INFO_ASSOC_REQ_IES;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0))
+ sinfo.filled = STA_INFO_BIT(INFO_ASSOC_REQ_IES);
+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0)) */
if (!data) {
WL_ERR(("No IEs present in ASSOC/REASSOC_IND"));
return -EINVAL;
WL_ERR(("WLC_DISASSOC error %d\n", err));
err = 0;
}
- cfg80211_disconnected(ndev, reason, NULL, 0, GFP_KERNEL);
+// cfg80211_disconnected(ndev, reason, NULL, 0, GFP_KERNEL);
+ CFG80211_DISCONNECTED(ndev, reason, NULL, 0, false, GFP_KERNEL);
wl_link_down(cfg);
wl_init_prof(cfg, ndev);
}
#ifndef WL_SCHED_SCAN
mutex_lock(&cfg->usr_sync);
/* TODO: Use cfg80211_sched_scan_results(wiphy); */
- cfg80211_disconnected(ndev, 0, NULL, 0, GFP_KERNEL);
+ //cfg80211_disconnected(ndev, 0, NULL, 0, GFP_KERNEL);
+ CFG80211_DISCONNECTED(ndev, 0, NULL, 0, false, GFP_KERNEL);
mutex_unlock(&cfg->usr_sync);
#else
/* If cfg80211 scheduled scan is supported, report the pno results via sched
u32 len = WL_SCAN_BUF_MAX;
s32 err = 0;
unsigned long flags;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0))
+ struct cfg80211_scan_info info;
+#endif
WL_DBG(("Enter \n"));
if (!wl_get_drv_status(cfg, SCANNING, ndev)) {
del_timer_sync(&cfg->scan_timeout);
spin_lock_irqsave(&cfg->cfgdrv_lock, flags);
if (cfg->scan_request) {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0))
+ info.aborted = false;
+ cfg80211_scan_done(cfg->scan_request, &info);
+#else
cfg80211_scan_done(cfg->scan_request, false);
+#endif
cfg->scan_request = NULL;
}
spin_unlock_irqrestore(&cfg->cfgdrv_lock, flags);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0))
retval = cfg80211_rx_mgmt(cfgdev, freq, 0, mgmt_frame, mgmt_frame_len, 0);
-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0))\r
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0))
retval = cfg80211_rx_mgmt(cfgdev, freq, 0, mgmt_frame, mgmt_frame_len, 0, GFP_ATOMIC);
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)) || \
defined(WL_COMPAT_WIRELESS)
s32 err = BCME_OK;
unsigned long flags;
struct net_device *dev;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0))
+ struct cfg80211_scan_info info;
+ info.aborted = aborted;
+#endif
WL_DBG(("Enter \n"));
if (!ndev) {
}
#endif /* WL_SCHED_SCAN */
if (likely(cfg->scan_request)) {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0))
+ cfg80211_scan_done(cfg->scan_request, &info);
+#else
cfg80211_scan_done(cfg->scan_request, aborted);
+#endif
cfg->scan_request = NULL;
}
if (p2p_is_on(cfg))
dhd_pub_t *dhd = (dhd_pub_t *)(cfg->pub);
#endif
#endif /* PROP_TXSTATUS_VSDB */
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0))
+ struct cfg80211_scan_info info;
+#endif
+
WL_DBG(("In\n"));
/* Delete pm_enable_work */
wl_add_remove_pm_enable_work(cfg, FALSE, WL_HANDLER_DEL);
spin_lock_irqsave(&cfg->cfgdrv_lock, flags);
if (cfg->scan_request) {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0))
+ info.aborted = true;
+ cfg80211_scan_done(cfg->scan_request, &info);
+#else
cfg80211_scan_done(cfg->scan_request, true);
+#endif
cfg->scan_request = NULL;
}
spin_unlock_irqrestore(&cfg->cfgdrv_lock, flags);
WL_ERR(("In : chip crash eventing\n"));
wl_add_remove_pm_enable_work(cfg, FALSE, WL_HANDLER_DEL);
- cfg80211_disconnected(dev, reason, NULL, 0, GFP_KERNEL);
+ //cfg80211_disconnected(dev, reason, NULL, 0, GFP_KERNEL);
+ CFG80211_DISCONNECTED(dev, reason, NULL, 0, false, GFP_KERNEL);
#if defined(RSSIAVG)
wl_free_rssi_cache(&g_rssi_cache_ctrl);
#endif
#if (LINUX_VERSION_CODE > KERNEL_VERSION(3, 2, 0)) || defined(WL_COMPAT_WIRELESS)
static s32
-#if defined(CONFIG_ARCH_MSM) && defined(TDLS_MGMT_VERSION2)
+#if (defined(CONFIG_ARCH_MSM) && defined(TDLS_MGMT_VERSION2)) || (LINUX_VERSION_CODE < \
+ KERNEL_VERSION(3, 16, 0) && LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0))
wl_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev,
u8 *peer, u8 action_code, u8 dialog_token, u16 status_code,
u32 peer_capability, const u8 *data, size_t len)
+#elif ((LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)) && \
+ (LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0)))
+wl_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev,
+ const u8 *peer, u8 action_code, u8 dialog_token, u16 status_code,
+ u32 peer_capability, const u8 *data, size_t len)
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0))
+wl_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev,
+ const u8 *peer, u8 action_code, u8 dialog_token, u16 status_code,
+ u32 peer_capability, bool initiator, const u8 *data, size_t len)
#else
wl_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev,
u8 *peer, u8 action_code, u8 dialog_token, u16 status_code, const u8 *data,
size_t len)
-#endif /* CONFIG_ARCH_MSM && TDLS_MGMT_VERSION2 */
+#endif /* CONFIG_ARCH_MSM && TDLS_MGMT_VERSION2 */
{
s32 ret = 0;
#ifdef WLTDLS
}
static s32
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
+wl_cfg80211_tdls_oper(struct wiphy *wiphy, struct net_device *dev,
+ const u8 *peer, enum nl80211_tdls_operation oper)
+#else
wl_cfg80211_tdls_oper(struct wiphy *wiphy, struct net_device *dev,
u8 *peer, enum nl80211_tdls_operation oper)
+#endif
{
s32 ret = 0;
#ifdef WLTDLS
unsigned long flags;
int clear_flag = 0;
int ret = 0;
-
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0))
+ struct cfg80211_scan_info info;
+#endif
WL_TRACE(("Enter\n"));
cfg = g_bcm_cfg;
if (cfg->scan_request && cfg->scan_request->dev == cfgdev)
#endif
{
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0))
+ info.aborted = true;
+ cfg80211_scan_done(cfg->scan_request, &info);
+#else
cfg80211_scan_done(cfg->scan_request, true);
+#endif
cfg->scan_request = NULL;
clear_flag = 1;
}