Skip to content

Commit

Permalink
SMSTCPIP: disabled call to sys_mbox_post() from err_tcp() and do_recv…
Browse files Browse the repository at this point in the history
…() when TCPIP_CORE_LOCKING is used. conn->mbox will no longer be created when TCPIP_CORE_LOCKING is used. Removed unused mbox field from struct api_msg_msg.

Related to a8630bb.
  • Loading branch information
sp193 committed Feb 17, 2019
1 parent df70a87 commit f16c52d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 4 additions & 0 deletions modules/network/SMSTCPIP/api_lib.c
Expand Up @@ -146,10 +146,12 @@ struct
conn->type = t;
conn->pcb.tcp = NULL;

#if !LWIP_TCPIP_CORE_LOCKING
if ((conn->mbox = sys_mbox_new()) == SYS_MBOX_NULL) {
memp_free(MEMP_NETCONN, conn);
return NULL;
}
#endif
conn->recvmbox = SYS_MBOX_NULL;
conn->acceptmbox = SYS_MBOX_NULL;
conn->sem = SYS_SEM_NULL;
Expand Down Expand Up @@ -218,8 +220,10 @@ err_t netconn_delete(struct netconn *conn)
conn->acceptmbox = SYS_MBOX_NULL;
}

#if !LWIP_TCPIP_CORE_LOCKING
sys_mbox_free(conn->mbox);
conn->mbox = SYS_MBOX_NULL;
#endif
if (conn->sem != SYS_SEM_NULL) {
sys_sem_free(conn->sem);
}
Expand Down
6 changes: 3 additions & 3 deletions modules/network/SMSTCPIP/api_msg.c
Expand Up @@ -196,7 +196,7 @@ err_tcp(void *arg, err_t err)
sys_mbox_post(conn->recvmbox, NULL);
}
if (conn->mbox != SYS_MBOX_NULL) {
sys_mbox_post(conn->mbox, NULL);
TCPIP_APIMSG_ACK(conn->mbox);
}
if (conn->acceptmbox != SYS_MBOX_NULL) {
/* Register event with callback */
Expand Down Expand Up @@ -475,7 +475,7 @@ do_connected(void *arg, struct tcp_pcb *pcb, err_t err)
if (conn->type == NETCONN_TCP && err == ERR_OK) {
setup_tcp(conn);
}
sys_mbox_post(conn->mbox, NULL);
TCPIP_APIMSG_ACK(conn->mbox);
return ERR_OK;
}
#endif
Expand Down Expand Up @@ -700,7 +700,7 @@ static void do_recv(struct api_msg_msg *msg)
if (conn->pcb.tcp && conn->type == NETCONN_TCP)
tcp_recved(conn->pcb.tcp, msg->msg.len);
#endif
sys_mbox_post(conn->mbox, NULL);
TCPIP_APIMSG_ACK(conn->mbox);

} /* end do_recv */

Expand Down
1 change: 0 additions & 1 deletion modules/network/SMSTCPIP/include/lwip/api_msg.h
Expand Up @@ -81,7 +81,6 @@ struct api_msg_msg
u16_t len;
unsigned char copy;
} w;
sys_mbox_t mbox;
u16_t len;
} msg;
};
Expand Down

0 comments on commit f16c52d

Please sign in to comment.