diff options
| -rw-r--r-- | CHANGES | 1 | ||||
| -rw-r--r-- | src/p80211/p80211wext.c | 30 |
2 files changed, 23 insertions, 8 deletions
@@ -41,6 +41,7 @@ * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- + - Add compatibility with 2.6.27+ WEXT API (Pavel Roskin) - Fix misplaced variable in PCMCIA code (Pavel Roskin) - Add compatibility for gfp_t and mutex APIs (Pavel Roskin) - Fix non-posix find arguments in script (Mark Mathews) diff --git a/src/p80211/p80211wext.c b/src/p80211/p80211wext.c index fb01de1..a99e57b 100644 --- a/src/p80211/p80211wext.c +++ b/src/p80211/p80211wext.c @@ -81,6 +81,12 @@ static int p80211wext_giwessid(netdevice_t *dev, /* compatibility to wireless extensions */ #ifdef WIRELESS_EXT +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 27) && \ + !defined(IW_REQUEST_FLAG_COMPAT) +#define iwe_stream_add_event(a, b, c, d, e) iwe_stream_add_event(b, c, d, e) +#define iwe_stream_add_point(a, b, c, d, e) iwe_stream_add_point(b, c, d, e) +#endif + static UINT8 p80211_mhz_to_channel(UINT16 mhz) { if (mhz >= 5000) { @@ -1520,7 +1526,8 @@ static int p80211wext_siwscan(netdevice_t *dev, * airo driver code. */ static char * -wext_translate_bss(char *current_ev, char *end_buf, p80211msg_dot11req_scan_results_t *bss) +wext_translate_bss(struct iw_request_info *info, char *current_ev, + char *end_buf, p80211msg_dot11req_scan_results_t *bss) { struct iw_event iwe; /* Temporary buffer */ @@ -1528,7 +1535,8 @@ wext_translate_bss(char *current_ev, char *end_buf, p80211msg_dot11req_scan_resu memcpy(iwe.u.ap_addr.sa_data, bss->bssid.data.data, WLAN_BSSID_LEN); iwe.u.ap_addr.sa_family = ARPHRD_ETHER; iwe.cmd = SIOCGIWAP; - 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); /* The following entries will be displayed in the same order we give them */ @@ -1544,7 +1552,8 @@ wext_translate_bss(char *current_ev, char *end_buf, p80211msg_dot11req_scan_resu iwe.u.data.length = size; iwe.u.data.flags = 1; iwe.cmd = SIOCGIWESSID; - current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, &essid[0]); + current_ev = iwe_stream_add_point(info, current_ev, end_buf, + &iwe, &essid[0]); WLAN_LOG_DEBUG(1, " essid size OK.\n"); } @@ -1563,7 +1572,8 @@ wext_translate_bss(char *current_ev, char *end_buf, p80211msg_dot11req_scan_resu } iwe.cmd = SIOCGIWMODE; if (iwe.u.mode) - 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); /* Encryption capability */ if (bss->privacy.data == P80211ENUM_truth_true) @@ -1572,13 +1582,15 @@ wext_translate_bss(char *current_ev, char *end_buf, p80211msg_dot11req_scan_resu iwe.u.data.flags = IW_ENCODE_DISABLED; iwe.u.data.length = 0; iwe.cmd = SIOCGIWENCODE; - current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, NULL); + current_ev = iwe_stream_add_point(info, current_ev, end_buf, &iwe, + NULL); /* Add frequency. (short) bss->channel is the frequency in MHz */ iwe.u.freq.m = bss->dschannel.data; iwe.u.freq.e = 0; iwe.cmd = SIOCGIWFREQ; - 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); /* Add quality statistics */ iwe.u.qual.level = bss->signal.data; @@ -1586,7 +1598,8 @@ wext_translate_bss(char *current_ev, char *end_buf, p80211msg_dot11req_scan_resu /* do a simple SNR for quality */ iwe.u.qual.qual = qual_as_percent(bss->signal.data - bss->noise.data); iwe.cmd = IWEVQUAL; - 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); return current_ev; } @@ -1627,7 +1640,8 @@ static int p80211wext_giwscan(netdevice_t *dev, break; } - current_ev = wext_translate_bss(current_ev, extra + IW_SCAN_MAX_DATA, &msg); + current_ev = wext_translate_bss(info, current_ev, + extra + IW_SCAN_MAX_DATA, &msg); scan_good = 1; i++; } while (i < IW_MAX_AP); |
