| 1 |
--- net80211/ieee80211_wireless.c.orig 2009-01-06 10:15:58.000000000 +0100 |
|---|
| 2 |
+++ net80211/ieee80211_wireless.c 2009-01-06 10:21:04.000000000 +0100 |
|---|
| 3 |
@@ -1550,6 +1550,7 @@ |
|---|
| 4 |
#endif /* WIRELESS_EXT > 14 */ |
|---|
| 5 |
|
|---|
| 6 |
struct iwscanreq { /* XXX: right place for this declaration? */ |
|---|
| 7 |
+ struct iw_request_info *info; |
|---|
| 8 |
struct ieee80211vap *vap; |
|---|
| 9 |
char *current_ev; |
|---|
| 10 |
char *end_buf; |
|---|
| 11 |
@@ -1562,6 +1563,7 @@ |
|---|
| 12 |
struct iwscanreq *req = arg; |
|---|
| 13 |
struct ieee80211vap *vap = req->vap; |
|---|
| 14 |
char *current_ev = req->current_ev; |
|---|
| 15 |
+ struct iw_request_info *info = req->info; |
|---|
| 16 |
char *end_buf = req->end_buf; |
|---|
| 17 |
char *last_ev; |
|---|
| 18 |
#if WIRELESS_EXT > 14 |
|---|
| 19 |
@@ -1576,6 +1578,7 @@ |
|---|
| 20 |
char *current_val; |
|---|
| 21 |
int j; |
|---|
| 22 |
|
|---|
| 23 |
+ |
|---|
| 24 |
if (current_ev >= end_buf) |
|---|
| 25 |
return E2BIG; |
|---|
| 26 |
/* WPA/!WPA sort criteria */ |
|---|
| 27 |
@@ -1590,7 +1593,7 @@ |
|---|
| 28 |
IEEE80211_ADDR_COPY(iwe.u.ap_addr.sa_data, se->se_macaddr); |
|---|
| 29 |
else |
|---|
| 30 |
IEEE80211_ADDR_COPY(iwe.u.ap_addr.sa_data, se->se_bssid); |
|---|
| 31 |
- current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, IW_EV_ADDR_LEN); |
|---|
| 32 |
+ current_ev = iwe_stream_add_event(info,current_ev, end_buf, &iwe, IW_EV_ADDR_LEN); |
|---|
| 33 |
|
|---|
| 34 |
/* We ran out of space in the buffer. */ |
|---|
| 35 |
if (last_ev == current_ev) |
|---|
| 36 |
@@ -1603,11 +1606,11 @@ |
|---|
| 37 |
if (vap->iv_opmode == IEEE80211_M_HOSTAP) { |
|---|
| 38 |
iwe.u.data.length = vap->iv_des_nssid > 0 ? |
|---|
| 39 |
vap->iv_des_ssid[0].len : 0; |
|---|
| 40 |
- current_ev = iwe_stream_add_point(current_ev, |
|---|
| 41 |
+ current_ev = iwe_stream_add_point(info,current_ev, |
|---|
| 42 |
end_buf, &iwe, vap->iv_des_ssid[0].ssid); |
|---|
| 43 |
} else { |
|---|
| 44 |
iwe.u.data.length = se->se_ssid[1]; |
|---|
| 45 |
- current_ev = iwe_stream_add_point(current_ev, |
|---|
| 46 |
+ current_ev = iwe_stream_add_point(info,current_ev, |
|---|
| 47 |
end_buf, &iwe, (char *) se->se_ssid+2); |
|---|
| 48 |
} |
|---|
| 49 |
|
|---|
| 50 |
@@ -1621,7 +1624,7 @@ |
|---|
| 51 |
iwe.cmd = SIOCGIWMODE; |
|---|
| 52 |
iwe.u.mode = se->se_capinfo & IEEE80211_CAPINFO_ESS ? |
|---|
| 53 |
IW_MODE_MASTER : IW_MODE_ADHOC; |
|---|
| 54 |
- current_ev = iwe_stream_add_event(current_ev, |
|---|
| 55 |
+ current_ev = iwe_stream_add_event(info,current_ev, |
|---|
| 56 |
end_buf, &iwe, IW_EV_UINT_LEN); |
|---|
| 57 |
|
|---|
| 58 |
/* We ran out of space in the buffer. */ |
|---|
| 59 |
@@ -1634,7 +1637,7 @@ |
|---|
| 60 |
iwe.cmd = SIOCGIWFREQ; |
|---|
| 61 |
iwe.u.freq.m = se->se_chan->ic_freq * 100000; |
|---|
| 62 |
iwe.u.freq.e = 1; |
|---|
| 63 |
- current_ev = iwe_stream_add_event(current_ev, |
|---|
| 64 |
+ current_ev = iwe_stream_add_event(info,current_ev, |
|---|
| 65 |
end_buf, &iwe, IW_EV_FREQ_LEN); |
|---|
| 66 |
|
|---|
| 67 |
/* We ran out of space in the buffer. */ |
|---|
| 68 |
@@ -1645,7 +1648,7 @@ |
|---|
| 69 |
last_ev = current_ev; |
|---|
| 70 |
iwe.cmd = IWEVQUAL; |
|---|
| 71 |
set_quality(&iwe.u.qual, se->se_rssi, ATH_DEFAULT_NOISE); |
|---|
| 72 |
- current_ev = iwe_stream_add_event(current_ev, |
|---|
| 73 |
+ current_ev = iwe_stream_add_event(info,current_ev, |
|---|
| 74 |
end_buf, &iwe, IW_EV_QUAL_LEN); |
|---|
| 75 |
|
|---|
| 76 |
/* We ran out of space in the buffer */ |
|---|
| 77 |
@@ -1660,7 +1663,7 @@ |
|---|
| 78 |
else |
|---|
| 79 |
iwe.u.data.flags = IW_ENCODE_DISABLED; |
|---|
| 80 |
iwe.u.data.length = 0; |
|---|
| 81 |
- current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, ""); |
|---|
| 82 |
+ current_ev = iwe_stream_add_point(info,current_ev, end_buf, &iwe, ""); |
|---|
| 83 |
|
|---|
| 84 |
/* We ran out of space in the buffer. */ |
|---|
| 85 |
if (last_ev == current_ev) |
|---|
| 86 |
@@ -1675,7 +1678,7 @@ |
|---|
| 87 |
int r = se->se_rates[2 + j] & IEEE80211_RATE_VAL; |
|---|
| 88 |
if (r != 0) { |
|---|
| 89 |
iwe.u.bitrate.value = r * (1000000 / 2); |
|---|
| 90 |
- current_val = iwe_stream_add_value(current_ev, |
|---|
| 91 |
+ current_val = iwe_stream_add_value(info,current_ev, |
|---|
| 92 |
current_val, end_buf, &iwe, |
|---|
| 93 |
IW_EV_PARAM_LEN); |
|---|
| 94 |
} |
|---|
| 95 |
@@ -1684,7 +1687,7 @@ |
|---|
| 96 |
int r = se->se_xrates[2+j] & IEEE80211_RATE_VAL; |
|---|
| 97 |
if (r != 0) { |
|---|
| 98 |
iwe.u.bitrate.value = r * (1000000 / 2); |
|---|
| 99 |
- current_val = iwe_stream_add_value(current_ev, |
|---|
| 100 |
+ current_val = iwe_stream_add_value(info,current_ev, |
|---|
| 101 |
current_val, end_buf, &iwe, |
|---|
| 102 |
IW_EV_PARAM_LEN); |
|---|
| 103 |
} |
|---|
| 104 |
@@ -1704,7 +1707,7 @@ |
|---|
| 105 |
iwe.cmd = IWEVCUSTOM; |
|---|
| 106 |
snprintf(buf, sizeof(buf), "bcn_int=%d", se->se_intval); |
|---|
| 107 |
iwe.u.data.length = strlen(buf); |
|---|
| 108 |
- current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, buf); |
|---|
| 109 |
+ current_ev = iwe_stream_add_point(info,current_ev, end_buf, &iwe, buf); |
|---|
| 110 |
|
|---|
| 111 |
/* We ran out of space in the buffer. */ |
|---|
| 112 |
if (last_ev == current_ev) |
|---|
| 113 |
@@ -1728,7 +1731,7 @@ |
|---|
| 114 |
rsn_leader, sizeof(rsn_leader) - 1); |
|---|
| 115 |
#endif |
|---|
| 116 |
if (iwe.u.data.length != 0) { |
|---|
| 117 |
- current_ev = iwe_stream_add_point(current_ev, end_buf, |
|---|
| 118 |
+ current_ev = iwe_stream_add_point(info,current_ev, end_buf, |
|---|
| 119 |
&iwe, buf); |
|---|
| 120 |
|
|---|
| 121 |
/* We ran out of space in the buffer */ |
|---|
| 122 |
@@ -1754,7 +1757,7 @@ |
|---|
| 123 |
wpa_leader, sizeof(wpa_leader) - 1); |
|---|
| 124 |
#endif |
|---|
| 125 |
if (iwe.u.data.length != 0) { |
|---|
| 126 |
- current_ev = iwe_stream_add_point(current_ev, end_buf, |
|---|
| 127 |
+ current_ev = iwe_stream_add_point(info,current_ev, end_buf, |
|---|
| 128 |
&iwe, buf); |
|---|
| 129 |
|
|---|
| 130 |
/* We ran out of space in the buffer. */ |
|---|
| 131 |
@@ -1773,7 +1776,7 @@ |
|---|
| 132 |
se->se_wme_ie, se->se_wme_ie[1] + 2, |
|---|
| 133 |
wme_leader, sizeof(wme_leader) - 1); |
|---|
| 134 |
if (iwe.u.data.length != 0) { |
|---|
| 135 |
- current_ev = iwe_stream_add_point(current_ev, end_buf, |
|---|
| 136 |
+ current_ev = iwe_stream_add_point(info,current_ev, end_buf, |
|---|
| 137 |
&iwe, buf); |
|---|
| 138 |
|
|---|
| 139 |
/* We ran out of space in the buffer. */ |
|---|
| 140 |
@@ -1791,7 +1794,7 @@ |
|---|
| 141 |
se->se_ath_ie, se->se_ath_ie[1] + 2, |
|---|
| 142 |
ath_leader, sizeof(ath_leader) - 1); |
|---|
| 143 |
if (iwe.u.data.length != 0) { |
|---|
| 144 |
- current_ev = iwe_stream_add_point(current_ev, end_buf, |
|---|
| 145 |
+ current_ev = iwe_stream_add_point(info,current_ev, end_buf, |
|---|
| 146 |
&iwe, buf); |
|---|
| 147 |
|
|---|
| 148 |
/* We ran out of space in the buffer. */ |
|---|