Lines Matching +full:int +full:- +full:threshold

4  * Authors :	Jean Tourrilhes - HPL - <[email protected]>
5 * Copyright (c) 1997-2007 Jean Tourrilhes, All Rights Reserved.
23 if (ieee->spy_enabled) in get_spydata()
24 return &ieee->spy_data; in get_spydata()
28 int ipw_wx_set_spy(struct net_device * dev, in ipw_wx_set_spy()
38 return -EOPNOTSUPP; in ipw_wx_set_spy()
43 spydata->spy_number = 0; in ipw_wx_set_spy()
54 if (wrqu->data.length > 0) { in ipw_wx_set_spy()
55 int i; in ipw_wx_set_spy()
58 for (i = 0; i < wrqu->data.length; i++) in ipw_wx_set_spy()
59 memcpy(spydata->spy_address[i], address[i].sa_data, in ipw_wx_set_spy()
62 memset(spydata->spy_stat, 0, in ipw_wx_set_spy()
66 /* Make sure above is updated before re-enabling */ in ipw_wx_set_spy()
70 spydata->spy_number = wrqu->data.length; in ipw_wx_set_spy()
76 int ipw_wx_get_spy(struct net_device * dev, in ipw_wx_get_spy()
83 int i; in ipw_wx_get_spy()
87 return -EOPNOTSUPP; in ipw_wx_get_spy()
89 wrqu->data.length = spydata->spy_number; in ipw_wx_get_spy()
92 for (i = 0; i < spydata->spy_number; i++) { in ipw_wx_get_spy()
93 memcpy(address[i].sa_data, spydata->spy_address[i], ETH_ALEN); in ipw_wx_get_spy()
97 if (spydata->spy_number > 0) in ipw_wx_get_spy()
98 memcpy(extra + (sizeof(struct sockaddr) *spydata->spy_number), in ipw_wx_get_spy()
99 spydata->spy_stat, in ipw_wx_get_spy()
100 sizeof(struct iw_quality) * spydata->spy_number); in ipw_wx_get_spy()
102 for (i = 0; i < spydata->spy_number; i++) in ipw_wx_get_spy()
103 spydata->spy_stat[i].updated &= ~IW_QUAL_ALL_UPDATED; in ipw_wx_get_spy()
108 /*------------------------------------------------------------------*/
110 * Standard Wireless Handler : set spy threshold
112 int ipw_wx_set_thrspy(struct net_device * dev, in ipw_wx_set_thrspy()
118 struct iw_thrspy * threshold = (struct iw_thrspy *) extra; in ipw_wx_set_thrspy() local
122 return -EOPNOTSUPP; in ipw_wx_set_thrspy()
125 spydata->spy_thr_low = threshold->low; in ipw_wx_set_thrspy()
126 spydata->spy_thr_high = threshold->high; in ipw_wx_set_thrspy()
129 memset(spydata->spy_thr_under, '\0', sizeof(spydata->spy_thr_under)); in ipw_wx_set_thrspy()
135 /*------------------------------------------------------------------*/
137 * Standard Wireless Handler : get spy threshold
139 int ipw_wx_get_thrspy(struct net_device * dev, in ipw_wx_get_thrspy()
145 struct iw_thrspy * threshold = (struct iw_thrspy *) extra; in ipw_wx_get_thrspy() local
149 return -EOPNOTSUPP; in ipw_wx_get_thrspy()
152 threshold->low = spydata->spy_thr_low; in ipw_wx_get_thrspy()
153 threshold->high = spydata->spy_thr_high; in ipw_wx_get_thrspy()
159 /*------------------------------------------------------------------*/
161 * Prepare and send a Spy Threshold event
169 struct iw_thrspy threshold; in iw_send_thrspy_event() local
175 memcpy(threshold.addr.sa_data, address, ETH_ALEN); in iw_send_thrspy_event()
176 threshold.addr.sa_family = ARPHRD_ETHER; in iw_send_thrspy_event()
178 threshold.qual = *wstats; in iw_send_thrspy_event()
180 threshold.low = spydata->spy_thr_low; in iw_send_thrspy_event()
181 threshold.high = spydata->spy_thr_high; in iw_send_thrspy_event()
184 wireless_send_event(dev, SIOCGIWTHRSPY, &wrqu, (char *) &threshold); in iw_send_thrspy_event()
187 /* ---------------------------------------------------------------- */
199 int i; in libipw_spy_update()
200 int match = -1; in libipw_spy_update()
207 for (i = 0; i < spydata->spy_number; i++) in libipw_spy_update()
208 if (ether_addr_equal(address, spydata->spy_address[i])) { in libipw_spy_update()
209 memcpy(&(spydata->spy_stat[i]), wstats, in libipw_spy_update()
214 /* Generate an event if we cross the spy threshold. in libipw_spy_update()
216 * event only when we go under the low threshold or above the in libipw_spy_update()
217 * high threshold. */ in libipw_spy_update()
219 if (spydata->spy_thr_under[match]) { in libipw_spy_update()
220 if (wstats->level > spydata->spy_thr_high.level) { in libipw_spy_update()
221 spydata->spy_thr_under[match] = 0; in libipw_spy_update()
226 if (wstats->level < spydata->spy_thr_low.level) { in libipw_spy_update()
227 spydata->spy_thr_under[match] = 1; in libipw_spy_update()