Revision 11261,
4.9 KB
checked in by ara_t, 7 years ago
(diff) |
update: self-build-broadcom-wl
|
-
a
|
b
|
|
1968 | 1968 | |
1969 | 1969 | if (dtoh32(bi->length) > WL_BSS_INFO_MAX) { |
1970 | 1970 | WL_DBG(("Beacon is larger than buffer. Discarding\n")); |
1971 | | return err; |
| 1971 | return -E2BIG; |
1972 | 1972 | } |
1973 | 1973 | notif_bss_info = kzalloc(sizeof(*notif_bss_info) + sizeof(*mgmt) - sizeof(u8) + |
1974 | 1974 | WL_BSS_INFO_MAX, GFP_KERNEL); |
… |
… |
|
1992 | 1992 | beacon_proberesp->capab_info = cpu_to_le16(bi->capability); |
1993 | 1993 | wl_rst_ie(wl); |
1994 | 1994 | |
1995 | | wl_mrg_ie(wl, ((u8 *) bi) + bi->ie_offset, bi->ie_length); |
1996 | | wl_cp_ie(wl, beacon_proberesp->variable, WL_BSS_INFO_MAX - |
| 1995 | err = wl_mrg_ie(wl, ((u8 *) bi) + bi->ie_offset, bi->ie_length); |
| 1996 | if (err) |
| 1997 | goto inform_single_bss_out; |
| 1998 | |
| 1999 | err = wl_cp_ie(wl, beacon_proberesp->variable, WL_BSS_INFO_MAX - |
1997 | 2000 | offsetof(struct wl_cfg80211_bss_info, frame_buf)); |
| 2001 | if (err) |
| 2002 | goto inform_single_bss_out; |
| 2003 | |
1998 | 2004 | notif_bss_info->frame_len = offsetof(struct ieee80211_mgmt, u.beacon.variable) + |
1999 | 2005 | wl_get_ielen(wl); |
2000 | 2006 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39) |
… |
… |
|
2006 | 2012 | #endif |
2007 | 2013 | if (freq == 0) { |
2008 | 2014 | WL_ERR(("Invalid channel, fail to chcnage channel to freq\n")); |
2009 | | kfree(notif_bss_info); |
2010 | | return -EINVAL; |
| 2015 | err = -EINVAL; |
| 2016 | goto inform_single_bss_out; |
2011 | 2017 | } |
2012 | 2018 | channel = ieee80211_get_channel(wiphy, freq); |
2013 | 2019 | if (unlikely(!channel)) { |
2014 | 2020 | WL_ERR(("ieee80211_get_channel error\n")); |
2015 | | kfree(notif_bss_info); |
2016 | | return -EINVAL; |
| 2021 | err = -EINVAL; |
| 2022 | goto inform_single_bss_out; |
2017 | 2023 | } |
2018 | 2024 | |
2019 | 2025 | WL_DBG(("SSID : \"%s\", rssi %d, channel %d, capability : 0x04%x, bssid %pM\n", |
… |
… |
|
2021 | 2027 | mgmt->u.beacon.capab_info, &bi->BSSID)); |
2022 | 2028 | |
2023 | 2029 | signal = notif_bss_info->rssi * 100; |
2024 | | cbss = cfg80211_inform_bss_frame(wiphy, channel, mgmt, |
2025 | | le16_to_cpu(notif_bss_info->frame_len), signal, GFP_KERNEL); |
2026 | | if (unlikely(!cbss)) { |
2027 | | WL_ERR(("cfg80211_inform_bss_frame error\n")); |
2028 | | kfree(notif_bss_info); |
2029 | | return -EINVAL; |
2030 | | } |
2031 | 2030 | |
2032 | | notify_ie = (u8 *)bi + le16_to_cpu(bi->ie_offset); |
2033 | | notify_ielen = le32_to_cpu(bi->ie_length); |
| 2031 | if (!wl->scan_request) { |
| 2032 | cbss = cfg80211_inform_bss_frame(wiphy, channel, mgmt, |
| 2033 | le16_to_cpu(notif_bss_info->frame_len), signal, GFP_KERNEL); |
| 2034 | if (unlikely(!cbss)) { |
| 2035 | WL_ERR(("cfg80211_inform_bss_frame error\n")); |
| 2036 | err = -ENOMEM; |
| 2037 | goto inform_single_bss_out; |
| 2038 | } |
| 2039 | } else { |
| 2040 | notify_ie = (u8 *)bi + le16_to_cpu(bi->ie_offset); |
| 2041 | notify_ielen = le32_to_cpu(bi->ie_length); |
2034 | 2042 | #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) |
2035 | | cbss = cfg80211_inform_bss(wiphy, channel, (const u8 *)(bi->BSSID.octet), |
2036 | | 0, beacon_proberesp->capab_info, beacon_proberesp->beacon_int, |
2037 | | (const u8 *)notify_ie, notify_ielen, signal, GFP_KERNEL); |
| 2043 | cbss = cfg80211_inform_bss(wiphy, channel, (const u8 *)(bi->BSSID.octet), |
| 2044 | 0, beacon_proberesp->capab_info, beacon_proberesp->beacon_int, |
| 2045 | (const u8 *)notify_ie, notify_ielen, signal, GFP_KERNEL); |
2038 | 2046 | #else |
2039 | | cbss = cfg80211_inform_bss(wiphy, channel, CFG80211_BSS_FTYPE_UNKNOWN, (const u8 *)(bi->BSSID.octet), |
2040 | | 0, beacon_proberesp->capab_info, beacon_proberesp->beacon_int, |
2041 | | (const u8 *)notify_ie, notify_ielen, signal, GFP_KERNEL); |
| 2047 | cbss = cfg80211_inform_bss(wiphy, channel, |
| 2048 | wl->active_scan ? |
| 2049 | CFG80211_BSS_FTYPE_PRESP : CFG80211_BSS_FTYPE_BEACON, |
| 2050 | (const u8 *)(bi->BSSID.octet), 0, |
| 2051 | beacon_proberesp->capab_info, |
| 2052 | beacon_proberesp->beacon_int, |
| 2053 | (const u8 *)notify_ie, notify_ielen, signal, GFP_KERNEL); |
2042 | 2054 | #endif |
2043 | | |
2044 | | if (unlikely(!cbss)) |
2045 | | return -ENOMEM; |
| 2055 | if (unlikely(!cbss)) { |
| 2056 | WL_ERR(("cfg80211_inform_bss error\n")); |
| 2057 | err = -ENOMEM; |
| 2058 | goto inform_single_bss_out; |
| 2059 | } |
| 2060 | } |
2046 | 2061 | |
2047 | 2062 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) |
2048 | 2063 | cfg80211_put_bss(wiphy, cbss); |
… |
… |
|
2050 | 2065 | cfg80211_put_bss(cbss); |
2051 | 2066 | #endif |
2052 | 2067 | |
| 2068 | inform_single_bss_out: |
2053 | 2069 | kfree(notif_bss_info); |
2054 | 2070 | |
2055 | 2071 | return err; |
… |
… |
|
2316 | 2332 | if (err) |
2317 | 2333 | goto update_bss_info_out; |
2318 | 2334 | |
| 2335 | bss = cfg80211_get_bss(wl_to_wiphy(wl), NULL, (s8 *)&wl->bssid, |
| 2336 | ssid->SSID, ssid->SSID_len, WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS); |
| 2337 | |
2319 | 2338 | ie = ((u8 *)bi) + bi->ie_offset; |
2320 | 2339 | ie_len = bi->ie_length; |
2321 | 2340 | } else { |
… |
… |
|
2328 | 2347 | ie_len = bss->len_information_elements; |
2329 | 2348 | #endif |
2330 | 2349 | wl->conf->channel = *bss->channel; |
| 2350 | } |
| 2351 | |
| 2352 | if (bss) { |
2331 | 2353 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) |
2332 | 2354 | cfg80211_put_bss(wiphy, bss); |
2333 | 2355 | #else |
2334 | 2356 | cfg80211_put_bss(bss); |
2335 | 2357 | #endif |
| 2358 | } else { |
| 2359 | WL_DBG(("Could not update BSS\n")); |
| 2360 | err = -EINVAL; |
| 2361 | goto update_bss_info_out; |
2336 | 2362 | } |
2337 | 2363 | |
2338 | 2364 | tim = bcm_parse_tlvs(ie, ie_len, WLAN_EID_TIM); |
… |
… |
|
2360 | 2386 | struct wl_cfg80211_connect_info *conn_info = wl_to_conn(wl); |
2361 | 2387 | s32 err = 0; |
2362 | 2388 | |
2363 | | wl_get_assoc_ies(wl); |
| 2389 | err = wl_get_assoc_ies(wl); |
| 2390 | if (err) |
| 2391 | return err; |
| 2392 | |
2364 | 2393 | memcpy(wl->profile->bssid, &e->addr, ETHER_ADDR_LEN); |
2365 | 2394 | memcpy(&wl->bssid, &e->addr, ETHER_ADDR_LEN); |
2366 | | wl_update_bss_info(wl); |
| 2395 | |
| 2396 | err = wl_update_bss_info(wl); |
| 2397 | if (err) |
| 2398 | return err; |
| 2399 | |
2367 | 2400 | cfg80211_roamed(ndev, |
2368 | 2401 | #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 39) |
2369 | 2402 | &wl->conf->channel, |
Note: See
TracBrowser
for help on using the repository browser.