ath9k: Add support for OCB mode
authorJan Kaisrlik <kaisrja1@fel.cvut.cz>
Thu, 17 Sep 2015 12:03:46 +0000 (14:03 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 29 Sep 2015 07:39:22 +0000 (10:39 +0300)
The patch adds support for "outside the context of a BSS"(OCB) mode
to ath9k driver and extends debugfs files by OCB ralated information.

This patch was tested on AR9380-AL1A cards.

Signed-off-by: Jan Kaisrlik <kaisrja1@fel.cvut.cz>
Cc: Michal Sojka <sojkam1@fel.cvut.cz>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ath/ath9k/ath9k.h
drivers/net/wireless/ath/ath9k/debug.c
drivers/net/wireless/ath/ath9k/htc_drv_init.c
drivers/net/wireless/ath/ath9k/hw.c
drivers/net/wireless/ath/ath9k/init.c
drivers/net/wireless/ath/ath9k/main.c
drivers/net/wireless/ath/ath9k/recv.c

index c85c47978e1e48e4dda029b1f9d55e5c04accf11..b42f4a963ef40ff0e6e29997099ad7cd66a779c1 100644 (file)
@@ -635,6 +635,7 @@ struct ath9k_vif_iter_data {
        int nstations; /* number of station vifs */
        int nwds;      /* number of WDS vifs */
        int nadhocs;   /* number of adhoc vifs */
+       int nocbs;     /* number of OCB vifs */
        struct ieee80211_vif *primary_sta;
 };
 
index da32c8faad94f1b58f2157c046e5db1bdb04f6f3..6de64cface3c26d3ff4dba5c9b0b99305a8dd348 100644 (file)
@@ -741,8 +741,8 @@ static int read_file_misc(struct seq_file *file, void *data)
                           i++, (int)(ctx->assigned), iter_data.naps,
                           iter_data.nstations,
                           iter_data.nmeshes, iter_data.nwds);
-               seq_printf(file, " ADHOC: %i TOTAL: %hi BEACON-VIF: %hi\n",
-                          iter_data.nadhocs, sc->cur_chan->nvifs,
+               seq_printf(file, " ADHOC: %i OCB: %i TOTAL: %hi BEACON-VIF: %hi\n",
+                          iter_data.nadhocs, iter_data.nocbs, sc->cur_chan->nvifs,
                           sc->nbcnvifs);
        }
 
index efe77db965706d4bda349a72aff5336f64d80b2f..8647ab77c019a30e7b8044b6147a62493626529b 100644 (file)
@@ -740,7 +740,8 @@ static void ath9k_set_hw_capab(struct ath9k_htc_priv *priv,
                BIT(NL80211_IFTYPE_AP) |
                BIT(NL80211_IFTYPE_P2P_GO) |
                BIT(NL80211_IFTYPE_P2P_CLIENT) |
-               BIT(NL80211_IFTYPE_MESH_POINT);
+               BIT(NL80211_IFTYPE_MESH_POINT) |
+               BIT(NL80211_IFTYPE_OCB);
 
        hw->wiphy->iface_combinations = &if_comb;
        hw->wiphy->n_iface_combinations = 1;
index 1dd0339de372901d753fa70f975e4c5b0f492f21..bdfff46419313955aaafc0b37063fe9e4b63e270 100644 (file)
@@ -1241,6 +1241,7 @@ static void ath9k_hw_set_operating_mode(struct ath_hw *ah, int opmode)
                        break;
                }
                /* fall through */
+       case NL80211_IFTYPE_OCB:
        case NL80211_IFTYPE_MESH_POINT:
        case NL80211_IFTYPE_AP:
                set |= AR_STA_ID1_STA_AP;
index 57f95f2dca5b072ac294b2c76122ec1b952a2a80..5d532c7b813fd1d356884134db2a4ebb7fb2d7f4 100644 (file)
@@ -855,7 +855,8 @@ static void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw)
                        BIT(NL80211_IFTYPE_STATION) |
                        BIT(NL80211_IFTYPE_ADHOC) |
                        BIT(NL80211_IFTYPE_MESH_POINT) |
-                       BIT(NL80211_IFTYPE_WDS);
+                       BIT(NL80211_IFTYPE_WDS) |
+                       BIT(NL80211_IFTYPE_OCB);
 
                if (ath9k_is_chanctx_enabled())
                        hw->wiphy->interface_modes |=
index c27143ba9ffbe8e6d863c0353e3ef3effd29bd5e..56abb9ddae67d22cab74d7fb5a707179b4003bcb 100644 (file)
@@ -938,6 +938,9 @@ static void ath9k_vif_iter(struct ath9k_vif_iter_data *iter_data,
                if (avp->assoc && !iter_data->primary_sta)
                        iter_data->primary_sta = vif;
                break;
+       case NL80211_IFTYPE_OCB:
+               iter_data->nocbs++;
+               break;
        case NL80211_IFTYPE_ADHOC:
                iter_data->nadhocs++;
                if (vif->bss_conf.enable_beacon)
@@ -1111,6 +1114,8 @@ void ath9k_calculate_summary_state(struct ath_softc *sc,
 
                if (iter_data.nmeshes)
                        ah->opmode = NL80211_IFTYPE_MESH_POINT;
+               else if (iter_data.nocbs)
+                       ah->opmode = NL80211_IFTYPE_OCB;
                else if (iter_data.nwds)
                        ah->opmode = NL80211_IFTYPE_AP;
                else if (iter_data.nadhocs)
@@ -1760,7 +1765,8 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw,
                ath9k_calculate_summary_state(sc, avp->chanctx);
        }
 
-       if (changed & BSS_CHANGED_IBSS) {
+       if ((changed & BSS_CHANGED_IBSS) ||
+             (changed & BSS_CHANGED_OCB)) {
                memcpy(common->curbssid, bss_conf->bssid, ETH_ALEN);
                common->curaid = bss_conf->aid;
                ath9k_hw_write_associd(sc->sc_ah);
index d3189daf99965e6059d1ce407c99600a822ed69f..994daf6c629798332ffe362efa5dd3481a93cdf1 100644 (file)
@@ -403,7 +403,7 @@ u32 ath_calcrxfilter(struct ath_softc *sc)
            (sc->cur_chan->nvifs <= 1) &&
            !(sc->cur_chan->rxfilter & FIF_BCN_PRBRESP_PROMISC))
                rfilt |= ATH9K_RX_FILTER_MYBEACON;
-       else
+       else if (sc->sc_ah->opmode != NL80211_IFTYPE_OCB)
                rfilt |= ATH9K_RX_FILTER_BEACON;
 
        if ((sc->sc_ah->opmode == NL80211_IFTYPE_AP) ||