From 8964e492b5740dae0f4f68e08f4a9a45d4b57620 Mon Sep 17 00:00:00 2001 From: David Gnedt Date: Sun, 30 Jan 2011 20:11:00 +0100 Subject: wl1251: implement connection quality monitoring Implement connection quality monitoring similar to the wl1271 driver. It triggers ieee80211_cqm_rssi_notify with the corresponding event when RSSI drops blow RSSI threshold or rises again above the RSSI threshold. It should be noted that wl1251 doesn't support RSSI hysteresis, instead it uses RSSI averageing and delays events until a certain count of frames proved RSSI change. Signed-off-by: David Gnedt Acked-by: Kalle Valo Signed-off-by: John W. Linville --- drivers/net/wireless/wl1251/acx.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'drivers/net/wireless/wl1251/acx.c') diff --git a/drivers/net/wireless/wl1251/acx.c b/drivers/net/wireless/wl1251/acx.c index 8c94366..ef8370e 100644 --- a/drivers/net/wireless/wl1251/acx.c +++ b/drivers/net/wireless/wl1251/acx.c @@ -776,6 +776,31 @@ out: return ret; } +int wl1251_acx_low_rssi(struct wl1251 *wl, s8 threshold, u8 weight, + u8 depth, enum wl1251_acx_low_rssi_type type) +{ + struct acx_low_rssi *rssi; + int ret; + + wl1251_debug(DEBUG_ACX, "acx low rssi"); + + rssi = kzalloc(sizeof(*rssi), GFP_KERNEL); + if (!rssi) + return -ENOMEM; + + rssi->threshold = threshold; + rssi->weight = weight; + rssi->depth = depth; + rssi->type = type; + + ret = wl1251_cmd_configure(wl, ACX_LOW_RSSI, rssi, sizeof(*rssi)); + if (ret < 0) + wl1251_warning("failed to set low rssi threshold: %d", ret); + + kfree(rssi); + return ret; +} + int wl1251_acx_set_preamble(struct wl1251 *wl, enum acx_preamble_type preamble) { struct acx_preamble *acx; -- cgit v1.1