提交 769f07d8 编写于 作者: A Andrzej Zaborowski 提交者: Johannes Berg

mac80211: Pass new RSSI level in CQM RSSI notification

Extend ieee80211_cqm_rssi_notify with a rssi_level parameter so that
this information can be passed to netlink clients in the next patch, if
available.  Most drivers will have this value at hand.  wl1251 receives
events from the firmware that only tell it whether latest measurement
is above or below threshold so we don't pass any value at this time
(parameter is 0).
Signed-off-by: NAndrew Zaborowski <andrew.zaborowski@intel.com>
Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
上级 aad1e812
...@@ -571,6 +571,7 @@ static void iwl_mvm_stat_iterator(void *_data, u8 *mac, ...@@ -571,6 +571,7 @@ static void iwl_mvm_stat_iterator(void *_data, u8 *mac,
ieee80211_cqm_rssi_notify( ieee80211_cqm_rssi_notify(
vif, vif,
NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW, NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW,
sig,
GFP_KERNEL); GFP_KERNEL);
} else if (sig > thold && } else if (sig > thold &&
(last_event == 0 || sig > last_event + hyst)) { (last_event == 0 || sig > last_event + hyst)) {
...@@ -580,6 +581,7 @@ static void iwl_mvm_stat_iterator(void *_data, u8 *mac, ...@@ -580,6 +581,7 @@ static void iwl_mvm_stat_iterator(void *_data, u8 *mac,
ieee80211_cqm_rssi_notify( ieee80211_cqm_rssi_notify(
vif, vif,
NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH, NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH,
sig,
GFP_KERNEL); GFP_KERNEL);
} }
} }
......
...@@ -877,7 +877,7 @@ static void rsi_perform_cqm(struct rsi_common *common, ...@@ -877,7 +877,7 @@ static void rsi_perform_cqm(struct rsi_common *common,
common->cqm_info.last_cqm_event_rssi = rssi; common->cqm_info.last_cqm_event_rssi = rssi;
rsi_dbg(INFO_ZONE, "CQM: Notifying event: %d\n", event); rsi_dbg(INFO_ZONE, "CQM: Notifying event: %d\n", event);
ieee80211_cqm_rssi_notify(adapter->vifs[0], event, GFP_KERNEL); ieee80211_cqm_rssi_notify(adapter->vifs[0], event, rssi, GFP_KERNEL);
return; return;
} }
......
...@@ -1019,7 +1019,7 @@ void cw1200_event_handler(struct work_struct *work) ...@@ -1019,7 +1019,7 @@ void cw1200_event_handler(struct work_struct *work)
NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW : NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW :
NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH; NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH;
pr_debug("[CQM] RSSI event: %d.\n", rcpi_rssi); pr_debug("[CQM] RSSI event: %d.\n", rcpi_rssi);
ieee80211_cqm_rssi_notify(priv->vif, cqm_evt, ieee80211_cqm_rssi_notify(priv->vif, cqm_evt, rcpi_rssi,
GFP_KERNEL); GFP_KERNEL);
break; break;
} }
......
...@@ -150,7 +150,7 @@ static int wl1251_event_process(struct wl1251 *wl, struct event_mailbox *mbox) ...@@ -150,7 +150,7 @@ static int wl1251_event_process(struct wl1251 *wl, struct event_mailbox *mbox)
"ROAMING_TRIGGER_LOW_RSSI_EVENT"); "ROAMING_TRIGGER_LOW_RSSI_EVENT");
ieee80211_cqm_rssi_notify(wl->vif, ieee80211_cqm_rssi_notify(wl->vif,
NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW, NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW,
GFP_KERNEL); 0, GFP_KERNEL);
} }
if (vector & ROAMING_TRIGGER_REGAINED_RSSI_EVENT_ID) { if (vector & ROAMING_TRIGGER_REGAINED_RSSI_EVENT_ID) {
...@@ -158,7 +158,7 @@ static int wl1251_event_process(struct wl1251 *wl, struct event_mailbox *mbox) ...@@ -158,7 +158,7 @@ static int wl1251_event_process(struct wl1251 *wl, struct event_mailbox *mbox)
"ROAMING_TRIGGER_REGAINED_RSSI_EVENT"); "ROAMING_TRIGGER_REGAINED_RSSI_EVENT");
ieee80211_cqm_rssi_notify(wl->vif, ieee80211_cqm_rssi_notify(wl->vif,
NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH, NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH,
GFP_KERNEL); 0, GFP_KERNEL);
} }
} }
......
...@@ -129,7 +129,8 @@ void wlcore_event_rssi_trigger(struct wl1271 *wl, s8 *metric_arr) ...@@ -129,7 +129,8 @@ void wlcore_event_rssi_trigger(struct wl1271 *wl, s8 *metric_arr)
vif = wl12xx_wlvif_to_vif(wlvif); vif = wl12xx_wlvif_to_vif(wlvif);
if (event != wlvif->last_rssi_event) if (event != wlvif->last_rssi_event)
ieee80211_cqm_rssi_notify(vif, event, GFP_KERNEL); ieee80211_cqm_rssi_notify(vif, event, metric,
GFP_KERNEL);
wlvif->last_rssi_event = event; wlvif->last_rssi_event = event;
} }
} }
......
...@@ -5278,6 +5278,7 @@ void ieee80211_resume_disconnect(struct ieee80211_vif *vif); ...@@ -5278,6 +5278,7 @@ void ieee80211_resume_disconnect(struct ieee80211_vif *vif);
* *
* @vif: &struct ieee80211_vif pointer from the add_interface callback. * @vif: &struct ieee80211_vif pointer from the add_interface callback.
* @rssi_event: the RSSI trigger event type * @rssi_event: the RSSI trigger event type
* @rssi_level: new RSSI level value or 0 if not available
* @gfp: context flags * @gfp: context flags
* *
* When the %IEEE80211_VIF_SUPPORTS_CQM_RSSI is set, and a connection quality * When the %IEEE80211_VIF_SUPPORTS_CQM_RSSI is set, and a connection quality
...@@ -5286,6 +5287,7 @@ void ieee80211_resume_disconnect(struct ieee80211_vif *vif); ...@@ -5286,6 +5287,7 @@ void ieee80211_resume_disconnect(struct ieee80211_vif *vif);
*/ */
void ieee80211_cqm_rssi_notify(struct ieee80211_vif *vif, void ieee80211_cqm_rssi_notify(struct ieee80211_vif *vif,
enum nl80211_cqm_rssi_threshold_event rssi_event, enum nl80211_cqm_rssi_threshold_event rssi_event,
s32 rssi_level,
gfp_t gfp); gfp_t gfp);
/** /**
......
...@@ -3419,14 +3419,14 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata, ...@@ -3419,14 +3419,14 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
ieee80211_cqm_rssi_notify( ieee80211_cqm_rssi_notify(
&sdata->vif, &sdata->vif,
NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW, NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW,
GFP_KERNEL); sig, GFP_KERNEL);
} else if (sig > thold && } else if (sig > thold &&
(last_event == 0 || sig > last_event + hyst)) { (last_event == 0 || sig > last_event + hyst)) {
ifmgd->last_cqm_event_signal = sig; ifmgd->last_cqm_event_signal = sig;
ieee80211_cqm_rssi_notify( ieee80211_cqm_rssi_notify(
&sdata->vif, &sdata->vif,
NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH, NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH,
GFP_KERNEL); sig, GFP_KERNEL);
} }
} }
...@@ -5041,11 +5041,12 @@ void ieee80211_mgd_stop(struct ieee80211_sub_if_data *sdata) ...@@ -5041,11 +5041,12 @@ void ieee80211_mgd_stop(struct ieee80211_sub_if_data *sdata)
void ieee80211_cqm_rssi_notify(struct ieee80211_vif *vif, void ieee80211_cqm_rssi_notify(struct ieee80211_vif *vif,
enum nl80211_cqm_rssi_threshold_event rssi_event, enum nl80211_cqm_rssi_threshold_event rssi_event,
s32 rssi_level,
gfp_t gfp) gfp_t gfp)
{ {
struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
trace_api_cqm_rssi_notify(sdata, rssi_event); trace_api_cqm_rssi_notify(sdata, rssi_event, rssi_level);
cfg80211_cqm_rssi_notify(sdata->dev, rssi_event, gfp); cfg80211_cqm_rssi_notify(sdata->dev, rssi_event, gfp);
} }
......
...@@ -1996,23 +1996,26 @@ TRACE_EVENT(api_connection_loss, ...@@ -1996,23 +1996,26 @@ TRACE_EVENT(api_connection_loss,
TRACE_EVENT(api_cqm_rssi_notify, TRACE_EVENT(api_cqm_rssi_notify,
TP_PROTO(struct ieee80211_sub_if_data *sdata, TP_PROTO(struct ieee80211_sub_if_data *sdata,
enum nl80211_cqm_rssi_threshold_event rssi_event), enum nl80211_cqm_rssi_threshold_event rssi_event,
s32 rssi_level),
TP_ARGS(sdata, rssi_event), TP_ARGS(sdata, rssi_event, rssi_level),
TP_STRUCT__entry( TP_STRUCT__entry(
VIF_ENTRY VIF_ENTRY
__field(u32, rssi_event) __field(u32, rssi_event)
__field(s32, rssi_level)
), ),
TP_fast_assign( TP_fast_assign(
VIF_ASSIGN; VIF_ASSIGN;
__entry->rssi_event = rssi_event; __entry->rssi_event = rssi_event;
__entry->rssi_level = rssi_level;
), ),
TP_printk( TP_printk(
VIF_PR_FMT " event:%d", VIF_PR_FMT " event:%d rssi:%d",
VIF_PR_ARG, __entry->rssi_event VIF_PR_ARG, __entry->rssi_event, __entry->rssi_level
) )
); );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册