2
0

316-ath9k-Add-a-function-to-check-for-an-active-GO.patch 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. From: Sujith Manoharan <[email protected]>
  2. Date: Fri, 17 Oct 2014 07:40:21 +0530
  3. Subject: [PATCH] ath9k: Add a function to check for an active GO
  4. Signed-off-by: Sujith Manoharan <[email protected]>
  5. ---
  6. --- a/drivers/net/wireless/ath/ath9k/ath9k.h
  7. +++ b/drivers/net/wireless/ath/ath9k/ath9k.h
  8. @@ -469,6 +469,7 @@ void ath_chanctx_set_next(struct ath_sof
  9. void ath_offchannel_next(struct ath_softc *sc);
  10. void ath_scan_complete(struct ath_softc *sc, bool abort);
  11. void ath_roc_complete(struct ath_softc *sc, bool abort);
  12. +struct ath_chanctx* ath_is_go_chanctx_present(struct ath_softc *sc);
  13. #else
  14. --- a/drivers/net/wireless/ath/ath9k/channel.c
  15. +++ b/drivers/net/wireless/ath/ath9k/channel.c
  16. @@ -146,6 +146,36 @@ void ath_chanctx_set_channel(struct ath_
  17. #ifdef CPTCFG_ATH9K_CHANNEL_CONTEXT
  18. +/*************/
  19. +/* Utilities */
  20. +/*************/
  21. +
  22. +struct ath_chanctx* ath_is_go_chanctx_present(struct ath_softc *sc)
  23. +{
  24. + struct ath_chanctx *ctx;
  25. + struct ath_vif *avp;
  26. + struct ieee80211_vif *vif;
  27. +
  28. + spin_lock_bh(&sc->chan_lock);
  29. +
  30. + ath_for_each_chanctx(sc, ctx) {
  31. + if (!ctx->active)
  32. + continue;
  33. +
  34. + list_for_each_entry(avp, &ctx->vifs, list) {
  35. + vif = avp->vif;
  36. +
  37. + if (ieee80211_vif_type_p2p(vif) == NL80211_IFTYPE_P2P_GO) {
  38. + spin_unlock_bh(&sc->chan_lock);
  39. + return ctx;
  40. + }
  41. + }
  42. + }
  43. +
  44. + spin_unlock_bh(&sc->chan_lock);
  45. + return NULL;
  46. +}
  47. +
  48. /**********************************************************/
  49. /* Functions to handle the channel context state machine. */
  50. /**********************************************************/