net: lwm2m: remove unused CONFIG_NET_CONTEXT_NET_PKT_POOL config
CONFIG_NET_CONTEXT_NET_PKT_POOL is used by Zephyr's TCP stack as a way of keeping the original packet data when compression and other l2 specific actions make the data unusable for retries. LwM2M uses UDP and this option was never used. Signed-off-by: Michael Scott <mike@foundries.io>
This commit is contained in:
parent
5c640cd0b5
commit
0ee0773abd
4 changed files with 3 additions and 57 deletions
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2017 Linaro Limited
|
||||
* Copyright (c) 2017 Foundries.io
|
||||
* Copyright (c) 2017-2019 Foundries.io
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
@ -37,10 +37,6 @@
|
|||
* consuming operation, like resolving DNS address.
|
||||
* @param net_timeout How long to wait for the network connection before
|
||||
* giving up.
|
||||
* @param tx_slab Network packet (net_pkt) memory pool for network contexts
|
||||
* attached to this LwM2M context.
|
||||
* @param data_pool Network data net_buf pool for network contexts attached
|
||||
* to this LwM2M context.
|
||||
*/
|
||||
struct lwm2m_ctx {
|
||||
/** Net app context structure */
|
||||
|
@ -48,11 +44,6 @@ struct lwm2m_ctx {
|
|||
s32_t net_init_timeout;
|
||||
s32_t net_timeout;
|
||||
|
||||
#if defined(CONFIG_NET_CONTEXT_NET_PKT_POOL)
|
||||
net_pkt_get_slab_func_t tx_slab;
|
||||
net_pkt_get_pool_func_t data_pool;
|
||||
#endif /* CONFIG_NET_CONTEXT_NET_PKT_POOL */
|
||||
|
||||
/** Private CoAP and networking structures */
|
||||
struct coap_pending pendings[CONFIG_LWM2M_ENGINE_MAX_PENDING];
|
||||
struct coap_reply replies[CONFIG_LWM2M_ENGINE_MAX_REPLIES];
|
||||
|
@ -225,11 +216,6 @@ int lwm2m_engine_set_res_data(char *pathstr, void *data_ptr, u16_t data_len,
|
|||
int lwm2m_engine_get_res_data(char *pathstr, void **data_ptr, u16_t *data_len,
|
||||
u8_t *data_flags);
|
||||
|
||||
#if defined(CONFIG_NET_CONTEXT_NET_PKT_POOL)
|
||||
int lwm2m_engine_set_net_pkt_pool(struct lwm2m_ctx *ctx,
|
||||
net_pkt_get_slab_func_t tx_slab,
|
||||
net_pkt_get_pool_func_t data_pool);
|
||||
#endif
|
||||
int lwm2m_engine_start(struct lwm2m_ctx *client_ctx,
|
||||
char *peer_str, u16_t peer_port);
|
||||
|
||||
|
|
|
@ -15,7 +15,6 @@ CONFIG_NET_PKT_TX_COUNT=10
|
|||
CONFIG_NET_BUF_RX_COUNT=10
|
||||
CONFIG_NET_BUF_TX_COUNT=10
|
||||
CONFIG_NET_MAX_CONTEXTS=5
|
||||
# CONFIG_NET_CONTEXT_NET_PKT_POOL is not set
|
||||
|
||||
CONFIG_NET_SHELL=y
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2017 Linaro Limited
|
||||
* Copyright (c) 2017 Foundries.io
|
||||
* Copyright (c) 2017-2019 Foundries.io
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
@ -96,24 +96,6 @@ static struct k_sem quit_lock;
|
|||
static u8_t firmware_buf[64];
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_NET_CONTEXT_NET_PKT_POOL)
|
||||
NET_PKT_TX_SLAB_DEFINE(lwm2m_tx_udp, 5);
|
||||
NET_PKT_DATA_POOL_DEFINE(lwm2m_data_udp, 20);
|
||||
|
||||
static struct k_mem_slab *tx_udp_slab(void)
|
||||
{
|
||||
return &lwm2m_tx_udp;
|
||||
}
|
||||
|
||||
static struct net_buf_pool *data_udp_pool(void)
|
||||
{
|
||||
return &lwm2m_data_udp;
|
||||
}
|
||||
#else
|
||||
#define tx_udp_slab NULL
|
||||
#define data_udp_pool NULL
|
||||
#endif /* CONFIG_NET_CONTEXT_NET_PKT_POOL */
|
||||
|
||||
/* TODO: Move to a pre write hook that can handle ret codes once available */
|
||||
static int led_on_off_cb(u16_t obj_inst_id, u8_t *data, u16_t data_len,
|
||||
bool last_block, size_t total_size)
|
||||
|
@ -362,10 +344,6 @@ void main(void)
|
|||
(void)memset(&client, 0x0, sizeof(client));
|
||||
client.net_init_timeout = WAIT_TIME;
|
||||
client.net_timeout = CONNECT_TIME;
|
||||
#if defined(CONFIG_NET_CONTEXT_NET_PKT_POOL)
|
||||
client.tx_slab = tx_udp_slab;
|
||||
client.data_pool = data_udp_pool;
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_NET_APP_DTLS)
|
||||
client.client_psk = client_psk;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2017 Linaro Limited
|
||||
* Copyright (c) 2018 Foundries.io
|
||||
* Copyright (c) 2018-2019 Foundries.io
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
@ -3909,26 +3909,9 @@ static void lwm2m_engine_service(void)
|
|||
}
|
||||
}
|
||||
|
||||
#if defined(CONFIG_NET_CONTEXT_NET_PKT_POOL)
|
||||
int lwm2m_engine_set_net_pkt_pool(struct lwm2m_ctx *ctx,
|
||||
net_pkt_get_slab_func_t tx_slab,
|
||||
net_pkt_get_pool_func_t data_pool)
|
||||
{
|
||||
ctx->tx_slab = tx_slab;
|
||||
ctx->data_pool = data_pool;
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_NET_CONTEXT_NET_PKT_POOL */
|
||||
|
||||
void lwm2m_engine_context_init(struct lwm2m_ctx *client_ctx)
|
||||
{
|
||||
k_delayed_work_init(&client_ctx->retransmit_work, retransmit_request);
|
||||
|
||||
#if defined(CONFIG_NET_CONTEXT_NET_PKT_POOL)
|
||||
net_app_set_net_pkt_pool(&client_ctx->net_app_ctx,
|
||||
client_ctx->tx_slab, client_ctx->data_pool);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(CONFIG_NET_APP_DTLS)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue