.. | .. |
---|
2287 | 2287 | |
---|
2288 | 2288 | while (p2p_ie) { |
---|
2289 | 2289 | /* Check P2P Capability ATTR */ |
---|
2290 | | - attr_contentlen = sizeof(cap_attr); |
---|
2291 | 2290 | if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CAPABILITY, (u8 *)&cap_attr, (uint *) &attr_contentlen)) { |
---|
2292 | 2291 | RTW_INFO("[%s] Got P2P Capability Attr!!\n", __FUNCTION__); |
---|
2293 | 2292 | cap_attr = le16_to_cpu(cap_attr); |
---|
.. | .. |
---|
2304 | 2303 | if (pattr_content) { |
---|
2305 | 2304 | u8 num_of_secdev_type; |
---|
2306 | 2305 | u16 dev_name_len; |
---|
| 2306 | + |
---|
2307 | 2307 | |
---|
2308 | 2308 | rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_DEVICE_INFO , pattr_content, (uint *)&attr_contentlen); |
---|
2309 | 2309 | |
---|
.. | .. |
---|
2384 | 2384 | u8 dev_addr[ETH_ALEN] = { 0x00 }; |
---|
2385 | 2385 | u32 attr_contentlen = 0; |
---|
2386 | 2386 | |
---|
2387 | | - attr_contentlen = sizeof(groupid); |
---|
2388 | 2387 | if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_GROUP_ID, groupid, &attr_contentlen)) { |
---|
2389 | 2388 | if (_rtw_memcmp(pwdinfo->device_addr, groupid, ETH_ALEN) && |
---|
2390 | 2389 | _rtw_memcmp(pwdinfo->p2p_group_ssid, groupid + ETH_ALEN, pwdinfo->p2p_group_ssid_len)) { |
---|
2391 | | - attr_contentlen = sizeof(dev_addr); |
---|
| 2390 | + attr_contentlen = 0; |
---|
2392 | 2391 | if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_DEVICE_ID, dev_addr, &attr_contentlen)) { |
---|
2393 | 2392 | _irqL irqL; |
---|
2394 | 2393 | _list *phead, *plist; |
---|
.. | .. |
---|
2456 | 2455 | |
---|
2457 | 2456 | wpsie = rtw_get_wps_ie(frame_body + _PUBLIC_ACTION_IE_OFFSET_, len - _PUBLIC_ACTION_IE_OFFSET_, NULL, &wps_ielen); |
---|
2458 | 2457 | if (wpsie) { |
---|
2459 | | - attr_contentlen = sizeof(uconfig_method); |
---|
2460 | 2458 | if (rtw_get_wps_attr_content(wpsie, wps_ielen, WPS_ATTR_CONF_METHOD , (u8 *) &uconfig_method, &attr_contentlen)) { |
---|
2461 | 2459 | uconfig_method = be16_to_cpu(uconfig_method); |
---|
2462 | 2460 | switch (uconfig_method) { |
---|
.. | .. |
---|
2554 | 2552 | /* If some device wants to do p2p handshake without sending prov_disc_req */ |
---|
2555 | 2553 | /* We have to get peer_req_cm from here. */ |
---|
2556 | 2554 | if (_rtw_memcmp(pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, "000", 3)) { |
---|
2557 | | - wps_devicepassword_id_len = sizeof(wps_devicepassword_id); |
---|
2558 | 2555 | rtw_get_wps_attr_content(wpsie, wps_ielen, WPS_ATTR_DEVICE_PWID, (u8 *) &wps_devicepassword_id, &wps_devicepassword_id_len); |
---|
2559 | 2556 | wps_devicepassword_id = be16_to_cpu(wps_devicepassword_id); |
---|
2560 | 2557 | |
---|
.. | .. |
---|
2598 | 2595 | rtw_p2p_set_state(pwdinfo, P2P_STATE_GONEGO_ING); |
---|
2599 | 2596 | |
---|
2600 | 2597 | /* Check P2P Capability ATTR */ |
---|
2601 | | - attr_contentlen = sizeof(cap_attr); |
---|
2602 | 2598 | if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CAPABILITY, (u8 *)&cap_attr, (uint *)&attr_contentlen)) { |
---|
2603 | 2599 | cap_attr = le16_to_cpu(cap_attr); |
---|
2604 | 2600 | |
---|
.. | .. |
---|
2608 | 2604 | #endif /* defined(CONFIG_WFD) && defined(CONFIG_TDLS) */ |
---|
2609 | 2605 | } |
---|
2610 | 2606 | |
---|
2611 | | - attr_contentlen = sizeof(attr_content); |
---|
2612 | 2607 | if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_GO_INTENT , &attr_content, &attr_contentlen)) { |
---|
2613 | 2608 | RTW_INFO("[%s] GO Intent = %d, tie = %d\n", __FUNCTION__, attr_content >> 1, attr_content & 0x01); |
---|
2614 | 2609 | pwdinfo->peer_intent = attr_content; /* include both intent and tie breaker values. */ |
---|
.. | .. |
---|
2636 | 2631 | } |
---|
2637 | 2632 | } |
---|
2638 | 2633 | |
---|
2639 | | - attr_contentlen = sizeof(listen_ch_attr); |
---|
2640 | 2634 | if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_LISTEN_CH, (u8 *)listen_ch_attr, (uint *) &attr_contentlen) && attr_contentlen == 5) |
---|
2641 | 2635 | pwdinfo->nego_req_info.peer_ch = listen_ch_attr[4]; |
---|
2642 | 2636 | |
---|
2643 | 2637 | RTW_INFO(FUNC_ADPT_FMT" listen channel :%u\n", FUNC_ADPT_ARG(padapter), pwdinfo->nego_req_info.peer_ch); |
---|
2644 | 2638 | |
---|
2645 | | - attr_contentlen = sizeof(pwdinfo->p2p_peer_interface_addr); |
---|
| 2639 | + attr_contentlen = 0; |
---|
2646 | 2640 | if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_INTENDED_IF_ADDR, pwdinfo->p2p_peer_interface_addr, &attr_contentlen)) { |
---|
2647 | 2641 | if (attr_contentlen != ETH_ALEN) |
---|
2648 | 2642 | _rtw_memset(pwdinfo->p2p_peer_interface_addr, 0x00, ETH_ALEN); |
---|
2649 | 2643 | } |
---|
2650 | 2644 | |
---|
2651 | | - ch_cnt = sizeof(ch_content); |
---|
2652 | 2645 | if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CH_LIST, ch_content, &ch_cnt)) { |
---|
2653 | 2646 | peer_ch_num = rtw_p2p_get_peer_ch_list(pwdinfo, ch_content, ch_cnt, peer_ch_list); |
---|
2654 | 2647 | ch_num_inclusioned = rtw_p2p_ch_inclusion(padapter, peer_ch_list, peer_ch_num, ch_list_inclusioned); |
---|
.. | .. |
---|
2674 | 2667 | #endif /* CONFIG_CONCURRENT_MODE */ |
---|
2675 | 2668 | { |
---|
2676 | 2669 | u8 operatingch_info[5] = { 0x00 }, peer_operating_ch = 0; |
---|
| 2670 | + attr_contentlen = 0; |
---|
2677 | 2671 | |
---|
2678 | | - attr_contentlen = sizeof(operatingch_info); |
---|
2679 | 2672 | if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_OPERATING_CH, operatingch_info, &attr_contentlen)) |
---|
2680 | 2673 | peer_operating_ch = operatingch_info[4]; |
---|
2681 | 2674 | |
---|
.. | .. |
---|
2761 | 2754 | while (p2p_ie) { /* Found the P2P IE. */ |
---|
2762 | 2755 | |
---|
2763 | 2756 | /* Check P2P Capability ATTR */ |
---|
2764 | | - attr_contentlen = sizeof(cap_attr); |
---|
2765 | 2757 | if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CAPABILITY, (u8 *)&cap_attr, (uint *)&attr_contentlen)) { |
---|
2766 | 2758 | cap_attr = le16_to_cpu(cap_attr); |
---|
2767 | 2759 | #ifdef CONFIG_TDLS |
---|
.. | .. |
---|
2770 | 2762 | #endif /* CONFIG_TDLS */ |
---|
2771 | 2763 | } |
---|
2772 | 2764 | |
---|
2773 | | - attr_contentlen = sizeof(attr_content); |
---|
2774 | 2765 | rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_STATUS, &attr_content, &attr_contentlen); |
---|
2775 | 2766 | if (attr_contentlen == 1) { |
---|
2776 | 2767 | RTW_INFO("[%s] Status = %d\n", __FUNCTION__, attr_content); |
---|
.. | .. |
---|
2788 | 2779 | } |
---|
2789 | 2780 | |
---|
2790 | 2781 | /* Try to get the peer's interface address */ |
---|
2791 | | - attr_contentlen = sizeof(pwdinfo->p2p_peer_interface_addr); |
---|
| 2782 | + attr_contentlen = 0; |
---|
2792 | 2783 | if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_INTENDED_IF_ADDR, pwdinfo->p2p_peer_interface_addr, &attr_contentlen)) { |
---|
2793 | 2784 | if (attr_contentlen != ETH_ALEN) |
---|
2794 | 2785 | _rtw_memset(pwdinfo->p2p_peer_interface_addr, 0x00, ETH_ALEN); |
---|
.. | .. |
---|
2796 | 2787 | |
---|
2797 | 2788 | /* Try to get the peer's intent and tie breaker value. */ |
---|
2798 | 2789 | attr_content = 0x00; |
---|
2799 | | - attr_contentlen = sizeof(attr_content); |
---|
| 2790 | + attr_contentlen = 0; |
---|
2800 | 2791 | if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_GO_INTENT , &attr_content, &attr_contentlen)) { |
---|
2801 | 2792 | RTW_INFO("[%s] GO Intent = %d, tie = %d\n", __FUNCTION__, attr_content >> 1, attr_content & 0x01); |
---|
2802 | 2793 | pwdinfo->peer_intent = attr_content; /* include both intent and tie breaker values. */ |
---|
.. | .. |
---|
2835 | 2826 | |
---|
2836 | 2827 | /* Try to get the operation channel information */ |
---|
2837 | 2828 | |
---|
2838 | | - attr_contentlen = sizeof(operatingch_info); |
---|
| 2829 | + attr_contentlen = 0; |
---|
2839 | 2830 | if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_OPERATING_CH, operatingch_info, &attr_contentlen)) { |
---|
2840 | 2831 | RTW_INFO("[%s] Peer's operating channel = %d\n", __FUNCTION__, operatingch_info[4]); |
---|
2841 | 2832 | pwdinfo->peer_operating_ch = operatingch_info[4]; |
---|
2842 | 2833 | } |
---|
2843 | 2834 | |
---|
2844 | 2835 | /* Try to get the channel list information */ |
---|
2845 | | - pwdinfo->channel_list_attr_len = sizeof(pwdinfo->channel_list_attr); |
---|
2846 | 2836 | if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CH_LIST, pwdinfo->channel_list_attr, &pwdinfo->channel_list_attr_len)) { |
---|
2847 | 2837 | RTW_INFO("[%s] channel list attribute found, len = %d\n", __FUNCTION__, pwdinfo->channel_list_attr_len); |
---|
2848 | 2838 | |
---|
.. | .. |
---|
2870 | 2860 | #endif /* CONFIG_CONCURRENT_MODE */ |
---|
2871 | 2861 | { |
---|
2872 | 2862 | u8 operatingch_info[5] = { 0x00 }, peer_operating_ch = 0; |
---|
2873 | | - attr_contentlen = sizeof(operatingch_info); |
---|
| 2863 | + attr_contentlen = 0; |
---|
2874 | 2864 | |
---|
2875 | 2865 | if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_OPERATING_CH, operatingch_info, &attr_contentlen)) |
---|
2876 | 2866 | peer_operating_ch = operatingch_info[4]; |
---|
.. | .. |
---|
2896 | 2886 | RTW_INFO("[%s] channel list attribute not found!\n", __FUNCTION__); |
---|
2897 | 2887 | |
---|
2898 | 2888 | /* Try to get the group id information if peer is GO */ |
---|
| 2889 | + attr_contentlen = 0; |
---|
2899 | 2890 | _rtw_memset(groupid, 0x00, 38); |
---|
2900 | | - attr_contentlen = sizeof(groupid); |
---|
2901 | 2891 | if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_GROUP_ID, groupid, &attr_contentlen)) { |
---|
2902 | 2892 | _rtw_memcpy(pwdinfo->groupid_info.go_device_addr, &groupid[0], ETH_ALEN); |
---|
2903 | 2893 | _rtw_memcpy(pwdinfo->groupid_info.ssid, &groupid[6], attr_contentlen - ETH_ALEN); |
---|
.. | .. |
---|
2938 | 2928 | u32 attr_contentlen = 0; |
---|
2939 | 2929 | |
---|
2940 | 2930 | pwdinfo->negotiation_dialog_token = 1; |
---|
2941 | | - attr_contentlen = sizeof(attr_content); |
---|
2942 | 2931 | rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_STATUS, &attr_content, &attr_contentlen); |
---|
2943 | 2932 | if (attr_contentlen == 1) { |
---|
2944 | 2933 | RTW_INFO("[%s] Status = %d\n", __FUNCTION__, attr_content); |
---|
.. | .. |
---|
2979 | 2968 | } |
---|
2980 | 2969 | |
---|
2981 | 2970 | /* Try to get the group id information */ |
---|
| 2971 | + attr_contentlen = 0; |
---|
2982 | 2972 | _rtw_memset(groupid, 0x00, 38); |
---|
2983 | | - attr_contentlen = sizeof(groupid); |
---|
2984 | 2973 | if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_GROUP_ID, groupid, &attr_contentlen)) { |
---|
2985 | 2974 | RTW_INFO("[%s] Ssid = %s, ssidlen = %zu\n", __FUNCTION__, &groupid[ETH_ALEN], strlen(&groupid[ETH_ALEN])); |
---|
2986 | 2975 | _rtw_memcpy(pwdinfo->groupid_info.go_device_addr, &groupid[0], ETH_ALEN); |
---|
2987 | 2976 | _rtw_memcpy(pwdinfo->groupid_info.ssid, &groupid[6], attr_contentlen - ETH_ALEN); |
---|
2988 | 2977 | } |
---|
2989 | 2978 | |
---|
2990 | | - attr_contentlen = sizeof(operatingch_info); |
---|
| 2979 | + attr_contentlen = 0; |
---|
2991 | 2980 | if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_OPERATING_CH, operatingch_info, &attr_contentlen)) { |
---|
2992 | 2981 | RTW_INFO("[%s] Peer's operating channel = %d\n", __FUNCTION__, operatingch_info[4]); |
---|
2993 | 2982 | pwdinfo->peer_operating_ch = operatingch_info[4]; |
---|
.. | .. |
---|
4026 | 4015 | |
---|
4027 | 4016 | while (p2p_ie) { |
---|
4028 | 4017 | /* Get P2P Manageability IE. */ |
---|
4029 | | - attr_contentlen = sizeof(p2p_attr); |
---|
4030 | 4018 | if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_MANAGEABILITY, p2p_attr, &attr_contentlen)) { |
---|
4031 | 4019 | if ((p2p_attr[0] & (BIT(0) | BIT(1))) == 0x01) |
---|
4032 | 4020 | ret = _FALSE; |
---|