MLK-11763-1 bcmdhd: make the driver work for 4.1 kernel
authorDong Aisheng <aisheng.dong@freescale.com>
Mon, 26 Oct 2015 10:42:43 +0000 (18:42 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:49:07 +0000 (14:49 -0500)
Fixing a lot of compiling issues due to kernel upgrade and then
make it work on 4.1 kernel.

Signed-off-by: Dong Aisheng <aisheng.dong@freescale.com>
drivers/net/wireless/bcmdhd/bcmutils.c
drivers/net/wireless/bcmdhd/dhd_wlfc.c
drivers/net/wireless/bcmdhd/wl_android.c
drivers/net/wireless/bcmdhd/wl_cfg80211.c
drivers/net/wireless/bcmdhd/wl_cfg_btcoex.c
drivers/net/wireless/bcmdhd/wl_cfgvendor.c

index 6e4c742..b57910d 100644 (file)
@@ -266,11 +266,12 @@ pktq_penq(struct pktq *pq, int prec, void *p)
        struct pktq_prec *q;
 
        ASSERT(prec >= 0 && prec < pq->num_prec);
-       ASSERT(PKTLINK(p) == NULL);         /* queueing chains not allowed */
+       ASSERT(!((PKTLINK(p) != NULL) && (PKTLINK(p) != p)));         /* queueing chains not allowed */
 
        ASSERT(!pktq_full(pq));
        ASSERT(!pktq_pfull(pq, prec));
 
+       PKTSETLINK(p, NULL);
        q = &pq->q[prec];
 
        if (q->head)
@@ -295,10 +296,11 @@ pktq_penq_head(struct pktq *pq, int prec, void *p)
        struct pktq_prec *q;
 
        ASSERT(prec >= 0 && prec < pq->num_prec);
-       ASSERT(PKTLINK(p) == NULL);         /* queueing chains not allowed */
+       ASSERT(!((PKTLINK(p) != NULL) && (PKTLINK(p) != p)));         /* queueing chains not allowed */
 
        ASSERT(!pktq_full(pq));
        ASSERT(!pktq_pfull(pq, prec));
+       PKTSETLINK(p, NULL);
 
        q = &pq->q[prec];
 
index aa8887d..c76f96a 100644 (file)
@@ -94,7 +94,7 @@ _dhd_wlfc_prec_enque(struct pktq *pq, int prec, void* p, bool qHead,
 
 
        ASSERT(prec >= 0 && prec < pq->num_prec);
-       ASSERT(PKTLINK(p) == NULL);         /* queueing chains not allowed */
+       ASSERT(!((PKTLINK(p) != NULL) && (PKTLINK(p) != p)));         /* queueing chains not allowed */
 
        ASSERT(!pktq_full(pq));
        ASSERT(!pktq_pfull(pq, prec));
index 4e0e5d9..4c1344d 100644 (file)
@@ -1722,11 +1722,11 @@ int wl_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
 
        DHD_INFO(("%s: Android private cmd \"%s\" on %s\n", __FUNCTION__, command, ifr->ifr_name));
 
-       if (strnicmp(command, CMD_START, strlen(CMD_START)) == 0) {
+       if (strncasecmp(command, CMD_START, strlen(CMD_START)) == 0) {
                DHD_INFO(("%s, Received regular START command\n", __FUNCTION__));
                bytes_written = wl_android_wifi_on(net);
        }
-       else if (strnicmp(command, CMD_SETFWPATH, strlen(CMD_SETFWPATH)) == 0) {
+       else if (strncasecmp(command, CMD_SETFWPATH, strlen(CMD_SETFWPATH)) == 0) {
                bytes_written = wl_android_set_fwpath(net, command, priv_cmd.total_len);
        }
 
@@ -1737,44 +1737,44 @@ int wl_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
                goto exit;
        }
 
-       if (strnicmp(command, CMD_STOP, strlen(CMD_STOP)) == 0) {
+       if (strncasecmp(command, CMD_STOP, strlen(CMD_STOP)) == 0) {
                bytes_written = wl_android_wifi_off(net);
        }
-       else if (strnicmp(command, CMD_SCAN_ACTIVE, strlen(CMD_SCAN_ACTIVE)) == 0) {
+       else if (strncasecmp(command, CMD_SCAN_ACTIVE, strlen(CMD_SCAN_ACTIVE)) == 0) {
                /* TBD: SCAN-ACTIVE */
        }
-       else if (strnicmp(command, CMD_SCAN_PASSIVE, strlen(CMD_SCAN_PASSIVE)) == 0) {
+       else if (strncasecmp(command, CMD_SCAN_PASSIVE, strlen(CMD_SCAN_PASSIVE)) == 0) {
                /* TBD: SCAN-PASSIVE */
        }
-       else if (strnicmp(command, CMD_RSSI, strlen(CMD_RSSI)) == 0) {
+       else if (strncasecmp(command, CMD_RSSI, strlen(CMD_RSSI)) == 0) {
                bytes_written = wl_android_get_rssi(net, command, priv_cmd.total_len);
        }
-       else if (strnicmp(command, CMD_LINKSPEED, strlen(CMD_LINKSPEED)) == 0) {
+       else if (strncasecmp(command, CMD_LINKSPEED, strlen(CMD_LINKSPEED)) == 0) {
                bytes_written = wl_android_get_link_speed(net, command, priv_cmd.total_len);
        }
 #ifdef PKT_FILTER_SUPPORT
-       else if (strnicmp(command, CMD_RXFILTER_START, strlen(CMD_RXFILTER_START)) == 0) {
+       else if (strncasecmp(command, CMD_RXFILTER_START, strlen(CMD_RXFILTER_START)) == 0) {
                bytes_written = net_os_enable_packet_filter(net, 1);
        }
-       else if (strnicmp(command, CMD_RXFILTER_STOP, strlen(CMD_RXFILTER_STOP)) == 0) {
+       else if (strncasecmp(command, CMD_RXFILTER_STOP, strlen(CMD_RXFILTER_STOP)) == 0) {
                bytes_written = net_os_enable_packet_filter(net, 0);
        }
-       else if (strnicmp(command, CMD_RXFILTER_ADD, strlen(CMD_RXFILTER_ADD)) == 0) {
+       else if (strncasecmp(command, CMD_RXFILTER_ADD, strlen(CMD_RXFILTER_ADD)) == 0) {
                int filter_num = *(command + strlen(CMD_RXFILTER_ADD) + 1) - '0';
                bytes_written = net_os_rxfilter_add_remove(net, TRUE, filter_num);
        }
-       else if (strnicmp(command, CMD_RXFILTER_REMOVE, strlen(CMD_RXFILTER_REMOVE)) == 0) {
+       else if (strncasecmp(command, CMD_RXFILTER_REMOVE, strlen(CMD_RXFILTER_REMOVE)) == 0) {
                int filter_num = *(command + strlen(CMD_RXFILTER_REMOVE) + 1) - '0';
                bytes_written = net_os_rxfilter_add_remove(net, FALSE, filter_num);
        }
 #endif /* PKT_FILTER_SUPPORT */
-       else if (strnicmp(command, CMD_BTCOEXSCAN_START, strlen(CMD_BTCOEXSCAN_START)) == 0) {
+       else if (strncasecmp(command, CMD_BTCOEXSCAN_START, strlen(CMD_BTCOEXSCAN_START)) == 0) {
                /* TBD: BTCOEXSCAN-START */
        }
-       else if (strnicmp(command, CMD_BTCOEXSCAN_STOP, strlen(CMD_BTCOEXSCAN_STOP)) == 0) {
+       else if (strncasecmp(command, CMD_BTCOEXSCAN_STOP, strlen(CMD_BTCOEXSCAN_STOP)) == 0) {
                /* TBD: BTCOEXSCAN-STOP */
        }
-       else if (strnicmp(command, CMD_BTCOEXMODE, strlen(CMD_BTCOEXMODE)) == 0) {
+       else if (strncasecmp(command, CMD_BTCOEXMODE, strlen(CMD_BTCOEXMODE)) == 0) {
 #ifdef WL_CFG80211
                void *dhdp = wl_cfg80211_get_dhdp();
                bytes_written = wl_cfg80211_set_btcoex_dhcp(net, dhdp, command);
@@ -1789,122 +1789,122 @@ int wl_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
 #endif /* PKT_FILTER_SUPPORT */
 #endif /* WL_CFG80211 */
        }
-       else if (strnicmp(command, CMD_SETSUSPENDOPT, strlen(CMD_SETSUSPENDOPT)) == 0) {
+       else if (strncasecmp(command, CMD_SETSUSPENDOPT, strlen(CMD_SETSUSPENDOPT)) == 0) {
                bytes_written = wl_android_set_suspendopt(net, command, priv_cmd.total_len);
        }
-       else if (strnicmp(command, CMD_SETSUSPENDMODE, strlen(CMD_SETSUSPENDMODE)) == 0) {
+       else if (strncasecmp(command, CMD_SETSUSPENDMODE, strlen(CMD_SETSUSPENDMODE)) == 0) {
                bytes_written = wl_android_set_suspendmode(net, command, priv_cmd.total_len);
        }
-       else if (strnicmp(command, CMD_SETBAND, strlen(CMD_SETBAND)) == 0) {
+       else if (strncasecmp(command, CMD_SETBAND, strlen(CMD_SETBAND)) == 0) {
                uint band = *(command + strlen(CMD_SETBAND) + 1) - '0';
                bytes_written = wldev_set_band(net, band);
        }
-       else if (strnicmp(command, CMD_GETBAND, strlen(CMD_GETBAND)) == 0) {
+       else if (strncasecmp(command, CMD_GETBAND, strlen(CMD_GETBAND)) == 0) {
                bytes_written = wl_android_get_band(net, command, priv_cmd.total_len);
        }
 #ifdef WL_CFG80211
        /* CUSTOMER_SET_COUNTRY feature is define for only GGSM model */
-       else if (strnicmp(command, CMD_COUNTRY, strlen(CMD_COUNTRY)) == 0) {
+       else if (strncasecmp(command, CMD_COUNTRY, strlen(CMD_COUNTRY)) == 0) {
                char *country_code = command + strlen(CMD_COUNTRY) + 1;
                bytes_written = wldev_set_country(net, country_code, true, true);
        }
 #endif /* WL_CFG80211 */
-       else if (strnicmp(command, CMD_80211_MODE, strlen(CMD_80211_MODE)) == 0) {
+       else if (strncasecmp(command, CMD_80211_MODE, strlen(CMD_80211_MODE)) == 0) {
                bytes_written = wl_android_get_80211_mode(net, command, priv_cmd.total_len);
-       } else if (strnicmp(command, CMD_CHANSPEC, strlen(CMD_CHANSPEC)) == 0) {
+       } else if (strncasecmp(command, CMD_CHANSPEC, strlen(CMD_CHANSPEC)) == 0) {
                bytes_written = wl_android_get_chanspec(net, command, priv_cmd.total_len);
-       } else if (strnicmp(command, CMD_DATARATE, strlen(CMD_DATARATE)) == 0) {
+       } else if (strncasecmp(command, CMD_DATARATE, strlen(CMD_DATARATE)) == 0) {
                bytes_written = wl_android_get_datarate(net, command, priv_cmd.total_len);
-       } else if (strnicmp(command, CMD_ASSOC_CLIENTS, strlen(CMD_ASSOC_CLIENTS)) == 0) {
+       } else if (strncasecmp(command, CMD_ASSOC_CLIENTS,      strlen(CMD_ASSOC_CLIENTS)) == 0) {
                bytes_written = wl_android_get_assoclist(net, command, priv_cmd.total_len);
        }
 
 #ifdef PNO_SUPPORT
-       else if (strnicmp(command, CMD_PNOSSIDCLR_SET, strlen(CMD_PNOSSIDCLR_SET)) == 0) {
+       else if (strncasecmp(command, CMD_PNOSSIDCLR_SET, strlen(CMD_PNOSSIDCLR_SET)) == 0) {
                bytes_written = dhd_dev_pno_stop_for_ssid(net);
        }
 #ifndef WL_SCHED_SCAN
-       else if (strnicmp(command, CMD_PNOSETUP_SET, strlen(CMD_PNOSETUP_SET)) == 0) {
+       else if (strncasecmp(command, CMD_PNOSETUP_SET, strlen(CMD_PNOSETUP_SET)) == 0) {
                bytes_written = wl_android_set_pno_setup(net, command, priv_cmd.total_len);
        }
 #endif /* !WL_SCHED_SCAN */
-       else if (strnicmp(command, CMD_PNOENABLE_SET, strlen(CMD_PNOENABLE_SET)) == 0) {
+       else if (strncasecmp(command, CMD_PNOENABLE_SET, strlen(CMD_PNOENABLE_SET)) == 0) {
                int enable = *(command + strlen(CMD_PNOENABLE_SET) + 1) - '0';
                bytes_written = (enable)? 0 : dhd_dev_pno_stop_for_ssid(net);
        }
-       else if (strnicmp(command, CMD_WLS_BATCHING, strlen(CMD_WLS_BATCHING)) == 0) {
+       else if (strncasecmp(command, CMD_WLS_BATCHING, strlen(CMD_WLS_BATCHING)) == 0) {
                bytes_written = wls_parse_batching_cmd(net, command, priv_cmd.total_len);
        }
 #endif /* PNO_SUPPORT */
-       else if (strnicmp(command, CMD_P2P_DEV_ADDR, strlen(CMD_P2P_DEV_ADDR)) == 0) {
+       else if (strncasecmp(command, CMD_P2P_DEV_ADDR, strlen(CMD_P2P_DEV_ADDR)) == 0) {
                bytes_written = wl_android_get_p2p_dev_addr(net, command, priv_cmd.total_len);
        }
-       else if (strnicmp(command, CMD_P2P_SET_NOA, strlen(CMD_P2P_SET_NOA)) == 0) {
+       else if (strncasecmp(command, CMD_P2P_SET_NOA, strlen(CMD_P2P_SET_NOA)) == 0) {
                int skip = strlen(CMD_P2P_SET_NOA) + 1;
                bytes_written = wl_cfg80211_set_p2p_noa(net, command + skip,
                        priv_cmd.total_len - skip);
        }
 #ifdef WL_NAN
-       else if (strnicmp(command, CMD_NAN, strlen(CMD_NAN)) == 0) {
+       else if (strncasecmp(command, CMD_NAN, strlen(CMD_NAN)) == 0) {
                bytes_written = wl_cfg80211_nan_cmd_handler(net, command,
                        priv_cmd.total_len);
        }
 #endif /* WL_NAN */
 #if !defined WL_ENABLE_P2P_IF
-       else if (strnicmp(command, CMD_P2P_GET_NOA, strlen(CMD_P2P_GET_NOA)) == 0) {
+       else if (strncasecmp(command, CMD_P2P_GET_NOA, strlen(CMD_P2P_GET_NOA)) == 0) {
                bytes_written = wl_cfg80211_get_p2p_noa(net, command, priv_cmd.total_len);
        }
 #endif /* WL_ENABLE_P2P_IF */
-       else if (strnicmp(command, CMD_P2P_SET_PS, strlen(CMD_P2P_SET_PS)) == 0) {
+       else if (strncasecmp(command, CMD_P2P_SET_PS, strlen(CMD_P2P_SET_PS)) == 0) {
                int skip = strlen(CMD_P2P_SET_PS) + 1;
                bytes_written = wl_cfg80211_set_p2p_ps(net, command + skip,
                        priv_cmd.total_len - skip);
        }
 #ifdef WL_CFG80211
-       else if (strnicmp(command, CMD_SET_AP_WPS_P2P_IE,
+       else if (strncasecmp(command, CMD_SET_AP_WPS_P2P_IE,
                strlen(CMD_SET_AP_WPS_P2P_IE)) == 0) {
                int skip = strlen(CMD_SET_AP_WPS_P2P_IE) + 3;
                bytes_written = wl_cfg80211_set_wps_p2p_ie(net, command + skip,
                        priv_cmd.total_len - skip, *(command + skip - 2) - '0');
        }
 #endif /* WL_CFG80211 */
-       else if (strnicmp(command, CMD_OKC_SET_PMK, strlen(CMD_OKC_SET_PMK)) == 0)
+       else if (strncasecmp(command, CMD_OKC_SET_PMK, strlen(CMD_OKC_SET_PMK)) == 0)
                bytes_written = wl_android_set_pmk(net, command, priv_cmd.total_len);
-       else if (strnicmp(command, CMD_OKC_ENABLE, strlen(CMD_OKC_ENABLE)) == 0)
+       else if (strncasecmp(command, CMD_OKC_ENABLE, strlen(CMD_OKC_ENABLE)) == 0)
                bytes_written = wl_android_okc_enable(net, command, priv_cmd.total_len);
 #if defined(WL_SUPPORT_AUTO_CHANNEL)
-       else if (strnicmp(command, CMD_GET_BEST_CHANNELS,
+       else if (strncasecmp(command, CMD_GET_BEST_CHANNELS,
                strlen(CMD_GET_BEST_CHANNELS)) == 0) {
                bytes_written = wl_cfg80211_get_best_channels(net, command,
                        priv_cmd.total_len);
        }
 #endif /* WL_SUPPORT_AUTO_CHANNEL */
-       else if (strnicmp(command, CMD_HAPD_MAC_FILTER, strlen(CMD_HAPD_MAC_FILTER)) == 0) {
+       else if (strncasecmp(command, CMD_HAPD_MAC_FILTER, strlen(CMD_HAPD_MAC_FILTER)) == 0) {
                int skip = strlen(CMD_HAPD_MAC_FILTER) + 1;
                wl_android_set_mac_address_filter(net, (const char*)command+skip);
        }
-       else if (strnicmp(command, CMD_SETROAMMODE, strlen(CMD_SETROAMMODE)) == 0)
+       else if (strncasecmp(command, CMD_SETROAMMODE, strlen(CMD_SETROAMMODE)) == 0)
                bytes_written = wl_android_set_roam_mode(net, command, priv_cmd.total_len);
 #if defined(BCMFW_ROAM_ENABLE)
-       else if (strnicmp(command, CMD_SET_ROAMPREF, strlen(CMD_SET_ROAMPREF)) == 0) {
+       else if (strncasecmp(command, CMD_SET_ROAMPREF, strlen(CMD_SET_ROAMPREF)) == 0) {
                bytes_written = wl_android_set_roampref(net, command, priv_cmd.total_len);
        }
 #endif /* BCMFW_ROAM_ENABLE */
-       else if (strnicmp(command, CMD_MIRACAST, strlen(CMD_MIRACAST)) == 0)
+       else if (strncasecmp(command, CMD_MIRACAST, strlen(CMD_MIRACAST)) == 0)
                bytes_written = wl_android_set_miracast(net, command, priv_cmd.total_len);
-       else if (strnicmp(command, CMD_SETIBSSBEACONOUIDATA, strlen(CMD_SETIBSSBEACONOUIDATA)) == 0)
+       else if (strncasecmp(command, CMD_SETIBSSBEACONOUIDATA, strlen(CMD_SETIBSSBEACONOUIDATA)) == 0)
                bytes_written = wl_android_set_ibss_beacon_ouidata(net,
                command, priv_cmd.total_len);
-       else if (strnicmp(command, CMD_KEEP_ALIVE, strlen(CMD_KEEP_ALIVE)) == 0) {
+       else if (strncasecmp(command, CMD_KEEP_ALIVE, strlen(CMD_KEEP_ALIVE)) == 0) {
                int skip = strlen(CMD_KEEP_ALIVE) + 1;
                bytes_written = wl_keep_alive_set(net, command + skip, priv_cmd.total_len - skip);
        }
-       else if (strnicmp(command, CMD_ROAM_OFFLOAD, strlen(CMD_ROAM_OFFLOAD)) == 0) {
+       else if (strncasecmp(command, CMD_ROAM_OFFLOAD, strlen(CMD_ROAM_OFFLOAD)) == 0) {
                int enable = *(command + strlen(CMD_ROAM_OFFLOAD) + 1) - '0';
                bytes_written = wl_cfg80211_enable_roam_offload(net, enable);
        }
 #ifdef CONNECTION_STATISTICS
-       else if (strnicmp(command, CMD_GET_CONNECTION_STATS,
+       else if (strncasecmp(command, CMD_GET_CONNECTION_STATS,
                strlen(CMD_GET_CONNECTION_STATS)) == 0) {
                bytes_written = wl_android_get_connection_stats(net, command,
                        priv_cmd.total_len);
index 38c3c28..f5a523a 100644 (file)
@@ -318,7 +318,7 @@ static s32 wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
 static s32 wl_cfg80211_leave_ibss(struct wiphy *wiphy,
        struct net_device *dev);
 static s32 wl_cfg80211_get_station(struct wiphy *wiphy,
-       struct net_device *dev, u8 *mac,
+       struct net_device *dev, const u8 *mac,
        struct station_info *sinfo);
 static s32 wl_cfg80211_set_power_mgmt(struct wiphy *wiphy,
        struct net_device *dev, bool enabled,
@@ -362,9 +362,10 @@ static s32 wl_cfg80211_resume(struct wiphy *wiphy);
 static s32 wl_cfg80211_mgmt_tx_cancel_wait(struct wiphy *wiphy,
        bcm_struct_cfgdev *cfgdev, u64 cookie);
 static s32 wl_cfg80211_del_station(struct wiphy *wiphy,
-       struct net_device *ndev, u8* mac_addr);
+       struct net_device *ndev,
+       struct station_del_parameters *params);
 static s32 wl_cfg80211_change_station(struct wiphy *wiphy,
-       struct net_device *dev, u8 *mac, struct station_parameters *params);
+       struct net_device *dev, const u8 *mac, struct station_parameters *params);
 #endif /* WL_SUPPORT_BACKPORTED_KPATCHES || KERNEL_VER >= KERNEL_VERSION(3, 2, 0)) */
 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 39))
 static s32 wl_cfg80211_suspend(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
@@ -386,10 +387,11 @@ 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))
 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,
+       const u8 *peer, u8 action_code, u8 dialog_token, u16 status_code,
+       u32 peer_capability, bool initiator, const u8 *data,
        size_t len);
 static s32 wl_cfg80211_tdls_oper(struct wiphy *wiphy, struct net_device *dev,
-       u8 *peer, enum nl80211_tdls_operation oper);
+       const u8 *peer, enum nl80211_tdls_operation oper);
 #endif 
 #ifdef WL_SCHED_SCAN
 static int wl_cfg80211_sched_scan_stop(struct wiphy *wiphy, struct net_device *dev);
@@ -1310,6 +1312,7 @@ wl_cfg80211_add_virtual_iface(struct wiphy *wiphy,
 #else
        char *name,
 #endif /* WL_CFG80211_P2P_DEV_IF */
+       unsigned char name_assign_type,
        enum nl80211_iftype type, u32 *flags,
        struct vif_params *params)
 {
@@ -4248,7 +4251,7 @@ wl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev,
        swap_key_to_BE(&key);
        memset(&params, 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)) {
@@ -4299,7 +4302,7 @@ wl_cfg80211_config_default_mgmt_key(struct wiphy *wiphy,
 
 static s32
 wl_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
-       u8 *mac, struct station_info *sinfo)
+       const u8 *mac, struct station_info *sinfo)
 {
        struct bcm_cfg80211 *cfg = wiphy_priv(wiphy);
        scb_val_t scb_val;
@@ -4319,7 +4322,7 @@ wl_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
                        WL_ERR(("GET STA INFO failed, %d\n", err));
                        return err;
                }
-               sinfo->filled = STATION_INFO_INACTIVE_TIME;
+               sinfo->filled = BIT(NL80211_STA_INFO_INACTIVE_TIME);
                sta = (sta_info_t *)cfg->ioctl_buf;
                sta->len = dtoh16(sta->len);
                sta->cap = dtoh16(sta->cap);
@@ -4329,7 +4332,7 @@ wl_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
                sinfo->inactive_time = sta->idle * 1000;
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0))
                if (sta->flags & WL_STA_ASSOC) {
-                       sinfo->filled |= STATION_INFO_CONNECTED_TIME;
+                       sinfo->filled |= BIT(NL80211_STA_INFO_CONNECTED_TIME);
                        sinfo->connected_time = sta->in;
                }
                WL_INFO(("STA %s : idle time : %d sec, connected time :%d ms\n",
@@ -4380,7 +4383,7 @@ wl_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
                        int rxpktglom;
 #endif
                        rate = dtoh32(rate);
-                       sinfo->filled |= STATION_INFO_TX_BITRATE;
+                       sinfo->filled |= BIT(NL80211_STA_INFO_TX_BITRATE);
                        sinfo->txrate.legacy = rate * 5;
                        WL_DBG(("Rate %d Mbps\n", (rate / 2)));
 #if defined(USE_DYNAMIC_MAXPKT_RXGLOM)
@@ -4409,16 +4412,16 @@ wl_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
                        goto get_station_err;
                }
                rssi = wl_rssi_offset(dtoh32(scb_val.val));
-               sinfo->filled |= STATION_INFO_SIGNAL;
+               sinfo->filled |= BIT(NL80211_STA_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 |= (BIT(NL80211_STA_INFO_RX_PACKETS) |
+                               BIT(NL80211_STA_INFO_RX_DROP_MISC) |
+                               BIT(NL80211_STA_INFO_TX_PACKETS) |
+                               BIT(NL80211_STA_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;
@@ -6492,7 +6495,7 @@ static s32
 wl_cfg80211_del_station(
        struct wiphy *wiphy,
        struct net_device *ndev,
-       u8* mac_addr)
+       struct station_del_parameters *params)
 {
        struct net_device *dev;
        struct bcm_cfg80211 *cfg = wiphy_priv(wiphy);
@@ -6505,7 +6508,7 @@ wl_cfg80211_del_station(
        int num_associated = 0;
 
        WL_DBG(("Entry\n"));
-       if (mac_addr == NULL) {
+       if (params->mac == NULL) {
                WL_DBG(("mac_addr is NULL ignore it\n"));
                return 0;
        }
@@ -6530,17 +6533,17 @@ wl_cfg80211_del_station(
        else
                num_associated = assoc_maclist->count;
 
-       memcpy(scb_val.ea.octet, mac_addr, ETHER_ADDR_LEN);
+       memcpy(scb_val.ea.octet, params->mac, ETHER_ADDR_LEN);
        scb_val.val = DOT11_RC_DEAUTH_LEAVING;
        err = wldev_ioctl(dev, WLC_SCB_DEAUTHENTICATE_FOR_REASON, &scb_val,
                sizeof(scb_val_t), true);
        if (err < 0)
                WL_ERR(("WLC_SCB_DEAUTHENTICATE_FOR_REASON err %d\n", err));
        WL_ERR(("Disconnect STA : %s scb_val.val %d\n",
-               bcm_ether_ntoa((const struct ether_addr *)mac_addr, eabuf),
+               bcm_ether_ntoa((const struct ether_addr *)(params->mac), eabuf),
                scb_val.val));
 
-       if (num_associated > 0 && ETHER_ISBCAST(mac_addr))
+       if (num_associated > 0 && ETHER_ISBCAST(params->mac))
                wl_delay(400);
 
        return 0;
@@ -6550,7 +6553,7 @@ static s32
 wl_cfg80211_change_station(
        struct wiphy *wiphy,
        struct net_device *dev,
-       u8 *mac,
+       const u8 *mac,
        struct station_parameters *params)
 {
        int err;
@@ -6562,13 +6565,13 @@ wl_cfg80211_change_station(
                return -ENOTSUPP;
 
        if (!(params->sta_flags_set & BIT(NL80211_STA_FLAG_AUTHORIZED))) {
-               err = wldev_ioctl(primary_ndev, WLC_SCB_DEAUTHORIZE, mac, ETH_ALEN, true);
+               err = wldev_ioctl(primary_ndev, WLC_SCB_DEAUTHORIZE, (void *)mac, ETH_ALEN, true);
                if (err)
                        WL_ERR(("WLC_SCB_DEAUTHORIZE error (%d)\n", err));
                return err;
        }
 
-       err = wldev_ioctl(primary_ndev, WLC_SCB_AUTHORIZE, mac, ETH_ALEN, true);
+       err = wldev_ioctl(primary_ndev, WLC_SCB_AUTHORIZE, (void *)mac, ETH_ALEN, true);
        if (err)
                WL_ERR(("WLC_SCB_AUTHORIZE error (%d)\n", err));
        return err;
@@ -7718,27 +7721,27 @@ wl_notify_connect_status_ap(struct bcm_cfg80211 *cfg, struct net_device *ndev,
 
        if (event == WLC_E_ASSOC_IND && reason == DOT11_SC_SUCCESS) {
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0))
-                cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len, 0, GFP_ATOMIC);
+                cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len, 0);
 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0))
-               cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len, GFP_ATOMIC);
+               cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len);
 #else
-               cfg80211_rx_mgmt(ndev, freq, mgmt_frame, len, GFP_ATOMIC);
+               cfg80211_rx_mgmt(ndev, freq, mgmt_frame, len);
 #endif /* KERNEL VERSION 3, 12 */ 
        } else if (event == WLC_E_DISASSOC_IND) {
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0))
-                cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len, 0, GFP_ATOMIC);
+                cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len, 0);
 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0))
-               cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len, GFP_ATOMIC);
+               cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len);
 #else
-               cfg80211_rx_mgmt(ndev, freq, mgmt_frame, len, GFP_ATOMIC);
+               cfg80211_rx_mgmt(ndev, freq, mgmt_frame, len);
 #endif /* version 3.12*/ 
        } else if ((event == WLC_E_DEAUTH_IND) || (event == WLC_E_DEAUTH)) {
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0))
-                cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len, 0, GFP_ATOMIC);
+                cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len, 0);
 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0))
-               cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len, GFP_ATOMIC);
+               cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len);
 #else
-               cfg80211_rx_mgmt(ndev, freq, mgmt_frame, len, GFP_ATOMIC);
+               cfg80211_rx_mgmt(ndev, freq, mgmt_frame, len);
 #endif /* version 3.12 */
        }
 
@@ -7751,7 +7754,6 @@ exit:
        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 (!data) {
                        WL_ERR(("No IEs present in ASSOC/REASSOC_IND"));
                        return -EINVAL;
@@ -7798,6 +7800,7 @@ wl_notify_connect_status_ibss(struct bcm_cfg80211 *cfg, struct net_device *ndev,
        u16 flags = ntoh16(e->flags);
        u32 status =  ntoh32(e->status);
        bool active;
+       struct ieee80211_channel *chan;
 
        if (event == WLC_E_JOIN) {
                WL_DBG(("joined in IBSS network\n"));
@@ -7807,6 +7810,7 @@ wl_notify_connect_status_ibss(struct bcm_cfg80211 *cfg, struct net_device *ndev,
        }
        if (event == WLC_E_JOIN || event == WLC_E_START ||
                (event == WLC_E_LINK && (flags == WLC_EVENT_MSG_LINK))) {
+               chan = ieee80211_get_channel(bcmcfg_to_wiphy(cfg), cfg->channel);
                if (wl_get_drv_status(cfg, CONNECTED, ndev)) {
                        /* ROAM or Redundant */
                        u8 *cur_bssid = wl_read_prof(cfg, ndev, WL_PROF_BSSID);
@@ -7820,7 +7824,7 @@ wl_notify_connect_status_ibss(struct bcm_cfg80211 *cfg, struct net_device *ndev,
                        wl_get_assoc_ies(cfg, ndev);
                        wl_update_prof(cfg, ndev, NULL, (void *)&e->addr, WL_PROF_BSSID);
                        wl_update_bss_info(cfg, ndev, false);
-                       cfg80211_ibss_joined(ndev, (s8 *)&e->addr, GFP_KERNEL);
+                       cfg80211_ibss_joined(ndev, (s8 *)&e->addr, chan, GFP_KERNEL);
                }
                else {
                        /* New connection */
@@ -7829,7 +7833,7 @@ wl_notify_connect_status_ibss(struct bcm_cfg80211 *cfg, struct net_device *ndev,
                        wl_get_assoc_ies(cfg, ndev);
                        wl_update_prof(cfg, ndev, NULL, (void *)&e->addr, WL_PROF_BSSID);
                        wl_update_bss_info(cfg, ndev, false);
-                       cfg80211_ibss_joined(ndev, (s8 *)&e->addr, GFP_KERNEL);
+                       cfg80211_ibss_joined(ndev, (s8 *)&e->addr, chan, GFP_KERNEL);
                        wl_set_drv_status(cfg, CONNECTED, ndev);
                        active = true;
                        wl_update_prof(cfg, ndev, NULL, (void *)&active, WL_PROF_ACT);
@@ -8791,12 +8795,12 @@ wl_notify_rx_mgmt_frame(struct bcm_cfg80211 *cfg, bcm_struct_cfgdev *cfgdev,
 #endif
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0))
-       retval = cfg80211_rx_mgmt(cfgdev, freq, 0,  mgmt_frame, mgmt_frame_len, 0, GFP_ATOMIC);
+       retval = cfg80211_rx_mgmt(cfgdev, freq, 0,  mgmt_frame, mgmt_frame_len, 0);
 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)) || \
        defined(WL_COMPAT_WIRELESS)
-       retval = cfg80211_rx_mgmt(cfgdev, freq, 0, mgmt_frame, mgmt_frame_len, GFP_ATOMIC);
+       retval = cfg80211_rx_mgmt(cfgdev, freq, 0, mgmt_frame, mgmt_frame_len);
 #else
-       retval = cfg80211_rx_mgmt(cfgdev, freq, mgmt_frame, mgmt_frame_len, GFP_ATOMIC);
+       retval = cfg80211_rx_mgmt(cfgdev, freq, mgmt_frame, mgmt_frame_len);
 #endif /* LINUX_VERSION >= VERSION(3, 12, 0) */
 
        WL_DBG(("mgmt_frame_len (%d) , e->datalen (%d), channel (%d), freq (%d) retval (%d)\n",
@@ -11371,16 +11375,13 @@ wl_tdls_event_handler(struct bcm_cfg80211 *cfg, bcm_struct_cfgdev *cfgdev,
                if (cfg->tdls_mgmt_frame) {
                        #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0))
                                 cfg80211_rx_mgmt(cfgdev, cfg->tdls_mgmt_freq, 0,
-                                       cfg->tdls_mgmt_frame, cfg->tdls_mgmt_frame_len,
-                                        0, GFP_ATOMIC);
+                                       cfg->tdls_mgmt_frame, cfg->tdls_mgmt_frame_len, 0);
                        #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)) || defined(WL_COMPAT_WIRELESS)
                                cfg80211_rx_mgmt(cfgdev, cfg->tdls_mgmt_freq, 0,
-                                       cfg->tdls_mgmt_frame, cfg->tdls_mgmt_frame_len,
-                                       GFP_ATOMIC);
+                                       cfg->tdls_mgmt_frame, cfg->tdls_mgmt_frame_len);
                        #else
                                cfg80211_rx_mgmt(cfgdev, cfg->tdls_mgmt_freq,
-                                       cfg->tdls_mgmt_frame, cfg->tdls_mgmt_frame_len,
-                                       GFP_ATOMIC);
+                                       cfg->tdls_mgmt_frame, cfg->tdls_mgmt_frame_len);
                        #endif 
                }
                msg = " TDLS PEER CONNECTED ";
@@ -11406,7 +11407,8 @@ wl_tdls_event_handler(struct bcm_cfg80211 *cfg, bcm_struct_cfgdev *cfgdev,
 #if (LINUX_VERSION_CODE > KERNEL_VERSION(3, 2, 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, const u8 *data,
+       const u8 *peer, u8 action_code, u8 dialog_token, u16 status_code,
+       u32 peer_capability, bool initiator, const u8 *data,
        size_t len)
 {
        s32 ret = 0;
@@ -11447,7 +11449,7 @@ out:
 
 static s32
 wl_cfg80211_tdls_oper(struct wiphy *wiphy, struct net_device *dev,
-       u8 *peer, enum nl80211_tdls_operation oper)
+       const u8 *peer, enum nl80211_tdls_operation oper)
 {
        s32 ret = 0;
 #ifdef WLTDLS
index a0b0bf4..7dbf3bc 100644 (file)
@@ -434,7 +434,7 @@ int wl_cfg80211_set_btcoex_dhcp(struct net_device *dev, dhd_pub_t *dhd, char *co
        /* Figure out powermode 1 or o command */
        strncpy((char *)&powermode_val, command + strlen("BTCOEXMODE") +1, 1);
 
-       if (strnicmp((char *)&powermode_val, "1", strlen("1")) == 0) {
+       if (strncasecmp((char *)&powermode_val, "1", strlen("1")) == 0) {
                WL_TRACE_HW4(("DHCP session starts\n"));
 
 
@@ -485,7 +485,7 @@ int wl_cfg80211_set_btcoex_dhcp(struct net_device *dev, dhd_pub_t *dhd, char *co
                        WL_ERR(("was called w/o DHCP OFF. Continue\n"));
                }
        }
-       else if (strnicmp((char *)&powermode_val, "2", strlen("2")) == 0) {
+       else if (strncasecmp((char *)&powermode_val, "2", strlen("2")) == 0) {
 
 
 
index 16b9388..c586e7f 100644 (file)
@@ -89,7 +89,7 @@ int wl_cfgvendor_send_async_event(struct wiphy *wiphy,
        kflags = in_atomic() ? GFP_ATOMIC : GFP_KERNEL;
 
        /* Alloc the SKB for vendor_event */
-       skb = cfg80211_vendor_event_alloc(wiphy, len, event_id, kflags);
+       skb = cfg80211_vendor_event_alloc(wiphy, NULL, len, event_id, kflags);
        if (!skb) {
                WL_ERR(("skb alloc failed"));
                return -ENOMEM;