diff options
author | Masakazu Mokuno <mokuno@sm.sony.co.jp> | 2008-03-11 00:15:44 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-03-13 15:57:25 -0400 |
commit | aad4c7d3a641315519add159a80f73cce554e7cd (patch) | |
tree | ffbc5ea8b8dc61ecc9b5cb078a639066eeefb285 /drivers/net/ps3_gelic_wireless.c | |
parent | 43557e15c22701f0b94e5f14a874fe02e814574e (diff) |
PS3: gelic: ignore scan info from zero SSID beacons
Some implementations of the hidden SSID APs emit beacons which have the zero
length SSID information element instead of SSID padded by null (\0) characters.
If the firmware of the PS3 wireless hardware meets these beacons, it abandons parsing
IEs. Thus guest OSes get the invalid scan information for the AP.
To work around this, ignore these scan informations from the list.
Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/ps3_gelic_wireless.c')
-rw-r--r-- | drivers/net/ps3_gelic_wireless.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/drivers/net/ps3_gelic_wireless.c b/drivers/net/ps3_gelic_wireless.c index daf5abab9534..f28b05f0bd95 100644 --- a/drivers/net/ps3_gelic_wireless.c +++ b/drivers/net/ps3_gelic_wireless.c | |||
@@ -1644,13 +1644,24 @@ static void gelic_wl_scan_complete_event(struct gelic_wl_info *wl) | |||
1644 | } | 1644 | } |
1645 | 1645 | ||
1646 | /* put them in the newtork_list */ | 1646 | /* put them in the newtork_list */ |
1647 | scan_info = wl->buf; | 1647 | for (i = 0, scan_info_size = 0, scan_info = wl->buf; |
1648 | scan_info_size = 0; | 1648 | scan_info_size < data_len; |
1649 | i = 0; | 1649 | i++, scan_info_size += be16_to_cpu(scan_info->size), |
1650 | while (scan_info_size < data_len) { | 1650 | scan_info = (void *)scan_info + be16_to_cpu(scan_info->size)) { |
1651 | pr_debug("%s:size=%d bssid=%s scan_info=%p\n", __func__, | 1651 | pr_debug("%s:size=%d bssid=%s scan_info=%p\n", __func__, |
1652 | be16_to_cpu(scan_info->size), | 1652 | be16_to_cpu(scan_info->size), |
1653 | print_mac(mac, &scan_info->bssid[2]), scan_info); | 1653 | print_mac(mac, &scan_info->bssid[2]), scan_info); |
1654 | |||
1655 | /* | ||
1656 | * The wireless firmware may return invalid channel 0 and/or | ||
1657 | * invalid rate if the AP emits zero length SSID ie. As this | ||
1658 | * scan information is useless, ignore it | ||
1659 | */ | ||
1660 | if (!be16_to_cpu(scan_info->channel) || !scan_info->rate[0]) { | ||
1661 | pr_debug("%s: invalid scan info\n", __func__); | ||
1662 | continue; | ||
1663 | } | ||
1664 | |||
1654 | found = 0; | 1665 | found = 0; |
1655 | oldest = NULL; | 1666 | oldest = NULL; |
1656 | list_for_each_entry(target, &wl->network_list, list) { | 1667 | list_for_each_entry(target, &wl->network_list, list) { |
@@ -1687,10 +1698,6 @@ static void gelic_wl_scan_complete_event(struct gelic_wl_info *wl) | |||
1687 | GFP_KERNEL); | 1698 | GFP_KERNEL); |
1688 | if (!target->hwinfo) { | 1699 | if (!target->hwinfo) { |
1689 | pr_info("%s: kzalloc failed\n", __func__); | 1700 | pr_info("%s: kzalloc failed\n", __func__); |
1690 | i++; | ||
1691 | scan_info_size += be16_to_cpu(scan_info->size); | ||
1692 | scan_info = (void *)scan_info + | ||
1693 | be16_to_cpu(scan_info->size); | ||
1694 | continue; | 1701 | continue; |
1695 | } | 1702 | } |
1696 | /* copy hw scan info */ | 1703 | /* copy hw scan info */ |
@@ -1709,10 +1716,6 @@ static void gelic_wl_scan_complete_event(struct gelic_wl_info *wl) | |||
1709 | if (scan_info->ext_rate[r]) | 1716 | if (scan_info->ext_rate[r]) |
1710 | target->rate_ext_len++; | 1717 | target->rate_ext_len++; |
1711 | list_move_tail(&target->list, &wl->network_list); | 1718 | list_move_tail(&target->list, &wl->network_list); |
1712 | /* bump pointer */ | ||
1713 | i++; | ||
1714 | scan_info_size += be16_to_cpu(scan_info->size); | ||
1715 | scan_info = (void *)scan_info + be16_to_cpu(scan_info->size); | ||
1716 | } | 1719 | } |
1717 | memset(&data, 0, sizeof(data)); | 1720 | memset(&data, 0, sizeof(data)); |
1718 | wireless_send_event(port_to_netdev(wl_port(wl)), SIOCGIWSCAN, &data, | 1721 | wireless_send_event(port_to_netdev(wl_port(wl)), SIOCGIWSCAN, &data, |