Ticket #781: iwspy-update-field.diff
| File iwspy-update-field.diff, 1.7 kB (added by Christian Buennig <masala@web.de>, 6 years ago) |
|---|
-
net80211/ieee80211_wireless.c
old new 1088 1088 for (i = 0; i < number; i++) 1089 1089 memcpy(&vap->iv_spy.mac[i * IEEE80211_ADDR_LEN], 1090 1090 address[i].sa_data, IEEE80211_ADDR_LEN); 1091 /* init rssi timestamps */ 1092 memset(vap->iv_spy.ts_rssi, 0, IW_MAX_SPY * sizeof(u_int32_t)); 1091 1093 } 1092 1094 vap->iv_spy.num = number; 1093 1095 … … 1119 1121 address[i].sa_family = AF_PACKET; 1120 1122 } 1121 1123 1122 /* locate a node, copy its rssi value, convert to dBm */1124 /* locate a node, read its rssi, check if updated, convert to dBm */ 1123 1125 for (i = 0; i < number; i++) { 1124 1126 ni = ieee80211_find_node(nt, &vap->iv_spy.mac[i * IEEE80211_ADDR_LEN]); 1125 1127 /* TODO: free node ? */ 1126 1128 /* check we are associated w/ this vap */ 1127 if (ni && (ni->ni_vap == vap)) 1129 if (ni && (ni->ni_vap == vap)) { 1128 1130 set_quality(&spy_stat[i], ni->ni_rssi); 1129 else 1131 if (ni->ni_rstamp != vap->iv_spy.ts_rssi[i]) { 1132 vap->iv_spy.ts_rssi[i] = ni->ni_rstamp; 1133 } else { 1134 spy_stat[i].updated = 0; 1135 } 1136 } else { 1130 1137 spy_stat[i].updated = IW_QUAL_ALL_INVALID; 1138 } 1131 1139 } 1132 1140 1133 1141 /* copy results to userspace */ -
net80211/ieee80211_var.h
old new 262 262 #define IW_MAX_SPY 8 263 263 struct ieee80211_spy { 264 264 u_int8_t mac[IW_MAX_SPY * IEEE80211_ADDR_LEN]; 265 u_int32_t ts_rssi[IW_MAX_SPY]; /* ts of rssi value from last read */ 265 266 u_int8_t thr_low; /* 1 byte rssi value, 0 = threshold is off */ 266 267 u_int8_t thr_high; /* 1 byte rssi value */ 267 268 u_int8_t num;
