source: projects/specs/trunk/nonfree/self-build-broadcom-wl/17-fix-kernel-warnings.patch @ 11261

Revision 11261, 4.9 KB checked in by ara_t, 6 years ago (diff)

update: self-build-broadcom-wl

  • amd64/src/wl/sys/wl_cfg80211_hybrid.c

    a b  
    19681968 
    19691969        if (dtoh32(bi->length) > WL_BSS_INFO_MAX) { 
    19701970                WL_DBG(("Beacon is larger than buffer. Discarding\n")); 
    1971                 return err; 
     1971                return -E2BIG; 
    19721972        } 
    19731973        notif_bss_info = kzalloc(sizeof(*notif_bss_info) + sizeof(*mgmt) - sizeof(u8) + 
    19741974                                 WL_BSS_INFO_MAX, GFP_KERNEL); 
     
    19921992        beacon_proberesp->capab_info = cpu_to_le16(bi->capability); 
    19931993        wl_rst_ie(wl); 
    19941994 
    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 - 
    19972000                 offsetof(struct wl_cfg80211_bss_info, frame_buf)); 
     2001        if (err) 
     2002                goto inform_single_bss_out; 
     2003 
    19982004        notif_bss_info->frame_len = offsetof(struct ieee80211_mgmt, u.beacon.variable) + 
    19992005                                    wl_get_ielen(wl); 
    20002006#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39) 
     
    20062012#endif 
    20072013        if (freq == 0) { 
    20082014                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; 
    20112017        } 
    20122018        channel = ieee80211_get_channel(wiphy, freq); 
    20132019        if (unlikely(!channel)) { 
    20142020                WL_ERR(("ieee80211_get_channel error\n")); 
    2015                 kfree(notif_bss_info); 
    2016                 return -EINVAL; 
     2021                err = -EINVAL; 
     2022                goto inform_single_bss_out; 
    20172023        } 
    20182024 
    20192025        WL_DBG(("SSID : \"%s\", rssi %d, channel %d, capability : 0x04%x, bssid %pM\n", 
     
    20212027                mgmt->u.beacon.capab_info, &bi->BSSID)); 
    20222028 
    20232029        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         } 
    20312030 
    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); 
    20342042#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); 
    20382046#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); 
    20422054#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        } 
    20462061 
    20472062#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) 
    20482063        cfg80211_put_bss(wiphy, cbss); 
     
    20502065        cfg80211_put_bss(cbss); 
    20512066#endif 
    20522067 
     2068inform_single_bss_out: 
    20532069        kfree(notif_bss_info); 
    20542070 
    20552071        return err; 
     
    23162332                if (err) 
    23172333                        goto update_bss_info_out; 
    23182334 
     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 
    23192338                ie = ((u8 *)bi) + bi->ie_offset; 
    23202339                ie_len = bi->ie_length; 
    23212340        } else { 
     
    23282347                ie_len = bss->len_information_elements; 
    23292348#endif 
    23302349                wl->conf->channel = *bss->channel; 
     2350        } 
     2351 
     2352        if (bss) { 
    23312353#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) 
    23322354                cfg80211_put_bss(wiphy, bss); 
    23332355#else 
    23342356                cfg80211_put_bss(bss); 
    23352357#endif 
     2358        } else { 
     2359                WL_DBG(("Could not update BSS\n")); 
     2360                err = -EINVAL; 
     2361                goto update_bss_info_out; 
    23362362        } 
    23372363 
    23382364        tim = bcm_parse_tlvs(ie, ie_len, WLAN_EID_TIM); 
     
    23602386        struct wl_cfg80211_connect_info *conn_info = wl_to_conn(wl); 
    23612387        s32 err = 0; 
    23622388 
    2363         wl_get_assoc_ies(wl); 
     2389        err = wl_get_assoc_ies(wl); 
     2390        if (err) 
     2391                return err; 
     2392 
    23642393        memcpy(wl->profile->bssid, &e->addr, ETHER_ADDR_LEN); 
    23652394        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 
    23672400        cfg80211_roamed(ndev, 
    23682401#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 39) 
    23692402                        &wl->conf->channel,       
Note: See TracBrowser for help on using the repository browser.