drivers: ieee802154: kw41z: fix issue in RX sequence

The chip seems to require a wait time before reading packet
data after the RX sequence done interrupt, as imidiate reading
of it will indicate a packet size of zero and cause the RX
sequence done to be continually retriggered.

In addition, the extra clearing of the interrupt flags can be
removed, as this is already done at the beginning of the isr.

Jira: ZEP-2278
Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
This commit is contained in:
Bogdan Davidoaia 2017-06-13 17:05:39 +03:00 committed by Maureen Helm
parent 8909be81f9
commit 3389ee4eb4

View file

@ -30,6 +30,8 @@
#define KW41Z_PER_BYTE_TIME 2
#define KW41Z_ACK_WAIT_TIME 54
#define KW41Z_IDLE_WAIT_RETRIES 5
#define KW41Z_PRE_RX_WAIT_TIME 1
#define RADIO_0_IRQ_PRIO 0x80
#define KW41Z_FCS_LENGTH 2
#define KW41Z_PSDU_LENGTH 125
@ -438,7 +440,14 @@ static void kw41z_isr(int unused)
switch (state) {
case KW41Z_STATE_RX:
SYS_LOG_DBG("RX seq done");
ZLL->IRQSTS = irqsts;
/*
* KW41Z seems to require some time before the RX SEQ
* done IRQ is triggered and the data is actually
* available in the packet buffer.
*/
k_busy_wait(KW41Z_PRE_RX_WAIT_TIME);
rx_len = (ZLL->IRQSTS &
ZLL_IRQSTS_RX_FRAME_LENGTH_MASK) >>
ZLL_IRQSTS_RX_FRAME_LENGTH_SHIFT;