]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
Merge tag 'wireless-drivers-next-for-davem-2017-02-16' of git://git.kernel.org/pub...
authorDavid S. Miller <davem@davemloft.net>
Fri, 17 Feb 2017 18:00:45 +0000 (13:00 -0500)
committerDavid S. Miller <davem@davemloft.net>
Fri, 17 Feb 2017 18:00:45 +0000 (13:00 -0500)
Kalle Valo says:

====================
wireless-drivers-next patches for 4.11

Mostly small fixes, not really any new features.

Major changes:

ath10k

* when trying older firmware versions don't confuse user with error messages

ath9k

* fix crash in AP mode (regression)
* fix relayfs crash (regression)
* fix initialisation with AR9340 and AR9550
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
28 files changed:
drivers/net/wireless/ath/ath10k/core.c
drivers/net/wireless/ath/ath10k/debug.c
drivers/net/wireless/ath/ath10k/hw.h
drivers/net/wireless/ath/ath10k/mac.c
drivers/net/wireless/ath/ath10k/mac.h
drivers/net/wireless/ath/ath10k/p2p.c
drivers/net/wireless/ath/ath10k/pci.c
drivers/net/wireless/ath/ath10k/spectral.c
drivers/net/wireless/ath/ath10k/testmode.c
drivers/net/wireless/ath/ath10k/wmi.c
drivers/net/wireless/ath/ath10k/wmi.h
drivers/net/wireless/ath/ath6kl/core.h
drivers/net/wireless/ath/ath6kl/main.c
drivers/net/wireless/ath/ath6kl/txrx.c
drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
drivers/net/wireless/ath/ath9k/common-spectral.c
drivers/net/wireless/ath/ath9k/xmit.c
drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
drivers/net/wireless/intersil/orinoco/main.c
drivers/net/wireless/intersil/orinoco/orinoco.h
drivers/net/wireless/intersil/orinoco/orinoco_usb.c
drivers/net/wireless/marvell/mwifiex/main.c
drivers/net/wireless/ralink/rt2x00/rt2500usb.c
drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b1ant.c
drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c
drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c
drivers/net/wireless/ti/wlcore/main.c

