Lines Matching +full:high +full:- +full:threshold
4 * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com>
5 * Copyright (c) 1997-2007 Jean Tourrilhes, All Rights Reserved.
21 if (dev->wireless_data) in get_spydata()
22 return dev->wireless_data->spy_data; in get_spydata()
36 return -EOPNOTSUPP; in iw_handler_set_spy()
41 spydata->spy_number = 0; in iw_handler_set_spy()
52 if (wrqu->data.length > 0) { in iw_handler_set_spy()
56 for (i = 0; i < wrqu->data.length; i++) in iw_handler_set_spy()
57 memcpy(spydata->spy_address[i], address[i].sa_data, in iw_handler_set_spy()
60 memset(spydata->spy_stat, 0, in iw_handler_set_spy()
64 /* Make sure above is updated before re-enabling */ in iw_handler_set_spy()
68 spydata->spy_number = wrqu->data.length; in iw_handler_set_spy()
85 return -EOPNOTSUPP; in iw_handler_get_spy()
87 wrqu->data.length = spydata->spy_number; in iw_handler_get_spy()
90 for (i = 0; i < spydata->spy_number; i++) { in iw_handler_get_spy()
91 memcpy(address[i].sa_data, spydata->spy_address[i], ETH_ALEN); in iw_handler_get_spy()
95 if (spydata->spy_number > 0) in iw_handler_get_spy()
96 memcpy(extra + (sizeof(struct sockaddr) *spydata->spy_number), in iw_handler_get_spy()
97 spydata->spy_stat, in iw_handler_get_spy()
98 sizeof(struct iw_quality) * spydata->spy_number); in iw_handler_get_spy()
100 for (i = 0; i < spydata->spy_number; i++) in iw_handler_get_spy()
101 spydata->spy_stat[i].updated &= ~IW_QUAL_ALL_UPDATED; in iw_handler_get_spy()
106 /*------------------------------------------------------------------*/
108 * Standard Wireless Handler : set spy threshold
116 struct iw_thrspy * threshold = (struct iw_thrspy *) extra; in iw_handler_set_thrspy() local
120 return -EOPNOTSUPP; in iw_handler_set_thrspy()
123 spydata->spy_thr_low = threshold->low; in iw_handler_set_thrspy()
124 spydata->spy_thr_high = threshold->high; in iw_handler_set_thrspy()
127 memset(spydata->spy_thr_under, '\0', sizeof(spydata->spy_thr_under)); in iw_handler_set_thrspy()
133 /*------------------------------------------------------------------*/
135 * Standard Wireless Handler : get spy threshold
143 struct iw_thrspy * threshold = (struct iw_thrspy *) extra; in iw_handler_get_thrspy() local
147 return -EOPNOTSUPP; in iw_handler_get_thrspy()
150 threshold->low = spydata->spy_thr_low; in iw_handler_get_thrspy()
151 threshold->high = spydata->spy_thr_high; in iw_handler_get_thrspy()
157 /*------------------------------------------------------------------*/
159 * Prepare and send a Spy Threshold event
167 struct iw_thrspy threshold; in iw_send_thrspy_event() local
173 memcpy(threshold.addr.sa_data, address, ETH_ALEN); in iw_send_thrspy_event()
174 threshold.addr.sa_family = ARPHRD_ETHER; in iw_send_thrspy_event()
176 threshold.qual = *wstats; in iw_send_thrspy_event()
178 threshold.low = spydata->spy_thr_low; in iw_send_thrspy_event()
179 threshold.high = spydata->spy_thr_high; in iw_send_thrspy_event()
182 wireless_send_event(dev, SIOCGIWTHRSPY, &wrqu, (char *) &threshold); in iw_send_thrspy_event()
185 /* ---------------------------------------------------------------- */
198 int match = -1; in wireless_spy_update()
205 for (i = 0; i < spydata->spy_number; i++) in wireless_spy_update()
206 if (ether_addr_equal(address, spydata->spy_address[i])) { in wireless_spy_update()
207 memcpy(&(spydata->spy_stat[i]), wstats, in wireless_spy_update()
212 /* Generate an event if we cross the spy threshold. in wireless_spy_update()
214 * event only when we go under the low threshold or above the in wireless_spy_update()
215 * high threshold. */ in wireless_spy_update()
217 if (spydata->spy_thr_under[match]) { in wireless_spy_update()
218 if (wstats->level > spydata->spy_thr_high.level) { in wireless_spy_update()
219 spydata->spy_thr_under[match] = 0; in wireless_spy_update()
224 if (wstats->level < spydata->spy_thr_low.level) { in wireless_spy_update()
225 spydata->spy_thr_under[match] = 1; in wireless_spy_update()