diff options
Diffstat (limited to 'drivers/net/wireless/hostap/hostap_ioctl.c')
-rw-r--r-- | drivers/net/wireless/hostap/hostap_ioctl.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c index e720369a3515..53f5246c40aa 100644 --- a/drivers/net/wireless/hostap/hostap_ioctl.c +++ b/drivers/net/wireless/hostap/hostap_ioctl.c | |||
@@ -50,7 +50,8 @@ static struct iw_statistics *hostap_get_wireless_stats(struct net_device *dev) | |||
50 | #endif /* in_atomic */ | 50 | #endif /* in_atomic */ |
51 | 51 | ||
52 | if (update && prism2_update_comms_qual(dev) == 0) | 52 | if (update && prism2_update_comms_qual(dev) == 0) |
53 | wstats->qual.updated = 7; | 53 | wstats->qual.updated = IW_QUAL_ALL_UPDATED | |
54 | IW_QUAL_DBM; | ||
54 | 55 | ||
55 | wstats->qual.qual = local->comms_qual; | 56 | wstats->qual.qual = local->comms_qual; |
56 | wstats->qual.level = local->avg_signal; | 57 | wstats->qual.level = local->avg_signal; |
@@ -59,7 +60,7 @@ static struct iw_statistics *hostap_get_wireless_stats(struct net_device *dev) | |||
59 | wstats->qual.qual = 0; | 60 | wstats->qual.qual = 0; |
60 | wstats->qual.level = 0; | 61 | wstats->qual.level = 0; |
61 | wstats->qual.noise = 0; | 62 | wstats->qual.noise = 0; |
62 | wstats->qual.updated = 0; | 63 | wstats->qual.updated = IW_QUAL_ALL_INVALID; |
63 | } | 64 | } |
64 | 65 | ||
65 | return wstats; | 66 | return wstats; |
@@ -1827,13 +1828,6 @@ static char * __prism2_translate_scan(local_info_t *local, | |||
1827 | iwe.cmd = SIOCGIWAP; | 1828 | iwe.cmd = SIOCGIWAP; |
1828 | iwe.u.ap_addr.sa_family = ARPHRD_ETHER; | 1829 | iwe.u.ap_addr.sa_family = ARPHRD_ETHER; |
1829 | memcpy(iwe.u.ap_addr.sa_data, bssid, ETH_ALEN); | 1830 | memcpy(iwe.u.ap_addr.sa_data, bssid, ETH_ALEN); |
1830 | /* FIX: | ||
1831 | * I do not know how this is possible, but iwe_stream_add_event | ||
1832 | * seems to re-order memcpy execution so that len is set only | ||
1833 | * after copying.. Pre-setting len here "fixes" this, but real | ||
1834 | * problems should be solved (after which these iwe.len | ||
1835 | * settings could be removed from this function). */ | ||
1836 | iwe.len = IW_EV_ADDR_LEN; | ||
1837 | current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, | 1831 | current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, |
1838 | IW_EV_ADDR_LEN); | 1832 | IW_EV_ADDR_LEN); |
1839 | 1833 | ||
@@ -1843,7 +1837,6 @@ static char * __prism2_translate_scan(local_info_t *local, | |||
1843 | iwe.cmd = SIOCGIWESSID; | 1837 | iwe.cmd = SIOCGIWESSID; |
1844 | iwe.u.data.length = ssid_len; | 1838 | iwe.u.data.length = ssid_len; |
1845 | iwe.u.data.flags = 1; | 1839 | iwe.u.data.flags = 1; |
1846 | iwe.len = IW_EV_POINT_LEN + iwe.u.data.length; | ||
1847 | current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, ssid); | 1840 | current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, ssid); |
1848 | 1841 | ||
1849 | memset(&iwe, 0, sizeof(iwe)); | 1842 | memset(&iwe, 0, sizeof(iwe)); |
@@ -1859,7 +1852,6 @@ static char * __prism2_translate_scan(local_info_t *local, | |||
1859 | iwe.u.mode = IW_MODE_MASTER; | 1852 | iwe.u.mode = IW_MODE_MASTER; |
1860 | else | 1853 | else |
1861 | iwe.u.mode = IW_MODE_ADHOC; | 1854 | iwe.u.mode = IW_MODE_ADHOC; |
1862 | iwe.len = IW_EV_UINT_LEN; | ||
1863 | current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, | 1855 | current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, |
1864 | IW_EV_UINT_LEN); | 1856 | IW_EV_UINT_LEN); |
1865 | } | 1857 | } |
@@ -1877,7 +1869,6 @@ static char * __prism2_translate_scan(local_info_t *local, | |||
1877 | if (chan > 0) { | 1869 | if (chan > 0) { |
1878 | iwe.u.freq.m = freq_list[le16_to_cpu(chan - 1)] * 100000; | 1870 | iwe.u.freq.m = freq_list[le16_to_cpu(chan - 1)] * 100000; |
1879 | iwe.u.freq.e = 1; | 1871 | iwe.u.freq.e = 1; |
1880 | iwe.len = IW_EV_FREQ_LEN; | ||
1881 | current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, | 1872 | current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, |
1882 | IW_EV_FREQ_LEN); | 1873 | IW_EV_FREQ_LEN); |
1883 | } | 1874 | } |
@@ -1894,7 +1885,10 @@ static char * __prism2_translate_scan(local_info_t *local, | |||
1894 | iwe.u.qual.noise = | 1885 | iwe.u.qual.noise = |
1895 | HFA384X_LEVEL_TO_dBm(le16_to_cpu(scan->anl)); | 1886 | HFA384X_LEVEL_TO_dBm(le16_to_cpu(scan->anl)); |
1896 | } | 1887 | } |
1897 | iwe.len = IW_EV_QUAL_LEN; | 1888 | iwe.u.qual.updated = IW_QUAL_LEVEL_UPDATED |
1889 | | IW_QUAL_NOISE_UPDATED | ||
1890 | | IW_QUAL_QUAL_INVALID | ||
1891 | | IW_QUAL_DBM; | ||
1898 | current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, | 1892 | current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, |
1899 | IW_EV_QUAL_LEN); | 1893 | IW_EV_QUAL_LEN); |
1900 | } | 1894 | } |
@@ -1906,7 +1900,6 @@ static char * __prism2_translate_scan(local_info_t *local, | |||
1906 | else | 1900 | else |
1907 | iwe.u.data.flags = IW_ENCODE_DISABLED; | 1901 | iwe.u.data.flags = IW_ENCODE_DISABLED; |
1908 | iwe.u.data.length = 0; | 1902 | iwe.u.data.length = 0; |
1909 | iwe.len = IW_EV_POINT_LEN + iwe.u.data.length; | ||
1910 | current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, ""); | 1903 | current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, ""); |
1911 | 1904 | ||
1912 | /* TODO: add SuppRates into BSS table */ | 1905 | /* TODO: add SuppRates into BSS table */ |
@@ -1930,7 +1923,7 @@ static char * __prism2_translate_scan(local_info_t *local, | |||
1930 | } | 1923 | } |
1931 | 1924 | ||
1932 | /* TODO: add BeaconInt,resp_rate,atim into BSS table */ | 1925 | /* TODO: add BeaconInt,resp_rate,atim into BSS table */ |
1933 | buf = kmalloc(MAX_WPA_IE_LEN * 2 + 30, GFP_KERNEL); | 1926 | buf = kmalloc(MAX_WPA_IE_LEN * 2 + 30, GFP_ATOMIC); |
1934 | if (buf && scan) { | 1927 | if (buf && scan) { |
1935 | memset(&iwe, 0, sizeof(iwe)); | 1928 | memset(&iwe, 0, sizeof(iwe)); |
1936 | iwe.cmd = IWEVCUSTOM; | 1929 | iwe.cmd = IWEVCUSTOM; |