index c27e7ea38a659d50b9badfa6ecc406a8798b8ad2..59729aa8cd821a5e3b6e148f4f5b02c4d493824e 100644 (file)
@@ -351,7 +351,7 @@ void ath10k_core_get_fw_features_str(struct ath10k *ar,
                                     char *buf,
                                     size_t buf_len)
 {
-       unsigned int len = 0;
+       size_t len = 0;
        int i;
 
        for (i = 0; i < ATH10K_FW_FEATURE_COUNT; i++) {
@@ -456,7 +456,10 @@ static const struct firmware *ath10k_fetch_fw_file(struct ath10k *ar,
                dir = ".";
 
        snprintf(filename, sizeof(filename), "%s/%s", dir, file);
-       ret = request_firmware(&fw, filename, ar->dev);
+       ret = request_firmware_direct(&fw, filename, ar->dev);
+       ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot fw request '%s': %d\n",
+                  filename, ret);
+
        if (ret)
                return ERR_PTR(ret);
 
@@ -698,7 +701,8 @@ static int ath10k_core_get_board_id_from_otp(struct ath10k *ar)
 
        if ((result & ATH10K_BMI_BOARD_ID_STATUS_MASK) != 0 ||
            (board_id == 0)) {
-               ath10k_warn(ar, "board id is not exist in otp, ignore it\n");
+               ath10k_dbg(ar, ATH10K_DBG_BOOT,
+                          "board id does not exist in otp, ignore it\n");
                return -EOPNOTSUPP;
        }
 
@@ -1122,7 +1126,7 @@ static int ath10k_core_create_board_name(struct ath10k *ar, char *name,
                                         size_t name_len)
 {
        /* strlen(',variant=') + strlen(ar->id.bdf_ext) */
-       char variant[9 + ATH10K_SMBIOS_BDF_EXT_STR_LENGTH];
+       char variant[9 + ATH10K_SMBIOS_BDF_EXT_STR_LENGTH] = { 0 };
 
        if (ar->id.bmi_ids_valid) {
                scnprintf(name, name_len,
@@ -1168,7 +1172,8 @@ static int ath10k_core_fetch_board_file(struct ath10k *ar)
        ar->bd_api = 1;
        ret = ath10k_core_fetch_board_data_api_1(ar);
        if (ret) {
-               ath10k_err(ar, "failed to fetch board data\n");
+               ath10k_err(ar, "failed to fetch board-2.bin or board.bin from %s\n",
+                          ar->hw_params.fw.dir);
                return ret;
        }
 
@@ -1189,12 +1194,8 @@ int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name,
        /* first fetch the firmware file (firmware-*.bin) */
        fw_file->firmware = ath10k_fetch_fw_file(ar, ar->hw_params.fw.dir,
                                                 name);
-       if (IS_ERR(fw_file->firmware)) {
-               ath10k_err(ar, "could not fetch firmware file '%s/%s': %ld\n",
-                          ar->hw_params.fw.dir, name,
-                          PTR_ERR(fw_file->firmware));
+       if (IS_ERR(fw_file->firmware))
                return PTR_ERR(fw_file->firmware);
-       }
 
        data = fw_file->firmware->data;
        len = fw_file->firmware->size;
@@ -1358,44 +1359,39 @@ err:
        return ret;
 }
 
+static void ath10k_core_get_fw_name(struct ath10k *ar, char *fw_name,
+                                   size_t fw_name_len, int fw_api)
+{
+       scnprintf(fw_name, fw_name_len, "%s-%d.bin", ATH10K_FW_FILE_BASE, fw_api);
+}
+
 static int ath10k_core_fetch_firmware_files(struct ath10k *ar)
 {
-       int ret;
+       int ret, i;
+       char fw_name[100];
 
        /* calibration file is optional, don't check for any errors */
        ath10k_fetch_cal_file(ar);
 
-       ar->fw_api = 5;
-       ath10k_dbg(ar, ATH10K_DBG_BOOT, "trying fw api %d\n", ar->fw_api);
-
-       ret = ath10k_core_fetch_firmware_api_n(ar, ATH10K_FW_API5_FILE,
-                                              &ar->normal_mode_fw.fw_file);
-       if (ret == 0)
-               goto success;
-
-       ar->fw_api = 4;
-       ath10k_dbg(ar, ATH10K_DBG_BOOT, "trying fw api %d\n", ar->fw_api);
+       for (i = ATH10K_FW_API_MAX; i >= ATH10K_FW_API_MIN; i--) {
+               ar->fw_api = i;
+               ath10k_dbg(ar, ATH10K_DBG_BOOT, "trying fw api %d\n",
+                          ar->fw_api);
 
-       ret = ath10k_core_fetch_firmware_api_n(ar, ATH10K_FW_API4_FILE,
-                                              &ar->normal_mode_fw.fw_file);
-       if (ret == 0)
-               goto success;
-
-       ar->fw_api = 3;
-       ath10k_dbg(ar, ATH10K_DBG_BOOT, "trying fw api %d\n", ar->fw_api);
+               ath10k_core_get_fw_name(ar, fw_name, sizeof(fw_name), ar->fw_api);
+               ret = ath10k_core_fetch_firmware_api_n(ar, fw_name,
+                                                      &ar->normal_mode_fw.fw_file);
+               if (!ret)
+                       goto success;
+       }
 
-       ret = ath10k_core_fetch_firmware_api_n(ar, ATH10K_FW_API3_FILE,
-                                              &ar->normal_mode_fw.fw_file);
-       if (ret == 0)
-               goto success;
+       /* we end up here if we couldn't fetch any firmware */
 
-       ar->fw_api = 2;
-       ath10k_dbg(ar, ATH10K_DBG_BOOT, "trying fw api %d\n", ar->fw_api);
+       ath10k_err(ar, "Failed to find firmware-N.bin (N between %d and %d) from %s: %d",
+                  ATH10K_FW_API_MIN, ATH10K_FW_API_MAX, ar->hw_params.fw.dir,
+                  ret);
 
-       ret = ath10k_core_fetch_firmware_api_n(ar, ATH10K_FW_API2_FILE,
-                                              &ar->normal_mode_fw.fw_file);
-       if (ret)
-               return ret;
+       return ret;
 
 success:
        ath10k_dbg(ar, ATH10K_DBG_BOOT, "using fw api %d\n", ar->fw_api);
index d5ff0f4ef5ce39522441b90e8eda250ad105b723..fb0ade3adb07de51d0f952ae63235efbeb4b4d44 100644 (file)
@@ -237,7 +237,7 @@ static ssize_t ath10k_read_wmi_services(struct file *file,
 {
        struct ath10k *ar = file->private_data;
        char *buf;
-       unsigned int len = 0, buf_len = 4096;
+       size_t len = 0, buf_len = 4096;
        const char *name;
        ssize_t ret_cnt;
        bool enabled;
@@ -529,7 +529,7 @@ static ssize_t ath10k_fw_stats_read(struct file *file, char __user *user_buf,
                                    size_t count, loff_t *ppos)
 {
        const char *buf = file->private_data;
-       unsigned int len = strlen(buf);
+       size_t len = strlen(buf);
 
        return simple_read_from_buffer(user_buf, count, ppos, buf, len);
 }
@@ -547,17 +547,16 @@ static ssize_t ath10k_debug_fw_reset_stats_read(struct file *file,
                                                size_t count, loff_t *ppos)
 {
        struct ath10k *ar = file->private_data;
-       int ret, len, buf_len;
+       int ret;
+       size_t len = 0, buf_len = 500;
        char *buf;
 
-       buf_len = 500;
        buf = kmalloc(buf_len, GFP_KERNEL);
        if (!buf)
                return -ENOMEM;
 
        spin_lock_bh(&ar->data_lock);
 
-       len = 0;
        len += scnprintf(buf + len, buf_len - len,
                         "fw_crash_counter\t\t%d\n", ar->stats.fw_crash_counter);
        len += scnprintf(buf + len, buf_len - len,
@@ -696,7 +695,7 @@ static ssize_t ath10k_read_chip_id(struct file *file, char __user *user_buf,
                                   size_t count, loff_t *ppos)
 {
        struct ath10k *ar = file->private_data;
-       unsigned int len;
+       size_t len;
        char buf[50];
 
        len = scnprintf(buf, sizeof(buf), "0x%08x\n", ar->chip_id);
@@ -733,8 +732,8 @@ static struct ath10k_dump_file_data *ath10k_build_dump_file(struct ath10k *ar,
        struct ath10k_ce_crash_hdr *ce_hdr;
        struct ath10k_dump_file_data *dump_data;
        struct ath10k_tlv_dump_data *dump_tlv;
-       int hdr_len = sizeof(*dump_data);
-       unsigned int len, sofar = 0;
+       size_t hdr_len = sizeof(*dump_data);
+       size_t len, sofar = 0;
        unsigned char *buf;
 
        len = hdr_len;
@@ -900,7 +899,7 @@ static ssize_t ath10k_reg_addr_read(struct file *file,
 {
        struct ath10k *ar = file->private_data;
        u8 buf[32];
-       unsigned int len = 0;
+       size_t len = 0;
        u32 reg_addr;
 
        mutex_lock(&ar->conf_mutex);
@@ -948,7 +947,7 @@ static ssize_t ath10k_reg_value_read(struct file *file,
 {
        struct ath10k *ar = file->private_data;
        u8 buf[48];
-       unsigned int len;
+       size_t len;
        u32 reg_addr, reg_val;
        int ret;
 
@@ -1171,7 +1170,7 @@ static ssize_t ath10k_read_htt_stats_mask(struct file *file,
 {
        struct ath10k *ar = file->private_data;
        char buf[32];
-       unsigned int len;
+       size_t len;
 
        len = scnprintf(buf, sizeof(buf), "%lu\n", ar->debug.htt_stats_mask);
 
@@ -1225,7 +1224,7 @@ static ssize_t ath10k_read_htt_max_amsdu_ampdu(struct file *file,
        struct ath10k *ar = file->private_data;
        char buf[64];
        u8 amsdu, ampdu;
-       unsigned int len;
+       size_t len;
 
        mutex_lock(&ar->conf_mutex);
 
@@ -1285,7 +1284,7 @@ static ssize_t ath10k_read_fw_dbglog(struct file *file,
                                     size_t count, loff_t *ppos)
 {
        struct ath10k *ar = file->private_data;
-       unsigned int len;
+       size_t len;
        char buf[96];
 
        len = scnprintf(buf, sizeof(buf), "0x%16llx %u\n",
@@ -1611,11 +1610,10 @@ static ssize_t ath10k_read_ani_enable(struct file *file, char __user *user_buf,
                                      size_t count, loff_t *ppos)
 {
        struct ath10k *ar = file->private_data;
-       int len = 0;
+       size_t len;
        char buf[32];
 
-       len = scnprintf(buf, sizeof(buf) - len, "%d\n",
-                       ar->ani_enabled);
+       len = scnprintf(buf, sizeof(buf), "%d\n", ar->ani_enabled);
 
        return simple_read_from_buffer(user_buf, count, ppos, buf, len);
 }
@@ -1640,11 +1638,10 @@ static ssize_t ath10k_read_nf_cal_period(struct file *file,
                                         size_t count, loff_t *ppos)
 {
        struct ath10k *ar = file->private_data;
-       unsigned int len;
+       size_t len;
        char buf[32];
 
-       len = scnprintf(buf, sizeof(buf), "%d\n",
-                       ar->debug.nf_cal_period);
+       len = scnprintf(buf, sizeof(buf), "%d\n", ar->debug.nf_cal_period);
 
        return simple_read_from_buffer(user_buf, count, ppos, buf, len);
 }
@@ -1740,9 +1737,10 @@ void ath10k_debug_tpc_stats_process(struct ath10k *ar,
 }
 
 static void ath10k_tpc_stats_print(struct ath10k_tpc_stats *tpc_stats,
-                                  unsigned int j, char *buf, unsigned int *len)
+                                  unsigned int j, char *buf, size_t *len)
 {
-       unsigned int i, buf_len;
+       int i;
+       size_t buf_len;
        static const char table_str[][5] = { "CDD",
                                             "STBC",
                                             "TXBF" };
@@ -1782,7 +1780,8 @@ static void ath10k_tpc_stats_fill(struct ath10k *ar,
                                  struct ath10k_tpc_stats *tpc_stats,
                                  char *buf)
 {
-       unsigned int len, j, buf_len;
+       int j;
+       size_t len, buf_len;
 
        len = 0;
        buf_len = ATH10K_TPC_CONFIG_BUF_SIZE;
@@ -1916,7 +1915,7 @@ static ssize_t ath10k_tpc_stats_read(struct file *file, char __user *user_buf,
                                     size_t count, loff_t *ppos)
 {
        const char *buf = file->private_data;
-       unsigned int len = strlen(buf);
+       size_t len = strlen(buf);
 
        return simple_read_from_buffer(user_buf, count, ppos, buf, len);
 }
@@ -2340,7 +2339,7 @@ static ssize_t ath10k_debug_fw_checksums_read(struct file *file,
                                              size_t count, loff_t *ppos)
 {
        struct ath10k *ar = file->private_data;
-       unsigned int len = 0, buf_len = 4096;
+       size_t len = 0, buf_len = 4096;
        ssize_t ret_cnt;
        char *buf;
 
@@ -2556,7 +2555,7 @@ void ath10k_dbg_dump(struct ath10k *ar,
                     const void *buf, size_t len)
 {
        char linebuf[256];
-       unsigned int linebuflen;
+       size_t linebuflen;
        const void *ptr;
 
        if (ath10k_debug_mask & mask) {
index 38aa7c95732ee96cd3c5c75b00720e3ba6accfda..f0fda0f2b3b487147dc6eb147eb55b8b4287b15a 100644 (file)
@@ -128,6 +128,10 @@ enum qca9377_chip_id_rev {
 #define QCA4019_HW_1_0_BOARD_DATA_FILE "board.bin"
 #define QCA4019_HW_1_0_PATCH_LOAD_ADDR  0x1234
 
+#define ATH10K_FW_FILE_BASE            "firmware"
+#define ATH10K_FW_API_MAX              5
+#define ATH10K_FW_API_MIN              2
+
 #define ATH10K_FW_API2_FILE            "firmware-2.bin"
 #define ATH10K_FW_API3_FILE            "firmware-3.bin"
 
index 9977829a6ec446d733416e8269fa32dd202aa2f5..3029f257a19a5988e13368a3922e9e55fc961258 100644 (file)
@@ -1993,7 +1993,7 @@ static void ath10k_mac_handle_beacon_iter(void *data, u8 *mac,
 {
        struct sk_buff *skb = data;
        struct ieee80211_mgmt *mgmt = (void *)skb->data;
-       struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
+       struct ath10k_vif *arvif = (void *)vif->drv_priv;
 
        if (vif->type != NL80211_IFTYPE_STATION)
                return;
@@ -2016,7 +2016,7 @@ static void ath10k_mac_handle_beacon_miss_iter(void *data, u8 *mac,
                                               struct ieee80211_vif *vif)
 {
        u32 *vdev_id = data;
-       struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
+       struct ath10k_vif *arvif = (void *)vif->drv_priv;
        struct ath10k *ar = arvif->ar;
        struct ieee80211_hw *hw = ar->hw;
 
@@ -2083,7 +2083,7 @@ static void ath10k_peer_assoc_h_basic(struct ath10k *ar,
                                      struct ieee80211_sta *sta,
                                      struct wmi_peer_assoc_complete_arg *arg)
 {
-       struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
+       struct ath10k_vif *arvif = (void *)vif->drv_priv;
        u32 aid;
 
        lockdep_assert_held(&ar->conf_mutex);
@@ -2159,7 +2159,7 @@ static void ath10k_peer_assoc_h_rates(struct ath10k *ar,
                                      struct ieee80211_sta *sta,
                                      struct wmi_peer_assoc_complete_arg *arg)
 {
-       struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
+       struct ath10k_vif *arvif = (void *)vif->drv_priv;
        struct wmi_rate_set_arg *rateset = &arg->peer_legacy_rates;
        struct cfg80211_chan_def def;
        const struct ieee80211_supported_band *sband;
@@ -2222,7 +2222,7 @@ static void ath10k_peer_assoc_h_ht(struct ath10k *ar,
                                   struct wmi_peer_assoc_complete_arg *arg)
 {
        const struct ieee80211_sta_ht_cap *ht_cap = &sta->ht_cap;
-       struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
+       struct ath10k_vif *arvif = (void *)vif->drv_priv;
        struct cfg80211_chan_def def;
        enum nl80211_band band;
        const u8 *ht_mcs_mask;
@@ -2446,7 +2446,7 @@ static void ath10k_peer_assoc_h_vht(struct ath10k *ar,
                                    struct wmi_peer_assoc_complete_arg *arg)
 {
        const struct ieee80211_sta_vht_cap *vht_cap = &sta->vht_cap;
-       struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
+       struct ath10k_vif *arvif = (void *)vif->drv_priv;
        struct cfg80211_chan_def def;
        enum nl80211_band band;
        const u16 *vht_mcs_mask;
@@ -2507,7 +2507,7 @@ static void ath10k_peer_assoc_h_qos(struct ath10k *ar,
                                    struct ieee80211_sta *sta,
                                    struct wmi_peer_assoc_complete_arg *arg)
 {
-       struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
+       struct ath10k_vif *arvif = (void *)vif->drv_priv;
 
        switch (arvif->vdev_type) {
        case WMI_VDEV_TYPE_AP:
@@ -2574,7 +2574,7 @@ static void ath10k_peer_assoc_h_phymode(struct ath10k *ar,
                                        struct ieee80211_sta *sta,
                                        struct wmi_peer_assoc_complete_arg *arg)
 {
-       struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
+       struct ath10k_vif *arvif = (void *)vif->drv_priv;
        struct cfg80211_chan_def def;
        enum nl80211_band band;
        const u8 *ht_mcs_mask;
@@ -2689,7 +2689,7 @@ static int ath10k_mac_vif_recalc_txbf(struct ath10k *ar,
                                      struct ieee80211_vif *vif,
                                      struct ieee80211_sta_vht_cap vht_cap)
 {
-       struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
+       struct ath10k_vif *arvif = (void *)vif->drv_priv;
        int ret;
        u32 param;
        u32 value;
@@ -2756,7 +2756,7 @@ static void ath10k_bss_assoc(struct ieee80211_hw *hw,
                             struct ieee80211_bss_conf *bss_conf)
 {
        struct ath10k *ar = hw->priv;
-       struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
+       struct ath10k_vif *arvif = (void *)vif->drv_priv;
        struct ieee80211_sta_ht_cap ht_cap;
        struct ieee80211_sta_vht_cap vht_cap;
        struct wmi_peer_assoc_complete_arg peer_arg;
@@ -2849,7 +2849,7 @@ static void ath10k_bss_disassoc(struct ieee80211_hw *hw,
                                struct ieee80211_vif *vif)
 {
        struct ath10k *ar = hw->priv;
-       struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
+       struct ath10k_vif *arvif = (void *)vif->drv_priv;
        struct ieee80211_sta_vht_cap vht_cap = {};
        int ret;
 
@@ -2882,7 +2882,7 @@ static int ath10k_station_assoc(struct ath10k *ar,
                                struct ieee80211_sta *sta,
                                bool reassoc)
 {
-       struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
+       struct ath10k_vif *arvif = (void *)vif->drv_priv;
        struct wmi_peer_assoc_complete_arg peer_arg;
        int ret = 0;
 
@@ -2949,7 +2949,7 @@ static int ath10k_station_disassoc(struct ath10k *ar,
                                   struct ieee80211_vif *vif,
                                   struct ieee80211_sta *sta)
 {
-       struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
+       struct ath10k_vif *arvif = (void *)vif->drv_priv;
        int ret = 0;
 
        lockdep_assert_held(&ar->conf_mutex);
@@ -3175,7 +3175,7 @@ static void ath10k_mac_tx_unlock_iter(void *data, u8 *mac,
                                      struct ieee80211_vif *vif)
 {
        struct ath10k *ar = data;
-       struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
+       struct ath10k_vif *arvif = (void *)vif->drv_priv;
 
        if (arvif->tx_paused)
                return;
@@ -3262,7 +3262,7 @@ struct ath10k_mac_tx_pause {
 static void ath10k_mac_handle_tx_pause_iter(void *data, u8 *mac,
                                            struct ieee80211_vif *vif)
 {
-       struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
+       struct ath10k_vif *arvif = (void *)vif->drv_priv;
        struct ath10k_mac_tx_pause *arg = data;
 
        if (arvif->vdev_id != arg->vdev_id)
@@ -3358,7 +3358,7 @@ static bool ath10k_tx_h_use_hwcrypto(struct ieee80211_vif *vif,
                return false;
 
        if (vif)
-               return !ath10k_vif_to_arvif(vif)->nohwcrypt;
+               return !((struct ath10k_vif *)vif->drv_priv)->nohwcrypt;
 
        return true;
 }
@@ -3423,7 +3423,7 @@ static void ath10k_tx_h_add_p2p_noa_ie(struct ath10k *ar,
                                       struct sk_buff *skb)
 {
        struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
-       struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
+       struct ath10k_vif *arvif = (void *)vif->drv_priv;
 
        /* This is case only for P2P_GO */
        if (vif->type != NL80211_IFTYPE_AP || !vif->p2p)
@@ -4849,7 +4849,7 @@ static int ath10k_add_interface(struct ieee80211_hw *hw,
                                struct ieee80211_vif *vif)
 {
        struct ath10k *ar = hw->priv;
-       struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
+       struct ath10k_vif *arvif = (void *)vif->drv_priv;
        struct ath10k_peer *peer;
        enum wmi_sta_powersave_param param;
        int ret = 0;
@@ -5185,7 +5185,7 @@ static void ath10k_remove_interface(struct ieee80211_hw *hw,
                                    struct ieee80211_vif *vif)
 {
        struct ath10k *ar = hw->priv;
-       struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
+       struct ath10k_vif *arvif = (void *)vif->drv_priv;
        struct ath10k_peer *peer;
        int ret;
        int i;
@@ -5320,7 +5320,7 @@ static void ath10k_bss_info_changed(struct ieee80211_hw *hw,
                                    u32 changed)
 {
        struct ath10k *ar = hw->priv;
-       struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
+       struct ath10k_vif *arvif = (void *)vif->drv_priv;
        int ret = 0;
        u32 vdev_param, pdev_param, slottime, preamble;
 
@@ -5512,7 +5512,7 @@ static int ath10k_hw_scan(struct ieee80211_hw *hw,
                          struct ieee80211_scan_request *hw_req)
 {
        struct ath10k *ar = hw->priv;
-       struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
+       struct ath10k_vif *arvif = (void *)vif->drv_priv;
        struct cfg80211_scan_request *req = &hw_req->req;
        struct wmi_start_scan_arg arg;
        int ret = 0;
@@ -5644,7 +5644,7 @@ static int ath10k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
                          struct ieee80211_key_conf *key)
 {
        struct ath10k *ar = hw->priv;
-       struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
+       struct ath10k_vif *arvif = (void *)vif->drv_priv;
        struct ath10k_peer *peer;
        const u8 *peer_addr;
        bool is_wep = key->cipher == WLAN_CIPHER_SUITE_WEP40 ||
@@ -5783,7 +5783,7 @@ static void ath10k_set_default_unicast_key(struct ieee80211_hw *hw,
                                           int keyidx)
 {
        struct ath10k *ar = hw->priv;
-       struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
+       struct ath10k_vif *arvif = (void *)vif->drv_priv;
        int ret;
 
        mutex_lock(&arvif->ar->conf_mutex);
@@ -5964,7 +5964,7 @@ static int ath10k_mac_tdls_vif_stations_count(struct ieee80211_hw *hw,
 static void ath10k_mac_tdls_vifs_count_iter(void *data, u8 *mac,
                                            struct ieee80211_vif *vif)
 {
-       struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
+       struct ath10k_vif *arvif = (void *)vif->drv_priv;
        int *num_tdls_vifs = data;
 
        if (vif->type != NL80211_IFTYPE_STATION)
@@ -5992,7 +5992,7 @@ static int ath10k_sta_state(struct ieee80211_hw *hw,
                            enum ieee80211_sta_state new_state)
 {
        struct ath10k *ar = hw->priv;
-       struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
+       struct ath10k_vif *arvif = (void *)vif->drv_priv;
        struct ath10k_sta *arsta = (struct ath10k_sta *)sta->drv_priv;
        struct ath10k_peer *peer;
        int ret = 0;
@@ -6227,7 +6227,7 @@ exit:
 static int ath10k_conf_tx_uapsd(struct ath10k *ar, struct ieee80211_vif *vif,
                                u16 ac, bool enable)
 {
-       struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
+       struct ath10k_vif *arvif = (void *)vif->drv_priv;
        struct wmi_sta_uapsd_auto_trig_arg arg = {};
        u32 prio = 0, acc = 0;
        u32 value = 0;
@@ -6335,7 +6335,7 @@ static int ath10k_conf_tx(struct ieee80211_hw *hw,
                          const struct ieee80211_tx_queue_params *params)
 {
        struct ath10k *ar = hw->priv;
-       struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
+       struct ath10k_vif *arvif = (void *)vif->drv_priv;
        struct wmi_wmm_params_arg *p = NULL;
        int ret;
 
@@ -6409,7 +6409,7 @@ static int ath10k_remain_on_channel(struct ieee80211_hw *hw,
                                    enum ieee80211_roc_type type)
 {
        struct ath10k *ar = hw->priv;
-       struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
+       struct ath10k_vif *arvif = (void *)vif->drv_priv;
        struct wmi_start_scan_arg arg;
        int ret = 0;
        u32 scan_time_msec;
@@ -6909,7 +6909,7 @@ static int ath10k_mac_op_set_bitrate_mask(struct ieee80211_hw *hw,
                                          struct ieee80211_vif *vif,
                                          const struct cfg80211_bitrate_mask *mask)
 {
-       struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
+       struct ath10k_vif *arvif = (void *)vif->drv_priv;
        struct cfg80211_chan_def def;
        struct ath10k *ar = arvif->ar;
        enum nl80211_band band;
@@ -7060,7 +7060,7 @@ static void ath10k_offset_tsf(struct ieee80211_hw *hw,
                              struct ieee80211_vif *vif, s64 tsf_offset)
 {
        struct ath10k *ar = hw->priv;
-       struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
+       struct ath10k_vif *arvif = (void *)vif->drv_priv;
        u32 offset, vdev_param;
        int ret;
 
@@ -7085,7 +7085,7 @@ static int ath10k_ampdu_action(struct ieee80211_hw *hw,
                               struct ieee80211_ampdu_params *params)
 {
        struct ath10k *ar = hw->priv;
-       struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
+       struct ath10k_vif *arvif = (void *)vif->drv_priv;
        struct ieee80211_sta *sta = params->sta;
        enum ieee80211_ampdu_mlme_action action = params->action;
        u16 tid = params->tid;
@@ -7183,7 +7183,7 @@ ath10k_mac_update_vif_chan(struct ath10k *ar,
                ath10k_monitor_stop(ar);
 
        for (i = 0; i < n_vifs; i++) {
-               arvif = ath10k_vif_to_arvif(vifs[i].vif);
+               arvif = (void *)vifs[i].vif->drv_priv;
 
                ath10k_dbg(ar, ATH10K_DBG_MAC,
                           "mac chanctx switch vdev_id %i freq %hu->%hu width %d->%d\n",
@@ -7216,7 +7216,7 @@ ath10k_mac_update_vif_chan(struct ath10k *ar,
        spin_unlock_bh(&ar->data_lock);
 
        for (i = 0; i < n_vifs; i++) {
-               arvif = ath10k_vif_to_arvif(vifs[i].vif);
+               arvif = (void *)vifs[i].vif->drv_priv;
 
                if (WARN_ON(!arvif->is_started))
                        continue;
@@ -7873,7 +7873,7 @@ static void ath10k_get_arvif_iter(void *data, u8 *mac,
                                  struct ieee80211_vif *vif)
 {
        struct ath10k_vif_iter *arvif_iter = data;
-       struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
+       struct ath10k_vif *arvif = (void *)vif->drv_priv;
 
        if (arvif->vdev_id == arvif_iter->vdev_id)
                arvif_iter->arvif = arvif;
index 1bd29ecfcdcc913ff8d3e447eb0d85c4d3c56ec2..553747bc19ed2d9eedd104fff3987e0c8e18c2a1 100644 (file)
@@ -83,17 +83,12 @@ struct ieee80211_txq *ath10k_mac_txq_lookup(struct ath10k *ar,
                                            u8 tid);
 int ath10k_mac_ext_resource_config(struct ath10k *ar, u32 val);
 
-static inline struct ath10k_vif *ath10k_vif_to_arvif(struct ieee80211_vif *vif)
-{
-       return (struct ath10k_vif *)vif->drv_priv;
-}
-
 static inline void ath10k_tx_h_seq_no(struct ieee80211_vif *vif,
                                      struct sk_buff *skb)
 {
        struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
        struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
-       struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
+       struct ath10k_vif *arvif = (void *)vif->drv_priv;
 
        if (info->flags  & IEEE80211_TX_CTL_ASSIGN_SEQ) {
                if (arvif->tx_seq_no == 0)
index c0b6ffaf3ec1b22648fd7d32e0001d4f0fcdcfb1..7e621ee194e3d717706a3186afec2cee2b0ad5d3 100644 (file)
@@ -132,7 +132,7 @@ struct ath10k_p2p_noa_arg {
 static void ath10k_p2p_noa_update_vdev_iter(void *data, u8 *mac,
                                            struct ieee80211_vif *vif)
 {
-       struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
+       struct ath10k_vif *arvif = (void *)vif->drv_priv;
        struct ath10k_p2p_noa_arg *arg = data;
 
        if (arvif->vdev_id != arg->vdev_id)
index 5d2f9b9922d34fde6a456890b59b5d06a2b45bc1..6094372307aae46b296cd1cff40498a06427d8a3 100644 (file)
@@ -1651,6 +1651,8 @@ static int ath10k_pci_hif_start(struct ath10k *ar)
 
        ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot hif start\n");
 
+       napi_enable(&ar->napi);
+
        ath10k_pci_irq_enable(ar);
        ath10k_pci_rx_post(ar);
 
@@ -2535,7 +2537,6 @@ static int ath10k_pci_hif_power_up(struct ath10k *ar)
                ath10k_err(ar, "could not wake up target CPU: %d\n", ret);
                goto err_ce;
        }
-       napi_enable(&ar->napi);
 
        return 0;
 
index 2ffc1fe4923b9696441b4411428ba5548a231783..c061d6958bd130f7d5756d6eaea6268397dd764e 100644 (file)
@@ -278,7 +278,7 @@ static ssize_t read_file_spec_scan_ctl(struct file *file, char __user *user_buf,
 {
        struct ath10k *ar = file->private_data;
        char *mode = "";
-       unsigned int len;
+       size_t len;
        enum ath10k_spectral_mode spectral_mode;
 
        mutex_lock(&ar->conf_mutex);
@@ -370,7 +370,7 @@ static ssize_t read_file_spectral_count(struct file *file,
 {
        struct ath10k *ar = file->private_data;
        char buf[32];
-       unsigned int len;
+       size_t len;
        u8 spectral_count;
 
        mutex_lock(&ar->conf_mutex);
@@ -422,7 +422,8 @@ static ssize_t read_file_spectral_bins(struct file *file,
 {
        struct ath10k *ar = file->private_data;
        char buf[32];
-       unsigned int len, bins, fft_size, bin_scale;
+       unsigned int bins, fft_size, bin_scale;
+       size_t len;
 
        mutex_lock(&ar->conf_mutex);
 
index ed85f938e3c0799795ccf117e572330ea2635c78..8bb36c18a7491a6d51e75dfaeb3bf0f1d12ff37e 100644 (file)
@@ -150,7 +150,10 @@ static int ath10k_tm_fetch_utf_firmware_api_1(struct ath10k *ar,
                 ar->hw_params.fw.dir, ATH10K_FW_UTF_FILE);
 
        /* load utf firmware image */
-       ret = request_firmware(&fw_file->firmware, filename, ar->dev);
+       ret = request_firmware_direct(&fw_file->firmware, filename, ar->dev);
+       ath10k_dbg(ar, ATH10K_DBG_TESTMODE, "testmode fw request '%s': %d\n",
+                  filename, ret);
+
        if (ret) {
                ath10k_warn(ar, "failed to retrieve utf firmware '%s': %d\n",
                            filename, ret);
index 414ad3e1eed4b617652dba2e3939354d9ae58f36..2f1743e60fa1303331fb654a79c745e725cc9eaf 100644 (file)
@@ -1779,7 +1779,7 @@ unlock:
 static void ath10k_wmi_tx_beacons_iter(void *data, u8 *mac,
                                       struct ieee80211_vif *vif)
 {
-       struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
+       struct ath10k_vif *arvif = (void *)vif->drv_priv;
 
        ath10k_wmi_tx_beacon_nowait(arvif);
 }
index cec713c999316922e95fa02525a5ede3ba6c17dc..386aa51435f1c4d57e0affa556153c4989b2c8e8 100644 (file)
@@ -75,7 +75,7 @@ struct wmi_cmd_hdr {
 
 /*
  * There is no signed version of __le32, so for a temporary solution come
- * up with our own version. The idea is from fs/ntfs/types.h.
+ * up with our own version. The idea is from fs/ntfs/endian.h.
  *
  * Use a_ prefix so that it doesn't conflict if we get proper support to
  * linux/types.h.
index ac25f1781b424e8b54cc74cff16e619f927fa20d..87e99c12d4baa373f6a1ce1b22713a98c823df27 100644 (file)
@@ -641,7 +641,6 @@ struct ath6kl_vif {
        u32 txe_intvl;
        u16 bg_scan_period;
        u8 assoc_bss_dtim_period;
-       struct net_device_stats net_stats;
        struct target_stats target_stats;
        struct wmi_connect_cmd profile;
        u16 rsn_capab;
index 1af3fed5a72caa203e9cbda00f677905ef966863..91ee542de3d79ec0903d56f2d45463af83b01a95 100644 (file)
@@ -1113,13 +1113,6 @@ static int ath6kl_close(struct net_device *dev)
        return 0;
 }
 
-static struct net_device_stats *ath6kl_get_stats(struct net_device *dev)
-{
-       struct ath6kl_vif *vif = netdev_priv(dev);
-
-       return &vif->net_stats;
-}
-
 static int ath6kl_set_features(struct net_device *dev,
                               netdev_features_t features)
 {
@@ -1285,7 +1278,6 @@ static const struct net_device_ops ath6kl_netdev_ops = {
        .ndo_open               = ath6kl_open,
        .ndo_stop               = ath6kl_close,
        .ndo_start_xmit         = ath6kl_data_tx,
-       .ndo_get_stats          = ath6kl_get_stats,
        .ndo_set_features       = ath6kl_set_features,
        .ndo_set_rx_mode        = ath6kl_set_multicast_list,
 };
index 9df41d5e32491d3c934808df9c3c99d5de2d643f..a531e0c5c1e28514c0a8bb32f18c4f0808ec6f18 100644 (file)
@@ -405,7 +405,7 @@ int ath6kl_data_tx(struct sk_buff *skb, struct net_device *dev)
                        skb = skb_realloc_headroom(skb, dev->needed_headroom);
                        kfree_skb(tmp_skb);
                        if (skb == NULL) {
-                               vif->net_stats.tx_dropped++;
+                               dev->stats.tx_dropped++;
                                return 0;
                        }
                }
@@ -520,8 +520,8 @@ int ath6kl_data_tx(struct sk_buff *skb, struct net_device *dev)
 fail_tx:
        dev_kfree_skb(skb);
 
-       vif->net_stats.tx_dropped++;
-       vif->net_stats.tx_aborted_errors++;
+       dev->stats.tx_dropped++;
+       dev->stats.tx_aborted_errors++;
 
        return 0;
 }
@@ -767,7 +767,7 @@ void ath6kl_tx_complete(struct htc_target *target,
                                /* a packet was flushed  */
                                flushing[if_idx] = true;
 
-                       vif->net_stats.tx_errors++;
+                       vif->ndev->stats.tx_errors++;
 
                        if (status != -ENOSPC && status != -ECANCELED)
                                ath6kl_warn("tx complete error: %d\n", status);
@@ -783,8 +783,8 @@ void ath6kl_tx_complete(struct htc_target *target,
                                   eid, "OK");
 
                        flushing[if_idx] = false;
-                       vif->net_stats.tx_packets++;
-                       vif->net_stats.tx_bytes += skb->len;
+                       vif->ndev->stats.tx_packets++;
+                       vif->ndev->stats.tx_bytes += skb->len;
                }
 
                ath6kl_tx_clear_node_map(vif, eid, map_no);
@@ -1365,8 +1365,8 @@ void ath6kl_rx(struct htc_target *target, struct htc_packet *packet)
         */
        spin_lock_bh(&vif->if_lock);
 
-       vif->net_stats.rx_packets++;
-       vif->net_stats.rx_bytes += packet->act_len;
+       vif->ndev->stats.rx_packets++;
+       vif->ndev->stats.rx_bytes += packet->act_len;
 
        spin_unlock_bh(&vif->if_lock);
 
@@ -1395,8 +1395,8 @@ void ath6kl_rx(struct htc_target *target, struct htc_packet *packet)
            ((packet->act_len < min_hdr_len) ||
             (packet->act_len > WMI_MAX_AMSDU_RX_DATA_FRAME_LENGTH))) {
                ath6kl_info("frame len is too short or too long\n");
-               vif->net_stats.rx_errors++;
-               vif->net_stats.rx_length_errors++;
+               vif->ndev->stats.rx_errors++;
+               vif->ndev->stats.rx_length_errors++;
                dev_kfree_skb(skb);
                return;
        }
@@ -1619,7 +1619,7 @@ void ath6kl_rx(struct htc_target *target, struct htc_packet *packet)
                        return;
                }
        } else if (!is_broadcast_ether_addr(datap->h_dest)) {
-               vif->net_stats.multicast++;
+               vif->ndev->stats.multicast++;
        }
 
        ath6kl_deliver_frames_to_nw_stack(vif->ndev, skb);
index 7dc7205dc8771159f79c3ce8f2651f8b75d21c07..bd2269c7de6bc14ed4e877b55b6df192e31bbd8b 100644 (file)
 #define AR9300_OTP_BASE \
                ((AR_SREV_9340(ah) || AR_SREV_9550(ah)) ? 0x30000 : 0x14000)
 #define AR9300_OTP_STATUS \
-               ((AR_SREV_9340(ah) || AR_SREV_9550(ah)) ? 0x30018 : 0x15f18)
+               ((AR_SREV_9340(ah) || AR_SREV_9550(ah)) ? 0x31018 : 0x15f18)
 #define AR9300_OTP_STATUS_TYPE         0x7
 #define AR9300_OTP_STATUS_VALID                0x4
 #define AR9300_OTP_STATUS_ACCESS_BUSY  0x2
 #define AR9300_OTP_STATUS_SM_BUSY      0x1
 #define AR9300_OTP_READ_DATA \
-               ((AR_SREV_9340(ah) || AR_SREV_9550(ah)) ? 0x3001c : 0x15f1c)
+               ((AR_SREV_9340(ah) || AR_SREV_9550(ah)) ? 0x3101c : 0x15f1c)
 
 enum targetPowerHTRates {
        HT_TARGET_RATE_0_8_16,
index 789a3dbe8341ee657623e05a23ea7672c068b618..0ffa23a615682400905bf31f22b5c9942a8ce282 100644 (file)
@@ -482,7 +482,7 @@ ath_cmn_is_fft_buf_full(struct ath_spec_scan_priv *spec_priv)
        struct rchan *rc = spec_priv->rfs_chan_spec_scan;
 
        for_each_online_cpu(i)
-               ret += relay_buf_full(rc->buf[i]);
+               ret += relay_buf_full(*per_cpu_ptr(rc->buf, i));
 
        i = num_online_cpus();
 
index 11073cf879090de0d095fef1005b4f4eafcfabe4..396bf05c6bf69da7c1f6b43ce20848d1dbdde230 100644 (file)
@@ -699,51 +699,31 @@ static bool bf_is_ampdu_not_probing(struct ath_buf *bf)
     return bf_isampdu(bf) && !(info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE);
 }
 
-static void ath_tx_count_airtime(struct ath_softc *sc, struct ath_txq *txq,
-                                struct ath_buf *bf, struct ath_tx_status *ts)
+static void ath_tx_count_airtime(struct ath_softc *sc, struct ath_node *an,
+                                struct ath_atx_tid *tid, struct ath_buf *bf,
+                                struct ath_tx_status *ts)
 {
-       struct ath_node *an;
-       struct ath_acq *acq = &sc->cur_chan->acq[txq->mac80211_qnum];
-       struct sk_buff *skb;
-       struct ieee80211_hdr *hdr;
-       struct ieee80211_hw *hw = sc->hw;
-       struct ieee80211_tx_rate rates[4];
-       struct ieee80211_sta *sta;
-       int i;
+       struct ath_txq *txq = tid->txq;
        u32 airtime = 0;
-
-       skb = bf->bf_mpdu;
-       if(!skb)
-               return;
-
-       hdr = (struct ieee80211_hdr *)skb->data;
-       memcpy(rates, bf->rates, sizeof(rates));
-
-       rcu_read_lock();
-
-       sta = ieee80211_find_sta_by_ifaddr(hw, hdr->addr1, hdr->addr2);
-       if(!sta)
-               goto exit;
-
-
-       an = (struct ath_node *) sta->drv_priv;
+       int i;
 
        airtime += ts->duration * (ts->ts_longretry + 1);
+       for(i = 0; i < ts->ts_rateindex; i++) {
+               int rate_dur = ath9k_hw_get_duration(sc->sc_ah, bf->bf_desc, i);
+               airtime += rate_dur * bf->rates[i].count;
+       }
 
-       for(i=0; i < ts->ts_rateindex; i++)
-               airtime += ath9k_hw_get_duration(sc->sc_ah, bf->bf_desc, i) * rates[i].count;
+       if (sc->airtime_flags & AIRTIME_USE_TX) {
+               int q = txq->mac80211_qnum;
+               struct ath_acq *acq = &sc->cur_chan->acq[q];
 
-       if (!!(sc->airtime_flags & AIRTIME_USE_TX)) {
                spin_lock_bh(&acq->lock);
-               an->airtime_deficit[txq->mac80211_qnum] -= airtime;
-               if (an->airtime_deficit[txq->mac80211_qnum] <= 0)
-                       __ath_tx_queue_tid(sc, ath_get_skb_tid(sc, an, skb));
+               an->airtime_deficit[q] -= airtime;
+               if (an->airtime_deficit[q] <= 0)
+                       __ath_tx_queue_tid(sc, tid);
                spin_unlock_bh(&acq->lock);
        }
        ath_debug_airtime(sc, an, 0, airtime);
-
-exit:
-       rcu_read_unlock();
 }
 
 static void ath_tx_process_buffer(struct ath_softc *sc, struct ath_txq *txq,
@@ -767,13 +747,13 @@ static void ath_tx_process_buffer(struct ath_softc *sc, struct ath_txq *txq,
 
        ts->duration = ath9k_hw_get_duration(sc->sc_ah, bf->bf_desc,
                                             ts->ts_rateindex);
-       ath_tx_count_airtime(sc, txq, bf, ts);
 
        hdr = (struct ieee80211_hdr *) bf->bf_mpdu->data;
        sta = ieee80211_find_sta_by_ifaddr(hw, hdr->addr1, hdr->addr2);
        if (sta) {
                struct ath_node *an = (struct ath_node *)sta->drv_priv;
                tid = ath_get_skb_tid(sc, an, bf->bf_mpdu);
+               ath_tx_count_airtime(sc, an, tid, bf, ts);
                if (ts->ts_status & (ATH9K_TXERR_FILT | ATH9K_TXERR_XRETRY))
                        tid->clear_ps_filter = true;
        }
index b73a55b00fa7402cf02b626fe710deb2e7188fc3..60da86a8d95b0190b22c76e99cfc88543939e1a1 100644 (file)
@@ -249,10 +249,10 @@ static netdev_tx_t brcmf_netdev_start_xmit(struct sk_buff *skb,
 
 done:
        if (ret) {
-               ifp->stats.tx_dropped++;
+               ndev->stats.tx_dropped++;
        } else {
-               ifp->stats.tx_packets++;
-               ifp->stats.tx_bytes += skb->len;
+               ndev->stats.tx_packets++;
+               ndev->stats.tx_bytes += skb->len;
        }
 
        /* Return ok: we always eat the packet */
@@ -296,15 +296,15 @@ void brcmf_txflowblock(struct device *dev, bool state)
 void brcmf_netif_rx(struct brcmf_if *ifp, struct sk_buff *skb)
 {
        if (skb->pkt_type == PACKET_MULTICAST)
-               ifp->stats.multicast++;
+               ifp->ndev->stats.multicast++;
 
        if (!(ifp->ndev->flags & IFF_UP)) {
                brcmu_pkt_buf_free_skb(skb);
                return;
        }
 
-       ifp->stats.rx_bytes += skb->len;
-       ifp->stats.rx_packets++;
+       ifp->ndev->stats.rx_bytes += skb->len;
+       ifp->ndev->stats.rx_packets++;
 
        brcmf_dbg(DATA, "rx proto=0x%X\n", ntohs(skb->protocol));
        if (in_interrupt())
@@ -327,7 +327,7 @@ static int brcmf_rx_hdrpull(struct brcmf_pub *drvr, struct sk_buff *skb,
 
        if (ret || !(*ifp) || !(*ifp)->ndev) {
                if (ret != -ENODATA && *ifp)
-                       (*ifp)->stats.rx_errors++;
+                       (*ifp)->ndev->stats.rx_errors++;
                brcmu_pkt_buf_free_skb(skb);
                return -ENODATA;
        }
@@ -388,7 +388,7 @@ void brcmf_txfinalize(struct brcmf_if *ifp, struct sk_buff *txp, bool success)
        }
 
        if (!success)
-               ifp->stats.tx_errors++;
+               ifp->ndev->stats.tx_errors++;
 
        brcmu_pkt_buf_free_skb(txp);
 }
@@ -411,15 +411,6 @@ void brcmf_txcomplete(struct device *dev, struct sk_buff *txp, bool success)
        }
 }
 
-static struct net_device_stats *brcmf_netdev_get_stats(struct net_device *ndev)
-{
-       struct brcmf_if *ifp = netdev_priv(ndev);
-
-       brcmf_dbg(TRACE, "Enter, bsscfgidx=%d\n", ifp->bsscfgidx);
-
-       return &ifp->stats;
-}
-
 static void brcmf_ethtool_get_drvinfo(struct net_device *ndev,
                                    struct ethtool_drvinfo *info)
 {
@@ -492,7 +483,6 @@ static int brcmf_netdev_open(struct net_device *ndev)
 static const struct net_device_ops brcmf_netdev_ops_pri = {
        .ndo_open = brcmf_netdev_open,
        .ndo_stop = brcmf_netdev_stop,
-       .ndo_get_stats = brcmf_netdev_get_stats,
        .ndo_start_xmit = brcmf_netdev_start_xmit,
        .ndo_set_mac_address = brcmf_netdev_set_mac_address,
        .ndo_set_rx_mode = brcmf_netdev_set_multicast_list
index de3197be5491da482ff20e276b9bd34077c4359f..6aecd8dfd824d9656890b96359734aa80a03ca35 100644 (file)
@@ -171,7 +171,6 @@ enum brcmf_netif_stop_reason {
  * @drvr: points to device related information.
  * @vif: points to cfg80211 specific interface information.
  * @ndev: associated network device.
- * @stats: interface specific network statistics.
  * @multicast_work: worker object for multicast provisioning.
  * @ndoffload_work: worker object for neighbor discovery offload configuration.
  * @fws_desc: interface specific firmware-signalling descriptor.
@@ -187,7 +186,6 @@ struct brcmf_if {
        struct brcmf_pub *drvr;
        struct brcmf_cfg80211_vif *vif;
        struct net_device *ndev;
-       struct net_device_stats stats;
        struct work_struct multicast_work;
        struct work_struct ndoffload_work;
        struct brcmf_fws_mac_descriptor *fws_desc;
index 9d96b7c928f7655e4a79e4b13717ce0a23357259..28cf9748900108959df907190dc34d9da3057ceb 100644 (file)
@@ -294,14 +294,6 @@ int orinoco_stop(struct net_device *dev)
 }
 EXPORT_SYMBOL(orinoco_stop);
 
-struct net_device_stats *orinoco_get_stats(struct net_device *dev)
-{
-       struct orinoco_private *priv = ndev_priv(dev);
-
-       return &priv->stats;
-}
-EXPORT_SYMBOL(orinoco_get_stats);
-
 void orinoco_set_multicast_list(struct net_device *dev)
 {
        struct orinoco_private *priv = ndev_priv(dev);
@@ -433,7 +425,7 @@ EXPORT_SYMBOL(orinoco_process_xmit_skb);
 static netdev_tx_t orinoco_xmit(struct sk_buff *skb, struct net_device *dev)
 {
        struct orinoco_private *priv = ndev_priv(dev);
-       struct net_device_stats *stats = &priv->stats;
+       struct net_device_stats *stats = &dev->stats;
        struct hermes *hw = &priv->hw;
        int err = 0;
        u16 txfid = priv->txfid;
@@ -593,10 +585,7 @@ static void __orinoco_ev_alloc(struct net_device *dev, struct hermes *hw)
 
 static void __orinoco_ev_tx(struct net_device *dev, struct hermes *hw)
 {
-       struct orinoco_private *priv = ndev_priv(dev);
-       struct net_device_stats *stats = &priv->stats;
-
-       stats->tx_packets++;
+       dev->stats.tx_packets++;
 
        netif_wake_queue(dev);
 
@@ -605,8 +594,7 @@ static void __orinoco_ev_tx(struct net_device *dev, struct hermes *hw)
 
 static void __orinoco_ev_txexc(struct net_device *dev, struct hermes *hw)
 {
-       struct orinoco_private *priv = ndev_priv(dev);
-       struct net_device_stats *stats = &priv->stats;
+       struct net_device_stats *stats = &dev->stats;
        u16 fid = hermes_read_regn(hw, TXCOMPLFID);
        u16 status;
        struct hermes_txexc_data hdr;
@@ -662,7 +650,7 @@ static void __orinoco_ev_txexc(struct net_device *dev, struct hermes *hw)
 void orinoco_tx_timeout(struct net_device *dev)
 {
        struct orinoco_private *priv = ndev_priv(dev);
-       struct net_device_stats *stats = &priv->stats;
+       struct net_device_stats *stats = &dev->stats;
        struct hermes *hw = &priv->hw;
 
        printk(KERN_WARNING "%s: Tx timeout! "
@@ -749,7 +737,7 @@ static void orinoco_rx_monitor(struct net_device *dev, u16 rxfid,
        int len;
        struct sk_buff *skb;
        struct orinoco_private *priv = ndev_priv(dev);
-       struct net_device_stats *stats = &priv->stats;
+       struct net_device_stats *stats = &dev->stats;
        struct hermes *hw = &priv->hw;
 
        len = le16_to_cpu(desc->data_len);
@@ -840,7 +828,7 @@ static void orinoco_rx_monitor(struct net_device *dev, u16 rxfid,
 void __orinoco_ev_rx(struct net_device *dev, struct hermes *hw)
 {
        struct orinoco_private *priv = ndev_priv(dev);
-       struct net_device_stats *stats = &priv->stats;
+       struct net_device_stats *stats = &dev->stats;
        struct iw_statistics *wstats = &priv->wstats;
        struct sk_buff *skb = NULL;
        u16 rxfid, status;
@@ -959,7 +947,7 @@ static void orinoco_rx(struct net_device *dev,
                       struct sk_buff *skb)
 {
        struct orinoco_private *priv = ndev_priv(dev);
-       struct net_device_stats *stats = &priv->stats;
+       struct net_device_stats *stats = &dev->stats;
        u16 status, fc;
        int length;
        struct ethhdr *hdr;
@@ -2137,7 +2125,6 @@ static const struct net_device_ops orinoco_netdev_ops = {
        .ndo_set_mac_address    = eth_mac_addr,
        .ndo_validate_addr      = eth_validate_addr,
        .ndo_tx_timeout         = orinoco_tx_timeout,
-       .ndo_get_stats          = orinoco_get_stats,
 };
 
 /* Allocate private data.
index 5fa1c3e3713f835387353ba781cbb24ce95df6dc..430862a6a24bd97a7663e6c79175fa2b067f4c2b 100644 (file)
@@ -84,7 +84,6 @@ struct orinoco_private {
 
        /* Net device stuff */
        struct net_device *ndev;
-       struct net_device_stats stats;
        struct iw_statistics wstats;
 
        /* Hardware control variables */
@@ -206,7 +205,6 @@ int orinoco_process_xmit_skb(struct sk_buff *skb,
 /* Common ndo functions exported for reuse by orinoco_usb */
 int orinoco_open(struct net_device *dev);
 int orinoco_stop(struct net_device *dev);
-struct net_device_stats *orinoco_get_stats(struct net_device *dev);
 void orinoco_set_multicast_list(struct net_device *dev);
 int orinoco_change_mtu(struct net_device *dev, int new_mtu);
 void orinoco_tx_timeout(struct net_device *dev);
index bca6935a94db9a4bd767bfa0b7d2d7c82cd6b60c..98e1380b9917f1e4889b140784d270904eec418e 100644 (file)
@@ -403,8 +403,7 @@ static void ezusb_ctx_complete(struct request_context *ctx)
 
                if ((ctx->out_rid == EZUSB_RID_TX) && upriv->dev) {
                        struct net_device *dev = upriv->dev;
-                       struct orinoco_private *priv = ndev_priv(dev);
-                       struct net_device_stats *stats = &priv->stats;
+                       struct net_device_stats *stats = &dev->stats;
 
                        if (ctx->state != EZUSB_CTX_COMPLETE)
                                stats->tx_errors++;
@@ -1183,7 +1182,7 @@ static int ezusb_program(struct hermes *hw, const char *buf,
 static netdev_tx_t ezusb_xmit(struct sk_buff *skb, struct net_device *dev)
 {
        struct orinoco_private *priv = ndev_priv(dev);
-       struct net_device_stats *stats = &priv->stats;
+       struct net_device_stats *stats = &dev->stats;
        struct ezusb_priv *upriv = priv->card;
        u8 mic[MICHAEL_MIC_LEN + 1];
        int err = 0;
@@ -1556,7 +1555,6 @@ static const struct net_device_ops ezusb_netdev_ops = {
        .ndo_set_mac_address    = eth_mac_addr,
        .ndo_validate_addr      = eth_validate_addr,
        .ndo_tx_timeout         = orinoco_tx_timeout,
-       .ndo_get_stats          = orinoco_get_stats,
 };
 
 static int ezusb_probe(struct usb_interface *interface,
index 9d80180a551975f34d5b912289029e4d713eec95..5ebca1d0cfc750969793c26ac5f37e858e897fc4 100644 (file)
@@ -1519,13 +1519,13 @@ static void mwifiex_probe_of(struct mwifiex_adapter *adapter)
        struct device *dev = adapter->dev;
 
        if (!dev->of_node)
-               return;
+               goto err_exit;
 
        adapter->dt_node = dev->of_node;
        adapter->irq_wakeup = irq_of_parse_and_map(adapter->dt_node, 0);
        if (!adapter->irq_wakeup) {
-               dev_info(dev, "fail to parse irq_wakeup from device tree\n");
-               return;
+               dev_dbg(dev, "fail to parse irq_wakeup from device tree\n");
+               goto err_exit;
        }
 
        ret = devm_request_irq(dev, adapter->irq_wakeup,
@@ -1545,7 +1545,7 @@ static void mwifiex_probe_of(struct mwifiex_adapter *adapter)
        return;
 
 err_exit:
-       adapter->irq_wakeup = 0;
+       adapter->irq_wakeup = -1;
 }
 
 /*
index 62357465fe291f8dd8411aea2b2b330e80f71c30..0d2670a56c4c5c116ac0c9108ace68bb1bfe261e 100644 (file)
@@ -55,7 +55,7 @@ MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption.");
  * If the csr_mutex is already held then the _lock variants must
  * be used instead.
  */
-static inline void rt2500usb_register_read(struct rt2x00_dev *rt2x00dev,
+static void rt2500usb_register_read(struct rt2x00_dev *rt2x00dev,
                                           const unsigned int offset,
                                           u16 *value)
 {
@@ -66,7 +66,7 @@ static inline void rt2500usb_register_read(struct rt2x00_dev *rt2x00dev,
        *value = le16_to_cpu(reg);
 }
 
-static inline void rt2500usb_register_read_lock(struct rt2x00_dev *rt2x00dev,
+static void rt2500usb_register_read_lock(struct rt2x00_dev *rt2x00dev,
                                                const unsigned int offset,
                                                u16 *value)
 {
@@ -77,16 +77,7 @@ static inline void rt2500usb_register_read_lock(struct rt2x00_dev *rt2x00dev,
        *value = le16_to_cpu(reg);
 }
 
-static inline void rt2500usb_register_multiread(struct rt2x00_dev *rt2x00dev,
-                                               const unsigned int offset,
-                                               void *value, const u16 length)
-{
-       rt2x00usb_vendor_request_buff(rt2x00dev, USB_MULTI_READ,
-                                     USB_VENDOR_REQUEST_IN, offset,
-                                     value, length);
-}
-
-static inline void rt2500usb_register_write(struct rt2x00_dev *rt2x00dev,
+static void rt2500usb_register_write(struct rt2x00_dev *rt2x00dev,
                                            const unsigned int offset,
                                            u16 value)
 {
@@ -96,7 +87,7 @@ static inline void rt2500usb_register_write(struct rt2x00_dev *rt2x00dev,
                                      &reg, sizeof(reg));
 }
 
-static inline void rt2500usb_register_write_lock(struct rt2x00_dev *rt2x00dev,
+static void rt2500usb_register_write_lock(struct rt2x00_dev *rt2x00dev,
                                                 const unsigned int offset,
                                                 u16 value)
 {
@@ -106,7 +97,7 @@ static inline void rt2500usb_register_write_lock(struct rt2x00_dev *rt2x00dev,
                                       &reg, sizeof(reg), REGISTER_TIMEOUT);
 }
 
-static inline void rt2500usb_register_multiwrite(struct rt2x00_dev *rt2x00dev,
+static void rt2500usb_register_multiwrite(struct rt2x00_dev *rt2x00dev,
                                                 const unsigned int offset,
                                                 void *value, const u16 length)
 {
index e9f0a76107ed508cd0cdcdc0f17235e302d57bb2..d67bbfb6ad8e61c4e1e0cef2e3a83c04a961f71f 100644 (file)
@@ -1872,16 +1872,8 @@ static void halbtc8723b1ant_action_wifi_connected_bt_acl_busy(
                }
        } else if (bt_link_info->hid_exist &&
                        bt_link_info->a2dp_exist) { /*HID+A2DP */
-               if ((bt_rssi_state == BTC_RSSI_STATE_HIGH) ||
-                   (bt_rssi_state == BTC_RSSI_STATE_STAY_HIGH)) {
-                       halbtc8723b1ant_ps_tdma(btcoexist, NORMAL_EXEC,
-                                               true, 14);
-                       coex_dm->auto_tdma_adjust = false;
-               } else { /*for low BT RSSI*/
-                       halbtc8723b1ant_ps_tdma(btcoexist, NORMAL_EXEC,
-                                               true, 14);
-                       coex_dm->auto_tdma_adjust = false;
-               }
+               halbtc8723b1ant_ps_tdma(btcoexist, NORMAL_EXEC, true, 14);
+               coex_dm->auto_tdma_adjust = false;
 
                halbtc8723b1ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 6);
         /*PAN(OPP,FTP), HID+PAN(OPP,FTP) */
@@ -2250,16 +2242,8 @@ static void halbtc8723b1ant_run_coexist_mechanism(struct btc_coexist *btcoexist)
                        wifi_rssi_state =
                                halbtc8723b1ant_wifi_rssi_state(btcoexist,
                                                                1, 2, 30, 0);
-                       if ((wifi_rssi_state == BTC_RSSI_STATE_HIGH) ||
-                           (wifi_rssi_state == BTC_RSSI_STATE_STAY_HIGH)) {
-                               halbtc8723b1ant_limited_tx(btcoexist,
-                                                          NORMAL_EXEC,
-                                                          1, 1, 1, 1);
-                       } else {
-                               halbtc8723b1ant_limited_tx(btcoexist,
-                                                          NORMAL_EXEC,
-                                                          1, 1, 1, 1);
-                       }
+                       halbtc8723b1ant_limited_tx(btcoexist,
+                                                  NORMAL_EXEC, 1, 1, 1, 1);
                } else {
                        halbtc8723b1ant_limited_tx(btcoexist, NORMAL_EXEC,
                                                   0, 0, 0, 0);
index 20562f081c968ef4e955d5403c44a901d5038030..8b689ed9a629bce30472d2b61adb562d24c071af 100644 (file)
@@ -1768,11 +1768,7 @@ static void btc8821a1ant_act_bt_sco_hid_only_busy(struct btc_coexist *btcoexist,
        /* tdma and coex table*/
        halbtc8821a1ant_ps_tdma(btcoexist, NORMAL_EXEC, true, 5);
 
-       if (BT_8821A_1ANT_WIFI_STATUS_NON_CONNECTED_ASSO_AUTH_SCAN ==
-           wifi_status)
-               halbtc8821a1ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 1);
-       else
-               halbtc8821a1ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 1);
+       halbtc8821a1ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 1);
 }
 
 static void btc8821a1ant_act_wifi_con_bt_acl_busy(struct btc_coexist *btcoexist,
@@ -2123,16 +2119,8 @@ static void halbtc8821a1ant_run_coexist_mechanism(struct btc_coexist *btcoexist)
                        wifi_rssi_state =
                                 halbtc8821a1ant_WifiRssiState(btcoexist, 1, 2,
                                                               30, 0);
-                       if ((wifi_rssi_state == BTC_RSSI_STATE_HIGH) ||
-                           (wifi_rssi_state == BTC_RSSI_STATE_STAY_HIGH)) {
-                               halbtc8821a1ant_limited_tx(btcoexist,
-                                                          NORMAL_EXEC, 1, 1,
-                                                          1, 1);
-                       } else {
-                               halbtc8821a1ant_limited_tx(btcoexist,
-                                                          NORMAL_EXEC, 1, 1,
-                                                          1, 1);
-                       }
+                       halbtc8821a1ant_limited_tx(btcoexist,
+                                                  NORMAL_EXEC, 1, 1, 1, 1);
                } else {
                        halbtc8821a1ant_limited_tx(btcoexist, NORMAL_EXEC,
                                                   0, 0, 0, 0);
index 962fbaf3ba1d89e38dfe5a2a1f70cc1f3f4f670b..1717e9ce96caa311e7b6002ebac5ba49286b0aa0 100644 (file)
@@ -2388,14 +2388,8 @@ static void halbtc8821a2ant_action_sco(struct btc_coexist *btcoexist)
                 * halbtc8821a2ant_ps_tdma(btcoexist, NORMAL_EXEC, true, 5);
                 */
 
-               if ((bt_rssi_state == BTC_RSSI_STATE_HIGH) ||
-                   (bt_rssi_state == BTC_RSSI_STATE_STAY_HIGH)) {
-                       halbtc8821a2ant_ps_tdma(btcoexist, NORMAL_EXEC,
-                                               false, 0); /*for voice quality*/
-               } else {
-                       halbtc8821a2ant_ps_tdma(btcoexist, NORMAL_EXEC,
-                                               false, 0); /*for voice quality*/
-               }
+               halbtc8821a2ant_ps_tdma(btcoexist, NORMAL_EXEC,
+                                       false, 0); /*for voice quality*/
 
                /* sw mechanism */
                if ((wifi_rssi_state == BTC_RSSI_STATE_HIGH) ||
@@ -2785,14 +2779,7 @@ static void halbtc8821a2ant_action_pan_hs(struct btc_coexist *btcoexist)
                                                   NORMAL_EXEC, false);
                }
 
-               if ((bt_rssi_state == BTC_RSSI_STATE_HIGH) ||
-                   (bt_rssi_state == BTC_RSSI_STATE_STAY_HIGH)) {
-                       halbtc8821a2ant_ps_tdma(btcoexist, NORMAL_EXEC,
-                                               false, 1);
-               } else {
-                       halbtc8821a2ant_ps_tdma(btcoexist, NORMAL_EXEC,
-                                               false, 1);
-               }
+               halbtc8821a2ant_ps_tdma(btcoexist, NORMAL_EXEC, false, 1);
 
                /* sw mechanism */
                if ((wifi_rssi_state == BTC_RSSI_STATE_HIGH) ||
@@ -2830,40 +2817,18 @@ static void halbtc8821a2ant_action_pan_edr_a2dp(struct btc_coexist *btcoexist)
 
        btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_BW, &wifi_bw);
 
-       if (BTC_WIFI_BW_LEGACY == wifi_bw) {
-               /* for HID at 11b/g mode */
-               halbtc8821a2ant_coex_table(btcoexist, NORMAL_EXEC, 0x55ff55ff,
-                                          0x5afa5afa, 0xffff, 0x3);
-       } else {
-               /* for HID quality & wifi performance balance at 11n mode */
-               halbtc8821a2ant_coex_table(btcoexist, NORMAL_EXEC, 0x55ff55ff,
-                                          0x5afa5afa, 0xffff, 0x3);
-       }
+       halbtc8821a2ant_coex_table(btcoexist, NORMAL_EXEC, 0x55ff55ff,
+                                  0x5afa5afa, 0xffff, 0x3);
 
        if (BTC_WIFI_BW_HT40 == wifi_bw) {
                /* fw mechanism */
                if ((bt_rssi_state == BTC_RSSI_STATE_HIGH) ||
-                   (bt_rssi_state == BTC_RSSI_STATE_STAY_HIGH)) {
-                       if (bt_info_ext&BIT0) {
-                               /* a2dp basic rate */
-                               btc8821a2ant_tdma_dur_adj(btcoexist, false,
-                                                         false, 3);
-                       } else {
-                               /* a2dp edr rate */
-                               btc8821a2ant_tdma_dur_adj(btcoexist, false,
-                                                         false, 3);
-                       }
-               } else {
-                       if (bt_info_ext&BIT0) {
-                               /* a2dp basic rate */
-                               btc8821a2ant_tdma_dur_adj(btcoexist, false,
-                                                         true, 3);
-                       } else {
-                               /* a2dp edr rate */
-                               btc8821a2ant_tdma_dur_adj(btcoexist, false,
-                                                         true, 3);
-                       }
-               }
+                   (bt_rssi_state == BTC_RSSI_STATE_STAY_HIGH))
+                       btc8821a2ant_tdma_dur_adj(btcoexist, false,
+                                                 false, 3);
+               else
+                       btc8821a2ant_tdma_dur_adj(btcoexist, false,
+                                                 true, 3);
 
                /* sw mechanism */
                if ((wifi_rssi_state == BTC_RSSI_STATE_HIGH) ||
@@ -2877,31 +2842,14 @@ static void halbtc8821a2ant_action_pan_edr_a2dp(struct btc_coexist *btcoexist)
                                              false, false);
                        btc8821a2ant_sw_mech2(btcoexist, false, false,
                                              false, 0x18);
-               };
+               }
        } else {
                /* fw mechanism */
                if ((bt_rssi_state == BTC_RSSI_STATE_HIGH) ||
-                   (bt_rssi_state == BTC_RSSI_STATE_STAY_HIGH)) {
-                       if (bt_info_ext&BIT0) {
-                               /* a2dp basic rate */
-                               btc8821a2ant_tdma_dur_adj(btcoexist, false,
-                                                         false, 3);
-                       } else {
-                               /* a2dp edr rate */
-                               btc8821a2ant_tdma_dur_adj(btcoexist, false,
-                                                         false, 3);
-                       }
-               } else {
-                       if (bt_info_ext&BIT0) {
-                               /* a2dp basic rate */
-                               btc8821a2ant_tdma_dur_adj(btcoexist, false,
-                                                         true, 3);
-                       } else {
-                               /* a2dp edr rate */
-                               btc8821a2ant_tdma_dur_adj(btcoexist, false,
-                                                         true, 3);
-                       }
-               }
+                   (bt_rssi_state == BTC_RSSI_STATE_STAY_HIGH))
+                       btc8821a2ant_tdma_dur_adj(btcoexist, false, false, 3);
+               else
+                       btc8821a2ant_tdma_dur_adj(btcoexist, false, true, 3);
 
                /* sw mechanism */
                if ((wifi_rssi_state == BTC_RSSI_STATE_HIGH) ||
@@ -2937,15 +2885,8 @@ static void halbtc8821a2ant_action_pan_edr_hid(struct btc_coexist *btcoexist)
 
        btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_BW, &wifi_bw);
 
-       if (BTC_WIFI_BW_LEGACY == wifi_bw) {
-               /* for HID at 11b/g mode */
-               halbtc8821a2ant_coex_table(btcoexist, NORMAL_EXEC, 0x55ff55ff,
-                                          0x5a5f5a5f, 0xffff, 0x3);
-       } else {
-               /* for HID quality & wifi performance balance at 11n mode */
-               halbtc8821a2ant_coex_table(btcoexist, NORMAL_EXEC, 0x55ff55ff,
-                                          0x5a5f5a5f, 0xffff, 0x3);
-       }
+       halbtc8821a2ant_coex_table(btcoexist, NORMAL_EXEC, 0x55ff55ff,
+                                  0x5a5f5a5f, 0xffff, 0x3);
 
        if (BTC_WIFI_BW_HT40 == wifi_bw) {
                halbtc8821a2ant_fw_dac_swing_lvl(btcoexist, NORMAL_EXEC, 3);
@@ -3020,40 +2961,12 @@ static void btc8821a2ant_act_hid_a2dp_pan_edr(struct btc_coexist *btcoexist)
 
        btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_BW, &wifi_bw);
 
-       if (BTC_WIFI_BW_LEGACY == wifi_bw) {
-               /* for HID at 11b/g mode */
-               halbtc8821a2ant_coex_table(btcoexist, NORMAL_EXEC, 0x55ff55ff,
-                                          0x5a5a5a5a, 0xffff, 0x3);
-       } else {
-               /* for HID quality & wifi performance balance at 11n mode */
-               halbtc8821a2ant_coex_table(btcoexist, NORMAL_EXEC, 0x55ff55ff,
-                                          0x5a5a5a5a, 0xffff, 0x3);
-       }
+       halbtc8821a2ant_coex_table(btcoexist, NORMAL_EXEC, 0x55ff55ff,
+                                  0x5a5a5a5a, 0xffff, 0x3);
 
        if (BTC_WIFI_BW_HT40 == wifi_bw) {
                /* fw mechanism */
-               if ((bt_rssi_state == BTC_RSSI_STATE_HIGH) ||
-                   (bt_rssi_state == BTC_RSSI_STATE_STAY_HIGH)) {
-                       if (bt_info_ext&BIT0) {
-                               /* a2dp basic rate */
-                               btc8821a2ant_tdma_dur_adj(btcoexist, true,
-                                                         true, 3);
-                       } else {
-                               /* a2dp edr rate */
-                               btc8821a2ant_tdma_dur_adj(btcoexist, true,
-                                                         true, 3);
-                       }
-               } else {
-                       if (bt_info_ext&BIT0) {
-                               /* a2dp basic rate */
-                               btc8821a2ant_tdma_dur_adj(btcoexist, true,
-                                                         true, 3);
-                       } else {
-                               /* a2dp edr rate */
-                               btc8821a2ant_tdma_dur_adj(btcoexist, true,
-                                                         true, 3);
-                       }
-               }
+               btc8821a2ant_tdma_dur_adj(btcoexist, true, true, 3);
 
                /* sw mechanism */
                if ((wifi_rssi_state == BTC_RSSI_STATE_HIGH) ||
@@ -3126,40 +3039,12 @@ static void halbtc8821a2ant_action_hid_a2dp(struct btc_coexist *btcoexist)
 
        btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_BW, &wifi_bw);
 
-       if (BTC_WIFI_BW_LEGACY == wifi_bw) {
-               /* for HID at 11b/g mode */
-               halbtc8821a2ant_coex_table(btcoexist, NORMAL_EXEC, 0x55ff55ff,
-                                          0x5f5b5f5b, 0xffffff, 0x3);
-       } else {
-               /*for HID quality & wifi performance balance at 11n mode*/
-               halbtc8821a2ant_coex_table(btcoexist, NORMAL_EXEC, 0x55ff55ff,
-                                          0x5f5b5f5b, 0xffffff, 0x3);
-       }
+       halbtc8821a2ant_coex_table(btcoexist, NORMAL_EXEC, 0x55ff55ff,
+                                  0x5f5b5f5b, 0xffffff, 0x3);
 
        if (BTC_WIFI_BW_HT40 == wifi_bw) {
                /* fw mechanism */
-               if ((bt_rssi_state == BTC_RSSI_STATE_HIGH) ||
-                   (bt_rssi_state == BTC_RSSI_STATE_STAY_HIGH)) {
-                       if (bt_info_ext&BIT0) {
-                               /* a2dp basic rate */
-                               btc8821a2ant_tdma_dur_adj(btcoexist,
-                                                         true, true, 2);
-                       } else {
-                               /* a2dp edr rate */
-                               btc8821a2ant_tdma_dur_adj(btcoexist,
-                                                         true, true, 2);
-                       }
-               } else {
-                       if (bt_info_ext&BIT0) {
-                               /* a2dp basic rate */
-                               btc8821a2ant_tdma_dur_adj(btcoexist,
-                                                         true, true, 2);
-                       } else {
-                               /* a2dp edr rate */
-                               btc8821a2ant_tdma_dur_adj(btcoexist,
-                                                         true, true, 2);
-                       }
-               }
+               btc8821a2ant_tdma_dur_adj(btcoexist, true, true, 2);
 
                /* sw mechanism */
                if ((wifi_rssi_state == BTC_RSSI_STATE_HIGH) ||
@@ -3176,29 +3061,7 @@ static void halbtc8821a2ant_action_hid_a2dp(struct btc_coexist *btcoexist)
                }
        } else {
                /* fw mechanism */
-               if ((bt_rssi_state == BTC_RSSI_STATE_HIGH) ||
-                   (bt_rssi_state == BTC_RSSI_STATE_STAY_HIGH)) {
-                       if (bt_info_ext&BIT0) {
-                               /* a2dp basic rate */
-                               btc8821a2ant_tdma_dur_adj(btcoexist,
-                                                         true, true, 2);
-
-                       } else {
-                               /* a2dp edr rate */
-                               btc8821a2ant_tdma_dur_adj(btcoexist,
-                                                         true, true, 2);
-                       }
-               } else {
-                       if (bt_info_ext&BIT0) {
-                               /*a2dp basic rate*/
-                               btc8821a2ant_tdma_dur_adj(btcoexist,
-                                                         true, true, 2);
-                       } else {
-                               /*a2dp edr rate*/
-                               btc8821a2ant_tdma_dur_adj(btcoexist,
-                                                         true, true, 2);
-                       }
-               }
+               btc8821a2ant_tdma_dur_adj(btcoexist, true, true, 2);
 
                /* sw mechanism */
                if ((wifi_rssi_state == BTC_RSSI_STATE_HIGH) ||
index e536aa01b937a958684c81a8a8c228dc44975b42..a21fda910529a45aff033ccbda6bfbdd758a66c9 100644 (file)
@@ -3202,6 +3202,21 @@ static void wl1271_op_configure_filter(struct ieee80211_hw *hw,
                        if (ret < 0)
                                goto out_sleep;
                }
+
+               /*
+                * If interface in AP mode and created with allmulticast then disable
+                * the firmware filters so that all multicast packets are passed
+                * This is mandatory for MDNS based discovery protocols 
+                */
+               if (wlvif->bss_type == BSS_TYPE_AP_BSS) {
+                       if (*total & FIF_ALLMULTI) {
+                               ret = wl1271_acx_group_address_tbl(wl, wlvif,
+                                                       false,
+                                                       NULL, 0);
+                               if (ret < 0)
+                                       goto out_sleep;
+                       }
+               }
        }
 
        /*