1 From: Sujith Manoharan <c_manoha@qca.qualcomm.com>
2 Date: Fri, 17 Oct 2014 07:40:21 +0530
3 Subject: [PATCH] ath9k: Add a function to check for an active GO
5 Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
8 --- a/drivers/net/wireless/ath/ath9k/ath9k.h
9 +++ b/drivers/net/wireless/ath/ath9k/ath9k.h
10 @@ -469,6 +469,7 @@ void ath_chanctx_set_next(struct ath_sof
11 void ath_offchannel_next(struct ath_softc *sc);
12 void ath_scan_complete(struct ath_softc *sc, bool abort);
13 void ath_roc_complete(struct ath_softc *sc, bool abort);
14 +struct ath_chanctx* ath_is_go_chanctx_present(struct ath_softc *sc);
18 --- a/drivers/net/wireless/ath/ath9k/channel.c
19 +++ b/drivers/net/wireless/ath/ath9k/channel.c
20 @@ -146,6 +146,36 @@ void ath_chanctx_set_channel(struct ath_
22 #ifdef CPTCFG_ATH9K_CHANNEL_CONTEXT
28 +struct ath_chanctx* ath_is_go_chanctx_present(struct ath_softc *sc)
30 + struct ath_chanctx *ctx;
31 + struct ath_vif *avp;
32 + struct ieee80211_vif *vif;
34 + spin_lock_bh(&sc->chan_lock);
36 + ath_for_each_chanctx(sc, ctx) {
40 + list_for_each_entry(avp, &ctx->vifs, list) {
43 + if (ieee80211_vif_type_p2p(vif) == NL80211_IFTYPE_P2P_GO) {
44 + spin_unlock_bh(&sc->chan_lock);
50 + spin_unlock_bh(&sc->chan_lock);
54 /**********************************************************/
55 /* Functions to handle the channel context state machine. */
56 /**********************************************************/