Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 327931
b: refs/heads/master
c: 327967c
h: refs/heads/master
i:
  327929: 9a3a785
  327927: 36bce89
v: v3
  • Loading branch information
Mohammed Shafi Shajakhan authored and John W. Linville committed Sep 11, 2012
1 parent adaf73b commit 0e79e9d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 48 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1b29ce42e94a93a821959ba5d46ddd4f235a7217
refs/heads/master: 327967cba4492c36ef498a786016295102521c55
57 changes: 10 additions & 47 deletions trunk/drivers/net/wireless/ath/ath9k/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -986,47 +986,21 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
struct ath_softc *sc = hw->priv;
struct ath_hw *ah = sc->sc_ah;
struct ath_common *common = ath9k_hw_common(ah);
int ret = 0;

ath9k_ps_wakeup(sc);
mutex_lock(&sc->mutex);

switch (vif->type) {
case NL80211_IFTYPE_STATION:
case NL80211_IFTYPE_WDS:
case NL80211_IFTYPE_ADHOC:
case NL80211_IFTYPE_AP:
case NL80211_IFTYPE_MESH_POINT:
break;
default:
ath_err(common, "Interface type %d not yet supported\n",
vif->type);
ret = -EOPNOTSUPP;
goto out;
}

if (ath9k_uses_beacons(vif->type)) {
if (sc->nbcnvifs >= ATH_BCBUF) {
ath_err(common, "Not enough beacon buffers when adding"
" new interface of type: %i\n",
vif->type);
ret = -ENOBUFS;
goto out;
}
}

ath_dbg(common, CONFIG, "Attach a VIF of type: %d\n", vif->type);

sc->nvifs++;

ath9k_ps_wakeup(sc);
ath9k_calculate_summary_state(hw, vif);
ath9k_ps_restore(sc);

if (ath9k_uses_beacons(vif->type))
ath9k_beacon_assign_slot(sc, vif);

out:
mutex_unlock(&sc->mutex);
ath9k_ps_restore(sc);
return ret;
return 0;
}

static int ath9k_change_interface(struct ieee80211_hw *hw,
Expand All @@ -1036,36 +1010,25 @@ static int ath9k_change_interface(struct ieee80211_hw *hw,
{
struct ath_softc *sc = hw->priv;
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
int ret = 0;

ath_dbg(common, CONFIG, "Change Interface\n");

mutex_lock(&sc->mutex);
ath9k_ps_wakeup(sc);

if (ath9k_uses_beacons(new_type) &&
!ath9k_uses_beacons(vif->type)) {
if (sc->nbcnvifs >= ATH_BCBUF) {
ath_err(common, "No beacon slot available\n");
ret = -ENOBUFS;
goto out;
}
}

if (ath9k_uses_beacons(vif->type))
ath9k_beacon_remove_slot(sc, vif);

vif->type = new_type;
vif->p2p = p2p;

ath9k_ps_wakeup(sc);
ath9k_calculate_summary_state(hw, vif);
ath9k_ps_restore(sc);

if (ath9k_uses_beacons(vif->type))
ath9k_beacon_assign_slot(sc, vif);

out:
ath9k_ps_restore(sc);
mutex_unlock(&sc->mutex);
return ret;
return 0;
}

static void ath9k_remove_interface(struct ieee80211_hw *hw,
Expand All @@ -1076,18 +1039,18 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw,

ath_dbg(common, CONFIG, "Detach Interface\n");

ath9k_ps_wakeup(sc);
mutex_lock(&sc->mutex);

sc->nvifs--;

if (ath9k_uses_beacons(vif->type))
ath9k_beacon_remove_slot(sc, vif);

ath9k_ps_wakeup(sc);
ath9k_calculate_summary_state(hw, NULL);
ath9k_ps_restore(sc);

mutex_unlock(&sc->mutex);
ath9k_ps_restore(sc);
}

static void ath9k_enable_ps(struct ath_softc *sc)
Expand Down

0 comments on commit 0e79e9d

Please sign in to comment.