: wext: Emit event stream entries correctly when compat.
Subsystems (8)
David Miller
maintainerPATCH 12/12 : 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.
With a lot of help and bug fixes from Masakazu Mokuno.
--- drivers/net/wireless/airo.c | 39 +++++--- drivers/net/wireless/atmel.c | 24 ++++- drivers/net/wireless/hostap/hostap.h | 3 +- drivers/net/wireless/hostap/hostap_ap.c | 32 +++--- drivers/net/wireless/hostap/hostap_ioctl.c | 54 ++++++----- drivers/net/wireless/libertas/scan.c | 32 +++--- drivers/net/wireless/orinoco.c | 19 ++-- drivers/net/wireless/prism54/isl_ioctl.c | 45 +++++---- drivers/net/wireless/rndis_wlan.c | 27 +++--- drivers/net/wireless/wl3501_cs.c | 10 +- drivers/net/wireless/zd1201.c | 21 +++-- include/linux/wireless.h | 15 +++ include/net/iw_handler.h | 149 ++++++++-------------------- net/ieee80211/ieee80211_wx.c | 44 +++++---- net/mac80211/ieee80211_i.h | 5 +- net/mac80211/mlme.c | 43 +++++---- net/mac80211/wext.c | 2 +- 17 files changed, 286 insertions(+), 278 deletions(-)
drivers/net/wireless/airo.c +26 -13
@@ -7165,6 +7165,7 @@ out:* format that the Wireless Tools will understand - Jean II */ static inline char *airo_translate_scan (struct net_device *dev, +struct iw_request_info *info,char *current_ev,char *end_buf,BSSListRid *bss)
@@ -7181,7 +7182,8 @@ static inline char *airo_translate_scan(struct net_device *dev, iwe.cmd =SIOCGIWAP ; iwe.u.ap_addr.sa_family =ARPHRD_ETHER ;memcpy (iwe.u.ap_addr.sa_data, bss->bssid,ETH_ALEN ); - current_ev =iwe_stream_add_event (current_ev, end_buf, &iwe,IW_EV_ADDR_LEN ); + current_ev =iwe_stream_add_event (info, current_ev, end_buf, + &iwe,IW_EV_ADDR_LEN );/* Other entries will be displayed in the order we give them */
@@ -7191,7 +7193,8 @@ static inline char *airo_translate_scan(struct net_device *dev, iwe.u.data.length =32 ; iwe.cmd =SIOCGIWESSID ; iwe.u.data.flags =1 ; - current_ev =iwe_stream_add_point (current_ev, end_buf, &iwe, bss->ssid); + current_ev =iwe_stream_add_point (info, current_ev, end_buf, + &iwe, bss->ssid);/* Add mode */ iwe.cmd =SIOCGIWMODE ;
@@ -7201,7 +7204,8 @@ static inline char *airo_translate_scan(struct net_device *dev, iwe.u.mode =IW_MODE_MASTER ; else iwe.u.mode = IW_MODE_ADHOC; - current_ev =iwe_stream_add_event (current_ev, end_buf, &iwe,IW_EV_UINT_LEN ); + current_ev =iwe_stream_add_event (info, current_ev, end_buf, + &iwe,IW_EV_UINT_LEN ); }/* Add frequency */
@@ -7212,7 +7216,8 @@ static inline char *airo_translate_scan(struct net_device *dev,*/ iwe.u.freq.m = frequency_list[iwe.u.freq.m -1 ] *100000 ; iwe.u.freq.e =1 ; - current_ev =iwe_stream_add_event (current_ev, end_buf, &iwe,IW_EV_FREQ_LEN ); + current_ev =iwe_stream_add_event (info, current_ev, end_buf, + &iwe,IW_EV_FREQ_LEN ); dBm =le16_to_cpu (bss->dBm);
@@ -7232,7 +7237,8 @@ static inline char *airo_translate_scan(struct net_device *dev, | IW_QUAL_DBM; } iwe.u.qual.noise = ai->wstats.qual.noise; - current_ev =iwe_stream_add_event (current_ev, end_buf, &iwe,IW_EV_QUAL_LEN ); + current_ev =iwe_stream_add_event (info, current_ev, end_buf, + &iwe,IW_EV_QUAL_LEN );/* Add encryption capability */ iwe.cmd =SIOCGIWENCODE ;
@@ -7241,7 +7247,8 @@ static inline char *airo_translate_scan(struct net_device *dev,else iwe.u.data.flags =IW_ENCODE_DISABLED ; iwe.u.data.length =0 ; - current_ev =iwe_stream_add_point (current_ev, end_buf, &iwe, bss->ssid); + current_ev =iwe_stream_add_point (info, current_ev, end_buf, + &iwe, bss->ssid);/* Rate : stuffing multiple values in a single event require a bit * more of magic - Jean II */
@@ -7258,7 +7265,9 @@ static inline char *airo_translate_scan(struct net_device *dev,/* Bit rate given in 500 kb/s units (+ 0x80) */ iwe.u.bitrate.value = ((bss->rates[i] &0x7f ) *500000 );/* Add new value to event */ - current_val =iwe_stream_add_value (current_ev, current_val, end_buf, &iwe,IW_EV_PARAM_LEN ); + current_val =iwe_stream_add_value (info, current_ev, + current_val, end_buf, + &iwe,IW_EV_PARAM_LEN ); }/* Check if we added any event */ if ((current_val - current_ev) >IW_EV_LCP_LEN )
@@ -7270,7 +7279,8 @@ static inline char *airo_translate_scan(struct net_device *dev, iwe.cmd =IWEVCUSTOM ;sprintf (buf,"bcn_int=%d" , bss->beaconInterval); iwe.u.data.length =strlen (buf); - current_ev =iwe_stream_add_point (current_ev, end_buf, &iwe, buf); + current_ev =iwe_stream_add_point (info, current_ev, end_buf, + &iwe, buf);kfree (buf); }
@@ -7304,8 +7314,10 @@ static inline char *airo_translate_scan(struct net_device *dev, iwe.cmd =IWEVGENIE ; iwe.u.data.length =min (info_element->len +2 ,MAX_WPA_IE_LEN ); - current_ev =iwe_stream_add_point (current_ev, end_buf, - &iwe, (char *) info_element); + current_ev =iwe_stream_add_point ( + info, current_ev, + end_buf, &iwe, + (char *) info_element); }break ;
@@ -7313,8 +7325,9 @@ static inline char *airo_translate_scan(struct net_device *dev, iwe.cmd =IWEVGENIE ; iwe.u.data.length =min (info_element->len +2 ,MAX_WPA_IE_LEN ); - current_ev =iwe_stream_add_point (current_ev, end_buf, - &iwe, (char *) info_element); + current_ev =iwe_stream_add_point ( + info, current_ev, end_buf, + &iwe, (char *) info_element);break ;default :
@@ -7353,7 +7366,7 @@ static int airo_get_scan(struct net_device *dev, list_for_each_entry (net, &ai->network_list, list) {/* Translate to WE format this entry */ - current_ev =airo_translate_scan (dev, current_ev, + current_ev =airo_translate_scan (dev, info, current_ev, extra + dwrq->length, &net->bss);
drivers/net/wireless/atmel.c +18 -6
@@ -2310,30 +2310,40 @@ static int atmel_get_scan(struct net_device *dev, iwe.cmd =SIOCGIWAP ; iwe.u.ap_addr.sa_family =ARPHRD_ETHER ;memcpy (iwe.u.ap_addr.sa_data, priv->BSSinfo[i].BSSID,6 ); - current_ev =iwe_stream_add_event (current_ev, extra +IW_SCAN_MAX_DATA , &iwe,IW_EV_ADDR_LEN ); + current_ev =iwe_stream_add_event (info, current_ev, + extra +IW_SCAN_MAX_DATA , + &iwe,IW_EV_ADDR_LEN ); iwe.u.data.length = priv->BSSinfo[i].SSIDsize;if (iwe.u.data.length >32 ) iwe.u.data.length =32 ; iwe.cmd =SIOCGIWESSID ; iwe.u.data.flags =1 ; - current_ev =iwe_stream_add_point (current_ev, extra +IW_SCAN_MAX_DATA , &iwe, priv->BSSinfo[i].SSID); + current_ev =iwe_stream_add_point (info, current_ev, + extra +IW_SCAN_MAX_DATA , + &iwe, priv->BSSinfo[i].SSID); iwe.cmd =SIOCGIWMODE ; iwe.u.mode = priv->BSSinfo[i].BSStype; - current_ev =iwe_stream_add_event (current_ev, extra +IW_SCAN_MAX_DATA , &iwe,IW_EV_UINT_LEN ); + current_ev =iwe_stream_add_event (info, current_ev, + extra +IW_SCAN_MAX_DATA , + &iwe,IW_EV_UINT_LEN ); iwe.cmd =SIOCGIWFREQ ; iwe.u.freq.m = priv->BSSinfo[i].channel; iwe.u.freq.e =0 ; - current_ev =iwe_stream_add_event (current_ev, extra +IW_SCAN_MAX_DATA , &iwe,IW_EV_FREQ_LEN ); + current_ev =iwe_stream_add_event (info, current_ev, + extra +IW_SCAN_MAX_DATA , + &iwe,IW_EV_FREQ_LEN );/* Add quality statistics */ iwe.cmd =IWEVQUAL ; iwe.u.qual.level = priv->BSSinfo[i].RSSI; iwe.u.qual.qual = iwe.u.qual.level;/* iwe.u.qual.noise = SOMETHING */ - current_ev =iwe_stream_add_event (current_ev, extra +IW_SCAN_MAX_DATA , &iwe,IW_EV_QUAL_LEN ); + current_ev =iwe_stream_add_event (info, current_ev, + extra +IW_SCAN_MAX_DATA , + &iwe,IW_EV_QUAL_LEN ); iwe.cmd =SIOCGIWENCODE ;
@@ -2342,7 +2352,9 @@ static int atmel_get_scan(struct net_device *dev,else iwe.u.data.flags =IW_ENCODE_DISABLED ; iwe.u.data.length =0 ; - current_ev =iwe_stream_add_point (current_ev, extra +IW_SCAN_MAX_DATA , &iwe,NULL ); + current_ev =iwe_stream_add_point (info, current_ev, + extra +IW_SCAN_MAX_DATA , + &iwe,NULL ); }/* Length of data */
drivers/net/wireless/hostap/hostap.h +2 -1
@@ -67,7 +67,8 @@ void * ap_crypt_get_ptrs(struct ap_data *ap, u8 *addr, int permanent,int prism2_ap_get_sta_qual (local_info_t *local,struct sockaddr addr[],struct iw_quality qual[],int buf_size,int aplist); -int prism2_ap_translate_scan (struct net_device *dev,char *buffer); +int prism2_ap_translate_scan (struct net_device *dev, +struct iw_request_info *info,char *buffer);int prism2_hostapd (struct ap_data *ap,struct prism2_hostapd_param *param);
drivers/net/wireless/hostap/hostap_ap.c +16 -16
@@ -2420,7 +2420,8 @@ int prism2_ap_get_sta_qual(local_info_t *local, struct sockaddr addr[],/* Translate our list of Access Points & Stations to a card independant * format that the Wireless Tools will understand - Jean II */ -int prism2_ap_translate_scan (struct net_device *dev,char *buffer) +int prism2_ap_translate_scan (struct net_device *dev, +struct iw_request_info *info,char *buffer) {struct hostap_interface *iface;local_info_t *local;
@@ -2449,8 +2450,8 @@ int prism2_ap_translate_scan(struct net_device *dev, char *buffer) iwe.u.ap_addr.sa_family =ARPHRD_ETHER ;memcpy (iwe.u.ap_addr.sa_data, sta->addr,ETH_ALEN ); iwe.len =IW_EV_ADDR_LEN ; - current_ev =iwe_stream_add_event (current_ev, end_buf, &iwe, -IW_EV_ADDR_LEN ); + current_ev =iwe_stream_add_event (info, current_ev, end_buf, + &iwe,IW_EV_ADDR_LEN );/* Use the mode to indicate if it's a station or * an Access Point */
@@ -2461,8 +2462,8 @@ int prism2_ap_translate_scan(struct net_device *dev, char *buffer)else iwe.u.mode =IW_MODE_INFRA ; iwe.len =IW_EV_UINT_LEN ; - current_ev =iwe_stream_add_event (current_ev, end_buf, &iwe, -IW_EV_UINT_LEN ); + current_ev =iwe_stream_add_event (info, current_ev, end_buf, + &iwe,IW_EV_UINT_LEN );/* Some quality */ memset (&iwe,0 ,sizeof (iwe));
@@ -2477,8 +2478,8 @@ int prism2_ap_translate_scan(struct net_device *dev, char *buffer) iwe.u.qual.noise =HFA384X_LEVEL_TO_dBm (sta->last_rx_silence); iwe.u.qual.updated = sta->last_rx_updated; iwe.len =IW_EV_QUAL_LEN ; - current_ev =iwe_stream_add_event (current_ev, end_buf, &iwe, -IW_EV_QUAL_LEN ); + current_ev =iwe_stream_add_event (info, current_ev, end_buf, + &iwe,IW_EV_QUAL_LEN );#ifndef PRISM2_NO_KERNEL_IEEE80211_MGMT if (sta->ap) {
@@ -2486,8 +2487,8 @@ int prism2_ap_translate_scan(struct net_device *dev, char *buffer) iwe.cmd =SIOCGIWESSID ; iwe.u.data.length = sta->u.ap.ssid_len; iwe.u.data.flags =1 ; - current_ev =iwe_stream_add_point (current_ev, end_buf, - &iwe, + current_ev =iwe_stream_add_point (info, current_ev, + end_buf, &iwe, sta->u.ap.ssid);memset (&iwe,0 ,sizeof (iwe));
@@ -2497,10 +2498,9 @@ int prism2_ap_translate_scan(struct net_device *dev, char *buffer)IW_ENCODE_ENABLED |IW_ENCODE_NOKEY ; else iwe.u.data.flags = IW_ENCODE_DISABLED; - current_ev =iwe_stream_add_point (current_ev, end_buf, - &iwe, - sta->u.ap.ssid -/* 0 byte memcpy */ ); + current_ev =iwe_stream_add_point (info, current_ev, + end_buf, &iwe, + sta->u.ap.ssid);if (sta->u.ap.channel >0 && sta->u.ap.channel <=FREQ_COUNT ) {
@@ -2510,7 +2510,7 @@ int prism2_ap_translate_scan(struct net_device *dev, char *buffer) *100000 ; iwe.u.freq.e =1 ; current_ev =iwe_stream_add_event ( - current_ev, end_buf, &iwe, + info, current_ev, end_buf, &iwe,IW_EV_FREQ_LEN ); }
@@ -2519,8 +2519,8 @@ int prism2_ap_translate_scan(struct net_device *dev, char *buffer)sprintf (buf,"beacon_interval=%d" , sta->listen_interval); iwe.u.data.length =strlen (buf); - current_ev =iwe_stream_add_point (current_ev, end_buf, - &iwe, buf); + current_ev =iwe_stream_add_point (info, current_ev, + end_buf, &iwe, buf); }#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */
drivers/net/wireless/hostap/hostap_ioctl.c +29 -25
166 lines not on this page · raw message
drivers/net/wireless/libertas/scan.c +17 -15
@@ -776,8 +776,9 @@ out:#define MAX_CUSTOM_LEN 64static inline char *lbs_translate_scan (struct lbs_private *priv, -char *start,char *stop, -struct bss_descriptor *bss) +struct iw_request_info *info, +char *start,char *stop, +struct bss_descriptor *bss) {struct chan_freq_power *cfp;char *current_val;/* For rates */
@@ -801,24 +802,24 @@ static inline char *lbs_translate_scan(struct lbs_private *priv, iwe.cmd =SIOCGIWAP ; iwe.u.ap_addr.sa_family =ARPHRD_ETHER ;memcpy (iwe.u.ap_addr.sa_data, &bss->bssid,ETH_ALEN ); - start =iwe_stream_add_event (start, stop, &iwe,IW_EV_ADDR_LEN ); + start =iwe_stream_add_event (info, start, stop, &iwe,IW_EV_ADDR_LEN );/* SSID */ iwe.cmd =SIOCGIWESSID ; iwe.u.data.flags =1 ; iwe.u.data.length =min ((uint32_t ) bss->ssid_len, (uint32_t )IW_ESSID_MAX_SIZE ); - start =iwe_stream_add_point (start, stop, &iwe, bss->ssid); + start =iwe_stream_add_point (info, start, stop, &iwe, bss->ssid);/* Mode */ iwe.cmd =SIOCGIWMODE ; iwe.u.mode = bss->mode; - start =iwe_stream_add_event (start, stop, &iwe,IW_EV_UINT_LEN ); + start =iwe_stream_add_event (info, start, stop, &iwe,IW_EV_UINT_LEN );/* Frequency */ iwe.cmd =SIOCGIWFREQ ; iwe.u.freq.m = (long )cfp->freq *100000 ; iwe.u.freq.e =1 ; - start =iwe_stream_add_event (start, stop, &iwe,IW_EV_FREQ_LEN ); + start =iwe_stream_add_event (info, start, stop, &iwe,IW_EV_FREQ_LEN );/* Add quality statistics */ iwe.cmd =IWEVQUAL ;
@@ -852,7 +853,7 @@ static inline char *lbs_translate_scan(struct lbs_private *priv, nf = priv->NF[TYPE_RXPD ][TYPE_AVG ] /AVG_SCALE ; iwe.u.qual.level =CAL_RSSI (snr, nf); } - start =iwe_stream_add_event (start, stop, &iwe,IW_EV_QUAL_LEN ); + start =iwe_stream_add_event (info, start, stop, &iwe,IW_EV_QUAL_LEN );/* Add encryption capability */ iwe.cmd =SIOCGIWENCODE ;
@@ -862,7 +863,7 @@ static inline char *lbs_translate_scan(struct lbs_private *priv, iwe.u.data.flags =IW_ENCODE_DISABLED ; } iwe.u.data.length =0 ; - start =iwe_stream_add_point (start, stop, &iwe, bss->ssid); + start =iwe_stream_add_point (info, start, stop, &iwe, bss->ssid); current_val = start +IW_EV_LCP_LEN ;
@@ -874,15 +875,15 @@ static inline char *lbs_translate_scan(struct lbs_private *priv,for (j =0 ; bss->rates[j] && (j <sizeof (bss->rates)); j++) {/* Bit rate given in 500 kb/s units */ iwe.u.bitrate.value = bss->rates[j] *500000 ; - current_val =iwe_stream_add_value (start, current_val, - stop, &iwe,IW_EV_PARAM_LEN ); + current_val =iwe_stream_add_value (info, start, current_val, + stop, &iwe,IW_EV_PARAM_LEN ); }if ((bss->mode ==IW_MODE_ADHOC ) && priv->adhoccreate && !lbs_ssid_cmp (priv->curbssparams.ssid, priv->curbssparams.ssid_len, bss->ssid, bss->ssid_len)) { iwe.u.bitrate.value =22 *500000 ; - current_val =iwe_stream_add_value (start, current_val, + current_val =iwe_stream_add_value (info, start, current_val, stop, &iwe,IW_EV_PARAM_LEN ); }/* Check if we added any event */
@@ -895,7 +896,7 @@ static inline char *lbs_translate_scan(struct lbs_private *priv,memcpy (buf, bss->wpa_ie, bss->wpa_ie_len); iwe.cmd =IWEVGENIE ; iwe.u.data.length = bss->wpa_ie_len; - start =iwe_stream_add_point (start, stop, &iwe, buf); + start =iwe_stream_add_point (info, start, stop, &iwe, buf); }memset (&iwe,0 ,sizeof (iwe));
@@ -904,7 +905,7 @@ static inline char *lbs_translate_scan(struct lbs_private *priv,memcpy (buf, bss->rsn_ie, bss->rsn_ie_len); iwe.cmd =IWEVGENIE ; iwe.u.data.length = bss->rsn_ie_len; - start =iwe_stream_add_point (start, stop, &iwe, buf); + start =iwe_stream_add_point (info, start, stop, &iwe, buf); }if (bss->mesh) {
@@ -915,7 +916,8 @@ static inline char *lbs_translate_scan(struct lbs_private *priv, p +=snprintf (p,MAX_CUSTOM_LEN ,"mesh-type: olpc" ); iwe.u.data.length = p - custom;if (iwe.u.data.length) - start =iwe_stream_add_point (start, stop, &iwe, custom); + start =iwe_stream_add_point (info, start, stop, + &iwe, custom); } out:
@@ -1036,7 +1038,7 @@ int lbs_get_scan(struct net_device *dev, struct iw_request_info *info, }/* Translate to WE format this entry */ - next_ev =lbs_translate_scan (priv, ev, stop, iter_bss); + next_ev =lbs_translate_scan (priv, info, ev, stop, iter_bss);if (next_ev ==NULL )continue ; ev = next_ev;
drivers/net/wireless/orinoco.c +10 -9
@@ -4046,6 +4046,7 @@ static int orinoco_ioctl_setscan(struct net_device *dev,* format that the Wireless Tools will understand - Jean II * Return message length or -errno for fatal errors */ static inline char *orinoco_translate_scan(struct net_device *dev, + struct iw_request_info *info, char *current_ev, char *end_buf, union hermes_scan_info *bss,
@@ -4062,7 +4063,7 @@ static inline char *orinoco_translate_scan(struct net_device *dev, iwe.cmd =SIOCGIWAP ; iwe.u.ap_addr.sa_family =ARPHRD_ETHER ;memcpy (iwe.u.ap_addr.sa_data, bss->a.bssid,ETH_ALEN ); - current_ev =iwe_stream_add_event (current_ev, end_buf, &iwe,IW_EV_ADDR_LEN ); + current_ev =iwe_stream_add_event (info, current_ev, end_buf, &iwe,IW_EV_ADDR_LEN );/* Other entries will be displayed in the order we give them */
@@ -4072,7 +4073,7 @@ static inline char *orinoco_translate_scan(struct net_device *dev, iwe.u.data.length =32 ; iwe.cmd =SIOCGIWESSID ; iwe.u.data.flags =1 ; - current_ev =iwe_stream_add_point (current_ev, end_buf, &iwe, bss->a.essid); + current_ev =iwe_stream_add_point (info, current_ev, end_buf, &iwe, bss->a.essid);/* Add mode */ iwe.cmd =SIOCGIWMODE ;
@@ -4082,7 +4083,7 @@ static inline char *orinoco_translate_scan(struct net_device *dev, iwe.u.mode =IW_MODE_MASTER ; else iwe.u.mode = IW_MODE_ADHOC; - current_ev =iwe_stream_add_event (current_ev, end_buf, &iwe,IW_EV_UINT_LEN ); + current_ev =iwe_stream_add_event (info, current_ev, end_buf, &iwe,IW_EV_UINT_LEN ); } channel = bss->s.channel;
@@ -4091,7 +4092,7 @@ static inline char *orinoco_translate_scan(struct net_device *dev, iwe.cmd =SIOCGIWFREQ ; iwe.u.freq.m = channel_frequency[channel-1 ] *100000 ; iwe.u.freq.e =1 ; - current_ev =iwe_stream_add_event (current_ev, end_buf, + current_ev =iwe_stream_add_event (info, current_ev, end_buf, &iwe,IW_EV_FREQ_LEN ); }
@@ -4106,7 +4107,7 @@ static inline char *orinoco_translate_scan(struct net_device *dev, iwe.u.qual.qual = iwe.u.qual.level - iwe.u.qual.noise; else iwe.u.qual.qual = 0; - current_ev =iwe_stream_add_event (current_ev, end_buf, &iwe,IW_EV_QUAL_LEN ); + current_ev =iwe_stream_add_event (info, current_ev, end_buf, &iwe,IW_EV_QUAL_LEN );/* Add encryption capability */ iwe.cmd =SIOCGIWENCODE ;
@@ -4115,7 +4116,7 @@ static inline char *orinoco_translate_scan(struct net_device *dev,else iwe.u.data.flags =IW_ENCODE_DISABLED ; iwe.u.data.length =0 ; - current_ev =iwe_stream_add_point (current_ev, end_buf, &iwe, bss->a.essid); + current_ev =iwe_stream_add_point (info, current_ev, end_buf, &iwe, bss->a.essid);/* Add EXTRA: Age to display seconds since last beacon/probe response * for given network. */
@@ -4126,7 +4127,7 @@ static inline char *orinoco_translate_scan(struct net_device *dev, jiffies_to_msecs(jiffies - last_scanned)); iwe.u.data.length = p - custom;if (iwe.u.data.length) - current_ev =iwe_stream_add_point (current_ev, end_buf, &iwe, custom); + current_ev =iwe_stream_add_point (info, current_ev, end_buf, &iwe, custom);/* Bit rate is not available in Lucent/Agere firmwares */ if (priv->firmware_type !=FIRMWARE_TYPE_AGERE ) {
@@ -4149,7 +4150,7 @@ static inline char *orinoco_translate_scan(struct net_device *dev,break ;/* Bit rate given in 500 kb/s units (+ 0x80) */ iwe.u.bitrate.value = ((bss->p.rates[i] &0x7f ) *500000 ); - current_val =iwe_stream_add_value (current_ev, current_val, + current_val =iwe_stream_add_value (info, current_ev, current_val, end_buf, &iwe,IW_EV_PARAM_LEN ); }
@@ -4190,7 +4191,7 @@ static int orinoco_ioctl_getscan(struct net_device *dev,list_for_each_entry (bss, &priv->bss_list, list) {/* Translate to WE format this entry */ - current_ev =orinoco_translate_scan (dev, current_ev, + current_ev =orinoco_translate_scan (dev, info, current_ev, extra + srq->length, &bss->bss, bss->last_scanned);
drivers/net/wireless/prism54/isl_ioctl.c +25 -20
118 lines not on this page · raw message
drivers/net/wireless/rndis_wlan.c +14 -13
@@ -1603,7 +1603,8 @@ static int rndis_iw_set_scan(struct net_device *dev,static char *rndis_translate_scan (struct net_device *dev, -char *cev,char *end_buf,struct ndis_80211_bssid_ex *bssid) +struct iw_request_info *info,char *cev, +char *end_buf,struct ndis_80211_bssid_ex *bssid) {#ifdef DEBUG struct usbnet *usbdev = dev->priv;
@@ -1622,14 +1623,14 @@ static char *rndis_translate_scan(struct net_device *dev, iwe.cmd =SIOCGIWAP ; iwe.u.ap_addr.sa_family =ARPHRD_ETHER ;memcpy (iwe.u.ap_addr.sa_data, bssid->mac,ETH_ALEN ); - cev =iwe_stream_add_event (cev, end_buf, &iwe,IW_EV_ADDR_LEN ); + cev =iwe_stream_add_event (info, cev, end_buf, &iwe,IW_EV_ADDR_LEN );devdbg (usbdev,"SSID(%d) %s" ,le32_to_cpu (bssid->ssid.length), bssid->ssid.essid); iwe.cmd =SIOCGIWESSID ; iwe.u.essid.length =le32_to_cpu (bssid->ssid.length); iwe.u.essid.flags =1 ; - cev =iwe_stream_add_point (cev, end_buf, &iwe, bssid->ssid.essid); + cev =iwe_stream_add_point (info, cev, end_buf, &iwe, bssid->ssid.essid);devdbg (usbdev,"MODE %d" ,le32_to_cpu (bssid->net_infra)); iwe.cmd =SIOCGIWMODE ;
@@ -1645,12 +1646,12 @@ static char *rndis_translate_scan(struct net_device *dev, iwe.u.mode =IW_MODE_AUTO ;break ; } - cev =iwe_stream_add_event (cev, end_buf, &iwe,IW_EV_UINT_LEN ); + cev =iwe_stream_add_event (info, cev, end_buf, &iwe,IW_EV_UINT_LEN );devdbg (usbdev,"FREQ %d kHz" ,le32_to_cpu (bssid->config.ds_config)); iwe.cmd =SIOCGIWFREQ ;dsconfig_to_freq (le32_to_cpu (bssid->config.ds_config), &iwe.u.freq); - cev =iwe_stream_add_event (cev, end_buf, &iwe,IW_EV_FREQ_LEN ); + cev =iwe_stream_add_event (info, cev, end_buf, &iwe,IW_EV_FREQ_LEN );devdbg (usbdev,"QUAL %d" ,le32_to_cpu (bssid->rssi)); iwe.cmd =IWEVQUAL ;
@@ -1659,7 +1660,7 @@ static char *rndis_translate_scan(struct net_device *dev, iwe.u.qual.updated =IW_QUAL_QUAL_UPDATED |IW_QUAL_LEVEL_UPDATED |IW_QUAL_NOISE_INVALID ; - cev =iwe_stream_add_event (cev, end_buf, &iwe,IW_EV_QUAL_LEN ); + cev =iwe_stream_add_event (info, cev, end_buf, &iwe,IW_EV_QUAL_LEN );devdbg (usbdev,"ENCODE %d" ,le32_to_cpu (bssid->privacy)); iwe.cmd =SIOCGIWENCODE ;
@@ -1669,7 +1670,7 @@ static char *rndis_translate_scan(struct net_device *dev,else iwe.u.data.flags =IW_ENCODE_ENABLED |IW_ENCODE_NOKEY ; - cev =iwe_stream_add_point (cev, end_buf, &iwe,NULL ); + cev =iwe_stream_add_point (info, cev, end_buf, &iwe,NULL );devdbg (usbdev,"RATES:" ); current_val = cev +IW_EV_LCP_LEN ;
@@ -1680,7 +1681,7 @@ static char *rndis_translate_scan(struct net_device *dev, ((bssid->rates[i] &0x7f ) *500000 );devdbg (usbdev," %d" , iwe.u.bitrate.value); - current_val =iwe_stream_add_value (cev, + current_val =iwe_stream_add_value (info, cev, current_val, end_buf, &iwe,IW_EV_PARAM_LEN ); }
@@ -1694,14 +1695,14 @@ static char *rndis_translate_scan(struct net_device *dev, iwe.cmd =IWEVCUSTOM ;snprintf (sbuf,sizeof (sbuf),"bcn_int=%d" , beacon); iwe.u.data.length =strlen (sbuf); - cev =iwe_stream_add_point (cev, end_buf, &iwe, sbuf); + cev =iwe_stream_add_point (info, cev, end_buf, &iwe, sbuf); atim =le32_to_cpu (bssid->config.atim_window);devdbg (usbdev,"ATIM %d" , atim); iwe.cmd =IWEVCUSTOM ;snprintf (sbuf,sizeof (sbuf),"atim=%u" , atim); iwe.u.data.length =strlen (sbuf); - cev =iwe_stream_add_point (cev, end_buf, &iwe, sbuf); + cev =iwe_stream_add_point (info, cev, end_buf, &iwe, sbuf); ie = (void *)(bssid->ies +sizeof (struct ndis_80211_fixed_ies )); ie_len = min(bssid_len - (int)sizeof(*bssid),
@@ -1715,7 +1716,7 @@ static char *rndis_translate_scan(struct net_device *dev, (ie->id == MFIE_TYPE_RSN) ? 2 : 1); iwe.cmd =IWEVGENIE ; iwe.u.data.length =min (ie->len +2 ,MAX_WPA_IE_LEN ); - cev =iwe_stream_add_point (cev, end_buf, &iwe, + cev =iwe_stream_add_point (info, cev, end_buf, &iwe, (u8 *)ie); }
@@ -1758,8 +1759,8 @@ static int rndis_iw_get_scan(struct net_device *dev,devdbg (usbdev,"SIOCGIWSCAN: %d BSSIDs found" , count);while (count && ((void *)bssid + bssid_len) <= (buf + len)) { - cev =rndis_translate_scan (dev, cev, extra +IW_SCAN_MAX_DATA , - bssid); + cev =rndis_translate_scan (dev, info, cev, + extra +IW_SCAN_MAX_DATA , bssid); bssid = (void *)bssid + bssid_len; bssid_len =le32_to_cpu (bssid->length); count--;
drivers/net/wireless/wl3501_cs.c +5 -5
@@ -1624,25 +1624,25 @@ static int wl3501_get_scan(struct net_device *dev, struct iw_request_info *info, iwe.cmd =SIOCGIWAP ; iwe.u.ap_addr.sa_family =ARPHRD_ETHER ;memcpy (iwe.u.ap_addr.sa_data, this->bss_set[i].bssid,ETH_ALEN ); - current_ev =iwe_stream_add_event (current_ev, + current_ev =iwe_stream_add_event (info, current_ev, extra +IW_SCAN_MAX_DATA , &iwe,IW_EV_ADDR_LEN ); iwe.cmd =SIOCGIWESSID ; iwe.u.data.flags =1 ; iwe.u.data.length = this->bss_set[i].ssid.el.len; - current_ev =iwe_stream_add_point (current_ev, + current_ev =iwe_stream_add_point (info, current_ev, extra +IW_SCAN_MAX_DATA , &iwe, this->bss_set[i].ssid.essid); iwe.cmd =SIOCGIWMODE ; iwe.u.mode = this->bss_set[i].bss_type; - current_ev =iwe_stream_add_event (current_ev, + current_ev =iwe_stream_add_event (info, current_ev, extra +IW_SCAN_MAX_DATA , &iwe,IW_EV_UINT_LEN ); iwe.cmd =SIOCGIWFREQ ; iwe.u.freq.m = this->bss_set[i].ds_pset.chan; iwe.u.freq.e =0 ; - current_ev =iwe_stream_add_event (current_ev, + current_ev =iwe_stream_add_event (info, current_ev, extra +IW_SCAN_MAX_DATA , &iwe,IW_EV_FREQ_LEN ); iwe.cmd =SIOCGIWENCODE ;
@@ -1651,7 +1651,7 @@ static int wl3501_get_scan(struct net_device *dev, struct iw_request_info *info,else iwe.u.data.flags =IW_ENCODE_DISABLED ; iwe.u.data.length =0 ; - current_ev =iwe_stream_add_point (current_ev, + current_ev =iwe_stream_add_point (info, current_ev, extra +IW_SCAN_MAX_DATA , &iwe,NULL ); }
drivers/net/wireless/zd1201.c +13 -8
@@ -1152,32 +1152,36 @@ static int zd1201_get_scan(struct net_device *dev, iwe.cmd =SIOCGIWAP ; iwe.u.ap_addr.sa_family =ARPHRD_ETHER ;memcpy (iwe.u.ap_addr.sa_data, zd->rxdata+i+6 ,6 ); - cev =iwe_stream_add_event (cev, end_buf, &iwe,IW_EV_ADDR_LEN ); + cev =iwe_stream_add_event (info, cev, end_buf, + &iwe,IW_EV_ADDR_LEN ); iwe.cmd =SIOCGIWESSID ; iwe.u.data.length = zd->rxdata[i+16 ]; iwe.u.data.flags =1 ; - cev =iwe_stream_add_point (cev, end_buf, &iwe, zd->rxdata+i+18 ); + cev =iwe_stream_add_point (info, cev, end_buf, + &iwe, zd->rxdata+i+18 ); iwe.cmd =SIOCGIWMODE ;if (zd->rxdata[i+14 ]&0x01 ) iwe.u.mode =IW_MODE_MASTER ;else iwe.u.mode =IW_MODE_ADHOC ; - cev =iwe_stream_add_event (cev, end_buf, &iwe,IW_EV_UINT_LEN ); + cev =iwe_stream_add_event (info, cev, end_buf, + &iwe,IW_EV_UINT_LEN ); iwe.cmd =SIOCGIWFREQ ; iwe.u.freq.m = zd->rxdata[i+0 ]; iwe.u.freq.e =0 ; - cev =iwe_stream_add_event (cev, end_buf, &iwe,IW_EV_FREQ_LEN ); + cev =iwe_stream_add_event (info, cev, end_buf, + &iwe,IW_EV_FREQ_LEN ); iwe.cmd =SIOCGIWRATE ; iwe.u.bitrate.fixed =0 ; iwe.u.bitrate.disabled =0 ;for (j=0 ; j<10 ; j++)if (zd->rxdata[i+50 +j]) { iwe.u.bitrate.value = (zd->rxdata[i+50 +j]&0x7f )*500000 ; - cev=iwe_stream_add_event (cev, end_buf, &iwe, -IW_EV_PARAM_LEN ); + cev=iwe_stream_add_event (info, cev, end_buf, + &iwe,IW_EV_PARAM_LEN ); } iwe.cmd =SIOCGIWENCODE ;
@@ -1186,14 +1190,15 @@ static int zd1201_get_scan(struct net_device *dev, iwe.u.data.flags =IW_ENCODE_ENABLED ; else iwe.u.data.flags = IW_ENCODE_DISABLED; - cev =iwe_stream_add_point (cev, end_buf, &iwe,NULL ); + cev =iwe_stream_add_point (info, cev, end_buf, &iwe,NULL ); iwe.cmd =IWEVQUAL ; iwe.u.qual.qual = zd->rxdata[i+4 ]; iwe.u.qual.noise= zd->rxdata[i+2 ]/10 -100 ; iwe.u.qual.level = (256 +zd->rxdata[i+4 ]*100 )/255 -100 ; iwe.u.qual.updated =7 ; - cev =iwe_stream_add_event (cev, end_buf, &iwe,IW_EV_QUAL_LEN ); + cev =iwe_stream_add_event (info, cev, end_buf, + &iwe,IW_EV_QUAL_LEN ); }if (!enabled_save)
include/linux/wireless.h +15 -0
@@ -1111,6 +1111,21 @@ struct iw_event#define IW_EV_POINT_LEN (IW_EV_LCP_LEN + sizeof(struct iw_point) - \ IW_EV_POINT_OFF) +#ifdef __KERNEL__ +#ifdef CONFIG_COMPAT +struct __compat_iw_event { +__u16 len;/* Real length of this stuff */ +__u16 cmd;/* Wireless IOCTL */ +compat_caddr_t pointer; +}; +#define IW_EV_COMPAT_LCP_LEN offsetof(struct __compat_iw_event, pointer) +#define IW_EV_COMPAT_POINT_OFF offsetof(struct compat_iw_point, length) +#define IW_EV_COMPAT_POINT_LEN \ + (IW_EV_COMPAT_LCP_LEN + sizeof(struct compat_iw_point) - \ + IW_EV_COMPAT_POINT_OFF) +#endif +#endif +/* Size of the Event prefix when packed in stream */ #define IW_EV_LCP_PK_LEN (4)/* Size of the various events when packed in stream */
include/net/iw_handler.h +42 -107
194 lines not on this page · raw message
net/ieee80211/ieee80211_wx.c +26 -18
142 lines not on this page · raw message
net/mac80211/ieee80211_i.h +4 -1
@@ -23,6 +23,7 @@#include <linux/spinlock.h> #include <linux/etherdevice.h> #include <net/wireless.h> +#include <net/iw_handler.h> #include "key.h" #include "sta_info.h"
@@ -908,7 +909,9 @@ int ieee80211_sta_set_bssid(struct net_device *dev, u8 *bssid);int ieee80211_sta_req_scan (struct net_device *dev,u8 *ssid,size_t ssid_len);void ieee80211_sta_req_auth (struct net_device *dev,struct ieee80211_if_sta *ifsta); -int ieee80211_sta_scan_results (struct net_device *dev,char *buf,size_t len); +int ieee80211_sta_scan_results (struct net_device *dev, +struct iw_request_info *info, +char *buf,size_t len);ieee80211_rx_result ieee80211_sta_rx_scan (struct net_device *dev,struct sk_buff *skb,struct ieee80211_rx_status *rx_status);
net/mac80211/mlme.c +23 -20
156 lines not on this page · raw message
net/mac80211/wext.c +1 -1
@@ -554,7 +554,7 @@ static int ieee80211_ioctl_giwscan(struct net_device *dev,if (local->sta_sw_scanning || local->sta_hw_scanning)return -EAGAIN ; - res =ieee80211_sta_scan_results (dev, extra, data->length); + res =ieee80211_sta_scan_results (dev, info, extra, data->length);if (res >=0 ) { data->length = res;return 0 ;
Signature · 6 lines
1.5.5.1.308.g1fbb5 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Johannes Berg
maintainerAwesome stuff. With respect to wpa supplicant, I'd expect we need some sort of handling for this wrt. notifications (multicast) which is a bit awkward, but maybe wpa supplicant doesn't care too much.
Quoted 13 lines
4) The mechanical transformations to the drivers and wireless stack bits to get the
iw_request_infopassed down into the routines modified in #3.drivers/net/wireless/airo.c | 39 +++++--- drivers/net/wireless/atmel.c | 24 ++++- drivers/net/wireless/hostap/hostap.h | 3 +- drivers/net/wireless/hostap/hostap_ap.c | 32 +++--- drivers/net/wireless/hostap/hostap_ioctl.c | 54 ++++++----- drivers/net/wireless/libertas/scan.c | 32 +++--- drivers/net/wireless/orinoco.c | 19 ++-- drivers/net/wireless/prism54/isl_ioctl.c | 45 +++++---- drivers/net/wireless/rndis_wlan.c | 27 +++---
Quoted 8 lines
drivers/net/wireless/wl3501_cs.c | 10 +- drivers/net/wireless/zd1201.c | 21 +++-- include/linux/wireless.h | 15 +++ include/net/iw_handler.h | 149 ++++++++-------------------- net/ieee80211/ieee80211_wx.c | 44 +++++---- net/mac80211/ieee80211_i.h | 5 +- net/mac80211/mlme.c | 43 +++++---- net/mac80211/wext.c | 2 +-
Did you miss drivers/net/ps3_gelic_wireless.c?
johannes
David Miller
maintainerFrom: Johannes Berg <[email protected]>
Date: Tue, 03 Jun 2008 22:48:49 +0200
Quoted 1 line
Did you miss
drivers/net/ps3_gelic_wireless.c?
Likely yes, I guess that won't get hit with an allmodconfig build on sparc64 :(
It would be really nice if we had some more compat layers so that the ps3 bus probing layer just nopped out but you could at least build test drivers on other platforms.
David Miller
maintainerFrom: David Miller <[email protected]>
Date: Tue, 03 Jun 2008 13:57:28 -0700 (PDT)
Quoted 7 lines
From: Johannes Berg <[email protected]>
Date: Tue, 03 Jun 2008 22:48:49 +0200Quoted 1 line
Did you miss
drivers/net/ps3_gelic_wireless.c?Likely yes, I guess that won't get hit with an allmodconfig build on sparc64 :(
Here is a respin of patch 12 with the ps3 bits included, thank for noticing Johannes.
I've also respun the tree on kernel.org so that it's fixed there too.
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.
With a lot of help and bug fixes from Masakazu Mokuno.
--- drivers/net/ps3_gelic_wireless.c | 26 +++--- drivers/net/wireless/airo.c | 39 +++++--- drivers/net/wireless/atmel.c | 24 ++++- drivers/net/wireless/hostap/hostap.h | 3 +- drivers/net/wireless/hostap/hostap_ap.c | 32 +++--- drivers/net/wireless/hostap/hostap_ioctl.c | 54 ++++++----- drivers/net/wireless/libertas/scan.c | 32 +++--- drivers/net/wireless/orinoco.c | 19 ++-- drivers/net/wireless/prism54/isl_ioctl.c | 45 +++++---- drivers/net/wireless/rndis_wlan.c | 27 +++--- drivers/net/wireless/wl3501_cs.c | 10 +- drivers/net/wireless/zd1201.c | 21 +++-- include/linux/wireless.h | 15 +++ include/net/iw_handler.h | 149 ++++++++-------------------- net/ieee80211/ieee80211_wx.c | 44 +++++---- net/mac80211/ieee80211_i.h | 5 +- net/mac80211/mlme.c | 43 +++++---- net/mac80211/wext.c | 2 +- 18 files changed, 300 insertions(+), 290 deletions(-)
drivers/net/ps3_gelic_wireless.c +14 -12
@@ -553,6 +553,7 @@ static void gelic_wl_parse_ie(u8 *data, size_t len,* independent format */ static char *gelic_wl_translate_scan (struct net_device *netdev, +struct iw_request_info *info,char *ev,char *stop,struct gelic_wl_scan_info *network)
@@ -570,20 +571,20 @@ static char *gelic_wl_translate_scan(struct net_device *netdev, iwe.cmd =SIOCGIWAP ; iwe.u.ap_addr.sa_family =ARPHRD_ETHER ;memcpy (iwe.u.ap_addr.sa_data, &scan->bssid[2 ],ETH_ALEN ); - ev =iwe_stream_add_event (ev, stop, &iwe,IW_EV_ADDR_LEN ); + ev =iwe_stream_add_event (info, ev, stop, &iwe,IW_EV_ADDR_LEN );/* ESSID */ iwe.cmd =SIOCGIWESSID ; iwe.u.data.flags =1 ; iwe.u.data.length =strnlen (scan->essid,32 ); - ev =iwe_stream_add_point (ev, stop, &iwe, scan->essid); + ev =iwe_stream_add_point (info, ev, stop, &iwe, scan->essid);/* FREQUENCY */ iwe.cmd =SIOCGIWFREQ ; iwe.u.freq.m =be16_to_cpu (scan->channel); iwe.u.freq.e =0 ;/* table value in MHz */ iwe.u.freq.i =0 ; - ev =iwe_stream_add_event (ev, stop, &iwe,IW_EV_FREQ_LEN ); + ev =iwe_stream_add_event (info, ev, stop, &iwe,IW_EV_FREQ_LEN );/* RATES */ iwe.cmd =SIOCGIWRATE ;
@@ -602,12 +603,12 @@ static char *gelic_wl_translate_scan(struct net_device *netdev,else rate = scan->rate[i++] &0x7f ; iwe.u.bitrate.value = rate *500000 ;/* 500kbps unit */ - tmp =iwe_stream_add_value (ev, tmp, stop, &iwe, + tmp =iwe_stream_add_value (info, ev, tmp, stop, &iwe,IW_EV_PARAM_LEN ); }while (j < network->rate_ext_len) { iwe.u.bitrate.value = (scan->ext_rate[j++] &0x7f ) *500000 ; - tmp =iwe_stream_add_value (ev, tmp, stop, &iwe, + tmp =iwe_stream_add_value (info, ev, tmp, stop, &iwe,IW_EV_PARAM_LEN ); }/* Check if we added any rate */
@@ -621,7 +622,7 @@ static char *gelic_wl_translate_scan(struct net_device *netdev,else iwe.u.data.flags =IW_ENCODE_DISABLED ; iwe.u.data.length =0 ; - ev =iwe_stream_add_point (ev, stop, &iwe, scan->essid); + ev =iwe_stream_add_point (info, ev, stop, &iwe, scan->essid);/* MODE */ iwe.cmd =SIOCGIWMODE ;
@@ -631,7 +632,7 @@ static char *gelic_wl_translate_scan(struct net_device *netdev, iwe.u.mode =IW_MODE_MASTER ; else iwe.u.mode = IW_MODE_ADHOC; - ev =iwe_stream_add_event (ev, stop, &iwe,IW_EV_UINT_LEN ); + ev =iwe_stream_add_event (info, ev, stop, &iwe,IW_EV_UINT_LEN ); }/* QUAL */
@@ -641,7 +642,7 @@ static char *gelic_wl_translate_scan(struct net_device *netdev, iwe.u.qual.level =be16_to_cpu (scan->rssi); iwe.u.qual.qual =be16_to_cpu (scan->rssi); iwe.u.qual.noise =0 ; - ev =iwe_stream_add_event (ev, stop, &iwe,IW_EV_QUAL_LEN ); + ev =iwe_stream_add_event (info, ev, stop, &iwe,IW_EV_QUAL_LEN );/* RSN */ memset (&iwe,0 ,sizeof (iwe));
@@ -651,7 +652,7 @@ static char *gelic_wl_translate_scan(struct net_device *netdev,if (len) { iwe.cmd =IWEVGENIE ; iwe.u.data.length = len; - ev =iwe_stream_add_point (ev, stop, &iwe, buf); + ev =iwe_stream_add_point (info, ev, stop, &iwe, buf); } }else {/* this scan info has IE data */
@@ -666,7 +667,7 @@ static char *gelic_wl_translate_scan(struct net_device *netdev,memcpy (buf, ie_info.wpa.data, ie_info.wpa.len); iwe.cmd =IWEVGENIE ; iwe.u.data.length = ie_info.wpa.len; - ev =iwe_stream_add_point (ev, stop, &iwe, buf); + ev =iwe_stream_add_point (info, ev, stop, &iwe, buf); }if (ie_info.rsn.len && (ie_info.rsn.len <=sizeof (buf))) {
@@ -674,7 +675,7 @@ static char *gelic_wl_translate_scan(struct net_device *netdev,memcpy (buf, ie_info.rsn.data, ie_info.rsn.len); iwe.cmd =IWEVGENIE ; iwe.u.data.length = ie_info.rsn.len; - ev =iwe_stream_add_point (ev, stop, &iwe, buf); + ev =iwe_stream_add_point (info, ev, stop, &iwe, buf); } }
@@ -719,7 +720,8 @@ static int gelic_wl_get_scan(struct net_device *netdev,if (wl->scan_age ==0 ||time_after (scan_info->last_scanned + wl->scan_age, this_time)) - ev =gelic_wl_translate_scan (netdev, ev, stop, + ev =gelic_wl_translate_scan (netdev, info, + ev, stop, scan_info);else pr_debug ("%s:entry too old\n" , __func__);
drivers/net/wireless/airo.c +26 -13
@@ -7165,6 +7165,7 @@ out:* format that the Wireless Tools will understand - Jean II */ static inline char *airo_translate_scan (struct net_device *dev, +struct iw_request_info *info,char *current_ev,char *end_buf,BSSListRid *bss)
@@ -7181,7 +7182,8 @@ static inline char *airo_translate_scan(struct net_device *dev, iwe.cmd =SIOCGIWAP ; iwe.u.ap_addr.sa_family =ARPHRD_ETHER ;memcpy (iwe.u.ap_addr.sa_data, bss->bssid,ETH_ALEN ); - current_ev =iwe_stream_add_event (current_ev, end_buf, &iwe,IW_EV_ADDR_LEN ); + current_ev =iwe_stream_add_event (info, current_ev, end_buf, + &iwe,IW_EV_ADDR_LEN );/* Other entries will be displayed in the order we give them */
@@ -7191,7 +7193,8 @@ static inline char *airo_translate_scan(struct net_device *dev, iwe.u.data.length =32 ; iwe.cmd =SIOCGIWESSID ; iwe.u.data.flags =1 ; - current_ev =iwe_stream_add_point (current_ev, end_buf, &iwe, bss->ssid); + current_ev =iwe_stream_add_point (info, current_ev, end_buf, + &iwe, bss->ssid);/* Add mode */ iwe.cmd =SIOCGIWMODE ;
@@ -7201,7 +7204,8 @@ static inline char *airo_translate_scan(struct net_device *dev, iwe.u.mode =IW_MODE_MASTER ; else iwe.u.mode = IW_MODE_ADHOC; - current_ev =iwe_stream_add_event (current_ev, end_buf, &iwe,IW_EV_UINT_LEN ); + current_ev =iwe_stream_add_event (info, current_ev, end_buf, + &iwe,IW_EV_UINT_LEN ); }/* Add frequency */
@@ -7212,7 +7216,8 @@ static inline char *airo_translate_scan(struct net_device *dev,*/ iwe.u.freq.m = frequency_list[iwe.u.freq.m -1 ] *100000 ; iwe.u.freq.e =1 ; - current_ev =iwe_stream_add_event (current_ev, end_buf, &iwe,IW_EV_FREQ_LEN ); + current_ev =iwe_stream_add_event (info, current_ev, end_buf, + &iwe,IW_EV_FREQ_LEN ); dBm =le16_to_cpu (bss->dBm);
@@ -7232,7 +7237,8 @@ static inline char *airo_translate_scan(struct net_device *dev, | IW_QUAL_DBM; } iwe.u.qual.noise = ai->wstats.qual.noise; - current_ev =iwe_stream_add_event (current_ev, end_buf, &iwe,IW_EV_QUAL_LEN ); + current_ev =iwe_stream_add_event (info, current_ev, end_buf, + &iwe,IW_EV_QUAL_LEN );/* Add encryption capability */ iwe.cmd =SIOCGIWENCODE ;
@@ -7241,7 +7247,8 @@ static inline char *airo_translate_scan(struct net_device *dev,else iwe.u.data.flags =IW_ENCODE_DISABLED ; iwe.u.data.length =0 ; - current_ev =iwe_stream_add_point (current_ev, end_buf, &iwe, bss->ssid); + current_ev =iwe_stream_add_point (info, current_ev, end_buf, + &iwe, bss->ssid);/* Rate : stuffing multiple values in a single event require a bit * more of magic - Jean II */
@@ -7258,7 +7265,9 @@ static inline char *airo_translate_scan(struct net_device *dev,/* Bit rate given in 500 kb/s units (+ 0x80) */ iwe.u.bitrate.value = ((bss->rates[i] &0x7f ) *500000 );/* Add new value to event */ - current_val =iwe_stream_add_value (current_ev, current_val, end_buf, &iwe,IW_EV_PARAM_LEN ); + current_val =iwe_stream_add_value (info, current_ev, + current_val, end_buf, + &iwe,IW_EV_PARAM_LEN ); }/* Check if we added any event */ if ((current_val - current_ev) >IW_EV_LCP_LEN )
@@ -7270,7 +7279,8 @@ static inline char *airo_translate_scan(struct net_device *dev, iwe.cmd =IWEVCUSTOM ;sprintf (buf,"bcn_int=%d" , bss->beaconInterval); iwe.u.data.length =strlen (buf); - current_ev =iwe_stream_add_point (current_ev, end_buf, &iwe, buf); + current_ev =iwe_stream_add_point (info, current_ev, end_buf, + &iwe, buf);kfree (buf); }
@@ -7304,8 +7314,10 @@ static inline char *airo_translate_scan(struct net_device *dev, iwe.cmd =IWEVGENIE ; iwe.u.data.length =min (info_element->len +2 ,MAX_WPA_IE_LEN ); - current_ev =iwe_stream_add_point (current_ev, end_buf, - &iwe, (char *) info_element); + current_ev =iwe_stream_add_point ( + info, current_ev, + end_buf, &iwe, + (char *) info_element); }break ;
@@ -7313,8 +7325,9 @@ static inline char *airo_translate_scan(struct net_device *dev, iwe.cmd =IWEVGENIE ; iwe.u.data.length =min (info_element->len +2 ,MAX_WPA_IE_LEN ); - current_ev =iwe_stream_add_point (current_ev, end_buf, - &iwe, (char *) info_element); + current_ev =iwe_stream_add_point ( + info, current_ev, end_buf, + &iwe, (char *) info_element);break ;default :
@@ -7353,7 +7366,7 @@ static int airo_get_scan(struct net_device *dev, list_for_each_entry (net, &ai->network_list, list) {/* Translate to WE format this entry */ - current_ev =airo_translate_scan (dev, current_ev, + current_ev =airo_translate_scan (dev, info, current_ev, extra + dwrq->length, &net->bss);
drivers/net/wireless/atmel.c +18 -6
@@ -2310,30 +2310,40 @@ static int atmel_get_scan(struct net_device *dev, iwe.cmd =SIOCGIWAP ; iwe.u.ap_addr.sa_family =ARPHRD_ETHER ;memcpy (iwe.u.ap_addr.sa_data, priv->BSSinfo[i].BSSID,6 ); - current_ev =iwe_stream_add_event (current_ev, extra +IW_SCAN_MAX_DATA , &iwe,IW_EV_ADDR_LEN ); + current_ev =iwe_stream_add_event (info, current_ev, + extra +IW_SCAN_MAX_DATA , + &iwe,IW_EV_ADDR_LEN ); iwe.u.data.length = priv->BSSinfo[i].SSIDsize;if (iwe.u.data.length >32 ) iwe.u.data.length =32 ; iwe.cmd =SIOCGIWESSID ; iwe.u.data.flags =1 ; - current_ev =iwe_stream_add_point (current_ev, extra +IW_SCAN_MAX_DATA , &iwe, priv->BSSinfo[i].SSID); + current_ev =iwe_stream_add_point (info, current_ev, + extra +IW_SCAN_MAX_DATA , + &iwe, priv->BSSinfo[i].SSID); iwe.cmd =SIOCGIWMODE ; iwe.u.mode = priv->BSSinfo[i].BSStype; - current_ev =iwe_stream_add_event (current_ev, extra +IW_SCAN_MAX_DATA , &iwe,IW_EV_UINT_LEN ); + current_ev =iwe_stream_add_event (info, current_ev, + extra +IW_SCAN_MAX_DATA , + &iwe,IW_EV_UINT_LEN ); iwe.cmd =SIOCGIWFREQ ; iwe.u.freq.m = priv->BSSinfo[i].channel; iwe.u.freq.e =0 ; - current_ev =iwe_stream_add_event (current_ev, extra +IW_SCAN_MAX_DATA , &iwe,IW_EV_FREQ_LEN ); + current_ev =iwe_stream_add_event (info, current_ev, + extra +IW_SCAN_MAX_DATA , + &iwe,IW_EV_FREQ_LEN );/* Add quality statistics */ iwe.cmd =IWEVQUAL ; iwe.u.qual.level = priv->BSSinfo[i].RSSI; iwe.u.qual.qual = iwe.u.qual.level;/* iwe.u.qual.noise = SOMETHING */ - current_ev =iwe_stream_add_event (current_ev, extra +IW_SCAN_MAX_DATA , &iwe,IW_EV_QUAL_LEN ); + current_ev =iwe_stream_add_event (info, current_ev, + extra +IW_SCAN_MAX_DATA , + &iwe,IW_EV_QUAL_LEN ); iwe.cmd =SIOCGIWENCODE ;
@@ -2342,7 +2352,9 @@ static int atmel_get_scan(struct net_device *dev,else iwe.u.data.flags =IW_ENCODE_DISABLED ; iwe.u.data.length =0 ; - current_ev =iwe_stream_add_point (current_ev, extra +IW_SCAN_MAX_DATA , &iwe,NULL ); + current_ev =iwe_stream_add_point (info, current_ev, + extra +IW_SCAN_MAX_DATA , + &iwe,NULL ); }/* Length of data */
drivers/net/wireless/hostap/hostap.h +2 -1
@@ -67,7 +67,8 @@ void * ap_crypt_get_ptrs(struct ap_data *ap, u8 *addr, int permanent,int prism2_ap_get_sta_qual (local_info_t *local,struct sockaddr addr[],struct iw_quality qual[],int buf_size,int aplist); -int prism2_ap_translate_scan (struct net_device *dev,char *buffer); +int prism2_ap_translate_scan (struct net_device *dev, +struct iw_request_info *info,char *buffer);int prism2_hostapd (struct ap_data *ap,struct prism2_hostapd_param *param);
drivers/net/wireless/hostap/hostap_ap.c +16 -16
@@ -2420,7 +2420,8 @@ int prism2_ap_get_sta_qual(local_info_t *local, struct sockaddr addr[],/* Translate our list of Access Points & Stations to a card independant * format that the Wireless Tools will understand - Jean II */ -int prism2_ap_translate_scan (struct net_device *dev,char *buffer) +int prism2_ap_translate_scan (struct net_device *dev, +struct iw_request_info *info,char *buffer) {struct hostap_interface *iface;local_info_t *local;
@@ -2449,8 +2450,8 @@ int prism2_ap_translate_scan(struct net_device *dev, char *buffer) iwe.u.ap_addr.sa_family =ARPHRD_ETHER ;memcpy (iwe.u.ap_addr.sa_data, sta->addr,ETH_ALEN ); iwe.len =IW_EV_ADDR_LEN ; - current_ev =iwe_stream_add_event (current_ev, end_buf, &iwe, -IW_EV_ADDR_LEN ); + current_ev =iwe_stream_add_event (info, current_ev, end_buf, + &iwe,IW_EV_ADDR_LEN );/* Use the mode to indicate if it's a station or * an Access Point */
@@ -2461,8 +2462,8 @@ int prism2_ap_translate_scan(struct net_device *dev, char *buffer)else iwe.u.mode =IW_MODE_INFRA ; iwe.len =IW_EV_UINT_LEN ; - current_ev =iwe_stream_add_event (current_ev, end_buf, &iwe, -IW_EV_UINT_LEN ); + current_ev =iwe_stream_add_event (info, current_ev, end_buf, + &iwe,IW_EV_UINT_LEN );/* Some quality */ memset (&iwe,0 ,sizeof (iwe));
@@ -2477,8 +2478,8 @@ int prism2_ap_translate_scan(struct net_device *dev, char *buffer) iwe.u.qual.noise =HFA384X_LEVEL_TO_dBm (sta->last_rx_silence); iwe.u.qual.updated = sta->last_rx_updated; iwe.len =IW_EV_QUAL_LEN ; - current_ev =iwe_stream_add_event (current_ev, end_buf, &iwe, -IW_EV_QUAL_LEN ); + current_ev =iwe_stream_add_event (info, current_ev, end_buf, + &iwe,IW_EV_QUAL_LEN );#ifndef PRISM2_NO_KERNEL_IEEE80211_MGMT if (sta->ap) {
@@ -2486,8 +2487,8 @@ int prism2_ap_translate_scan(struct net_device *dev, char *buffer) iwe.cmd =SIOCGIWESSID ; iwe.u.data.length = sta->u.ap.ssid_len; iwe.u.data.flags =1 ; - current_ev =iwe_stream_add_point (current_ev, end_buf, - &iwe, + current_ev =iwe_stream_add_point (info, current_ev, + end_buf, &iwe, sta->u.ap.ssid);memset (&iwe,0 ,sizeof (iwe));
@@ -2497,10 +2498,9 @@ int prism2_ap_translate_scan(struct net_device *dev, char *buffer)IW_ENCODE_ENABLED |IW_ENCODE_NOKEY ; else iwe.u.data.flags = IW_ENCODE_DISABLED; - current_ev =iwe_stream_add_point (current_ev, end_buf, - &iwe, - sta->u.ap.ssid -/* 0 byte memcpy */ ); + current_ev =iwe_stream_add_point (info, current_ev, + end_buf, &iwe, + sta->u.ap.ssid);if (sta->u.ap.channel >0 && sta->u.ap.channel <=FREQ_COUNT ) {
@@ -2510,7 +2510,7 @@ int prism2_ap_translate_scan(struct net_device *dev, char *buffer) *100000 ; iwe.u.freq.e =1 ; current_ev =iwe_stream_add_event ( - current_ev, end_buf, &iwe, + info, current_ev, end_buf, &iwe,IW_EV_FREQ_LEN ); }
@@ -2519,8 +2519,8 @@ int prism2_ap_translate_scan(struct net_device *dev, char *buffer)sprintf (buf,"beacon_interval=%d" , sta->listen_interval); iwe.u.data.length =strlen (buf); - current_ev =iwe_stream_add_point (current_ev, end_buf, - &iwe, buf); + current_ev =iwe_stream_add_point (info, current_ev, + end_buf, &iwe, buf); }#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */
drivers/net/wireless/hostap/hostap_ioctl.c +29 -25
166 lines not on this page · raw message
drivers/net/wireless/libertas/scan.c +17 -15
@@ -776,8 +776,9 @@ out:#define MAX_CUSTOM_LEN 64static inline char *lbs_translate_scan (struct lbs_private *priv, -char *start,char *stop, -struct bss_descriptor *bss) +struct iw_request_info *info, +char *start,char *stop, +struct bss_descriptor *bss) {struct chan_freq_power *cfp;char *current_val;/* For rates */
@@ -801,24 +802,24 @@ static inline char *lbs_translate_scan(struct lbs_private *priv, iwe.cmd =SIOCGIWAP ; iwe.u.ap_addr.sa_family =ARPHRD_ETHER ;memcpy (iwe.u.ap_addr.sa_data, &bss->bssid,ETH_ALEN ); - start =iwe_stream_add_event (start, stop, &iwe,IW_EV_ADDR_LEN ); + start =iwe_stream_add_event (info, start, stop, &iwe,IW_EV_ADDR_LEN );/* SSID */ iwe.cmd =SIOCGIWESSID ; iwe.u.data.flags =1 ; iwe.u.data.length =min ((uint32_t ) bss->ssid_len, (uint32_t )IW_ESSID_MAX_SIZE ); - start =iwe_stream_add_point (start, stop, &iwe, bss->ssid); + start =iwe_stream_add_point (info, start, stop, &iwe, bss->ssid);/* Mode */ iwe.cmd =SIOCGIWMODE ; iwe.u.mode = bss->mode; - start =iwe_stream_add_event (start, stop, &iwe,IW_EV_UINT_LEN ); + start =iwe_stream_add_event (info, start, stop, &iwe,IW_EV_UINT_LEN );/* Frequency */ iwe.cmd =SIOCGIWFREQ ; iwe.u.freq.m = (long )cfp->freq *100000 ; iwe.u.freq.e =1 ; - start =iwe_stream_add_event (start, stop, &iwe,IW_EV_FREQ_LEN ); + start =iwe_stream_add_event (info, start, stop, &iwe,IW_EV_FREQ_LEN );/* Add quality statistics */ iwe.cmd =IWEVQUAL ;
@@ -852,7 +853,7 @@ static inline char *lbs_translate_scan(struct lbs_private *priv, nf = priv->NF[TYPE_RXPD ][TYPE_AVG ] /AVG_SCALE ; iwe.u.qual.level =CAL_RSSI (snr, nf); } - start =iwe_stream_add_event (start, stop, &iwe,IW_EV_QUAL_LEN ); + start =iwe_stream_add_event (info, start, stop, &iwe,IW_EV_QUAL_LEN );/* Add encryption capability */ iwe.cmd =SIOCGIWENCODE ;
@@ -862,7 +863,7 @@ static inline char *lbs_translate_scan(struct lbs_private *priv, iwe.u.data.flags =IW_ENCODE_DISABLED ; } iwe.u.data.length =0 ; - start =iwe_stream_add_point (start, stop, &iwe, bss->ssid); + start =iwe_stream_add_point (info, start, stop, &iwe, bss->ssid); current_val = start +IW_EV_LCP_LEN ;
@@ -874,15 +875,15 @@ static inline char *lbs_translate_scan(struct lbs_private *priv,for (j =0 ; bss->rates[j] && (j <sizeof (bss->rates)); j++) {/* Bit rate given in 500 kb/s units */ iwe.u.bitrate.value = bss->rates[j] *500000 ; - current_val =iwe_stream_add_value (start, current_val, - stop, &iwe,IW_EV_PARAM_LEN ); + current_val =iwe_stream_add_value (info, start, current_val, + stop, &iwe,IW_EV_PARAM_LEN ); }if ((bss->mode ==IW_MODE_ADHOC ) && priv->adhoccreate && !lbs_ssid_cmp (priv->curbssparams.ssid, priv->curbssparams.ssid_len, bss->ssid, bss->ssid_len)) { iwe.u.bitrate.value =22 *500000 ; - current_val =iwe_stream_add_value (start, current_val, + current_val =iwe_stream_add_value (info, start, current_val, stop, &iwe,IW_EV_PARAM_LEN ); }/* Check if we added any event */
@@ -895,7 +896,7 @@ static inline char *lbs_translate_scan(struct lbs_private *priv,memcpy (buf, bss->wpa_ie, bss->wpa_ie_len); iwe.cmd =IWEVGENIE ; iwe.u.data.length = bss->wpa_ie_len; - start =iwe_stream_add_point (start, stop, &iwe, buf); + start =iwe_stream_add_point (info, start, stop, &iwe, buf); }memset (&iwe,0 ,sizeof (iwe));
@@ -904,7 +905,7 @@ static inline char *lbs_translate_scan(struct lbs_private *priv,memcpy (buf, bss->rsn_ie, bss->rsn_ie_len); iwe.cmd =IWEVGENIE ; iwe.u.data.length = bss->rsn_ie_len; - start =iwe_stream_add_point (start, stop, &iwe, buf); + start =iwe_stream_add_point (info, start, stop, &iwe, buf); }if (bss->mesh) {
@@ -915,7 +916,8 @@ static inline char *lbs_translate_scan(struct lbs_private *priv, p +=snprintf (p,MAX_CUSTOM_LEN ,"mesh-type: olpc" ); iwe.u.data.length = p - custom;if (iwe.u.data.length) - start =iwe_stream_add_point (start, stop, &iwe, custom); + start =iwe_stream_add_point (info, start, stop, + &iwe, custom); } out:
@@ -1036,7 +1038,7 @@ int lbs_get_scan(struct net_device *dev, struct iw_request_info *info, }/* Translate to WE format this entry */ - next_ev =lbs_translate_scan (priv, ev, stop, iter_bss); + next_ev =lbs_translate_scan (priv, info, ev, stop, iter_bss);if (next_ev ==NULL )continue ; ev = next_ev;
drivers/net/wireless/orinoco.c +10 -9
@@ -4046,6 +4046,7 @@ static int orinoco_ioctl_setscan(struct net_device *dev,* format that the Wireless Tools will understand - Jean II * Return message length or -errno for fatal errors */ static inline char *orinoco_translate_scan(struct net_device *dev, + struct iw_request_info *info, char *current_ev, char *end_buf, union hermes_scan_info *bss,
@@ -4062,7 +4063,7 @@ static inline char *orinoco_translate_scan(struct net_device *dev, iwe.cmd =SIOCGIWAP ; iwe.u.ap_addr.sa_family =ARPHRD_ETHER ;memcpy (iwe.u.ap_addr.sa_data, bss->a.bssid,ETH_ALEN ); - current_ev =iwe_stream_add_event (current_ev, end_buf, &iwe,IW_EV_ADDR_LEN ); + current_ev =iwe_stream_add_event (info, current_ev, end_buf, &iwe,IW_EV_ADDR_LEN );/* Other entries will be displayed in the order we give them */
@@ -4072,7 +4073,7 @@ static inline char *orinoco_translate_scan(struct net_device *dev, iwe.u.data.length =32 ; iwe.cmd =SIOCGIWESSID ; iwe.u.data.flags =1 ; - current_ev =iwe_stream_add_point (current_ev, end_buf, &iwe, bss->a.essid); + current_ev =iwe_stream_add_point (info, current_ev, end_buf, &iwe, bss->a.essid);/* Add mode */ iwe.cmd =SIOCGIWMODE ;
@@ -4082,7 +4083,7 @@ static inline char *orinoco_translate_scan(struct net_device *dev, iwe.u.mode =IW_MODE_MASTER ; else iwe.u.mode = IW_MODE_ADHOC; - current_ev =iwe_stream_add_event (current_ev, end_buf, &iwe,IW_EV_UINT_LEN ); + current_ev =iwe_stream_add_event (info, current_ev, end_buf, &iwe,IW_EV_UINT_LEN ); } channel = bss->s.channel;
@@ -4091,7 +4092,7 @@ static inline char *orinoco_translate_scan(struct net_device *dev, iwe.cmd =SIOCGIWFREQ ; iwe.u.freq.m = channel_frequency[channel-1 ] *100000 ; iwe.u.freq.e =1 ; - current_ev =iwe_stream_add_event (current_ev, end_buf, + current_ev =iwe_stream_add_event (info, current_ev, end_buf, &iwe,IW_EV_FREQ_LEN ); }
@@ -4106,7 +4107,7 @@ static inline char *orinoco_translate_scan(struct net_device *dev, iwe.u.qual.qual = iwe.u.qual.level - iwe.u.qual.noise; else iwe.u.qual.qual = 0; - current_ev =iwe_stream_add_event (current_ev, end_buf, &iwe,IW_EV_QUAL_LEN ); + current_ev =iwe_stream_add_event (info, current_ev, end_buf, &iwe,IW_EV_QUAL_LEN );/* Add encryption capability */ iwe.cmd =SIOCGIWENCODE ;
@@ -4115,7 +4116,7 @@ static inline char *orinoco_translate_scan(struct net_device *dev,else iwe.u.data.flags =IW_ENCODE_DISABLED ; iwe.u.data.length =0 ; - current_ev =iwe_stream_add_point (current_ev, end_buf, &iwe, bss->a.essid); + current_ev =iwe_stream_add_point (info, current_ev, end_buf, &iwe, bss->a.essid);/* Add EXTRA: Age to display seconds since last beacon/probe response * for given network. */
@@ -4126,7 +4127,7 @@ static inline char *orinoco_translate_scan(struct net_device *dev, jiffies_to_msecs(jiffies - last_scanned)); iwe.u.data.length = p - custom;if (iwe.u.data.length) - current_ev =iwe_stream_add_point (current_ev, end_buf, &iwe, custom); + current_ev =iwe_stream_add_point (info, current_ev, end_buf, &iwe, custom);/* Bit rate is not available in Lucent/Agere firmwares */ if (priv->firmware_type !=FIRMWARE_TYPE_AGERE ) {
@@ -4149,7 +4150,7 @@ static inline char *orinoco_translate_scan(struct net_device *dev,break ;/* Bit rate given in 500 kb/s units (+ 0x80) */ iwe.u.bitrate.value = ((bss->p.rates[i] &0x7f ) *500000 ); - current_val =iwe_stream_add_value (current_ev, current_val, + current_val =iwe_stream_add_value (info, current_ev, current_val, end_buf, &iwe,IW_EV_PARAM_LEN ); }
@@ -4190,7 +4191,7 @@ static int orinoco_ioctl_getscan(struct net_device *dev,list_for_each_entry (bss, &priv->bss_list, list) {/* Translate to WE format this entry */ - current_ev =orinoco_translate_scan (dev, current_ev, + current_ev =orinoco_translate_scan (dev, info, current_ev, extra + srq->length, &bss->bss, bss->last_scanned);
drivers/net/wireless/prism54/isl_ioctl.c +25 -20
118 lines not on this page · raw message
drivers/net/wireless/rndis_wlan.c +14 -13
@@ -1603,7 +1603,8 @@ static int rndis_iw_set_scan(struct net_device *dev,static char *rndis_translate_scan (struct net_device *dev, -char *cev,char *end_buf,struct ndis_80211_bssid_ex *bssid) +struct iw_request_info *info,char *cev, +char *end_buf,struct ndis_80211_bssid_ex *bssid) {#ifdef DEBUG struct usbnet *usbdev = dev->priv;
@@ -1622,14 +1623,14 @@ static char *rndis_translate_scan(struct net_device *dev, iwe.cmd =SIOCGIWAP ; iwe.u.ap_addr.sa_family =ARPHRD_ETHER ;memcpy (iwe.u.ap_addr.sa_data, bssid->mac,ETH_ALEN ); - cev =iwe_stream_add_event (cev, end_buf, &iwe,IW_EV_ADDR_LEN ); + cev =iwe_stream_add_event (info, cev, end_buf, &iwe,IW_EV_ADDR_LEN );devdbg (usbdev,"SSID(%d) %s" ,le32_to_cpu (bssid->ssid.length), bssid->ssid.essid); iwe.cmd =SIOCGIWESSID ; iwe.u.essid.length =le32_to_cpu (bssid->ssid.length); iwe.u.essid.flags =1 ; - cev =iwe_stream_add_point (cev, end_buf, &iwe, bssid->ssid.essid); + cev =iwe_stream_add_point (info, cev, end_buf, &iwe, bssid->ssid.essid);devdbg (usbdev,"MODE %d" ,le32_to_cpu (bssid->net_infra)); iwe.cmd =SIOCGIWMODE ;
@@ -1645,12 +1646,12 @@ static char *rndis_translate_scan(struct net_device *dev, iwe.u.mode =IW_MODE_AUTO ;break ; } - cev =iwe_stream_add_event (cev, end_buf, &iwe,IW_EV_UINT_LEN ); + cev =iwe_stream_add_event (info, cev, end_buf, &iwe,IW_EV_UINT_LEN );devdbg (usbdev,"FREQ %d kHz" ,le32_to_cpu (bssid->config.ds_config)); iwe.cmd =SIOCGIWFREQ ;dsconfig_to_freq (le32_to_cpu (bssid->config.ds_config), &iwe.u.freq); - cev =iwe_stream_add_event (cev, end_buf, &iwe,IW_EV_FREQ_LEN ); + cev =iwe_stream_add_event (info, cev, end_buf, &iwe,IW_EV_FREQ_LEN );devdbg (usbdev,"QUAL %d" ,le32_to_cpu (bssid->rssi)); iwe.cmd =IWEVQUAL ;
@@ -1659,7 +1660,7 @@ static char *rndis_translate_scan(struct net_device *dev, iwe.u.qual.updated =IW_QUAL_QUAL_UPDATED |IW_QUAL_LEVEL_UPDATED |IW_QUAL_NOISE_INVALID ; - cev =iwe_stream_add_event (cev, end_buf, &iwe,IW_EV_QUAL_LEN ); + cev =iwe_stream_add_event (info, cev, end_buf, &iwe,IW_EV_QUAL_LEN );devdbg (usbdev,"ENCODE %d" ,le32_to_cpu (bssid->privacy)); iwe.cmd =SIOCGIWENCODE ;
@@ -1669,7 +1670,7 @@ static char *rndis_translate_scan(struct net_device *dev,else iwe.u.data.flags =IW_ENCODE_ENABLED |IW_ENCODE_NOKEY ; - cev =iwe_stream_add_point (cev, end_buf, &iwe,NULL ); + cev =iwe_stream_add_point (info, cev, end_buf, &iwe,NULL );devdbg (usbdev,"RATES:" ); current_val = cev +IW_EV_LCP_LEN ;
@@ -1680,7 +1681,7 @@ static char *rndis_translate_scan(struct net_device *dev, ((bssid->rates[i] &0x7f ) *500000 );devdbg (usbdev," %d" , iwe.u.bitrate.value); - current_val =iwe_stream_add_value (cev, + current_val =iwe_stream_add_value (info, cev, current_val, end_buf, &iwe,IW_EV_PARAM_LEN ); }
@@ -1694,14 +1695,14 @@ static char *rndis_translate_scan(struct net_device *dev, iwe.cmd =IWEVCUSTOM ;snprintf (sbuf,sizeof (sbuf),"bcn_int=%d" , beacon); iwe.u.data.length =strlen (sbuf); - cev =iwe_stream_add_point (cev, end_buf, &iwe, sbuf); + cev =iwe_stream_add_point (info, cev, end_buf, &iwe, sbuf); atim =le32_to_cpu (bssid->config.atim_window);devdbg (usbdev,"ATIM %d" , atim); iwe.cmd =IWEVCUSTOM ;snprintf (sbuf,sizeof (sbuf),"atim=%u" , atim); iwe.u.data.length =strlen (sbuf); - cev =iwe_stream_add_point (cev, end_buf, &iwe, sbuf); + cev =iwe_stream_add_point (info, cev, end_buf, &iwe, sbuf); ie = (void *)(bssid->ies +sizeof (struct ndis_80211_fixed_ies )); ie_len = min(bssid_len - (int)sizeof(*bssid),
@@ -1715,7 +1716,7 @@ static char *rndis_translate_scan(struct net_device *dev, (ie->id == MFIE_TYPE_RSN) ? 2 : 1); iwe.cmd =IWEVGENIE ; iwe.u.data.length =min (ie->len +2 ,MAX_WPA_IE_LEN ); - cev =iwe_stream_add_point (cev, end_buf, &iwe, + cev =iwe_stream_add_point (info, cev, end_buf, &iwe, (u8 *)ie); }
@@ -1758,8 +1759,8 @@ static int rndis_iw_get_scan(struct net_device *dev,devdbg (usbdev,"SIOCGIWSCAN: %d BSSIDs found" , count);while (count && ((void *)bssid + bssid_len) <= (buf + len)) { - cev =rndis_translate_scan (dev, cev, extra +IW_SCAN_MAX_DATA , - bssid); + cev =rndis_translate_scan (dev, info, cev, + extra +IW_SCAN_MAX_DATA , bssid); bssid = (void *)bssid + bssid_len; bssid_len =le32_to_cpu (bssid->length); count--;
drivers/net/wireless/wl3501_cs.c +5 -5
@@ -1624,25 +1624,25 @@ static int wl3501_get_scan(struct net_device *dev, struct iw_request_info *info, iwe.cmd =SIOCGIWAP ; iwe.u.ap_addr.sa_family =ARPHRD_ETHER ;memcpy (iwe.u.ap_addr.sa_data, this->bss_set[i].bssid,ETH_ALEN ); - current_ev =iwe_stream_add_event (current_ev, + current_ev =iwe_stream_add_event (info, current_ev, extra +IW_SCAN_MAX_DATA , &iwe,IW_EV_ADDR_LEN ); iwe.cmd =SIOCGIWESSID ; iwe.u.data.flags =1 ; iwe.u.data.length = this->bss_set[i].ssid.el.len; - current_ev =iwe_stream_add_point (current_ev, + current_ev =iwe_stream_add_point (info, current_ev, extra +IW_SCAN_MAX_DATA , &iwe, this->bss_set[i].ssid.essid); iwe.cmd =SIOCGIWMODE ; iwe.u.mode = this->bss_set[i].bss_type; - current_ev =iwe_stream_add_event (current_ev, + current_ev =iwe_stream_add_event (info, current_ev, extra +IW_SCAN_MAX_DATA , &iwe,IW_EV_UINT_LEN ); iwe.cmd =SIOCGIWFREQ ; iwe.u.freq.m = this->bss_set[i].ds_pset.chan; iwe.u.freq.e =0 ; - current_ev =iwe_stream_add_event (current_ev, + current_ev =iwe_stream_add_event (info, current_ev, extra +IW_SCAN_MAX_DATA , &iwe,IW_EV_FREQ_LEN ); iwe.cmd =SIOCGIWENCODE ;
@@ -1651,7 +1651,7 @@ static int wl3501_get_scan(struct net_device *dev, struct iw_request_info *info,else iwe.u.data.flags =IW_ENCODE_DISABLED ; iwe.u.data.length =0 ; - current_ev =iwe_stream_add_point (current_ev, + current_ev =iwe_stream_add_point (info, current_ev, extra +IW_SCAN_MAX_DATA , &iwe,NULL ); }
drivers/net/wireless/zd1201.c +13 -8
@@ -1152,32 +1152,36 @@ static int zd1201_get_scan(struct net_device *dev, iwe.cmd =SIOCGIWAP ; iwe.u.ap_addr.sa_family =ARPHRD_ETHER ;memcpy (iwe.u.ap_addr.sa_data, zd->rxdata+i+6 ,6 ); - cev =iwe_stream_add_event (cev, end_buf, &iwe,IW_EV_ADDR_LEN ); + cev =iwe_stream_add_event (info, cev, end_buf, + &iwe,IW_EV_ADDR_LEN ); iwe.cmd =SIOCGIWESSID ; iwe.u.data.length = zd->rxdata[i+16 ]; iwe.u.data.flags =1 ; - cev =iwe_stream_add_point (cev, end_buf, &iwe, zd->rxdata+i+18 ); + cev =iwe_stream_add_point (info, cev, end_buf, + &iwe, zd->rxdata+i+18 ); iwe.cmd =SIOCGIWMODE ;if (zd->rxdata[i+14 ]&0x01 ) iwe.u.mode =IW_MODE_MASTER ;else iwe.u.mode =IW_MODE_ADHOC ; - cev =iwe_stream_add_event (cev, end_buf, &iwe,IW_EV_UINT_LEN ); + cev =iwe_stream_add_event (info, cev, end_buf, + &iwe,IW_EV_UINT_LEN ); iwe.cmd =SIOCGIWFREQ ; iwe.u.freq.m = zd->rxdata[i+0 ]; iwe.u.freq.e =0 ; - cev =iwe_stream_add_event (cev, end_buf, &iwe,IW_EV_FREQ_LEN ); + cev =iwe_stream_add_event (info, cev, end_buf, + &iwe,IW_EV_FREQ_LEN ); iwe.cmd =SIOCGIWRATE ; iwe.u.bitrate.fixed =0 ; iwe.u.bitrate.disabled =0 ;for (j=0 ; j<10 ; j++)if (zd->rxdata[i+50 +j]) { iwe.u.bitrate.value = (zd->rxdata[i+50 +j]&0x7f )*500000 ; - cev=iwe_stream_add_event (cev, end_buf, &iwe, -IW_EV_PARAM_LEN ); + cev=iwe_stream_add_event (info, cev, end_buf, + &iwe,IW_EV_PARAM_LEN ); } iwe.cmd =SIOCGIWENCODE ;
@@ -1186,14 +1190,15 @@ static int zd1201_get_scan(struct net_device *dev, iwe.u.data.flags =IW_ENCODE_ENABLED ; else iwe.u.data.flags = IW_ENCODE_DISABLED; - cev =iwe_stream_add_point (cev, end_buf, &iwe,NULL ); + cev =iwe_stream_add_point (info, cev, end_buf, &iwe,NULL ); iwe.cmd =IWEVQUAL ; iwe.u.qual.qual = zd->rxdata[i+4 ]; iwe.u.qual.noise= zd->rxdata[i+2 ]/10 -100 ; iwe.u.qual.level = (256 +zd->rxdata[i+4 ]*100 )/255 -100 ; iwe.u.qual.updated =7 ; - cev =iwe_stream_add_event (cev, end_buf, &iwe,IW_EV_QUAL_LEN ); + cev =iwe_stream_add_event (info, cev, end_buf, + &iwe,IW_EV_QUAL_LEN ); }if (!enabled_save)
include/linux/wireless.h +15 -0
@@ -1111,6 +1111,21 @@ struct iw_event#define IW_EV_POINT_LEN (IW_EV_LCP_LEN + sizeof(struct iw_point) - \ IW_EV_POINT_OFF) +#ifdef __KERNEL__ +#ifdef CONFIG_COMPAT +struct __compat_iw_event { +__u16 len;/* Real length of this stuff */ +__u16 cmd;/* Wireless IOCTL */ +compat_caddr_t pointer; +}; +#define IW_EV_COMPAT_LCP_LEN offsetof(struct __compat_iw_event, pointer) +#define IW_EV_COMPAT_POINT_OFF offsetof(struct compat_iw_point, length) +#define IW_EV_COMPAT_POINT_LEN \ + (IW_EV_COMPAT_LCP_LEN + sizeof(struct compat_iw_point) - \ + IW_EV_COMPAT_POINT_OFF) +#endif +#endif +/* Size of the Event prefix when packed in stream */ #define IW_EV_LCP_PK_LEN (4)/* Size of the various events when packed in stream */
include/net/iw_handler.h +42 -107
194 lines not on this page · raw message
net/ieee80211/ieee80211_wx.c +26 -18
142 lines not on this page · raw message
net/mac80211/ieee80211_i.h +4 -1
@@ -23,6 +23,7 @@#include <linux/spinlock.h> #include <linux/etherdevice.h> #include <net/wireless.h> +#include <net/iw_handler.h> #include "key.h" #include "sta_info.h"
@@ -908,7 +909,9 @@ int ieee80211_sta_set_bssid(struct net_device *dev, u8 *bssid);int ieee80211_sta_req_scan (struct net_device *dev,u8 *ssid,size_t ssid_len);void ieee80211_sta_req_auth (struct net_device *dev,struct ieee80211_if_sta *ifsta); -int ieee80211_sta_scan_results (struct net_device *dev,char *buf,size_t len); +int ieee80211_sta_scan_results (struct net_device *dev, +struct iw_request_info *info, +char *buf,size_t len);ieee80211_rx_result ieee80211_sta_rx_scan (struct net_device *dev,struct sk_buff *skb,struct ieee80211_rx_status *rx_status);
net/mac80211/mlme.c +23 -20
156 lines not on this page · raw message
net/mac80211/wext.c +1 -1
@@ -554,7 +554,7 @@ static int ieee80211_ioctl_giwscan(struct net_device *dev,if (local->sta_sw_scanning || local->sta_hw_scanning)return -EAGAIN ; - res =ieee80211_sta_scan_results (dev, extra, data->length); + res =ieee80211_sta_scan_results (dev, info, extra, data->length);if (res >=0 ) { data->length = res;return 0 ;
Signature · 1 line
1.5.5.1.308.g1fbb5
Quoted 8 lines · David Miller
Quoted 1 line
Did you miss
drivers/net/ps3_gelic_wireless.c?Likely yes, I guess that won't get hit with an allmodconfig build on sparc64 :(
It would be really nice if we had some more compat layers so that the ps3 bus probing layer just nopped out but you could at least build test drivers on other platforms.
That wouldn't help, as it runs on top of an hypervisor API.
The wired part may be merged back with spider_net one day...
With kind regards,
Geert Uytterhoeven
Software Architect
Sony Techsoft Centre
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium
Phone: +32 (0)2 700 8453 Fax: +32 (0)2 700 8622 E-mail: [email protected] Internet: http://www.sony-europe.com/
Sony Technology and Software Centre Europe
A division of Sony Service Centre (Europe) N.V. Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium VAT BE 0413.825.160 · RPR Brussels
Fortis 293-0376800-10 GEBA-BE-BB
Quoted 11 lines · David Miller
Three major portions to this change:
1) Add
IW_EV_COMPAT_LCP_LEN,IW_EV_COMPAT_POINT_OFF, andIW_EV_COMPAT_POINT_LENhelper defines.2) Delete iw_stream_check_add_*(), they are unused.
3) Add
iw_request_infoargument to iwe_stream_add_*(), and use it to size the event and pointer lengths correctly depending upon whetherIW_REQUEST_FLAG_COMPATis set or not.
Quoted 8 lines
4) The mechanical transformations to the drivers and wireless stack bits to get the
iw_request_infopassed down into the routines modified in #3.With a lot of help and bug fixes from Masakazu Mokuno.
Signed-off-by David S. Miller <[email protected]>---
David,
What tree should be used for this patch? On wireless-testing that git-describe lists as v2.6.26-rc4-8782-gd9a8bd7, hunk 5 for mlme.c fails.
Larry
David Miller
maintainerFrom: Larry Finger <[email protected]>
Date: Tue, 03 Jun 2008 17:00:49 -0500
Quoted 2 lines
What tree should be used for this patch? On wireless-testing that git-describe lists as v2.6.26-rc4-8782-gd9a8bd7, hunk 5 for
mlme.cfails.
I said in the 0/12 posting that the patches are based upon net-next-2.6