drivers: ieee802154: use k_thread_create()

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2017-05-09 12:15:00 -07:00 committed by Anas Nashif
commit 27bcdc571b
6 changed files with 16 additions and 15 deletions

View file

@ -1075,11 +1075,10 @@ static int cc2520_init(struct device *dev)
return -EIO;
}
k_thread_spawn(cc2520->cc2520_rx_stack,
CONFIG_IEEE802154_CC2520_RX_STACK_SIZE,
(k_thread_entry_t)cc2520_rx,
dev, NULL, NULL,
K_PRIO_COOP(2), 0, 0);
k_thread_create(&cc2520->cc2520_rx_thread, cc2520->cc2520_rx_stack,
CONFIG_IEEE802154_CC2520_RX_STACK_SIZE,
(k_thread_entry_t)cc2520_rx,
dev, NULL, NULL, K_PRIO_COOP(2), 0, 0);
SYS_LOG_INF("CC2520 initialized");

View file

@ -41,6 +41,7 @@ struct cc2520_context {
atomic_t tx;
/************RX************/
char __stack cc2520_rx_stack[CONFIG_IEEE802154_CC2520_RX_STACK_SIZE];
struct k_thread cc2520_rx_thread;
struct k_sem rx_lock;
#ifdef CONFIG_IEEE802154_CC2520_CRYPTO
struct k_sem access_lock;

View file

@ -1405,11 +1405,10 @@ static int mcr20a_init(struct device *dev)
return -EIO;
}
k_thread_spawn(mcr20a->mcr20a_rx_stack,
CONFIG_IEEE802154_MCR20A_RX_STACK_SIZE,
(k_thread_entry_t)mcr20a_thread_main,
dev, NULL, NULL,
K_PRIO_COOP(2), 0, 0);
k_thread_create(&mcr20a->mcr20a_rx_thread, mcr20a->mcr20a_rx_stack,
CONFIG_IEEE802154_MCR20A_RX_STACK_SIZE,
(k_thread_entry_t)mcr20a_thread_main,
dev, NULL, NULL, K_PRIO_COOP(2), 0, 0);
return 0;
}

View file

@ -43,6 +43,7 @@ struct mcr20a_context {
atomic_t seq_retval;
/************RX************/
char __stack mcr20a_rx_stack[CONFIG_IEEE802154_MCR20A_RX_STACK_SIZE];
struct k_thread mcr20a_rx_thread;
u8_t lqi;
};

View file

@ -335,11 +335,10 @@ static int nrf5_init(struct device *dev)
nrf5_radio_cfg->irq_config_func(dev);
k_thread_spawn(nrf5_radio->rx_stack,
CONFIG_IEEE802154_NRF5_RX_STACK_SIZE,
nrf5_rx_thread,
dev, NULL, NULL,
K_PRIO_COOP(2), 0, 0);
k_thread_create(&nrf5_radio->rx_thread, nrf5_radio->rx_stack,
CONFIG_IEEE802154_NRF5_RX_STACK_SIZE,
nrf5_rx_thread, dev, NULL, NULL,
K_PRIO_COOP(2), 0, 0);
SYS_LOG_INF("nRF5 802154 radio initialized");

View file

@ -28,6 +28,8 @@ struct nrf5_802154_data {
u8_t mac[8];
/* RX thread stack. */
char __stack rx_stack[CONFIG_IEEE802154_NRF5_RX_STACK_SIZE];
/* RX thread control block */
struct k_thread rx_thread;
/* CCA complete sempahore. Unlocked when CCA is complete. */
struct k_sem cca_wait;