Skip to content
Permalink
Browse files

wifi: eswifi: Select socket before configuration

Socket selection needs to be first in the order of operation

Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
  • Loading branch information...
Saravanan Sekar authored and carlescufi committed Aug 2, 2019
1 parent 23d863f commit 0fd92b463bf3ff952dae84ad9423e067b3284e5b
Showing with 7 additions and 7 deletions.
  1. +7 −7 drivers/wifi/eswifi/eswifi_offload.c
@@ -637,6 +637,13 @@ static int eswifi_off_get(sa_family_t family,
return -ENOMEM;
}

err = __select_socket(eswifi, socket->index);
if (err < 0) {
LOG_ERR("Unable to select socket %u", socket->index);
eswifi_unlock(eswifi);
return -EIO;
}

/* Set Transport Protocol */
if (ip_proto == IPPROTO_TCP) {
socket->type = ESWIFI_TRANSPORT_TCP;
@@ -666,13 +673,6 @@ static int eswifi_off_get(sa_family_t family,
k_sem_init(&socket->accept_sem, 1, 1);
socket->usage = 1;

err = __select_socket(eswifi, socket->index);
if (err < 0) {
LOG_ERR("Unable to select socket %u", socket->index);
eswifi_unlock(eswifi);
return -EIO;
}

k_delayed_work_submit_to_queue(&eswifi->work_q, &socket->read_work,
500);
eswifi_unlock(eswifi);

0 comments on commit 0fd92b4

Please sign in to comment.
You can’t perform that action at this time.