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 12:23:24 UTC

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

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



##########
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 -
+                        FIRST_WORD_SIZE];
+  uint8_t first_word[FIRST_WORD_SIZE];
+  uint8_t remaining_aligned_buf[HEADER_SIZE - FIRST_WORD_SIZE +
+                                MAX_NETDEV_PKTSIZE + CONFIG_NET_GUARDSIZE];
+};
+
 struct bcmf_sdio_frame
 {
   struct bcmf_frame_s header;
   bool                tx;
   dq_entry_t          list_entry;
-  uint8_t             data[HEADER_SIZE + MAX_NETDEV_PKTSIZE +
-                           CONFIG_NET_GUARDSIZE];
+  struct bcmf_dma_buf data
+  __attribute__((aligned(CONFIG_IEEE80211_BROADCOM_SDIO_DMA_BUF_ALIGNMENT)));

Review comment:
       GCC attributes are forbidden in common code.  This should not be merged until this fixed.  There are compiler-independent macros in include/nuttx/compiler.h that should be used to make the alignment compiler independent.




-- 
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