aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/atmel.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-06-16 21:50:49 -0400
committerDavid S. Miller <davem@davemloft.net>2008-06-16 21:50:49 -0400
commitccc580571cf0799d0460a085a7632b77753f083e (patch)
tree018e0f83776b089b1f272694132688ac93be25b4 /drivers/net/wireless/atmel.c
parent0f5cabba49021d36e9f76bd97d7fa0f4a408063f (diff)
wext: Emit event stream entries correctly when compat.
Three major portions to this change: 1) Add IW_EV_COMPAT_LCP_LEN, IW_EV_COMPAT_POINT_OFF, and IW_EV_COMPAT_POINT_LEN helper defines. 2) Delete iw_stream_check_add_*(), they are unused. 3) Add iw_request_info argument to iwe_stream_add_*(), and use it to size the event and pointer lengths correctly depending upon whether IW_REQUEST_FLAG_COMPAT is set or not. 4) The mechanical transformations to the drivers and wireless stack bits to get the iw_request_info passed down into the routines modified in #3. Also, explicit references to IW_EV_LCP_LEN are replaced with iwe_stream_lcp_len(info). With a lot of help and bug fixes from Masakazu Mokuno. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/atmel.c')
-rw-r--r--drivers/net/wireless/atmel.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/drivers/net/wireless/atmel.c b/drivers/net/wireless/atmel.c
index 7bb2646ae0ef..28b6ff3eaa37 100644
--- a/drivers/net/wireless/atmel.c
+++ b/drivers/net/wireless/atmel.c
@@ -2310,30 +2310,40 @@ static int atmel_get_scan(struct net_device *dev,
2310 iwe.cmd = SIOCGIWAP; 2310 iwe.cmd = SIOCGIWAP;
2311 iwe.u.ap_addr.sa_family = ARPHRD_ETHER; 2311 iwe.u.ap_addr.sa_family = ARPHRD_ETHER;
2312 memcpy(iwe.u.ap_addr.sa_data, priv->BSSinfo[i].BSSID, 6); 2312 memcpy(iwe.u.ap_addr.sa_data, priv->BSSinfo[i].BSSID, 6);
2313 current_ev = iwe_stream_add_event(current_ev, extra + IW_SCAN_MAX_DATA, &iwe, IW_EV_ADDR_LEN); 2313 current_ev = iwe_stream_add_event(info, current_ev,
2314 extra + IW_SCAN_MAX_DATA,
2315 &iwe, IW_EV_ADDR_LEN);
2314 2316
2315 iwe.u.data.length = priv->BSSinfo[i].SSIDsize; 2317 iwe.u.data.length = priv->BSSinfo[i].SSIDsize;
2316 if (iwe.u.data.length > 32) 2318 if (iwe.u.data.length > 32)
2317 iwe.u.data.length = 32; 2319 iwe.u.data.length = 32;
2318 iwe.cmd = SIOCGIWESSID; 2320 iwe.cmd = SIOCGIWESSID;
2319 iwe.u.data.flags = 1; 2321 iwe.u.data.flags = 1;
2320 current_ev = iwe_stream_add_point(current_ev, extra + IW_SCAN_MAX_DATA, &iwe, priv->BSSinfo[i].SSID); 2322 current_ev = iwe_stream_add_point(info, current_ev,
2323 extra + IW_SCAN_MAX_DATA,
2324 &iwe, priv->BSSinfo[i].SSID);
2321 2325
2322 iwe.cmd = SIOCGIWMODE; 2326 iwe.cmd = SIOCGIWMODE;
2323 iwe.u.mode = priv->BSSinfo[i].BSStype; 2327 iwe.u.mode = priv->BSSinfo[i].BSStype;
2324 current_ev = iwe_stream_add_event(current_ev, extra + IW_SCAN_MAX_DATA, &iwe, IW_EV_UINT_LEN); 2328 current_ev = iwe_stream_add_event(info, current_ev,
2329 extra + IW_SCAN_MAX_DATA,
2330 &iwe, IW_EV_UINT_LEN);
2325 2331
2326 iwe.cmd = SIOCGIWFREQ; 2332 iwe.cmd = SIOCGIWFREQ;
2327 iwe.u.freq.m = priv->BSSinfo[i].channel; 2333 iwe.u.freq.m = priv->BSSinfo[i].channel;
2328 iwe.u.freq.e = 0; 2334 iwe.u.freq.e = 0;
2329 current_ev = iwe_stream_add_event(current_ev, extra + IW_SCAN_MAX_DATA, &iwe, IW_EV_FREQ_LEN); 2335 current_ev = iwe_stream_add_event(info, current_ev,
2336 extra + IW_SCAN_MAX_DATA,
2337 &iwe, IW_EV_FREQ_LEN);
2330 2338
2331 /* Add quality statistics */ 2339 /* Add quality statistics */
2332 iwe.cmd = IWEVQUAL; 2340 iwe.cmd = IWEVQUAL;
2333 iwe.u.qual.level = priv->BSSinfo[i].RSSI; 2341 iwe.u.qual.level = priv->BSSinfo[i].RSSI;
2334 iwe.u.qual.qual = iwe.u.qual.level; 2342 iwe.u.qual.qual = iwe.u.qual.level;
2335 /* iwe.u.qual.noise = SOMETHING */ 2343 /* iwe.u.qual.noise = SOMETHING */
2336 current_ev = iwe_stream_add_event(current_ev, extra + IW_SCAN_MAX_DATA , &iwe, IW_EV_QUAL_LEN); 2344 current_ev = iwe_stream_add_event(info, current_ev,
2345 extra + IW_SCAN_MAX_DATA,
2346 &iwe, IW_EV_QUAL_LEN);
2337 2347
2338 2348
2339 iwe.cmd = SIOCGIWENCODE; 2349 iwe.cmd = SIOCGIWENCODE;
@@ -2342,7 +2352,9 @@ static int atmel_get_scan(struct net_device *dev,
2342 else 2352 else
2343 iwe.u.data.flags = IW_ENCODE_DISABLED; 2353 iwe.u.data.flags = IW_ENCODE_DISABLED;
2344 iwe.u.data.length = 0; 2354 iwe.u.data.length = 0;
2345 current_ev = iwe_stream_add_point(current_ev, extra + IW_SCAN_MAX_DATA, &iwe, NULL); 2355 current_ev = iwe_stream_add_point(info, current_ev,
2356 extra + IW_SCAN_MAX_DATA,
2357 &iwe, NULL);
2346 } 2358 }
2347 2359
2348 /* Length of data */ 2360 /* Length of data */