32 #ifndef LWIP_HDR_TCPIP_PRIV_H 33 #define LWIP_HDR_TCPIP_PRIV_H 55 #ifndef LWIP_TCPIP_THREAD_ALIVE 56 #define LWIP_TCPIP_THREAD_ALIVE() 59 #if LWIP_TCPIP_CORE_LOCKING 62 #define LOCK_TCPIP_CORE() sys_mutex_lock(&lock_tcpip_core) 63 #define UNLOCK_TCPIP_CORE() sys_mutex_unlock(&lock_tcpip_core) 65 #define TCIP_APIMSG_SET_ERR(m, e) (m)->msg.err = e 67 #define TCIP_APIMSG_SET_ERR(m, e) 69 #if LWIP_NETCONN_SEM_PER_THREAD 70 #define TCPIP_APIMSG_SET_SEM(m) ((m)->msg.op_completed_sem = LWIP_NETCONN_THREAD_SEM_GET()) 72 #define TCPIP_APIMSG_SET_SEM(m) 74 #define TCPIP_APIMSG_NOERR(m,f) do { \ 75 TCIP_APIMSG_SET_ERR(m, ERR_VAL); \ 76 TCPIP_APIMSG_SET_SEM(m); \ 79 UNLOCK_TCPIP_CORE(); \ 81 #define TCPIP_APIMSG(m,f,e) do { \ 82 TCPIP_APIMSG_NOERR(m,f); \ 85 #define TCPIP_APIMSG_ACK(m) NETCONN_SET_SAFE_ERR((m)->conn, (m)->err) 86 #define TCPIP_NETIFAPI(m) tcpip_netifapi_lock(m) 87 #define TCPIP_NETIFAPI_ACK(m) 88 #define TCPIP_PPPAPI(m) tcpip_pppapi_lock(m) 89 #define TCPIP_PPPAPI_ACK(m) 91 #define LOCK_TCPIP_CORE() 92 #define UNLOCK_TCPIP_CORE() 93 #define TCPIP_APIMSG_NOERR(m,f) do { (m)->function = f; tcpip_apimsg(m); } while(0) 94 #define TCPIP_APIMSG(m,f,e) do { (m)->function = f; (e) = tcpip_apimsg(m); } while(0) 95 #define TCPIP_APIMSG_ACK(m) do { NETCONN_SET_SAFE_ERR((m)->conn, (m)->err); sys_sem_signal(LWIP_API_MSG_SEM(m)); } while(0) 96 #define TCPIP_NETIFAPI(m) tcpip_netifapi(m) 97 #define TCPIP_NETIFAPI_ACK(m) sys_sem_signal(&m->sem) 98 #define TCPIP_PPPAPI(m) tcpip_pppapi(m) 99 #define TCPIP_PPPAPI_ACK(m) sys_sem_signal(&m->sem) 103 #if LWIP_MPU_COMPATIBLE 104 #define API_VAR_REF(name) (*(name)) 105 #define API_VAR_DECLARE(type, name) type * name 106 #define API_VAR_ALLOC(type, pool, name) do { \ 107 name = (type *)memp_malloc(pool); \ 108 if (name == NULL) { \ 112 #define API_VAR_ALLOC_DONTFAIL(type, pool, name) do { \ 113 name = (type *)memp_malloc(pool); \ 114 LWIP_ASSERT("pool empty", name != NULL); \ 116 #define API_VAR_FREE(pool, name) memp_free(pool, name) 117 #define API_EXPR_REF(expr) &(expr) 118 #if LWIP_NETCONN_SEM_PER_THREAD 119 #define API_EXPR_REF_SEM(expr) (expr) 121 #define API_EXPR_REF_SEM(expr) API_EXPR_REF(expr) 123 #define API_EXPR_DEREF(expr) expr 125 #define API_VAR_REF(name) name 126 #define API_VAR_DECLARE(type, name) type name 127 #define API_VAR_ALLOC(type, pool, name) 128 #define API_VAR_ALLOC_DONTFAIL(type, pool, name) 129 #define API_VAR_FREE(pool, name) 130 #define API_EXPR_REF(expr) expr 131 #define API_EXPR_REF_SEM(expr) API_EXPR_REF(expr) 132 #define API_EXPR_DEREF(expr) *(expr) 136 #if LWIP_NETCONN || LWIP_SOCKET 137 err_t tcpip_apimsg(
struct api_msg *apimsg);
140 #if PPPOS_SUPPORT && !PPP_INPROC_IRQ_SAFE 145 err_t tcpip_netifapi(
struct netifapi_msg *netifapimsg);
146 #if LWIP_TCPIP_CORE_LOCKING 147 err_t tcpip_netifapi_lock(
struct netifapi_msg *netifapimsg);
152 err_t tcpip_pppapi(
struct pppapi_msg *pppapimsg);
153 #if LWIP_TCPIP_CORE_LOCKING 154 err_t tcpip_pppapi_lock(
struct pppapi_msg *pppapimsg);
160 #if LWIP_NETCONN || LWIP_SOCKET 164 #if PPPOS_SUPPORT && !PPP_INPROC_IRQ_SAFE 165 TCPIP_MSG_INPKT_PPPOS,
173 #if LWIP_TCPIP_TIMEOUT 185 #if LWIP_NETCONN || LWIP_SOCKET 186 struct api_msg *apimsg;
189 struct netifapi_msg *netifapimsg;
192 struct pppapi_msg *pppapimsg;
202 #if LWIP_TCPIP_TIMEOUT
void(* tcpip_callback_fn)(void *ctx)
void(* sys_timeout_handler)(void *arg)
struct tcpip_msg::@48::@49 inp
struct tcpip_msg::@48::@50 cb
osSemaphoreId sys_mutex_t