Lines Matching +full:ctrl +full:- +full:len
3 * Copyright (c) 2010-2011, Atheros Communications, Inc.
4 * Copyright (c) 2011-2012, Qualcomm Atheros, Inc.
25 struct wpa_ctrl *ctrl; in wpa_open_ctrl() local
28 ctrl = wpa_ctrl_open(buf); in wpa_open_ctrl()
29 if (ctrl == NULL) in wpa_open_ctrl()
31 return ctrl; in wpa_open_ctrl()
37 struct wpa_ctrl *ctrl; in wpa_command() local
39 size_t len; in wpa_command() local
42 ctrl = wpa_open_ctrl(ifname); in wpa_command()
43 if (ctrl == NULL) in wpa_command()
44 return -1; in wpa_command()
45 len = sizeof(buf); in wpa_command()
46 if (wpa_ctrl_request(ctrl, cmd, strlen(cmd), buf, &len, NULL) < 0) { in wpa_command()
48 wpa_ctrl_close(ctrl); in wpa_command()
49 return -1; in wpa_command()
51 wpa_ctrl_close(ctrl); in wpa_command()
52 buf[len] = '\0'; in wpa_command()
55 return -1; in wpa_command()
64 struct wpa_ctrl *ctrl; in wpa_command_resp() local
65 size_t len; in wpa_command_resp() local
68 ctrl = wpa_open_ctrl(ifname); in wpa_command_resp()
69 if (ctrl == NULL) in wpa_command_resp()
70 return -1; in wpa_command_resp()
71 len = resp_size; in wpa_command_resp()
72 if (wpa_ctrl_request(ctrl, cmd, strlen(cmd), resp, &len, NULL) < 0) { in wpa_command_resp()
74 wpa_ctrl_close(ctrl); in wpa_command_resp()
75 return -1; in wpa_command_resp()
77 wpa_ctrl_close(ctrl); in wpa_command_resp()
78 resp[len] = '\0'; in wpa_command_resp()
85 struct wpa_ctrl *ctrl; in open_wpa_mon() local
87 ctrl = wpa_open_ctrl(ifname); in open_wpa_mon()
88 if (ctrl == NULL) in open_wpa_mon()
90 if (wpa_ctrl_attach(ctrl) < 0) { in open_wpa_mon()
91 wpa_ctrl_close(ctrl); in open_wpa_mon()
95 return ctrl; in open_wpa_mon()
112 return -1; in get_wpa_cli_event2()
116 size_t len; in get_wpa_cli_event2() local
125 return -1; in get_wpa_cli_event2()
129 return -1; in get_wpa_cli_event2()
131 len = buf_size; in get_wpa_cli_event2()
132 if (wpa_ctrl_recv(mon, buf, &len) < 0) { in get_wpa_cli_event2()
134 return -1; in get_wpa_cli_event2()
136 if (len == buf_size) in get_wpa_cli_event2()
137 len--; in get_wpa_cli_event2()
138 buf[len] = '\0'; in get_wpa_cli_event2()
148 if ((int) (now - start) > default_timeout) { in get_wpa_cli_event2()
150 return -1; in get_wpa_cli_event2()
166 struct wpa_ctrl *ctrl; in get_wpa_status() local
169 size_t len, flen; in get_wpa_status() local
171 ctrl = wpa_open_ctrl(ifname); in get_wpa_status()
172 if (ctrl == NULL) in get_wpa_status()
173 return -1; in get_wpa_status()
174 len = sizeof(buf); in get_wpa_status()
175 if (wpa_ctrl_request(ctrl, "STATUS-NO_EVENTS", 16, buf, &len, in get_wpa_status()
177 wpa_ctrl_close(ctrl); in get_wpa_status()
178 return -1; in get_wpa_status()
180 wpa_ctrl_close(ctrl); in get_wpa_status()
181 buf[len] = '\0'; in get_wpa_status()
185 while (pos + flen < buf + len) { in get_wpa_status()
200 return -1; in get_wpa_status()
202 if (end - pos > (int) obuf_size) in get_wpa_status()
203 return -1; in get_wpa_status()
204 memcpy(obuf, pos, end - pos); in get_wpa_status()
208 return -1; in get_wpa_status()
216 struct wpa_ctrl *ctrl; in wait_ip_addr() local
219 printf("%s: ifname='%s' - %d seconds remaining\n", in wait_ip_addr()
221 count--; in wait_ip_addr()
228 ctrl = wpa_open_ctrl(ifname); in wait_ip_addr()
229 if (ctrl == NULL) in wait_ip_addr()
230 return -1; in wait_ip_addr()
231 wpa_ctrl_close(ctrl); in wait_ip_addr()
236 return -1; in wait_ip_addr()
245 return -1; in add_network()
274 return -1; in add_cred()