Lines Matching +full:long +full:- +full:frame +full:- +full:rx +full:- +full:support

5  * SPDX-License-Identifier: Apache-2.0
42 /* Rx: Set LNA bias current offset to +15 to saturate trim to max (default: 0) */
49 {-20, RF_TxPowerTable_DEFAULT_PA_ENTRY(6, 3, 0, 2)},
50 {-15, RF_TxPowerTable_DEFAULT_PA_ENTRY(10, 3, 0, 3)},
51 {-10, RF_TxPowerTable_DEFAULT_PA_ENTRY(15, 3, 0, 5)},
52 {-5, RF_TxPowerTable_DEFAULT_PA_ENTRY(22, 3, 0, 9)},
78 struct ieee802154_cc13xx_cc26xx_data *drv_data = dev->data; in cmd_ieee_csma_callback()
80 update_saved_cmdhandle(ch, (RF_CmdHandle *) &drv_data->saved_cmdhandle); in cmd_ieee_csma_callback()
94 struct ieee802154_cc13xx_cc26xx_data *drv_data = dev->data; in cmd_ieee_rx_callback()
96 update_saved_cmdhandle(ch, (RF_CmdHandle *) &drv_data->saved_cmdhandle); in cmd_ieee_rx_callback()
101 LOG_WRN("RX buffer is full"); in cmd_ieee_rx_callback()
136 struct ieee802154_cc13xx_cc26xx_data *drv_data = dev->data; in ieee802154_cc13xx_cc26xx_cca()
139 status = RF_runImmediateCmd(drv_data->rf_handle, in ieee802154_cc13xx_cc26xx_cca()
140 (uint32_t *)&drv_data->cmd_ieee_cca_req); in ieee802154_cc13xx_cc26xx_cca()
143 return -EIO; in ieee802154_cc13xx_cc26xx_cca()
146 switch (drv_data->cmd_ieee_cca_req.ccaInfo.ccaState) { in ieee802154_cc13xx_cc26xx_cca()
150 return -EBUSY; in ieee802154_cc13xx_cc26xx_cca()
152 return -EIO; in ieee802154_cc13xx_cc26xx_cca()
162 /* See IEEE 802.15.4-2020, section 10.1.3.3. */ in ieee802154_cc13xx_cc26xx_channel_to_frequency()
164 *frequency = 2405 + 5 * (channel - 11); in ieee802154_cc13xx_cc26xx_channel_to_frequency()
168 /* TODO: Support sub-GHz for CC13xx rather than having separate drivers */ in ieee802154_cc13xx_cc26xx_channel_to_frequency()
171 return channel < 11 ? -ENOTSUP : -EINVAL; in ieee802154_cc13xx_cc26xx_channel_to_frequency()
182 struct ieee802154_cc13xx_cc26xx_data *drv_data = dev->data; in ieee802154_cc13xx_cc26xx_set_channel()
191 ret = -EIO; in ieee802154_cc13xx_cc26xx_set_channel()
196 k_mutex_lock(&drv_data->tx_mutex, K_FOREVER); in ieee802154_cc13xx_cc26xx_set_channel()
199 drv_data->cmd_fs.status = IDLE; in ieee802154_cc13xx_cc26xx_set_channel()
200 drv_data->cmd_fs.frequency = freq; in ieee802154_cc13xx_cc26xx_set_channel()
201 drv_data->cmd_fs.fractFreq = fract; in ieee802154_cc13xx_cc26xx_set_channel()
202 reason = RF_runCmd(drv_data->rf_handle, (RF_Op *)&drv_data->cmd_fs, in ieee802154_cc13xx_cc26xx_set_channel()
206 ret = -EIO; in ieee802154_cc13xx_cc26xx_set_channel()
211 drv_data->cmd_ieee_rx.status = IDLE; in ieee802154_cc13xx_cc26xx_set_channel()
212 drv_data->cmd_ieee_rx.channel = channel; in ieee802154_cc13xx_cc26xx_set_channel()
213 cmd_handle = RF_postCmd(drv_data->rf_handle, in ieee802154_cc13xx_cc26xx_set_channel()
214 (RF_Op *)&drv_data->cmd_ieee_rx, RF_PriorityNormal, in ieee802154_cc13xx_cc26xx_set_channel()
217 LOG_ERR("Failed to post RX command (%d)", cmd_handle); in ieee802154_cc13xx_cc26xx_set_channel()
218 ret = -EIO; in ieee802154_cc13xx_cc26xx_set_channel()
225 k_mutex_unlock(&drv_data->tx_mutex); in ieee802154_cc13xx_cc26xx_set_channel()
234 struct ieee802154_cc13xx_cc26xx_data *drv_data = dev->data; in ieee802154_cc13xx_cc26xx_reset_channel()
237 channel = drv_data->cmd_ieee_rx.channel; in ieee802154_cc13xx_cc26xx_reset_channel()
241 LOG_DBG("re-setting channel to %u", channel); in ieee802154_cc13xx_cc26xx_reset_channel()
251 struct ieee802154_cc13xx_cc26xx_data *drv_data = dev->data; in ieee802154_cc13xx_cc26xx_filter()
254 return -ENOTSUP; in ieee802154_cc13xx_cc26xx_filter()
258 memcpy((uint8_t *)&drv_data->cmd_ieee_rx.localExtAddr, in ieee802154_cc13xx_cc26xx_filter()
259 filter->ieee_addr, in ieee802154_cc13xx_cc26xx_filter()
260 sizeof(drv_data->cmd_ieee_rx.localExtAddr)); in ieee802154_cc13xx_cc26xx_filter()
262 drv_data->cmd_ieee_rx.localShortAddr = filter->short_addr; in ieee802154_cc13xx_cc26xx_filter()
264 drv_data->cmd_ieee_rx.localPanID = filter->pan_id; in ieee802154_cc13xx_cc26xx_filter()
266 return -ENOTSUP; in ieee802154_cc13xx_cc26xx_filter()
277 struct ieee802154_cc13xx_cc26xx_data *drv_data = dev->data; in ieee802154_cc13xx_cc26xx_set_txpower()
279 /* TODO Support sub-GHz for CC13xx */ in ieee802154_cc13xx_cc26xx_set_txpower()
286 return -EINVAL; in ieee802154_cc13xx_cc26xx_set_txpower()
289 status = RF_setTxPower(drv_data->rf_handle, power_table_value); in ieee802154_cc13xx_cc26xx_set_txpower()
292 return -EIO; in ieee802154_cc13xx_cc26xx_set_txpower()
309 struct ieee802154_cc13xx_cc26xx_data *drv_data = dev->data; in ieee802154_cc13xx_cc26xx_tx()
315 return -ENOTSUP; in ieee802154_cc13xx_cc26xx_tx()
318 k_mutex_lock(&drv_data->tx_mutex, K_FOREVER); in ieee802154_cc13xx_cc26xx_tx()
326 if (drv_data->saved_cmdhandle >= BIT(12) - 5) { in ieee802154_cc13xx_cc26xx_tx()
331 drv_data->saved_cmdhandle = -1; in ieee802154_cc13xx_cc26xx_tx()
336 drv_data->cmd_ieee_csma.status = IDLE; in ieee802154_cc13xx_cc26xx_tx()
337 drv_data->cmd_ieee_csma.randomState = sys_rand32_get(); in ieee802154_cc13xx_cc26xx_tx()
339 drv_data->cmd_ieee_tx.status = IDLE; in ieee802154_cc13xx_cc26xx_tx()
340 drv_data->cmd_ieee_tx.payloadLen = frag->len; in ieee802154_cc13xx_cc26xx_tx()
341 drv_data->cmd_ieee_tx.pPayload = frag->data; in ieee802154_cc13xx_cc26xx_tx()
342 drv_data->cmd_ieee_tx.condition.rule = in ieee802154_cc13xx_cc26xx_tx()
346 drv_data->cmd_ieee_rx_ack.status = IDLE; in ieee802154_cc13xx_cc26xx_tx()
347 drv_data->cmd_ieee_rx_ack.seqNo = frag->data[2]; in ieee802154_cc13xx_cc26xx_tx()
350 reason = RF_runScheduleCmd(drv_data->rf_handle, in ieee802154_cc13xx_cc26xx_tx()
351 (RF_Op *)&drv_data->cmd_ieee_csma, &sched_params, in ieee802154_cc13xx_cc26xx_tx()
361 if (drv_data->cmd_ieee_csma.status != IEEE_DONE_OK) { in ieee802154_cc13xx_cc26xx_tx()
367 drv_data->cmd_ieee_csma.status); in ieee802154_cc13xx_cc26xx_tx()
371 if (drv_data->cmd_ieee_tx.status != IEEE_DONE_OK) { in ieee802154_cc13xx_cc26xx_tx()
377 drv_data->cmd_ieee_tx.status); in ieee802154_cc13xx_cc26xx_tx()
381 if (!ack || drv_data->cmd_ieee_rx_ack.status == IEEE_DONE_ACK || in ieee802154_cc13xx_cc26xx_tx()
382 drv_data->cmd_ieee_rx_ack.status == IEEE_DONE_ACKPEND) { in ieee802154_cc13xx_cc26xx_tx()
388 drv_data->cmd_ieee_rx_ack.status); in ieee802154_cc13xx_cc26xx_tx()
389 } while (retry-- > 0); in ieee802154_cc13xx_cc26xx_tx()
392 r = -EIO; in ieee802154_cc13xx_cc26xx_tx()
395 k_mutex_unlock(&drv_data->tx_mutex); in ieee802154_cc13xx_cc26xx_tx()
408 if (drv_data->rx_entry[i].status == DATA_ENTRY_FINISHED) { in ieee802154_cc13xx_cc26xx_rx_done()
410 len = drv_data->rx_data[i][0]; in ieee802154_cc13xx_cc26xx_rx_done()
411 sdu = drv_data->rx_data[i] + 1; in ieee802154_cc13xx_cc26xx_rx_done()
412 seq = drv_data->rx_data[i][3]; in ieee802154_cc13xx_cc26xx_rx_done()
413 corr = drv_data->rx_data[i][len--] & 0x3F; in ieee802154_cc13xx_cc26xx_rx_done()
414 rssi = drv_data->rx_data[i][len--]; in ieee802154_cc13xx_cc26xx_rx_done()
420 len -= 2; in ieee802154_cc13xx_cc26xx_rx_done()
423 /* scale 6-bit corr to 8-bit lqi */ in ieee802154_cc13xx_cc26xx_rx_done()
430 drv_data->iface, len, AF_UNSPEC, 0, K_NO_WAIT); in ieee802154_cc13xx_cc26xx_rx_done()
442 drv_data->rx_entry[i].status = DATA_ENTRY_PENDING; in ieee802154_cc13xx_cc26xx_rx_done()
450 if (net_recv_data(drv_data->iface, pkt)) { in ieee802154_cc13xx_cc26xx_rx_done()
455 } else if (drv_data->rx_entry[i].status == in ieee802154_cc13xx_cc26xx_rx_done()
457 LOG_WRN("Frame not finished"); in ieee802154_cc13xx_cc26xx_rx_done()
458 drv_data->rx_entry[i].status = DATA_ENTRY_PENDING; in ieee802154_cc13xx_cc26xx_rx_done()
472 struct ieee802154_cc13xx_cc26xx_data *drv_data = dev->data; in ieee802154_cc13xx_cc26xx_stop()
476 status = RF_flushCmd(drv_data->rf_handle, RF_CMDHANDLE_FLUSH_ALL, 0); in ieee802154_cc13xx_cc26xx_stop()
482 return -EIO; in ieee802154_cc13xx_cc26xx_stop()
489 * Stops the sub-GHz interface and yields the radio (tells RF module to power
494 struct ieee802154_cc13xx_cc26xx_data *drv_data = dev->data; in ieee802154_cc13xx_cc26xx_stop_if()
503 RF_yield(drv_data->rf_handle); in ieee802154_cc13xx_cc26xx_stop_if()
512 return -ENOTSUP; in ieee802154_cc13xx_cc26xx_configure()
515 /* driver-allocated attribute memory - constant across all driver instances */
530 struct ieee802154_cc13xx_cc26xx_data *drv_data = dev->data; in ieee802154_cc13xx_cc26xx_data_init()
540 sys_memcpy_swap(&drv_data->mac, mac, sizeof(drv_data->mac)); in ieee802154_cc13xx_cc26xx_data_init()
542 /* Setup circular RX queue (TRM 25.3.2.7) */ in ieee802154_cc13xx_cc26xx_data_init()
543 memset(&drv_data->rx_entry[0], 0, sizeof(drv_data->rx_entry[0])); in ieee802154_cc13xx_cc26xx_data_init()
544 memset(&drv_data->rx_entry[1], 0, sizeof(drv_data->rx_entry[1])); in ieee802154_cc13xx_cc26xx_data_init()
546 drv_data->rx_entry[0].pNextEntry = (uint8_t *)&drv_data->rx_entry[1]; in ieee802154_cc13xx_cc26xx_data_init()
547 drv_data->rx_entry[0].config.type = DATA_ENTRY_TYPE_PTR; in ieee802154_cc13xx_cc26xx_data_init()
548 drv_data->rx_entry[0].config.lenSz = 1; in ieee802154_cc13xx_cc26xx_data_init()
549 drv_data->rx_entry[0].length = sizeof(drv_data->rx_data[0]); in ieee802154_cc13xx_cc26xx_data_init()
550 drv_data->rx_entry[0].pData = drv_data->rx_data[0]; in ieee802154_cc13xx_cc26xx_data_init()
552 drv_data->rx_entry[1].pNextEntry = (uint8_t *)&drv_data->rx_entry[0]; in ieee802154_cc13xx_cc26xx_data_init()
553 drv_data->rx_entry[1].config.type = DATA_ENTRY_TYPE_PTR; in ieee802154_cc13xx_cc26xx_data_init()
554 drv_data->rx_entry[1].config.lenSz = 1; in ieee802154_cc13xx_cc26xx_data_init()
555 drv_data->rx_entry[1].length = sizeof(drv_data->rx_data[1]); in ieee802154_cc13xx_cc26xx_data_init()
556 drv_data->rx_entry[1].pData = drv_data->rx_data[1]; in ieee802154_cc13xx_cc26xx_data_init()
558 drv_data->rx_queue.pCurrEntry = (uint8_t *)&drv_data->rx_entry[0]; in ieee802154_cc13xx_cc26xx_data_init()
559 drv_data->rx_queue.pLastEntry = NULL; in ieee802154_cc13xx_cc26xx_data_init()
561 k_mutex_init(&drv_data->tx_mutex); in ieee802154_cc13xx_cc26xx_data_init()
567 struct ieee802154_cc13xx_cc26xx_data *drv_data = dev->data; in ieee802154_cc13xx_cc26xx_iface_init()
569 net_if_set_link_addr(iface, drv_data->mac, sizeof(drv_data->mac), in ieee802154_cc13xx_cc26xx_iface_init()
572 drv_data->iface = iface; in ieee802154_cc13xx_cc26xx_iface_init()
602 struct ieee802154_cc13xx_cc26xx_data *drv_data = dev->data; in ieee802154_cc13xx_cc26xx_init()
612 drv_data->rf_handle = RF_open(&drv_data->rf_object, in ieee802154_cc13xx_cc26xx_init()
613 &rf_mode, (RF_RadioSetup *)&drv_data->cmd_radio_setup, in ieee802154_cc13xx_cc26xx_init()
615 if (drv_data->rf_handle == NULL) { in ieee802154_cc13xx_cc26xx_init()
617 return -EIO; in ieee802154_cc13xx_cc26xx_init()
625 drv_data->cmd_fs.status = IDLE; in ieee802154_cc13xx_cc26xx_init()
626 drv_data->cmd_fs.pNextOp = NULL; in ieee802154_cc13xx_cc26xx_init()
627 drv_data->cmd_fs.condition.rule = COND_NEVER; in ieee802154_cc13xx_cc26xx_init()
628 drv_data->cmd_fs.synthConf.bTxMode = false; in ieee802154_cc13xx_cc26xx_init()
629 drv_data->cmd_fs.frequency = 0; in ieee802154_cc13xx_cc26xx_init()
630 drv_data->cmd_fs.fractFreq = 0; in ieee802154_cc13xx_cc26xx_init()
632 reason = RF_runCmd(drv_data->rf_handle, (RF_Op *)&drv_data->cmd_fs, in ieee802154_cc13xx_cc26xx_init()
636 return -EIO; in ieee802154_cc13xx_cc26xx_init()
712 /* See IEEE 802.15.4-2006 6.9.9*/
738 /* Unslotted CSMA for non-beacon enabled PAN */
740 /* RX stays on during CSMA backoffs */
760 /* Disable long frame testing */