cherry-embedded / CherryUSB

CherryUSB is a tiny and portable USB Stack (device & host) for embedded system with USB IP
https://cherryusb.readthedocs.io/
Apache License 2.0
1.14k stars 245 forks source link

review cdc-ecm enum success but comunication error #208

Closed yukelab closed 1 month ago

yukelab commented 1 month ago
  1. merge usbd_cdc_ecm_start_write function to usbd_cdc_ecm_eth_tx because deduplication judge g_cdc_ecm_tx_data_length > 0 cause send data fail
  2. mandatory implementation usbd_cdc_ecm_data_recv_done function to notify receive usb data to lwip
  3. review CDC_ECM_DESCRIPTOR_INIT macro wMaxSegmentSize parameter error
sakumisu commented 1 month ago

do not remove usbd_cdc_ecm_start_write and recv_done

sakumisu commented 1 month ago

usbd_cdc_ecm_start_write is for eth without lwip and usbd_cdc_ecm_data_recv_done is for users to call with os.

sakumisu commented 1 month ago

for common, you should disable CONFIG_USBDEV_CDC_ECM_USING_LWIP, we do not use lwip for ecm. Eth rx data to usb tx and usb rx data to eth tx.

sakumisu commented 1 month ago

you can modify your changes in usbd_cdc_ecm_eth_rx.

sakumisu commented 1 month ago

1, remove g_cdc_ecm_tx_data_length = p->tot_len and change g_cdc_ecm_tx_data_length with p->tot_len in usbd_cdc_ecm_eth_tx 2, not mandatory 3, yes