net: Fix stack info collector in net shell

The cc2520 driver RX thread did not like the stack information
collection macros defined in net_core.h. Both the cc2520 TX and
RX got the same variable name which did not compile.
This is now changed so that the first parameter is added to
the variable name to create a unique variable.

Change-Id: Ia41d01a71afd73af2ef31aa5f7a890a3cf0385aa
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
Jukka Rissanen 2016-11-28 15:05:02 +02:00
parent bd48a9eca7
commit b4cba17408
5 changed files with 13 additions and 8 deletions

View file

@ -1112,6 +1112,10 @@ NET_DEVICE_INIT(cc2520, CONFIG_TI_CC2520_DRV_NAME,
&cc2520_radio_api, IEEE802154_L2,
NET_L2_GET_CTX_TYPE(IEEE802154_L2), 125);
NET_STACK_INFO("RX", cc2520, CONFIG_CC2520_RX_STACK_SIZE,
CONFIG_CC2520_RX_STACK_SIZE);
NET_STACK_INFO_ADDR(RX, cc2520,
CONFIG_CC2520_RX_STACK_SIZE,
CONFIG_CC2520_RX_STACK_SIZE,
((struct cc2520_context *)(&__device_cc2520))->
cc2520_rx_stack,
0);
#endif

View file

@ -104,17 +104,18 @@ struct net_stack_info {
};
#if defined(CONFIG_NET_SHELL)
#define NET_STACK_GET_NAME(name, sfx) (__net_stack_##name##_##sfx)
#define NET_STACK_GET_NAME(pretty, name, sfx) \
(__net_stack_##pretty##_##name##_##sfx)
#define NET_STACK_INFO_ADDR(_pretty, _name, _orig, _size, _addr, sfx) \
static struct net_stack_info \
(NET_STACK_GET_NAME(_name, sfx)) __used \
(NET_STACK_GET_NAME(_pretty, _name, sfx)) __used \
__attribute__((__section__(".net_stack.data"))) = { \
.stack = _addr, \
.size = _size, \
.orig_size = _orig, \
.name = #_name, \
.pretty_name = _pretty, \
.pretty_name = #_pretty, \
}
#define NET_STACK_INFO(_pretty_name, _name, _orig, _size) \

View file

@ -1105,7 +1105,7 @@ struct net_if_api {
.l2_data = &(NET_L2_GET_DATA(dev_name, sfx)), \
.mtu = _mtu, \
}; \
NET_STACK_INFO_ADDR("TX", \
NET_STACK_INFO_ADDR(TX, \
dev_name, \
CONFIG_NET_TX_STACK_SIZE, \
CONFIG_NET_TX_STACK_SIZE, \

View file

@ -63,7 +63,7 @@
#define CONFIG_NET_RX_STACK_SIZE 1024
#endif
NET_STACK_DEFINE("RX", rx_stack, CONFIG_NET_RX_STACK_SIZE,
NET_STACK_DEFINE(RX, rx_stack, CONFIG_NET_RX_STACK_SIZE,
CONFIG_NET_RX_STACK_SIZE + CONFIG_NET_RX_STACK_RPL);
static struct k_fifo rx_queue;

View file

@ -33,7 +33,7 @@ struct mgmt_event_entry {
};
static struct k_sem network_event;
NET_STACK_DEFINE("MGMT", mgmt_stack, CONFIG_NET_MGMT_EVENT_STACK_SIZE,
NET_STACK_DEFINE(MGMT, mgmt_stack, CONFIG_NET_MGMT_EVENT_STACK_SIZE,
CONFIG_NET_MGMT_EVENT_STACK_SIZE);
static struct mgmt_event_entry events[CONFIG_NET_MGMT_EVENT_QUEUE_SIZE];
static uint32_t global_event_mask;