diff options
author | David S. Miller <davem@davemloft.net> | 2015-11-03 19:30:57 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-11-03 19:30:57 +0300 |
commit | b3047a77cba193658ebf534ee4abab9cb5446842 (patch) | |
tree | 3d631c99faa0520c077046988fc40c9961546665 /net/mac80211/driver-ops.c | |
parent | 3d131f070948e4ad93189cb379b3a45d53dce71b (diff) | |
parent | e4208427247ecc7306c8f71ab3c5c08e08cf9fda (diff) | |
download | linux-b3047a77cba193658ebf534ee4abab9cb5446842.tar.xz |
Merge tag 'mac80211-for-davem-2015-11-03' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211
Johannes Berg says:
====================
Another set of fixes:
* remove a warning on a check that can trigger without any
errors having happened (Andrei)
* correctly handle deauth request while in the process of
associating (Andrei)
* fix TDLS HT operation (Arik)
* allow changing AID/listen interval during client setup (Ayala)
* be more forgiving with WMM parameters to get HT/VHT in case of
broken APs with bad WMM settings (Emmanuel, myself)
* a number of other fixes (some in documentation)
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mac80211/driver-ops.c')
-rw-r--r-- | net/mac80211/driver-ops.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/net/mac80211/driver-ops.c b/net/mac80211/driver-ops.c index a1d54318f16c..ca1fe5576103 100644 --- a/net/mac80211/driver-ops.c +++ b/net/mac80211/driver-ops.c @@ -1,4 +1,6 @@ /* + * Copyright 2015 Intel Deutschland GmbH + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. @@ -8,6 +10,48 @@ #include "trace.h" #include "driver-ops.h" +int drv_start(struct ieee80211_local *local) +{ + int ret; + + might_sleep(); + + if (WARN_ON(local->started)) + return -EALREADY; + + trace_drv_start(local); + local->started = true; + /* allow rx frames */ + smp_mb(); + ret = local->ops->start(&local->hw); + trace_drv_return_int(local, ret); + + if (ret) + local->started = false; + + return ret; +} + +void drv_stop(struct ieee80211_local *local) +{ + might_sleep(); + + if (WARN_ON(!local->started)) + return; + + trace_drv_stop(local); + local->ops->stop(&local->hw); + trace_drv_return_void(local); + + /* sync away all work on the tasklet before clearing started */ + tasklet_disable(&local->tasklet); + tasklet_enable(&local->tasklet); + + barrier(); + + local->started = false; +} + int drv_add_interface(struct ieee80211_local *local, struct ieee80211_sub_if_data *sdata) { @@ -192,6 +236,8 @@ int drv_switch_vif_chanctx(struct ieee80211_local *local, int ret = 0; int i; + might_sleep(); + if (!local->ops->switch_vif_chanctx) return -EOPNOTSUPP; |