diff options
author | David S. Miller <davem@davemloft.net> | 2008-06-16 21:50:49 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-06-16 21:50:49 -0400 |
commit | ccc580571cf0799d0460a085a7632b77753f083e (patch) | |
tree | 018e0f83776b089b1f272694132688ac93be25b4 /drivers/net/wireless/hostap/hostap_ap.c | |
parent | 0f5cabba49021d36e9f76bd97d7fa0f4a408063f (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/hostap/hostap_ap.c')
-rw-r--r-- | drivers/net/wireless/hostap/hostap_ap.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/net/wireless/hostap/hostap_ap.c b/drivers/net/wireless/hostap/hostap_ap.c index 0acd9589c48c..06b23df8f69b 100644 --- a/drivers/net/wireless/hostap/hostap_ap.c +++ b/drivers/net/wireless/hostap/hostap_ap.c | |||
@@ -2420,7 +2420,8 @@ int prism2_ap_get_sta_qual(local_info_t *local, struct sockaddr addr[], | |||
2420 | 2420 | ||
2421 | /* Translate our list of Access Points & Stations to a card independant | 2421 | /* Translate our list of Access Points & Stations to a card independant |
2422 | * format that the Wireless Tools will understand - Jean II */ | 2422 | * format that the Wireless Tools will understand - Jean II */ |
2423 | int prism2_ap_translate_scan(struct net_device *dev, char *buffer) | 2423 | int prism2_ap_translate_scan(struct net_device *dev, |
2424 | struct iw_request_info *info, char *buffer) | ||
2424 | { | 2425 | { |
2425 | struct hostap_interface *iface; | 2426 | struct hostap_interface *iface; |
2426 | local_info_t *local; | 2427 | local_info_t *local; |
@@ -2449,8 +2450,8 @@ int prism2_ap_translate_scan(struct net_device *dev, char *buffer) | |||
2449 | iwe.u.ap_addr.sa_family = ARPHRD_ETHER; | 2450 | iwe.u.ap_addr.sa_family = ARPHRD_ETHER; |
2450 | memcpy(iwe.u.ap_addr.sa_data, sta->addr, ETH_ALEN); | 2451 | memcpy(iwe.u.ap_addr.sa_data, sta->addr, ETH_ALEN); |
2451 | iwe.len = IW_EV_ADDR_LEN; | 2452 | iwe.len = IW_EV_ADDR_LEN; |
2452 | current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, | 2453 | current_ev = iwe_stream_add_event(info, current_ev, end_buf, |
2453 | IW_EV_ADDR_LEN); | 2454 | &iwe, IW_EV_ADDR_LEN); |
2454 | 2455 | ||
2455 | /* Use the mode to indicate if it's a station or | 2456 | /* Use the mode to indicate if it's a station or |
2456 | * an Access Point */ | 2457 | * an Access Point */ |
@@ -2461,8 +2462,8 @@ int prism2_ap_translate_scan(struct net_device *dev, char *buffer) | |||
2461 | else | 2462 | else |
2462 | iwe.u.mode = IW_MODE_INFRA; | 2463 | iwe.u.mode = IW_MODE_INFRA; |
2463 | iwe.len = IW_EV_UINT_LEN; | 2464 | iwe.len = IW_EV_UINT_LEN; |
2464 | current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, | 2465 | current_ev = iwe_stream_add_event(info, current_ev, end_buf, |
2465 | IW_EV_UINT_LEN); | 2466 | &iwe, IW_EV_UINT_LEN); |
2466 | 2467 | ||
2467 | /* Some quality */ | 2468 | /* Some quality */ |
2468 | memset(&iwe, 0, sizeof(iwe)); | 2469 | memset(&iwe, 0, sizeof(iwe)); |
@@ -2477,8 +2478,8 @@ int prism2_ap_translate_scan(struct net_device *dev, char *buffer) | |||
2477 | iwe.u.qual.noise = HFA384X_LEVEL_TO_dBm(sta->last_rx_silence); | 2478 | iwe.u.qual.noise = HFA384X_LEVEL_TO_dBm(sta->last_rx_silence); |
2478 | iwe.u.qual.updated = sta->last_rx_updated; | 2479 | iwe.u.qual.updated = sta->last_rx_updated; |
2479 | iwe.len = IW_EV_QUAL_LEN; | 2480 | iwe.len = IW_EV_QUAL_LEN; |
2480 | current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, | 2481 | current_ev = iwe_stream_add_event(info, current_ev, end_buf, |
2481 | IW_EV_QUAL_LEN); | 2482 | &iwe, IW_EV_QUAL_LEN); |
2482 | 2483 | ||
2483 | #ifndef PRISM2_NO_KERNEL_IEEE80211_MGMT | 2484 | #ifndef PRISM2_NO_KERNEL_IEEE80211_MGMT |
2484 | if (sta->ap) { | 2485 | if (sta->ap) { |
@@ -2486,8 +2487,8 @@ int prism2_ap_translate_scan(struct net_device *dev, char *buffer) | |||
2486 | iwe.cmd = SIOCGIWESSID; | 2487 | iwe.cmd = SIOCGIWESSID; |
2487 | iwe.u.data.length = sta->u.ap.ssid_len; | 2488 | iwe.u.data.length = sta->u.ap.ssid_len; |
2488 | iwe.u.data.flags = 1; | 2489 | iwe.u.data.flags = 1; |
2489 | current_ev = iwe_stream_add_point(current_ev, end_buf, | 2490 | current_ev = iwe_stream_add_point(info, current_ev, |
2490 | &iwe, | 2491 | end_buf, &iwe, |
2491 | sta->u.ap.ssid); | 2492 | sta->u.ap.ssid); |
2492 | 2493 | ||
2493 | memset(&iwe, 0, sizeof(iwe)); | 2494 | memset(&iwe, 0, sizeof(iwe)); |
@@ -2497,10 +2498,9 @@ int prism2_ap_translate_scan(struct net_device *dev, char *buffer) | |||
2497 | IW_ENCODE_ENABLED | IW_ENCODE_NOKEY; | 2498 | IW_ENCODE_ENABLED | IW_ENCODE_NOKEY; |
2498 | else | 2499 | else |
2499 | iwe.u.data.flags = IW_ENCODE_DISABLED; | 2500 | iwe.u.data.flags = IW_ENCODE_DISABLED; |
2500 | current_ev = iwe_stream_add_point(current_ev, end_buf, | 2501 | current_ev = iwe_stream_add_point(info, current_ev, |
2501 | &iwe, | 2502 | end_buf, &iwe, |
2502 | sta->u.ap.ssid | 2503 | sta->u.ap.ssid); |
2503 | /* 0 byte memcpy */); | ||
2504 | 2504 | ||
2505 | if (sta->u.ap.channel > 0 && | 2505 | if (sta->u.ap.channel > 0 && |
2506 | sta->u.ap.channel <= FREQ_COUNT) { | 2506 | sta->u.ap.channel <= FREQ_COUNT) { |
@@ -2510,7 +2510,7 @@ int prism2_ap_translate_scan(struct net_device *dev, char *buffer) | |||
2510 | * 100000; | 2510 | * 100000; |
2511 | iwe.u.freq.e = 1; | 2511 | iwe.u.freq.e = 1; |
2512 | current_ev = iwe_stream_add_event( | 2512 | current_ev = iwe_stream_add_event( |
2513 | current_ev, end_buf, &iwe, | 2513 | info, current_ev, end_buf, &iwe, |
2514 | IW_EV_FREQ_LEN); | 2514 | IW_EV_FREQ_LEN); |
2515 | } | 2515 | } |
2516 | 2516 | ||
@@ -2519,8 +2519,8 @@ int prism2_ap_translate_scan(struct net_device *dev, char *buffer) | |||
2519 | sprintf(buf, "beacon_interval=%d", | 2519 | sprintf(buf, "beacon_interval=%d", |
2520 | sta->listen_interval); | 2520 | sta->listen_interval); |
2521 | iwe.u.data.length = strlen(buf); | 2521 | iwe.u.data.length = strlen(buf); |
2522 | current_ev = iwe_stream_add_point(current_ev, end_buf, | 2522 | current_ev = iwe_stream_add_point(info, current_ev, |
2523 | &iwe, buf); | 2523 | end_buf, &iwe, buf); |
2524 | } | 2524 | } |
2525 | #endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */ | 2525 | #endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */ |
2526 | 2526 | ||