Commit 862a336c authored by Jan Kaisrlik's avatar Jan Kaisrlik Committed by Kalle Valo

ath9k: Add support for OCB mode

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: default avatarJan Kaisrlik <kaisrja1@fel.cvut.cz>
Cc: Michal Sojka <sojkam1@fel.cvut.cz>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent c452d944
...@@ -635,6 +635,7 @@ struct ath9k_vif_iter_data { ...@@ -635,6 +635,7 @@ struct ath9k_vif_iter_data {
int nstations; /* number of station vifs */ int nstations; /* number of station vifs */
int nwds; /* number of WDS vifs */ int nwds; /* number of WDS vifs */
int nadhocs; /* number of adhoc vifs */ int nadhocs; /* number of adhoc vifs */
int nocbs; /* number of OCB vifs */
struct ieee80211_vif *primary_sta; struct ieee80211_vif *primary_sta;
}; };
......
...@@ -741,8 +741,8 @@ static int read_file_misc(struct seq_file *file, void *data) ...@@ -741,8 +741,8 @@ static int read_file_misc(struct seq_file *file, void *data)
i++, (int)(ctx->assigned), iter_data.naps, i++, (int)(ctx->assigned), iter_data.naps,
iter_data.nstations, iter_data.nstations,
iter_data.nmeshes, iter_data.nwds); iter_data.nmeshes, iter_data.nwds);
seq_printf(file, " ADHOC: %i TOTAL: %hi BEACON-VIF: %hi\n", seq_printf(file, " ADHOC: %i OCB: %i TOTAL: %hi BEACON-VIF: %hi\n",
iter_data.nadhocs, sc->cur_chan->nvifs, iter_data.nadhocs, iter_data.nocbs, sc->cur_chan->nvifs,
sc->nbcnvifs); sc->nbcnvifs);
} }
......
...@@ -740,7 +740,8 @@ static void ath9k_set_hw_capab(struct ath9k_htc_priv *priv, ...@@ -740,7 +740,8 @@ static void ath9k_set_hw_capab(struct ath9k_htc_priv *priv,
BIT(NL80211_IFTYPE_AP) | BIT(NL80211_IFTYPE_AP) |
BIT(NL80211_IFTYPE_P2P_GO) | BIT(NL80211_IFTYPE_P2P_GO) |
BIT(NL80211_IFTYPE_P2P_CLIENT) | 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->iface_combinations = &if_comb;
hw->wiphy->n_iface_combinations = 1; hw->wiphy->n_iface_combinations = 1;
......
...@@ -1241,6 +1241,7 @@ static void ath9k_hw_set_operating_mode(struct ath_hw *ah, int opmode) ...@@ -1241,6 +1241,7 @@ static void ath9k_hw_set_operating_mode(struct ath_hw *ah, int opmode)
break; break;
} }
/* fall through */ /* fall through */
case NL80211_IFTYPE_OCB:
case NL80211_IFTYPE_MESH_POINT: case NL80211_IFTYPE_MESH_POINT:
case NL80211_IFTYPE_AP: case NL80211_IFTYPE_AP:
set |= AR_STA_ID1_STA_AP; set |= AR_STA_ID1_STA_AP;
......
...@@ -855,7 +855,8 @@ static void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw) ...@@ -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_STATION) |
BIT(NL80211_IFTYPE_ADHOC) | BIT(NL80211_IFTYPE_ADHOC) |
BIT(NL80211_IFTYPE_MESH_POINT) | BIT(NL80211_IFTYPE_MESH_POINT) |
BIT(NL80211_IFTYPE_WDS); BIT(NL80211_IFTYPE_WDS) |
BIT(NL80211_IFTYPE_OCB);
if (ath9k_is_chanctx_enabled()) if (ath9k_is_chanctx_enabled())
hw->wiphy->interface_modes |= hw->wiphy->interface_modes |=
......
...@@ -938,6 +938,9 @@ static void ath9k_vif_iter(struct ath9k_vif_iter_data *iter_data, ...@@ -938,6 +938,9 @@ static void ath9k_vif_iter(struct ath9k_vif_iter_data *iter_data,
if (avp->assoc && !iter_data->primary_sta) if (avp->assoc && !iter_data->primary_sta)
iter_data->primary_sta = vif; iter_data->primary_sta = vif;
break; break;
case NL80211_IFTYPE_OCB:
iter_data->nocbs++;
break;
case NL80211_IFTYPE_ADHOC: case NL80211_IFTYPE_ADHOC:
iter_data->nadhocs++; iter_data->nadhocs++;
if (vif->bss_conf.enable_beacon) if (vif->bss_conf.enable_beacon)
...@@ -1111,6 +1114,8 @@ void ath9k_calculate_summary_state(struct ath_softc *sc, ...@@ -1111,6 +1114,8 @@ void ath9k_calculate_summary_state(struct ath_softc *sc,
if (iter_data.nmeshes) if (iter_data.nmeshes)
ah->opmode = NL80211_IFTYPE_MESH_POINT; ah->opmode = NL80211_IFTYPE_MESH_POINT;
else if (iter_data.nocbs)
ah->opmode = NL80211_IFTYPE_OCB;
else if (iter_data.nwds) else if (iter_data.nwds)
ah->opmode = NL80211_IFTYPE_AP; ah->opmode = NL80211_IFTYPE_AP;
else if (iter_data.nadhocs) else if (iter_data.nadhocs)
...@@ -1760,7 +1765,8 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw, ...@@ -1760,7 +1765,8 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw,
ath9k_calculate_summary_state(sc, avp->chanctx); 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); memcpy(common->curbssid, bss_conf->bssid, ETH_ALEN);
common->curaid = bss_conf->aid; common->curaid = bss_conf->aid;
ath9k_hw_write_associd(sc->sc_ah); ath9k_hw_write_associd(sc->sc_ah);
......
...@@ -403,7 +403,7 @@ u32 ath_calcrxfilter(struct ath_softc *sc) ...@@ -403,7 +403,7 @@ u32 ath_calcrxfilter(struct ath_softc *sc)
(sc->cur_chan->nvifs <= 1) && (sc->cur_chan->nvifs <= 1) &&
!(sc->cur_chan->rxfilter & FIF_BCN_PRBRESP_PROMISC)) !(sc->cur_chan->rxfilter & FIF_BCN_PRBRESP_PROMISC))
rfilt |= ATH9K_RX_FILTER_MYBEACON; rfilt |= ATH9K_RX_FILTER_MYBEACON;
else else if (sc->sc_ah->opmode != NL80211_IFTYPE_OCB)
rfilt |= ATH9K_RX_FILTER_BEACON; rfilt |= ATH9K_RX_FILTER_BEACON;
if ((sc->sc_ah->opmode == NL80211_IFTYPE_AP) || if ((sc->sc_ah->opmode == NL80211_IFTYPE_AP) ||
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment