mirror of
https://github.com/genodelabs/genode.git
synced 2025-03-11 06:54:18 +00:00
parent
8f47609024
commit
ac59b68257
@ -35,6 +35,7 @@ void wpa_ctrl_set_fd(void);
|
||||
|
||||
void *wifi_get_buffer(void);
|
||||
void wifi_notify_cmd_result(void);
|
||||
void wifi_block_for_processing(void);
|
||||
void wifi_notify_event(void);
|
||||
|
||||
|
||||
|
@ -1501,6 +1501,7 @@ struct Wifi::Frontend
|
||||
char const *msg = reinterpret_cast<char const*>(_msg.recv);
|
||||
unsigned const recv_id = _msg.recv_id;
|
||||
|
||||
|
||||
/* return early */
|
||||
if (_last_recv_id == recv_id) {
|
||||
_notify_lock_unlock();
|
||||
|
@ -35,7 +35,7 @@ static Wifi::Frontend *_wifi_frontend = nullptr;
|
||||
* Called by the CTRL interface after wpa_supplicant has processed
|
||||
* the command.
|
||||
*/
|
||||
void wifi_notify_cmd_result(void)
|
||||
void wifi_block_for_processing(void)
|
||||
{
|
||||
if (!_wifi_frontend) {
|
||||
Genode::warning("frontend not available, dropping notification");
|
||||
@ -50,6 +50,15 @@ void wifi_notify_cmd_result(void)
|
||||
|
||||
/* XXX hack to trick poll() into returning faster */
|
||||
wpa_ctrl_set_fd();
|
||||
}
|
||||
|
||||
|
||||
void wifi_notify_cmd_result(void)
|
||||
{
|
||||
if (!_wifi_frontend) {
|
||||
Genode::warning("frontend not available, dropping notification");
|
||||
return;
|
||||
}
|
||||
|
||||
Genode::Signal_transmitter(_wifi_frontend->result_sigh()).submit();
|
||||
}
|
||||
|
@ -115,19 +115,22 @@ static void wpa_supplicant_ctrl_iface_receive(int fd, void *eloop_ctx,
|
||||
&reply_len);
|
||||
|
||||
if (reply) {
|
||||
wifi_notify_cmd_result();
|
||||
wifi_block_for_processing();
|
||||
send_reply(priv, reply, reply_len);
|
||||
wifi_notify_cmd_result();
|
||||
os_free(reply);
|
||||
} else
|
||||
|
||||
if (reply_len == 1) {
|
||||
wifi_notify_cmd_result();
|
||||
wifi_block_for_processing();
|
||||
send_reply(priv, "FAIL", 4);
|
||||
wifi_notify_cmd_result();
|
||||
} else
|
||||
|
||||
if (reply_len == 2) {
|
||||
wifi_notify_cmd_result();
|
||||
wifi_block_for_processing();
|
||||
send_reply(priv, "OK", 2);
|
||||
wifi_notify_cmd_result();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user