kopia lustrzana https://github.com/espressif/esp-idf
usb_host: Fix incorrect memset() usage in HCD
This commit fixes incorrect usage of memset() in the HCD's various _buffer_parse_...() functions. The memset was not clearing the qtd lists, and were simply setting the first qtd to a non zero value (i.e., the length of the QTD list). However, no bug occurred as the subsequent _buffer_fill_...() functions would overwrite the QTD list anyways.pull/10984/head
rodzic
e86181704a
commit
9f3c0b1e38
|
@ -2343,7 +2343,7 @@ static inline void _buffer_parse_ctrl(dma_buffer_block_t *buffer)
|
||||||
//Update URB status
|
//Update URB status
|
||||||
transfer->status = USB_TRANSFER_STATUS_COMPLETED;
|
transfer->status = USB_TRANSFER_STATUS_COMPLETED;
|
||||||
//Clear the descriptor list
|
//Clear the descriptor list
|
||||||
memset(buffer->xfer_desc_list, XFER_LIST_LEN_CTRL, sizeof(usbh_ll_dma_qtd_t));
|
memset(buffer->xfer_desc_list, 0, XFER_LIST_LEN_CTRL * sizeof(usbh_ll_dma_qtd_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void _buffer_parse_bulk(dma_buffer_block_t *buffer)
|
static inline void _buffer_parse_bulk(dma_buffer_block_t *buffer)
|
||||||
|
@ -2359,7 +2359,7 @@ static inline void _buffer_parse_bulk(dma_buffer_block_t *buffer)
|
||||||
//Update URB's status
|
//Update URB's status
|
||||||
transfer->status = USB_TRANSFER_STATUS_COMPLETED;
|
transfer->status = USB_TRANSFER_STATUS_COMPLETED;
|
||||||
//Clear the descriptor list
|
//Clear the descriptor list
|
||||||
memset(buffer->xfer_desc_list, XFER_LIST_LEN_BULK, sizeof(usbh_ll_dma_qtd_t));
|
memset(buffer->xfer_desc_list, 0, XFER_LIST_LEN_BULK * sizeof(usbh_ll_dma_qtd_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void _buffer_parse_intr(dma_buffer_block_t *buffer, bool is_in, int mps)
|
static inline void _buffer_parse_intr(dma_buffer_block_t *buffer, bool is_in, int mps)
|
||||||
|
@ -2409,7 +2409,7 @@ static inline void _buffer_parse_intr(dma_buffer_block_t *buffer, bool is_in, in
|
||||||
//Update URB's status
|
//Update URB's status
|
||||||
transfer->status = USB_TRANSFER_STATUS_COMPLETED;
|
transfer->status = USB_TRANSFER_STATUS_COMPLETED;
|
||||||
//Clear the descriptor list
|
//Clear the descriptor list
|
||||||
memset(buffer->xfer_desc_list, XFER_LIST_LEN_INTR, sizeof(usbh_ll_dma_qtd_t));
|
memset(buffer->xfer_desc_list, 0, XFER_LIST_LEN_INTR * sizeof(usbh_ll_dma_qtd_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void _buffer_parse_isoc(dma_buffer_block_t *buffer, bool is_in)
|
static inline void _buffer_parse_isoc(dma_buffer_block_t *buffer, bool is_in)
|
||||||
|
|
Ładowanie…
Reference in New Issue