extmod/modnetwork: Remove modnetwork socket u_state member.

To simplify the socket state.

The CC3K driver (see drivers/cc3000/inc/socket.h and src/socket.c) has
socket() returning an INT16 so there is now enough room to store it
directly in the fileno member.
This commit is contained in:
iabdalkader
2021-09-14 21:21:09 +02:00
committed by Damien George
parent f9d573a4ac
commit d9749f90ad
4 changed files with 68 additions and 69 deletions

View File

@@ -72,15 +72,11 @@ typedef struct _mod_network_socket_obj_t {
mp_obj_base_t base;
mp_obj_t nic;
mod_network_nic_type_t *nic_type;
union {
struct {
uint8_t domain;
uint8_t type;
int8_t fileno;
uint8_t bound;
} u_param;
mp_uint_t u_state;
};
uint32_t domain : 5;
uint32_t type : 5;
uint32_t proto : 5;
uint32_t bound : 1;
int32_t fileno : 16;
#if MICROPY_PY_USOCKET_EXTENDED_STATE
// Extended socket state for NICs/ports that need it.
int32_t timeout;