Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 351753
b: refs/heads/master
c: 8a61af6
h: refs/heads/master
i:
  351751: 06837fd
v: v3
  • Loading branch information
Johannes Berg committed Jan 3, 2013
1 parent 35553dc commit 5ce6b8b
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 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: 529ba6e9313dbe60dab7e72c6fdf647a012e9f5b
refs/heads/master: 8a61af65c6d03781015315dbc43d0942a5b31db9
5 changes: 5 additions & 0 deletions trunk/include/net/mac80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -3754,6 +3754,11 @@ void ieee80211_iter_keys(struct ieee80211_hw *hw,
* The iterator will not find a context that's being added (during
* the driver callback to add it) but will find it while it's being
* removed.
*
* Note that during hardware restart, all contexts that existed
* before the restart are considered already present so will be
* found while iterating, whether they've been re-added already
* or not.
*/
void ieee80211_iter_chan_contexts_atomic(
struct ieee80211_hw *hw,
Expand Down
3 changes: 2 additions & 1 deletion trunk/net/mac80211/chan.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,8 @@ void ieee80211_iter_chan_contexts_atomic(

rcu_read_lock();
list_for_each_entry_rcu(ctx, &local->chanctx_list, list)
iter(hw, &ctx->conf, iter_data);
if (ctx->driver_present)
iter(hw, &ctx->conf, iter_data);
rcu_read_unlock();
}
EXPORT_SYMBOL_GPL(ieee80211_iter_chan_contexts_atomic);
15 changes: 12 additions & 3 deletions trunk/net/mac80211/driver-ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,8 @@ static inline int drv_add_chanctx(struct ieee80211_local *local,
if (local->ops->add_chanctx)
ret = local->ops->add_chanctx(&local->hw, &ctx->conf);
trace_drv_return_int(local, ret);
if (!ret)
ctx->driver_present = true;

return ret;
}
Expand All @@ -924,15 +926,18 @@ static inline void drv_remove_chanctx(struct ieee80211_local *local,
if (local->ops->remove_chanctx)
local->ops->remove_chanctx(&local->hw, &ctx->conf);
trace_drv_return_void(local);
ctx->driver_present = false;
}

static inline void drv_change_chanctx(struct ieee80211_local *local,
struct ieee80211_chanctx *ctx,
u32 changed)
{
trace_drv_change_chanctx(local, ctx, changed);
if (local->ops->change_chanctx)
if (local->ops->change_chanctx) {
WARN_ON_ONCE(!ctx->driver_present);
local->ops->change_chanctx(&local->hw, &ctx->conf, changed);
}
trace_drv_return_void(local);
}

Expand All @@ -945,10 +950,12 @@ static inline int drv_assign_vif_chanctx(struct ieee80211_local *local,
check_sdata_in_driver(sdata);

trace_drv_assign_vif_chanctx(local, sdata, ctx);
if (local->ops->assign_vif_chanctx)
if (local->ops->assign_vif_chanctx) {
WARN_ON_ONCE(!ctx->driver_present);
ret = local->ops->assign_vif_chanctx(&local->hw,
&sdata->vif,
&ctx->conf);
}
trace_drv_return_int(local, ret);

return ret;
Expand All @@ -961,10 +968,12 @@ static inline void drv_unassign_vif_chanctx(struct ieee80211_local *local,
check_sdata_in_driver(sdata);

trace_drv_unassign_vif_chanctx(local, sdata, ctx);
if (local->ops->unassign_vif_chanctx)
if (local->ops->unassign_vif_chanctx) {
WARN_ON_ONCE(!ctx->driver_present);
local->ops->unassign_vif_chanctx(&local->hw,
&sdata->vif,
&ctx->conf);
}
trace_drv_return_void(local);
}

Expand Down
1 change: 1 addition & 0 deletions trunk/net/mac80211/ieee80211_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,7 @@ struct ieee80211_chanctx {

enum ieee80211_chanctx_mode mode;
int refcount;
bool driver_present;

struct ieee80211_chanctx_conf conf;
};
Expand Down

0 comments on commit 5ce6b8b

Please sign in to comment.