drivers: ieee802154: cc13/26xx_subg: clean up constants
The CC13xx/CC26xx Sub-GHz driver header file defined several constants that were not used in the driver. Other constants could be replaced with generic constants which were introduced in the prior commit. This change removes and/or replaces redundant definitions. Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
This commit is contained in:
parent
f940a5a988
commit
81fa03f7a3
|
@ -10,6 +10,7 @@
|
|||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/net/net_if.h>
|
||||
#include <zephyr/net/ieee802154.h>
|
||||
#include <zephyr/net/ieee802154_radio.h>
|
||||
|
||||
#include <ti/drivers/rf/RF.h>
|
||||
|
||||
|
@ -19,18 +20,16 @@
|
|||
#include <driverlib/rf_mailbox.h>
|
||||
|
||||
/* IEEE 802.15.4-2006 2450 MHz O-QPSK PHY symbol rate (6.5.3.2) */
|
||||
#define IEEE802154_2450MHZ_OQPSK_SYMBOLS_PER_SECOND 62500
|
||||
|
||||
/* IEEE 802.15.4-2006 PHY constants (6.4.1) */
|
||||
#define IEEE802154_TURNAROUND_TIME 12
|
||||
/* For O-QPSK the physical and MAC timing symbol rates are the same, see section 12.3.3. */
|
||||
#define IEEE802154_2450MHZ_OQPSK_SYMBOLS_PER_SECOND \
|
||||
IEEE802154_PHY_SYMBOLS_PER_SECOND(IEEE802154_PHY_OQPSK_2450MHZ_SYMBOL_PERIOD_US)
|
||||
|
||||
/* IEEE 802.15.4-2006 PHY PIB attributes (6.4.2) */
|
||||
#define IEEE802154_PHY_CCA_MODE 3
|
||||
#define IEEE802154_PHY_SHR_DURATION 10
|
||||
#define IEEE802154_PHY_SYMBOLS_PER_OCTET 2
|
||||
|
||||
/* IEEE 802.15.4-2006 MAC constants (7.4.1) */
|
||||
#define IEEE802154_UNIT_BACKOFF_PERIOD 20
|
||||
#define IEEE802154_PHY_SHR_DURATION 10
|
||||
|
||||
#define IEEE802154_PHY_SYMBOLS_PER_OCTET 2
|
||||
|
||||
/* ACK is 2 bytes for PHY header + 2 bytes MAC header + 2 bytes MAC footer */
|
||||
#define IEEE802154_ACK_FRAME_OCTETS 6
|
||||
|
@ -40,8 +39,8 @@
|
|||
* The macAckWaitDuration attribute does not include aUnitBackoffPeriod for
|
||||
* non-beacon enabled PANs (See IEEE 802.15.4-2006 7.5.6.4.2)
|
||||
*/
|
||||
#define IEEE802154_MAC_ACK_WAIT_DURATION \
|
||||
(IEEE802154_TURNAROUND_TIME + IEEE802154_PHY_SHR_DURATION + \
|
||||
#define IEEE802154_MAC_ACK_WAIT_DURATION \
|
||||
(IEEE802154_PHY_A_TURNAROUND_TIME_DEFAULT + IEEE802154_PHY_SHR_DURATION + \
|
||||
IEEE802154_ACK_FRAME_OCTETS * IEEE802154_PHY_SYMBOLS_PER_OCTET)
|
||||
|
||||
#define CC13XX_CC26XX_RAT_CYCLES_PER_SECOND 4000000
|
||||
|
|
|
@ -489,13 +489,12 @@ static int ieee802154_cc13xx_cc26xx_subg_tx(const struct device *dev,
|
|||
k_mutex_lock(&drv_data->tx_mutex, K_FOREVER);
|
||||
|
||||
/* Prepend data with the SUN FSK PHY header */
|
||||
drv_data->tx_data[0] = frag->len + IEEE802154_SUN_PHY_FSK_PHR_LEN;
|
||||
drv_data->tx_data[0] = frag->len + IEEE802154_PHY_SUN_FSK_PHR_LEN;
|
||||
/* 20.2.2 PHR field format. 802.15.4-2015 */
|
||||
drv_data->tx_data[1] = 0;
|
||||
drv_data->tx_data[1] |= BIT(3); /* FCS Type: 2-octet FCS */
|
||||
drv_data->tx_data[1] |= BIT(4); /* DW: Enable Data Whitening */
|
||||
memcpy(&drv_data->tx_data[IEEE802154_SUN_PHY_FSK_PHR_LEN],
|
||||
frag->data, frag->len);
|
||||
memcpy(&drv_data->tx_data[IEEE802154_PHY_SUN_FSK_PHR_LEN], frag->data, frag->len);
|
||||
|
||||
/* Chain commands */
|
||||
drv_data->cmd_prop_cs.pNextOp =
|
||||
|
@ -503,8 +502,7 @@ static int ieee802154_cc13xx_cc26xx_subg_tx(const struct device *dev,
|
|||
drv_data->cmd_prop_cs.condition.rule = COND_STOP_ON_TRUE;
|
||||
|
||||
/* Set TX data */
|
||||
drv_data->cmd_prop_tx_adv.pktLen = frag->len
|
||||
+ IEEE802154_SUN_PHY_FSK_PHR_LEN;
|
||||
drv_data->cmd_prop_tx_adv.pktLen = frag->len + IEEE802154_PHY_SUN_FSK_PHR_LEN;
|
||||
drv_data->cmd_prop_tx_adv.pPkt = drv_data->tx_data;
|
||||
|
||||
/* Abort FG and BG processes */
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/net/net_if.h>
|
||||
#include <zephyr/net/ieee802154.h>
|
||||
#include <zephyr/net/ieee802154_radio.h>
|
||||
|
||||
#include <ti/drivers/rf/RF.h>
|
||||
|
||||
|
@ -20,49 +21,13 @@
|
|||
#include <driverlib/rf_prop_cmd.h>
|
||||
#include <driverlib/rf_mailbox.h>
|
||||
|
||||
/* See IEEE 802.15.4-2015 20.2.2 */
|
||||
#define IEEE802154_SUN_PHY_FSK_PHR_LEN 2
|
||||
|
||||
/* IEEE 802.15.4-2015 915 MHz 2FSK PHY symbol rate (20.6.3) */
|
||||
#define IEEE802154_SUN_PHY_2FSK_200K_SYMBOLS_PER_SECOND 200000
|
||||
|
||||
/* IEEE 802.15.4-2006 PHY constants (6.4.1) */
|
||||
#define IEEE802154_TURNAROUND_TIME 12
|
||||
|
||||
/* IEEE 802.15.4-2006 PHY PIB attributes (6.4.2) */
|
||||
#define IEEE802154_PHY_CCA_MODE 1
|
||||
#define IEEE802154_PHY_SHR_DURATION 2
|
||||
#define IEEE802154_PHY_SYMBOLS_PER_OCTET 8
|
||||
|
||||
/* IEEE 802.15.4-2006 MAC constants (7.4.1) */
|
||||
#define IEEE802154_UNIT_BACKOFF_PERIOD 20
|
||||
|
||||
/* ACK is 2 bytes for PHY header + 2 bytes MAC header + 2 bytes MAC footer */
|
||||
#define IEEE802154_ACK_FRAME_OCTETS 6
|
||||
|
||||
/* IEEE 802.15.4-2006 MAC PIB attributes (7.4.2)
|
||||
*
|
||||
* The macAckWaitDuration attribute does not include aUnitBackoffPeriod for
|
||||
* non-beacon enabled PANs (See IEEE 802.15.4-2006 7.5.6.4.2)
|
||||
*/
|
||||
#define IEEE802154_MAC_ACK_WAIT_DURATION \
|
||||
(IEEE802154_TURNAROUND_TIME + IEEE802154_PHY_SHR_DURATION + \
|
||||
IEEE802154_ACK_FRAME_OCTETS * IEEE802154_PHY_SYMBOLS_PER_OCTET)
|
||||
|
||||
#define CC13XX_CC26XX_RAT_CYCLES_PER_SECOND 4000000
|
||||
|
||||
#define CC13XX_CC26XX_NUM_RX_BUF \
|
||||
CONFIG_IEEE802154_CC13XX_CC26XX_SUB_GHZ_NUM_RX_BUF
|
||||
|
||||
/* Three additional bytes for length, RSSI and status values from CPE */
|
||||
#define CC13XX_CC26XX_RX_BUF_SIZE (IEEE802154_MAX_PHY_PACKET_SIZE + 3)
|
||||
|
||||
/*
|
||||
* Two additional bytes for the SUN FSK PHY HDR
|
||||
* (See IEEE 802.15.4-2015 20.2.2)
|
||||
*/
|
||||
#define CC13XX_CC26XX_TX_BUF_SIZE \
|
||||
(IEEE802154_MAX_PHY_PACKET_SIZE + IEEE802154_SUN_PHY_FSK_PHR_LEN)
|
||||
#define CC13XX_CC26XX_TX_BUF_SIZE (IEEE802154_PHY_SUN_FSK_PHR_LEN + IEEE802154_MAX_PHY_PACKET_SIZE)
|
||||
|
||||
#define CC13XX_CC26XX_INVALID_RSSI INT8_MIN
|
||||
|
||||
|
|
Loading…
Reference in a new issue