Rx buffer/descriptor management. More...
Data Structures | |
| struct | rxdesc |
| SW descriptor to manage the MAC SW receive operations. More... | |
| struct | rxl_hwdesc_env_tag |
| Buffer Management control structure. More... | |
| struct | rxl_buffer_tag |
| Structure caching the RX buffers parameters. More... | |
Defines | |
| #define | RXL_LAST_DMA_PATTERN_LEN 4 |
| Length of the pattern for final DMA transfer. | |
| #define | NX_AMSDU_DEAGG_LEN 0 |
| Length of de-aggregated A-MSDUs (not available). | |
| #define | RXU_MACHDRDESC_LEN 0 |
| Length of MAC Header descriptor (not available). | |
| #define | RXL_ADD_INFO_LEN (sizeof_b(struct phy_channel_info) + 4 + RXU_MACHDRDESC_LEN + NX_AMSDU_DEAGG_LEN) |
| Length of the RX SW information. | |
| #define | RXL_HEADER_INFO_LEN |
| Length of the receive vectors. | |
| #define | RXL_PAYLOAD_OFFSET (RXL_HEADER_INFO_LEN + 2) |
| Offset of the payload in the RX buffer. | |
| #define | RXL_WRAP CO_BIT(31) |
| Bit indicating a buffer wrap in the read and write addresses. | |
| #define | RXL_RXDESC_SIZE (sizeof_b(struct rxdesc)) |
| RX descriptor size. | |
| #define | RXL_RHD_HEADER (sizeof_b(struct rx_upload_cntrl_tag) / 4) |
| Head room for RHD. | |
| #define | RXL_RHD_FOOTER ((RXL_RXDESC_SIZE - sizeof_b(struct rx_hd)) / 4 - RXL_RHD_HEADER) |
| Tail room for RHD. | |
| #define | RXL_RBD_HEADER 0 |
| Head room for RBD. | |
| #define | RXL_RBD_FOOTER ((sizeof_b(struct rx_payloaddesc) - sizeof_b(struct rx_pbd)) / 4) |
| Tail room for RBD. | |
| #define | RXL_BUFFER1_SIZE ((RWNX_MAX_AMSDU_RX + RXL_RXDESC_SIZE) / 2) |
| Size of the RX buffer 1 (the size of 2 big A-MSDUs + their descriptors). | |
| #define | RXL_BUFFER2_SIZE ((512 + RXL_RXDESC_SIZE) / 4) |
| Size of the RX buffer 2 (512 bytes + the size of a RX descriptor). | |
| #define | RXL_HW_BUFFER_INIT(id) |
| Macro initializing the buffer pointers to the HW. | |
Enumerations | |
| enum | rx_buf_id { DH_BUF = 0, IH_BUF = 1 } |
RX buffers identifiers. More... | |
Functions | |
| __INLINE struct rx_dmadesc * | rxl_dmadesc_get (struct rxdesc *rxdesc) |
| Get the DMA descriptor attached to a received MPDU. | |
| void | rxl_hwdesc_init (void) |
| Initialize the pools of element Function to initialize the Rx buffer and descriptor pools. | |
| void | rxl_mpdu_copy (struct rx_pbd *pbd, uint16_t length, uint16_t offset, uint32_t *dst) |
| Do a SW copy of a received MPDU. | |
| void | rxl_mpdu_partial_transfer (struct rxdesc *rxdesc, uint16_t upload_len, uint32_t hostbuf, uint16_t payl_offset, cb_rx_dma_func_ptr cb, void *env) |
| Do a partial upload of a MPDU to a host buffer. | |
| void | rxl_mpdu_transfer (struct rxdesc *rxdesc) |
| This function programs the DMA transfer of the received payload to the host memory. | |
| void | rxl_mpdu_free (struct rxdesc *rxdesc) |
| Free the HW descriptors attached to the SW descriptor passed as parameter. | |
| void | rxl_frame_release (struct rxdesc *rxdesc) |
| This function cleans up the complete frame data structures. | |
| struct rxdesc * | rxl_rxdesc_get (void) |
| Get the RX descriptor pointing to the first MPDU ready for processing. | |
| void | rxl_rxdesc_ready_for_processing (struct rxdesc *rxdesc) |
| Indicate that the MPDU associated to the descriptor is ready for processing. | |
| void | rxl_mpdu_isr (void) |
| Service routine for the MAC HW RX interrupt. | |
| void | rxl_immediate_frame_get (void) |
| Function used to get the immediate frame that was indicated from its dedicated interrupt. | |
| void | rxl_current_desc_get (struct rx_hd **rhd, struct rx_pbd **rbd) |
| This function returns the pointer to the first RX Header and Buffer descriptors chained to the MAC HW. | |
| void | rxl_hwdesc_monitor (bool enable) |
| This function is called when an interface is changing its type, in order to configure correctly the RX path for either monitor or active mode. | |
| static void | rxl_hd_append (struct rx_dmadesc *desc) |
| Appends a descriptor to the list visible to HW Function to initialize the freed HW desc and tail it to the list of HW descriptors. | |
| static void | rxl_pd_append (struct rx_pbd *first, struct rx_pbd *last, struct rx_pbd *spare) |
| Appends a list of RX payload buffer descriptors to the list visible to HW Function to initialize the freed HW desc and tail it to the list of HW descriptors. | |
| static bool | rxl_rxcntrl_frame (struct rxdesc *rxdesc) |
| This function processes the received control frames. | |
| static struct rx_payloaddesc * | rxl_payload_transfer (struct rx_payloaddesc **curr_pd, uint16_t upload_len, uint32_t hostbuf, uint16_t *payl_offset, int dma_idx, int irq_en) |
| Upload a payload to a higher layer buffer. | |
| static void | rxl_go_to_last_rbd (struct rxdesc *rxdesc, struct rx_payloaddesc *pd, struct rx_payloaddesc *prev_pd) |
| Loop on the payload descriptors until the RX_PD_LASTBUF flag is found. | |
| __INLINE bool | rxl_dh_buf_has_data (void) |
| Return the DH buffer status. | |
| __INLINE bool | rxl_ih_buf_has_data (void) |
| Return the IH buffer status. | |
| __INLINE uint32_t | rxl_add_wrap_bit (uint32_t new_read, uint32_t old_read) |
| Set correctly the wrap bit (bit 31) to the new read address, based on the previous read address. | |
| __INLINE void | rxl_update_hw_buf_read (uint32_t new_read, int id) |
| Update the read address HW register. | |
| __INLINE void | rxl_update_sw_buf_read (uint32_t new_read, struct rxl_buffer_tag *buf) |
| Update the read address of the FW. | |
| __INLINE void | rxl_adjust_sw_buf_read (struct rxl_buffer_tag *buf) |
| Check if there is enough space between the SW read address and the end of the buffer. | |
| __INLINE void | rxl_adjust_frmlen (struct rx_hd *rhd) |
| Remove the MIC/ICV/FCS length from the frame length. | |
Variables | |
| static struct rxdesc | rx_swdesc_tab [NX_RXDESC_CNT] |
| Array of RX SW descriptors. | |
| static struct rxl_hwdesc_env_tag | rx_hwdesc_env |
| RXL HW descriptor environment variable. | |
| struct rx_dmadesc | rx_dma_hdrdesc [NX_RXDESC_CNT] |
| Array of struct containing the RX header descriptors. | |
| struct rx_payloaddesc | rx_payload_desc [NX_RX_PAYLOAD_DESC_CNT] |
| Array of struct containing the RX buffer descriptors. | |
| static struct rxl_hwdesc_env_tag | rx_hwdesc_env |
| RXL HW descriptor environment variable. | |
| static uint32_t | rxl_hw_buffer1 [RXL_BUFFER1_SIZE] |
| RX buffer 1, i.e. | |
| static uint32_t | rxl_hw_buffer2 [RXL_BUFFER2_SIZE] |
| RX buffer 2, i.e. | |
Rx buffer/descriptor management.
| #define RXL_HEADER_INFO_LEN |
Length of the receive vectors.
Definition at line 108 of file rxl_hwdesc.h.
Referenced by rxl_mpdu_transfer().
| #define RXL_HW_BUFFER_INIT | ( | id | ) |
do { \ struct rxl_buffer_tag *buf = &rx_hwdesc_env.buf[id - 1]; \ buf->start = CPU2HW(rxl_hw_buffer##id); \ buf->end = buf->start + CO_ALIGN4_LO(sizeof_b(rxl_hw_buffer##id)); \ buf->read = buf->start; \ nxmac_rx_buf_##id##_start_ptr_set(buf->start); \ nxmac_rx_buf_##id##_end_ptr_set(buf->end - 4); \ nxmac_rx_buf_##id##_rd_ptr_set(buf->start); \ nxmac_rx_buf_##id##_wr_ptr_set(buf->start); \ } while(0)
Macro initializing the buffer pointers to the HW.
Definition at line 114 of file rxl_hwdesc.c.
Referenced by rxl_hwdesc_init().
| enum rx_buf_id |
RX buffers identifiers.
| DH_BUF |
Id of the buffer requiring deferred handling (i.e. for normal data/management). |
| IH_BUF |
Id of the buffer requiring immediate handling (i.e. for BA/HE trigger). |
Definition at line 86 of file rxl_hwdesc.c.
| __INLINE uint32_t rxl_add_wrap_bit | ( | uint32_t | new_read, | |
| uint32_t | old_read | |||
| ) |
Set correctly the wrap bit (bit 31) to the new read address, based on the previous read address.
The function checks if the new read address causes a wrap of the buffer, and toggles the wrap bit if this is the case.
| [in] | new_read | New read address (without the wrap bit) |
| [in] | old_read | Old read address (with current value of wrap bit) |
Definition at line 168 of file rxl_hwdesc.c.
References RXL_WRAP.
Referenced by rxl_update_hw_buf_read(), and rxl_update_sw_buf_read().
| __INLINE void rxl_adjust_frmlen | ( | struct rx_hd * | rhd | ) |
Remove the MIC/ICV/FCS length from the frame length.
The MAC HW is now including the length of these fields in the frame length reported in the RHD, whereas it was not the case before. As all the RX SW is expecting those lengths not to be included, let's remove them prior to any SW processing of the frame.
| [in,out] | rhd | Pointer to the RHD to be updated. |
Definition at line 252 of file rxl_hwdesc.c.
References rx_hd::frmlen, ICV_LEN, MAC_FCS_LEN, MIC_LEN, RX_HD_DECR_CCMP128_SUCCESS, RX_HD_DECR_TKIP_SUCCESS, RX_HD_DECR_WEP_SUCCESS, RX_HD_DECRSTATUS, and rx_hd::statinfo.
Referenced by rxl_rxdesc_ready_for_processing().
| __INLINE void rxl_adjust_sw_buf_read | ( | struct rxl_buffer_tag * | buf | ) |
Check if there is enough space between the SW read address and the end of the buffer.
If not the SW read address is set to the beginning of the buffer, in order to stay aligned with the location where the HW wrote the frame.
This function shall be called only after comparing SW read and HW write address to determine if some frame is available for the SW.
| [in] | buf | The buffer to be checked |
Definition at line 235 of file rxl_hwdesc.c.
References rxl_buffer_tag::end, rxl_buffer_tag::read, RXL_RXDESC_SIZE, rxl_update_sw_buf_read(), RXL_WRAP, and rxl_buffer_tag::start.
Referenced by rxl_immediate_frame_get(), and rxl_rxdesc_get().
This function returns the pointer to the first RX Header and Buffer descriptors chained to the MAC HW.
It is used for error logging when an issue is detected in the LMAC.
| [out] | rhd | Pointer to the first RX Header descriptor chained to the MAC HW |
| [out] | rbd | Pointer to the first RX Buffer descriptor chained to the MAC HW |
Definition at line 968 of file rxl_hwdesc.c.
References rxdesc::dma_hdrdesc, rx_hd::first_pbd_ptr, rx_dmadesc::hd, HW2CPU, and rxl_rxdesc_get().
| __INLINE bool rxl_dh_buf_has_data | ( | void | ) |
Return the DH buffer status.
Definition at line 137 of file rxl_hwdesc.c.
References rxl_hwdesc_env_tag::buf, DH_BUF, rxl_buffer_tag::read, and rx_hwdesc_env.
Referenced by rxl_rxdesc_get().
| __INLINE struct rx_dmadesc* rxl_dmadesc_get | ( | struct rxdesc * | rxdesc | ) | [read] |
Get the DMA descriptor attached to a received MPDU.
| [in] | rxdesc | Pointer to the RX descriptor attached to the MPDU |
Definition at line 131 of file rxl_hwdesc.h.
References rxdesc::dma_hdrdesc.
Referenced by bfr_upload_report(), rxl_frame_handle(), rxl_mpdu_free(), rxl_mpdu_partial_transfer(), rxl_mpdu_transfer(), rxl_rxcntrl_frame(), rxu_cntrl_defrag_check(), rxu_cntrl_mac2eth_update(), rxu_cntrl_mic_check(), rxu_cntrl_remove_sec_hdr_mgmt_frame(), rxu_mgt_frame_check(), rxu_mpdu_upload_and_indicate(), rxu_msdu_upload_and_indicate(), txl_ba_ac_get(), txl_decode_compressed_ba(), and txl_is_ba_valid().
| void rxl_frame_release | ( | struct rxdesc * | rxdesc | ) |
This function cleans up the complete frame data structures.
| [in] | rxdesc | Pointer to the structure that is holding the frame details. |
Definition at line 707 of file rxl_hwdesc.c.
References rxl_update_hw_buf_read().
Referenced by rxl_mpdu_free(), and rxl_rxcntrl_frame().
| static void rxl_go_to_last_rbd | ( | struct rxdesc * | rxdesc, | |
| struct rx_payloaddesc * | pd, | |||
| struct rx_payloaddesc * | prev_pd | |||
| ) | [static] |
Loop on the payload descriptors until the RX_PD_LASTBUF flag is found.
The function then assigns the last and spare payload descriptor pointers to the SW descriptor in order to allow the later freeing of the HW descriptors.
| [out] | rxdesc | Pointer to the RX SW descriptor |
| [in] | pd | Pointer to the buffer descriptor to start with. |
| [in] | prev_pd | Pointer to the buffer descriptor just preceding pd (might be NULL). |
Definition at line 640 of file rxl_hwdesc.c.
References ASSERT_REC, rxl_hwdesc_env_tag::buf, rx_pbd::bufstatinfo, CO_ALIGN4_LO, CPU2HW, rx_pbd::dataendptr, DH_BUF, rxl_buffer_tag::end, HW2CPU, rx_pbd::next, rx_payloaddesc::pbd, rx_hwdesc_env, RX_PD_LASTBUF, rxl_update_sw_buf_read(), and rxl_buffer_tag::start.
Referenced by rxl_mpdu_free(), rxl_mpdu_partial_transfer(), and rxl_mpdu_transfer().
| static void rxl_hd_append | ( | struct rx_dmadesc * | desc | ) | [static] |
Appends a descriptor to the list visible to HW Function to initialize the freed HW desc and tail it to the list of HW descriptors.
The element pointers are linked and the valid bit is set. The New Head/New Tail bit is also set accordingly. It also updates the pointer pointing to the last desc tailed.
| [in] | desc | HW desc to be freed and appended |
Definition at line 96 of file rxl_hwdesc.c.
References ASSERT_ERR, CPU2HW, rxl_hwdesc_env_tag::first_dmadesc, rx_hd::first_pbd_ptr, rxl_hwdesc_env_tag::free_dmadesc, rx_hd::frmlen, rx_dmadesc::hd, HW2CPU, rxl_hwdesc_env_tag::last_dmadesc, rx_hd::next, rx_hwdesc_env, and rx_hd::statinfo.
| void rxl_hwdesc_init | ( | void | ) |
Initialize the pools of element Function to initialize the Rx buffer and descriptor pools.
Definition at line 684 of file rxl_hwdesc.c.
References RXL_HW_BUFFER_INIT, RXL_RBD_FOOTER, RXL_RBD_HEADER, RXL_RHD_FOOTER, and RXL_RHD_HEADER.
Referenced by rxl_hwdesc_monitor().
| void rxl_hwdesc_monitor | ( | bool | enable | ) |
This function is called when an interface is changing its type, in order to configure correctly the RX path for either monitor or active mode.
In case monitor mode is enabled, the BA and other control frames are not handled internally anymore, but forwarded to the upper layers. This mode shall therefore not be used when monitoring is enabled in parallel of an active STA or AP interface.
| [in] | enable | Flag indicating if monitor mode is enabled or not |
Definition at line 695 of file rxl_hwdesc.c.
References rxl_hwdesc_init().
| __INLINE bool rxl_ih_buf_has_data | ( | void | ) |
Return the IH buffer status.
Definition at line 149 of file rxl_hwdesc.c.
References rxl_hwdesc_env_tag::buf, IH_BUF, rxl_buffer_tag::read, and rx_hwdesc_env.
Referenced by rxl_immediate_frame_get().
| void rxl_immediate_frame_get | ( | void | ) |
Function used to get the immediate frame that was indicated from its dedicated interrupt.
This function shall be called from the interrupt handlers indicating the reception of a BlockAck or a HE trigger frame.
Definition at line 948 of file rxl_hwdesc.c.
References rxl_hwdesc_env_tag::buf, HW2CPU, IH_BUF, rxl_buffer_tag::read, rx_hwdesc_env, rxl_adjust_sw_buf_read(), rxl_ih_buf_has_data(), rxl_rxcntrl_frame(), rxl_rxdesc_ready_for_processing(), and RXL_WRAP.
Referenced by txl_frame_exchange_done().
| void rxl_mpdu_copy | ( | struct rx_pbd * | pbd, | |
| uint16_t | length, | |||
| uint16_t | offset, | |||
| uint32_t * | dst | |||
| ) |
Do a SW copy of a received MPDU.
| [in] | pbd | Pointer to the first payload descriptor of the MPDU |
| [in] | length | Length to be copied |
| [in] | offset | Offset inside the MPDU where to start the copy |
| [in] | dst | Pointer to the destination buffer |
Definition at line 713 of file rxl_hwdesc.c.
References ASSERT_ERR, co_copy32(), rx_pbd::dataendptr, rx_pbd::datastartptr, HW2CPU, and rx_pbd::next.
Referenced by rxu_mgt_frame_ind().
| void rxl_mpdu_free | ( | struct rxdesc * | rxdesc | ) |
Free the HW descriptors attached to the SW descriptor passed as parameter.
This function releases both the RHD and RBD and requests chaining them to the HW.
| [in] | rxdesc | Pointer to the rx SW descriptor for which the MPDU descriptors are freed |
Definition at line 866 of file rxl_hwdesc.c.
References rx_upload_cntrl_tag::cb, rx_hd::first_pbd_ptr, rx_upload_cntrl_tag::flags, rx_dmadesc::hd, HW2CPU, RX_MPDU_FREE_CLR, RX_MPDU_FREE_SET, RX_NO_UPLOAD, rxl_dmadesc_get(), rxl_frame_release(), rxl_go_to_last_rbd(), rxl_upload_cntrl_push_pending(), rxl_upload_pending(), and rxdesc::upload_cntrl.
| void rxl_mpdu_isr | ( | void | ) |
Service routine for the MAC HW RX interrupt.
This function clears the source of the interrupt and invokes the RX receive path operations by setting an event that is scheduled by the kernel.
Definition at line 932 of file rxl_hwdesc.c.
References KE_EVT_RXREADY_BIT, ke_evt_set(), PROF_RX_MAC_IRQ_CLR, and PROF_RX_MAC_IRQ_SET.
| void rxl_mpdu_partial_transfer | ( | struct rxdesc * | rxdesc, | |
| uint16_t | upload_len, | |||
| uint32_t | hostbuf, | |||
| uint16_t | payl_offset, | |||
| cb_rx_dma_func_ptr | cb, | |||
| void * | env | |||
| ) |
Do a partial upload of a MPDU to a host buffer.
This function performs the upload of a part of the MPDU. Once the upload is done, the callback function passed as parameter is executed and the HW descriptors linked to the MPDU are freed. This function is used by the BFR module to upload the calibration reports, and the UMAC to upload the received fragments of a MSDU.
| [in] | rxdesc | Pointer to the RX SW descriptor linked to the MPDU |
| [in] | upload_len | Length to be uploaded |
| [in] | hostbuf | Address in host memory where to upload the MPDU |
| [in] | payl_offset | Offset inside the MPDU where to start the upload |
| [in] | cb | Function to be called upon upload completion |
| [in] | env | Variable to be passed to the callback function |
Definition at line 741 of file rxl_hwdesc.c.
References rx_upload_cntrl_tag::cb, rx_upload_cntrl_tag::env, rx_hd::first_pbd_ptr, rx_dmadesc::hd, HW2CPU, RX_MPDU_XFER_CLR, RX_MPDU_XFER_SET, rxl_dmadesc_get(), rxl_go_to_last_rbd(), rxl_payload_transfer(), rxl_upload_cntrl_push_pending(), and rxdesc::upload_cntrl.
Referenced by bfr_upload_report(), and rxu_cntrl_defrag_mpdu_transfer().
| void rxl_mpdu_transfer | ( | struct rxdesc * | rxdesc | ) |
This function programs the DMA transfer of the received payload to the host memory.
| [in] | rxdesc | Pointer to SW descriptor attached to the received payload |
Definition at line 769 of file rxl_hwdesc.c.
References ASSERT_REC, CPU2HW, dma_desc::ctrl, dma_desc::dest, rx_dmadesc::dma_desc, DMA_HD_RXPATTERN, dma_push(), rx_hd::first_pbd_ptr, rx_dmadesc::flags, rx_hd::frmlen, rx_dmadesc::hd, rx_cntrl_rx_status::host_buf_addr, rxu_cntrl_env_tag::hostid_current, HW2CPU, dma_desc::length, macif_rx_buf_get(), rx_dmadesc::pattern, rx_cntrl_rx_status::payl_offset, phy_get_channel(), rx_dmadesc::phy_info, PHY_PRIM, RX_DATA_UPLOAD_CHAN, RX_FLAGS_IS_AMSDU_BIT, RX_LLICTRL, RX_MPDU_XFER_CLR, RX_MPDU_XFER_SET, rxu_cntrl_env_tag::rx_status, rxl_dmadesc_get(), rxl_go_to_last_rbd(), RXL_HEADER_INFO_LEN, RXL_PAYLOAD_OFFSET, rxl_payload_transfer(), rxl_upload_cntrl_push_pending(), rxu_cntrl_env, dma_desc::src, and rxdesc::upload_cntrl.
Referenced by rxu_mpdu_upload_and_indicate(), and rxu_msdu_upload_and_indicate().
| static struct rx_payloaddesc * rxl_payload_transfer | ( | struct rx_payloaddesc ** | curr_pd, | |
| uint16_t | upload_len, | |||
| uint32_t | hostbuf, | |||
| uint16_t * | payl_offset, | |||
| int | dma_idx, | |||
| int | irq_en | |||
| ) | [static, read] |
Upload a payload to a higher layer buffer.
This function takes as payload source address the datastartptr of the buffer descriptor passed as parameter, corrected by the payl_offset offset. It then goes through the list of buffer descriptor until upload_len has been copied.
| [in,out] | curr_pd | Pointer to the buffer descriptor on which the payload to be uploaded starts. At the end of the upload, the last processed buffer descriptor is returned in this variable. |
| [in] | upload_len | Length to be uploaded |
| [in] | hostbuf | Address in host memory where the upload has to be performed |
| [in,out] | payl_offset | Offset inside the first buffer descriptor where the data to upload is located. At the end of the upload, this parameter is set to the offset inside the last handled buffer descriptor where non uploaded data is located. |
| [in] | dma_idx | Index of the DMA descriptor to be used for the upload. |
| [in] | irq_en | Set to 1 to get a DMA interrupt at the end of the upload, and to 0 otherwise |
Definition at line 448 of file rxl_hwdesc.c.
References ASSERT_ERR, CPU2HW, dma_desc::ctrl, rx_pbd::dataendptr, rx_pbd::datastartptr, dma_desc::dest, rx_payloaddesc::dma_desc, dma_push(), HW2CPU, dma_desc::length, dma_desc::next, rx_pbd::next, rx_payloaddesc::pbd, RX_DATA_UPLOAD_CHAN, RX_LLICTRL, and dma_desc::src.
Referenced by rxl_mpdu_partial_transfer(), and rxl_mpdu_transfer().
| static void rxl_pd_append | ( | struct rx_pbd * | first, | |
| struct rx_pbd * | last, | |||
| struct rx_pbd * | spare | |||
| ) | [static] |
Appends a list of RX payload buffer descriptors to the list visible to HW Function to initialize the freed HW desc and tail it to the list of HW descriptors.
The element pointers are linked and the valid bit is set. The New Head/New Tail bit is also set accordingly. It also updates the pointer pointing to the last desc tailed.
| [in] | first | First buffer descriptor of the list |
| [in] | last | Last buffer descriptor of the list |
| [in] | spare | Spare descriptor that won't be chained immediately to HW |
Definition at line 157 of file rxl_hwdesc.c.
References ASSERT_ERR, rx_pbd::bufstatinfo, CPU2HW, rxl_hwdesc_env_tag::first, rxl_hwdesc_env_tag::free, HW2CPU, rxl_hwdesc_env_tag::last, rx_pbd::next, and rx_hwdesc_env.
| void rxl_rxcntrl_frame | ( | struct rxdesc * | rxdesc | ) | [static] |
This function processes the received control frames.
| [in] | rxdesc | SW header descriptor of the frame |
Definition at line 349 of file rxl_hwdesc.c.
References ASSERT_REC, rxl_hwdesc_env_tag::buf, CO_ALIGN4_LO, co_read16(), CPU2HW, rx_pbd::dataendptr, rx_pbd::datastartptr, rxl_buffer_tag::end, rx_hd::first_pbd_ptr, rx_hd::frmlen, rx_dmadesc::hd, HW2CPU, IH_BUF, MAC_FCTRL_BA, MAC_FCTRL_HE_TRIGGER, MAC_FCTRL_TYPESUBTYPE_MASK, RX_HD_RSP_FRM, RX_HD_SUCCESS, rx_hwdesc_env, rxl_dmadesc_get(), rxl_frame_release(), rxl_update_sw_buf_read(), rxl_buffer_tag::start, rx_hd::statinfo, and txl_ba_push().
Referenced by rxl_immediate_frame_get().
| struct rxdesc * rxl_rxdesc_get | ( | void | ) | [read] |
Get the RX descriptor pointing to the first MPDU ready for processing.
This function is called from the RXL control event prior to check if buffers are available for upload. Once these checks are done and before any additional processing is performed, the function rxl_rxdesc_ready_for_processing shall be called.
Definition at line 895 of file rxl_hwdesc.c.
References rxl_hwdesc_env_tag::buf, DH_BUF, HW2CPU, rxl_buffer_tag::read, rx_hwdesc_env, rxl_adjust_sw_buf_read(), rxl_dh_buf_has_data(), and RXL_WRAP.
Referenced by rxl_current_desc_get().
| void rxl_rxdesc_ready_for_processing | ( | struct rxdesc * | rxdesc | ) |
Indicate that the MPDU associated to the descriptor is ready for processing.
This function is called from the RXL control event after checking that the MPDU associated to the descriptor is ready for processing, e.g. if host resources are available for upload.
| [in] | rxdesc | The RX descriptor pointing to the MPDU |
Definition at line 910 of file rxl_hwdesc.c.
References ASSERT_ERR, rx_upload_cntrl_tag::cb, DH_BUF, rxdesc::dma_hdrdesc, rx_upload_cntrl_tag::flags, rx_dmadesc::hd, RX_HEADER_DESC_PATTERN, rx_upload_cntrl_tag::rxdesc, rxl_adjust_frmlen(), rxl_host_irq_mitigation_update(), rx_hd::upatternrx, and rxdesc::upload_cntrl.
Referenced by rxl_immediate_frame_get().
| __INLINE void rxl_update_hw_buf_read | ( | uint32_t | new_read, | |
| int | id | |||
| ) |
Update the read address HW register.
This address is used by the HW to know where it shall stop writing into the HW buffer. To be able to distinguish between buffer full and buffer empty cases, the HW toggles the bit 31 of the address each time it wraps around. We therefore have to update this bit as well when updating the read address.
| [in] | new_read | Address inside the RX buffer where we expect the next frame buffer |
| [in] | id | Index of the RX buffer (rx_buf_id) |
Definition at line 192 of file rxl_hwdesc.c.
References DH_BUF, and rxl_add_wrap_bit().
Referenced by rxl_frame_release().
| __INLINE void rxl_update_sw_buf_read | ( | uint32_t | new_read, | |
| struct rxl_buffer_tag * | buf | |||
| ) |
Update the read address of the FW.
This address is used to know where the FW is expecting the next frame written by the HW inside the RX buffer. In order to know if a frame is present in the RX buffer, this address is compared with the HW write address. To be able to distinguish between buffer full and buffer empty cases, the HW toggles the bit 31 of the address each time it wraps around. We use this mechanism on the SW read address too.
| [in] | new_read | Address inside the RX buffer where we expect the next frame buffer |
| [in,out] | buf | Pointer to the buffer information structure. |
Definition at line 218 of file rxl_hwdesc.c.
References rxl_buffer_tag::read, and rxl_add_wrap_bit().
Referenced by rxl_adjust_sw_buf_read(), rxl_go_to_last_rbd(), and rxl_rxcntrl_frame().
uint32_t rxl_hw_buffer1[RXL_BUFFER1_SIZE] [static] |
RX buffer 1, i.e.
buffer used by the MAC HW to store all received frames except those requiring a time critical handling (i.e. BA and HE trigger frames)
Definition at line 103 of file rxl_hwdesc.c.
uint32_t rxl_hw_buffer2[RXL_BUFFER2_SIZE] [static] |
RX buffer 2, i.e.
buffer used by the MAC HW to store frames requiring a time critical handling (i.e. BA and HE trigger frames)
Definition at line 107 of file rxl_hwdesc.c.
1.6.1