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



##########
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'm referencing bcmf_dma_buf struct I've introduced. first_word[] and 
remaining_aligned_buf[] parts should not have a gap between each other as they 
form the whole bcmf frame. Thus I've added "attribute((packed))" to the struct 
to prevent a gap inside of the struct (now I've wrapped it into 
begin_packed_struct / end_packed_struct for compiler independence).
   However, the whole bcmf_dma_buf struct should be aligned to the address 
boundary of 16.
   As the struct is packed inside and aligned to 16 outside, then 
remaining_aligned_buf[] is also aligned to the address boundary of 16, that is 
the purpose as it's used in DMA transfer.
   There are two conditions at the same time:
   - remaining_aligned_buf[] should be aligned;
   - remaining_aligned_buf[] should follow first_word[] w/o a gap.
   The main purpose of first_word[] is to receive the length (the first phase) 
of the remaining frame to be read (the second phase). DMA receive transfer can 
not be invoked w/o knowing the length of the frame first, thus it can not be a 
single transfer.




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to