Merge ath-next from ath.git
[cascardo/linux.git] / drivers / net / wireless / ath / ath9k / main.c
index cfd45cb..56abb9d 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)
@@ -1459,13 +1464,18 @@ static void ath9k_configure_filter(struct ieee80211_hw *hw,
                                   u64 multicast)
 {
        struct ath_softc *sc = hw->priv;
+       struct ath_chanctx *ctx;
        u32 rfilt;
 
        changed_flags &= SUPPORTED_FILTERS;
        *total_flags &= SUPPORTED_FILTERS;
 
        spin_lock_bh(&sc->chan_lock);
-       sc->cur_chan->rxfilter = *total_flags;
+       ath_for_each_chanctx(sc, ctx)
+               ctx->rxfilter = *total_flags;
+#ifdef CONFIG_ATH9K_CHANNEL_CONTEXT
+       sc->offchannel.chan.rxfilter = *total_flags;
+#endif
        spin_unlock_bh(&sc->chan_lock);
 
        ath9k_ps_wakeup(sc);
@@ -1755,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);
@@ -2246,7 +2257,7 @@ static void ath9k_cancel_pending_offchannel(struct ath_softc *sc)
 
                del_timer_sync(&sc->offchannel.timer);
                if (sc->offchannel.state >= ATH_OFFCHANNEL_ROC_START)
-                       ath_roc_complete(sc, true);
+                       ath_roc_complete(sc, ATH_ROC_COMPLETE_ABORT);
        }
 
        if (test_bit(ATH_OP_SCANNING, &common->op_flags)) {
@@ -2355,7 +2366,7 @@ static int ath9k_cancel_remain_on_channel(struct ieee80211_hw *hw)
 
        if (sc->offchannel.roc_vif) {
                if (sc->offchannel.state >= ATH_OFFCHANNEL_ROC_START)
-                       ath_roc_complete(sc, true);
+                       ath_roc_complete(sc, ATH_ROC_COMPLETE_CANCEL);
        }
 
        mutex_unlock(&sc->mutex);