drivers/ieee802154/cc2520: Set the current rx frame RSSI into its nbuf

Change-Id: I215a8ceaa066a8521a2f647746301dbec780b43f
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
Tomasz Bursztyka 2017-04-12 15:33:05 +02:00 committed by Jukka Rissanen
commit feaa1e1371

View file

@ -541,7 +541,8 @@ static inline bool read_rxfifo_content(struct cc2520_spi *spi,
return true;
}
static inline bool verify_crc(struct cc2520_context *cc2520)
static inline bool verify_crc(struct cc2520_context *cc2520,
struct net_buf *buf)
{
cc2520->spi.cmd_buf[0] = CC2520_INS_RXBUF;
cc2520->spi.cmd_buf[1] = 0;
@ -558,6 +559,8 @@ static inline bool verify_crc(struct cc2520_context *cc2520)
return false;
}
net_nbuf_set_ieee802154_rssi(buf, cc2520->spi.cmd_buf[1]);
/**
* CC2520 does not provide an LQI but a correlation factor.
* See Section 20.6
@ -661,7 +664,7 @@ static void cc2520_rx(int arg)
goto flush;
}
if (!verify_crc(cc2520)) {
if (!verify_crc(cc2520, buf)) {
SYS_LOG_ERR("Bad packet CRC");
goto out;
}