From: Victor Goldenshtein <victorg@ti.com>
To: <linux-wireless@vger.kernel.org>
Cc: <kgiori@qca.qualcomm.com>, <mcgrof@frijolero.org>,
<zefir.kurtisi@neratec.com>, <adrian.chadd@gmail.com>, <j@w1.fi>,
<johannes@sipsolutions.net>, <coelho@ti.com>, <assaf@ti.com>,
<yoni.divinsky@ti.com>, <igalc@ti.com>, <adrian@freebsd.org>,
<nbd@nbd.name>, <simon.wunderlich@s2003.tu-chemnitz.de>
Subject: [PATCH 4/7] mac80211: add ability to enable TX on op-channel
Date: Mon, 18 Jun 2012 17:46:35 +0300 [thread overview]
Message-ID: <1340030798-28992-5-git-send-email-victorg@ti.com> (raw)
In-Reply-To: <1340030798-28992-1-git-send-email-victorg@ti.com>
Prior starting tx on DFS channels, the DFS master
device shall perform a Channel Availability Check
to ensure that there is no radar interference on
those channels. Once CAC done, the tx can be
enabled with ieee80211_dfs_en_tx().
Signed-off-by: Victor Goldenshtein <victorg@ti.com>
---
include/net/mac80211.h | 4 ++++
net/mac80211/cfg.c | 15 +++++++++++++++
net/mac80211/driver-ops.h | 14 ++++++++++++++
net/mac80211/driver-trace.h | 6 ++++++
4 files changed, 39 insertions(+), 0 deletions(-)
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index a2222cf..82e5ee7 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -2249,6 +2249,8 @@ enum ieee80211_rate_control_changed {
* @start_radar_detection: Start radar detection on current operational
* channel, once started it will continuously monitor for radars as long
* as the channel active.
+ * @dfs_en_tx: Once channel pass the DFS initial channel availability check,
+ * initiate the tx on the channel with this command.
*
*/
struct ieee80211_ops {
@@ -2392,6 +2394,8 @@ struct ieee80211_ops {
int (*start_radar_detection)(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct ieee80211_channel *chan);
+ int (*dfs_en_tx)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
+ struct ieee80211_channel *chan);
};
/**
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 541b274..a48d055 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2226,6 +2226,20 @@ static int ieee80211_start_radar_detection(struct wiphy *wiphy,
return ret;
}
+static int ieee80211_dfs_en_tx(struct wiphy *wiphy, struct net_device *dev,
+ struct ieee80211_channel *chan)
+{
+ struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+ struct ieee80211_local *local = sdata->local;
+ int ret = -ENOENT;
+
+ if (!local->ops->dfs_en_tx)
+ return -EOPNOTSUPP;
+
+ ret = drv_dfs_en_tx(local, sdata, chan);
+ return ret;
+}
+
static enum work_done_result
ieee80211_offchan_tx_done(struct ieee80211_work *wk, struct sk_buff *skb)
{
@@ -2995,4 +3009,5 @@ struct cfg80211_ops mac80211_config_ops = {
.get_et_stats = ieee80211_get_et_stats,
.get_et_strings = ieee80211_get_et_strings,
.start_radar_detection = ieee80211_start_radar_detection,
+ .dfs_en_tx = ieee80211_dfs_en_tx,
};
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index 57185df..f49b76b 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -343,6 +343,20 @@ static inline int drv_start_radar_detection(struct ieee80211_local *local,
return ret;
}
+static inline int drv_dfs_en_tx(struct ieee80211_local *local,
+ struct ieee80211_sub_if_data *sdata,
+ struct ieee80211_channel *chan)
+{
+ int ret;
+
+ might_sleep();
+
+ trace_drv_dfs_en_tx(local, sdata);
+ ret = local->ops->dfs_en_tx(&local->hw, &sdata->vif, chan);
+ trace_drv_return_int(local, ret);
+ return ret;
+}
+
static inline int
drv_sched_scan_start(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
diff --git a/net/mac80211/driver-trace.h b/net/mac80211/driver-trace.h
index 4112aa3..6df02c4 100644
--- a/net/mac80211/driver-trace.h
+++ b/net/mac80211/driver-trace.h
@@ -490,6 +490,12 @@ DEFINE_EVENT(local_sdata_evt, drv_start_radar_detection,
TP_ARGS(local, sdata)
);
+DEFINE_EVENT(local_sdata_evt, drv_dfs_en_tx,
+ TP_PROTO(struct ieee80211_local *local,
+ struct ieee80211_sub_if_data *sdata),
+ TP_ARGS(local, sdata)
+);
+
DEFINE_EVENT(local_sdata_evt, drv_sched_scan_start,
TP_PROTO(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata),
--
1.7.5.4
next prev parent reply other threads:[~2012-06-18 14:50 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-18 14:46 [PATCH 0/7] nl/cfg/mac80211: add DFS master ability Victor Goldenshtein
2012-06-18 14:46 ` [PATCH 1/7] nl80211/cfg80211: add radar detection command/event Victor Goldenshtein
2012-06-18 14:46 ` [PATCH 2/7] mac80211: " Victor Goldenshtein
2012-06-18 14:46 ` [PATCH 3/7] nl80211/cfg80211: add ability to enable TX on op-channel Victor Goldenshtein
2012-06-18 14:46 ` Victor Goldenshtein [this message]
2012-06-18 14:46 ` [PATCH 5/7] nl80211/cfg80211: add ap channel switch command/event Victor Goldenshtein
2012-06-18 14:46 ` [PATCH 6/7] mac80211: " Victor Goldenshtein
2012-06-18 14:46 ` [PATCH 7/7] mac80211: add DFS support to monitor interface Victor Goldenshtein
2012-06-19 6:44 ` Kalle Valo
2012-06-19 6:57 ` Luciano Coelho
2012-06-20 6:09 ` Kalle Valo
2012-06-19 8:42 ` Goldenshtein, Victor
2012-06-18 14:59 ` [PATCH 0/7] nl/cfg/mac80211: add DFS master ability Johannes Berg
2012-06-18 15:02 ` Goldenshtein, Victor
2012-06-18 15:04 ` Johannes Berg
2012-06-20 10:34 ` Zefir Kurtisi
2012-06-20 10:47 ` Goldenshtein, Victor
2012-06-20 10:49 ` Johannes Berg
2012-06-20 11:02 ` Goldenshtein, Victor
2012-06-20 12:03 ` Luciano Coelho
2012-06-20 12:07 ` Luciano Coelho
2012-06-20 16:44 ` Goldenshtein, Victor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1340030798-28992-5-git-send-email-victorg@ti.com \
--to=victorg@ti.com \
--cc=adrian.chadd@gmail.com \
--cc=adrian@freebsd.org \
--cc=assaf@ti.com \
--cc=coelho@ti.com \
--cc=igalc@ti.com \
--cc=j@w1.fi \
--cc=johannes@sipsolutions.net \
--cc=kgiori@qca.qualcomm.com \
--cc=linux-wireless@vger.kernel.org \
--cc=mcgrof@frijolero.org \
--cc=nbd@nbd.name \
--cc=simon.wunderlich@s2003.tu-chemnitz.de \
--cc=yoni.divinsky@ti.com \
--cc=zefir.kurtisi@neratec.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).