aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex
diff options
context:
space:
mode:
authorAvinash Patil <patila@marvell.com>2015-01-28 05:24:23 -0500
committerKalle Valo <kvalo@codeaurora.org>2015-01-29 03:22:06 -0500
commit3b57c1a713a9dd3b8da74b6df9f16ce1f8f9144b (patch)
treeed463dab22332327ab464b5b4370435a5df832f2 /drivers/net/wireless/mwifiex
parent0a694d68651b16b307d5ad64acac90d604146bcc (diff)
mwifiex: handle radar detect event from FW
This patch adds support for radar_detected event from FW. Driver in turn would stop netdev queues to stop TX traffic and issue RADAR_DETECT event to cfg80211. Signed-off-by: Avinash Patil <patila@marvell.com> Signed-off-by: Qingshui Gao <gaoqs@marvell.com> Signed-off-by: Cathy Luo <cluo@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/mwifiex')
-rw-r--r--drivers/net/wireless/mwifiex/11h.c24
-rw-r--r--drivers/net/wireless/mwifiex/fw.h20
-rw-r--r--drivers/net/wireless/mwifiex/main.h2
-rw-r--r--drivers/net/wireless/mwifiex/sta_event.c5
-rw-r--r--drivers/net/wireless/mwifiex/uap_event.c4
5 files changed, 55 insertions, 0 deletions
diff --git a/drivers/net/wireless/mwifiex/11h.c b/drivers/net/wireless/mwifiex/11h.c
index e44cac72712e..08c12aece9ae 100644
--- a/drivers/net/wireless/mwifiex/11h.c
+++ b/drivers/net/wireless/mwifiex/11h.c
@@ -216,3 +216,27 @@ int mwifiex_11h_handle_chanrpt_ready(struct mwifiex_private *priv,
216 216
217 return 0; 217 return 0;
218} 218}
219
220/* Handler for radar detected event from FW.*/
221int mwifiex_11h_handle_radar_detected(struct mwifiex_private *priv,
222 struct sk_buff *skb)
223{
224 struct mwifiex_radar_det_event *rdr_event;
225
226 rdr_event = (void *)(skb->data + sizeof(u32));
227
228 if (le32_to_cpu(rdr_event->passed)) {
229 dev_notice(priv->adapter->dev,
230 "radar detected; indicating kernel\n");
231 cfg80211_radar_event(priv->adapter->wiphy, &priv->dfs_chandef,
232 GFP_KERNEL);
233 dev_dbg(priv->adapter->dev, "regdomain: %d\n",
234 rdr_event->reg_domain);
235 dev_dbg(priv->adapter->dev, "radar detection type: %d\n",
236 rdr_event->det_type);
237 } else {
238 dev_dbg(priv->adapter->dev, "false radar detection event!\n");
239 }
240
241 return 0;
242}
diff --git a/drivers/net/wireless/mwifiex/fw.h b/drivers/net/wireless/mwifiex/fw.h
index 324ef298bea6..6d433227e273 100644
--- a/drivers/net/wireless/mwifiex/fw.h
+++ b/drivers/net/wireless/mwifiex/fw.h
@@ -495,6 +495,7 @@ enum P2P_MODES {
495#define EVENT_HOSTWAKE_STAIE 0x0000004d 495#define EVENT_HOSTWAKE_STAIE 0x0000004d
496#define EVENT_CHANNEL_SWITCH_ANN 0x00000050 496#define EVENT_CHANNEL_SWITCH_ANN 0x00000050
497#define EVENT_TDLS_GENERIC_EVENT 0x00000052 497#define EVENT_TDLS_GENERIC_EVENT 0x00000052
498#define EVENT_RADAR_DETECTED 0x00000053
498#define EVENT_CHANNEL_REPORT_RDY 0x00000054 499#define EVENT_CHANNEL_REPORT_RDY 0x00000054
499#define EVENT_EXT_SCAN_REPORT 0x00000058 500#define EVENT_EXT_SCAN_REPORT 0x00000058
500#define EVENT_REMAIN_ON_CHAN_EXPIRED 0x0000005f 501#define EVENT_REMAIN_ON_CHAN_EXPIRED 0x0000005f
@@ -1813,6 +1814,25 @@ struct mwifiex_ie_types_rssi_threshold {
1813 u8 evt_freq; 1814 u8 evt_freq;
1814} __packed; 1815} __packed;
1815 1816
1817#define MWIFIEX_DFS_REC_HDR_LEN 8
1818#define MWIFIEX_DFS_REC_HDR_NUM 10
1819#define MWIFIEX_BIN_COUNTER_LEN 7
1820
1821struct mwifiex_radar_det_event {
1822 __le32 detect_count;
1823 u8 reg_domain; /*1=fcc, 2=etsi, 3=mic*/
1824 u8 det_type; /*0=none, 1=pw(chirp), 2=pri(radar)*/
1825 __le16 pw_chirp_type;
1826 u8 pw_chirp_idx;
1827 u8 pw_value;
1828 u8 pri_radar_type;
1829 u8 pri_bincnt;
1830 u8 bin_counter[MWIFIEX_BIN_COUNTER_LEN];
1831 u8 num_dfs_records;
1832 u8 dfs_record_hdr[MWIFIEX_DFS_REC_HDR_NUM][MWIFIEX_DFS_REC_HDR_LEN];
1833 __le32 passed;
1834} __packed;
1835
1816struct meas_rpt_map { 1836struct meas_rpt_map {
1817 u8 rssi:3; 1837 u8 rssi:3;
1818 u8 unmeasured:1; 1838 u8 unmeasured:1;
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
index 281a30a8d857..ad9d679c3eed 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -1395,6 +1395,8 @@ mwifiex_clone_skb_for_tx_status(struct mwifiex_private *priv,
1395 struct sk_buff *skb, u8 flag, u64 *cookie); 1395 struct sk_buff *skb, u8 flag, u64 *cookie);
1396void mwifiex_dfs_cac_work_queue(struct work_struct *work); 1396void mwifiex_dfs_cac_work_queue(struct work_struct *work);
1397void mwifiex_abort_cac(struct mwifiex_private *priv); 1397void mwifiex_abort_cac(struct mwifiex_private *priv);
1398int mwifiex_11h_handle_radar_detected(struct mwifiex_private *priv,
1399 struct sk_buff *skb);
1398 1400
1399void mwifiex_hist_data_set(struct mwifiex_private *priv, u8 rx_rate, s8 snr, 1401void mwifiex_hist_data_set(struct mwifiex_private *priv, u8 rx_rate, s8 snr,
1400 s8 nflr); 1402 s8 nflr);
diff --git a/drivers/net/wireless/mwifiex/sta_event.c b/drivers/net/wireless/mwifiex/sta_event.c
index ad5c5e0deac0..c03b82c2fe1c 100644
--- a/drivers/net/wireless/mwifiex/sta_event.c
+++ b/drivers/net/wireless/mwifiex/sta_event.c
@@ -521,6 +521,11 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
521 ret = mwifiex_11h_handle_chanrpt_ready(priv, 521 ret = mwifiex_11h_handle_chanrpt_ready(priv,
522 adapter->event_skb); 522 adapter->event_skb);
523 break; 523 break;
524 case EVENT_RADAR_DETECTED:
525 dev_dbg(adapter->dev, "event: Radar detected\n");
526 ret = mwifiex_11h_handle_radar_detected(priv,
527 adapter->event_skb);
528 break;
524 default: 529 default:
525 dev_dbg(adapter->dev, "event: unknown event id: %#x\n", 530 dev_dbg(adapter->dev, "event: unknown event id: %#x\n",
526 eventcause); 531 eventcause);
diff --git a/drivers/net/wireless/mwifiex/uap_event.c b/drivers/net/wireless/mwifiex/uap_event.c
index e0bdf6a79916..f4794cdc36d2 100644
--- a/drivers/net/wireless/mwifiex/uap_event.c
+++ b/drivers/net/wireless/mwifiex/uap_event.c
@@ -221,6 +221,10 @@ int mwifiex_process_uap_event(struct mwifiex_private *priv)
221 dev_dbg(adapter->dev, "event: Channel Report\n"); 221 dev_dbg(adapter->dev, "event: Channel Report\n");
222 mwifiex_11h_handle_chanrpt_ready(priv, adapter->event_skb); 222 mwifiex_11h_handle_chanrpt_ready(priv, adapter->event_skb);
223 break; 223 break;
224 case EVENT_RADAR_DETECTED:
225 dev_dbg(adapter->dev, "event: Radar detected\n");
226 mwifiex_11h_handle_radar_detected(priv, adapter->event_skb);
227 break;
224 default: 228 default:
225 dev_dbg(adapter->dev, "event: unknown event id: %#x\n", 229 dev_dbg(adapter->dev, "event: unknown event id: %#x\n",
226 eventcause); 230 eventcause);