You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/07/27 11:11:49 UTC

[GitHub] [incubator-nuttx] a-lunev commented on a change in pull request #4236: bcm43xxx: fixed issues with unaligned buffers for DMA transfers.

a-lunev commented on a change in pull request #4236:
URL: https://github.com/apache/incubator-nuttx/pull/4236#discussion_r677348955



##########
File path: drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.h
##########
@@ -110,13 +111,22 @@ struct bcmf_sdio_dev_s
 
 /* Structure used to manage SDIO frames */
 
+struct __attribute__((packed)) bcmf_dma_buf
+{
+  uint8_t align_padding[CONFIG_IEEE80211_BROADCOM_SDIO_DMA_BUF_ALIGNMENT -

Review comment:
       I tried to use __attribute__((aligned(16))) attached directly to "uint8_t remaining_aligned_buf", however the alignment did not work inside of struct __attribute__((packed)). (first_word[] and remaining_aligned_buf[] parts are required to be adjacent). Thus I've added align_padding[] before first_word[] and attached __attribute__((aligned(16))) to the whole structure.
   One more alternative approach would be to use a monolitic data array and use offsets to point to imaginary first_word[] and remaining_aligned_buf[] parts. Is the alternative preferable?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org