Lines Matching full:global
22 int wifi_display_init(struct wpa_global *global) in wifi_display_init() argument
24 global->wifi_display = 1; in wifi_display_init()
29 void wifi_display_deinit(struct wpa_global *global) in wifi_display_deinit() argument
33 wpabuf_free(global->wfd_subelem[i]); in wifi_display_deinit()
34 global->wfd_subelem[i] = NULL; in wifi_display_deinit()
39 struct wpabuf * wifi_display_get_wfd_ie(struct wpa_global *global) in wifi_display_get_wfd_ie() argument
45 if (global->p2p == NULL) in wifi_display_get_wfd_ie()
50 if (global->wfd_subelem[i]) in wifi_display_get_wfd_ie()
51 len += wpabuf_len(global->wfd_subelem[i]); in wifi_display_get_wfd_ie()
59 if (global->wfd_subelem[i]) in wifi_display_get_wfd_ie()
60 wpabuf_put_buf(ie, global->wfd_subelem[i]); in wifi_display_get_wfd_ie()
67 static int wifi_display_update_wfd_ie(struct wpa_global *global) in wifi_display_update_wfd_ie() argument
72 if (global->p2p == NULL) in wifi_display_update_wfd_ie()
77 if (!global->wifi_display) { in wifi_display_update_wfd_ie()
80 p2p_set_wfd_ie_beacon(global->p2p, NULL); in wifi_display_update_wfd_ie()
81 p2p_set_wfd_ie_probe_req(global->p2p, NULL); in wifi_display_update_wfd_ie()
82 p2p_set_wfd_ie_probe_resp(global->p2p, NULL); in wifi_display_update_wfd_ie()
83 p2p_set_wfd_ie_assoc_req(global->p2p, NULL); in wifi_display_update_wfd_ie()
84 p2p_set_wfd_ie_invitation(global->p2p, NULL); in wifi_display_update_wfd_ie()
85 p2p_set_wfd_ie_prov_disc_req(global->p2p, NULL); in wifi_display_update_wfd_ie()
86 p2p_set_wfd_ie_prov_disc_resp(global->p2p, NULL); in wifi_display_update_wfd_ie()
87 p2p_set_wfd_ie_go_neg(global->p2p, NULL); in wifi_display_update_wfd_ie()
88 p2p_set_wfd_dev_info(global->p2p, NULL); in wifi_display_update_wfd_ie()
89 p2p_set_wfd_r2_dev_info(global->p2p, NULL); in wifi_display_update_wfd_ie()
90 p2p_set_wfd_assoc_bssid(global->p2p, NULL); in wifi_display_update_wfd_ie()
91 p2p_set_wfd_coupled_sink_info(global->p2p, NULL); in wifi_display_update_wfd_ie()
95 p2p_set_wfd_dev_info(global->p2p, in wifi_display_update_wfd_ie()
96 global->wfd_subelem[WFD_SUBELEM_DEVICE_INFO]); in wifi_display_update_wfd_ie()
98 global->p2p, global->wfd_subelem[WFD_SUBELEM_R2_DEVICE_INFO]); in wifi_display_update_wfd_ie()
100 global->p2p, in wifi_display_update_wfd_ie()
101 global->wfd_subelem[WFD_SUBELEM_ASSOCIATED_BSSID]); in wifi_display_update_wfd_ie()
103 global->p2p, global->wfd_subelem[WFD_SUBELEM_COUPLED_SINK]); in wifi_display_update_wfd_ie()
136 if (global->wfd_subelem[WFD_SUBELEM_DEVICE_INFO]) in wifi_display_update_wfd_ie()
137 len += wpabuf_len(global->wfd_subelem[ in wifi_display_update_wfd_ie()
140 if (global->wfd_subelem[WFD_SUBELEM_R2_DEVICE_INFO]) in wifi_display_update_wfd_ie()
141 len += wpabuf_len(global->wfd_subelem[ in wifi_display_update_wfd_ie()
144 if (global->wfd_subelem[WFD_SUBELEM_ASSOCIATED_BSSID]) in wifi_display_update_wfd_ie()
145 len += wpabuf_len(global->wfd_subelem[ in wifi_display_update_wfd_ie()
147 if (global->wfd_subelem[WFD_SUBELEM_COUPLED_SINK]) in wifi_display_update_wfd_ie()
148 len += wpabuf_len(global->wfd_subelem[ in wifi_display_update_wfd_ie()
150 if (global->wfd_subelem[WFD_SUBELEM_SESSION_INFO]) in wifi_display_update_wfd_ie()
151 len += wpabuf_len(global->wfd_subelem[ in wifi_display_update_wfd_ie()
153 if (global->wfd_subelem[WFD_SUBELEM_EXT_CAPAB]) in wifi_display_update_wfd_ie()
154 len += wpabuf_len(global->wfd_subelem[WFD_SUBELEM_EXT_CAPAB]); in wifi_display_update_wfd_ie()
159 if (global->wfd_subelem[WFD_SUBELEM_DEVICE_INFO]) in wifi_display_update_wfd_ie()
161 global->wfd_subelem[WFD_SUBELEM_DEVICE_INFO]); in wifi_display_update_wfd_ie()
163 if (global->wfd_subelem[WFD_SUBELEM_R2_DEVICE_INFO]) in wifi_display_update_wfd_ie()
165 global->wfd_subelem[WFD_SUBELEM_R2_DEVICE_INFO]); in wifi_display_update_wfd_ie()
167 if (global->wfd_subelem[WFD_SUBELEM_ASSOCIATED_BSSID]) in wifi_display_update_wfd_ie()
168 wpabuf_put_buf(buf, global->wfd_subelem[ in wifi_display_update_wfd_ie()
170 if (global->wfd_subelem[WFD_SUBELEM_COUPLED_SINK]) in wifi_display_update_wfd_ie()
172 global->wfd_subelem[WFD_SUBELEM_COUPLED_SINK]); in wifi_display_update_wfd_ie()
176 p2p_set_wfd_ie_beacon(global->p2p, ie); in wifi_display_update_wfd_ie()
181 p2p_set_wfd_ie_assoc_req(global->p2p, ie); in wifi_display_update_wfd_ie()
185 p2p_set_wfd_ie_go_neg(global->p2p, ie); in wifi_display_update_wfd_ie()
190 p2p_set_wfd_ie_prov_disc_req(global->p2p, ie); in wifi_display_update_wfd_ie()
193 if (global->wfd_subelem[WFD_SUBELEM_EXT_CAPAB]) in wifi_display_update_wfd_ie()
195 global->wfd_subelem[WFD_SUBELEM_EXT_CAPAB]); in wifi_display_update_wfd_ie()
199 p2p_set_wfd_ie_probe_req(global->p2p, ie); in wifi_display_update_wfd_ie()
201 if (global->wfd_subelem[WFD_SUBELEM_SESSION_INFO]) in wifi_display_update_wfd_ie()
203 global->wfd_subelem[WFD_SUBELEM_SESSION_INFO]); in wifi_display_update_wfd_ie()
206 p2p_set_wfd_ie_probe_resp(global->p2p, ie); in wifi_display_update_wfd_ie()
210 if (global->wfd_subelem[WFD_SUBELEM_SESSION_INFO]) in wifi_display_update_wfd_ie()
212 global->wfd_subelem[WFD_SUBELEM_SESSION_INFO]); in wifi_display_update_wfd_ie()
216 p2p_set_wfd_ie_invitation(global->p2p, ie); in wifi_display_update_wfd_ie()
221 p2p_set_wfd_ie_prov_disc_resp(global->p2p, ie); in wifi_display_update_wfd_ie()
229 void wifi_display_enable(struct wpa_global *global, int enabled) in wifi_display_enable() argument
233 global->wifi_display = enabled; in wifi_display_enable()
234 wifi_display_update_wfd_ie(global); in wifi_display_enable()
238 int wifi_display_subelem_set(struct wpa_global *global, char *cmd) in wifi_display_subelem_set() argument
265 res = wifi_display_subelem_set_from_ies(global, e); in wifi_display_subelem_set()
290 wpabuf_free(global->wfd_subelem[subelem]); in wifi_display_subelem_set()
291 global->wfd_subelem[subelem] = e; in wifi_display_subelem_set()
292 wifi_display_update_wfd_ie(global); in wifi_display_subelem_set()
298 int wifi_display_subelem_set_from_ies(struct wpa_global *global, in wifi_display_subelem_set_from_ies() argument
333 wpabuf_free(global->wfd_subelem[subelem]); in wifi_display_subelem_set_from_ies()
334 global->wfd_subelem[subelem] = e; in wifi_display_subelem_set_from_ies()
343 wpabuf_free(global->wfd_subelem[subelem]); in wifi_display_subelem_set_from_ies()
344 global->wfd_subelem[subelem] = NULL; in wifi_display_subelem_set_from_ies()
348 return wifi_display_update_wfd_ie(global); in wifi_display_subelem_set_from_ies()
352 int wifi_display_subelem_get(struct wpa_global *global, char *cmd, in wifi_display_subelem_get() argument
361 ie = wifi_display_get_wfd_ie(global); in wifi_display_subelem_get()
374 if (global->wfd_subelem[subelem] == NULL) in wifi_display_subelem_get()
378 wpabuf_head_u8(global->wfd_subelem[subelem]) + in wifi_display_subelem_get()
380 wpabuf_len(global->wfd_subelem[subelem]) - 1); in wifi_display_subelem_get()