Netdev events questions

Dear developers, I'm working on a radio driver for the Kinetis KW41Z 802.15.4 radio and I have run into some questions regarding when to send the different netdev events from my device driver.

Should NETDEV_EVENT_RX_COMPLETE be sent before, or after TX of ACK packet is finished? Should NETDEV_EVENT_RX_COMPLETE be sent even when the radio detects a CRC failure?

My device is using hardware auto-ACK, but I can enable interrupts for both the end of RX and at the end of TX ACK. It seem like it would be more robust to always wait for TX ACK to be performed, but it may add delays if the medium is very busy. It is possible to abort the TX ACK after an RX if the CPU issues a new command quickly enough.

Best regards, Joakim

Hi Joakim,

I'm very excited to see the KW41Z supported in 802.15.4 mode.

As for your questions regarding NETDEV_EVENT_RX_COMPLETE: To my knowledge it is not strictly formalized if it should be sent before or after transmitting the ACK. Generally I think this depends on the capabilities of the hardware but as there are also 802.15.4 frames that don't require ACKs I think triggering RX_COMPLETE after successful reception of a valid frame is reasonable. Also this should be doable on most hardware to have as consistent behavior as possible. (The at86rf2xx transceiver line for example doesn't offer a way to configure this, at least when using auto-ACKs.)

Would you be ok with this approach?

Best, Thomas