diff options
| author | sakimisu <[email protected]> | 2022-11-18 22:16:25 +0800 |
|---|---|---|
| committer | sakimisu <[email protected]> | 2022-11-19 21:51:38 +0800 |
| commit | 9ef2988f6a63a71380fe83571e5e57d02159735f (patch) | |
| tree | 707ba19dc9e4800f57d86e3930f912b4683015e9 /class/vendor | |
| parent | fcfcdc0013873b902ecd07c22f7400ca02b750f7 (diff) | |
fix rndis pipe config and move cmd & resp into no cache ramv0.7.0
Diffstat (limited to 'class/vendor')
| -rw-r--r-- | class/vendor/usbh_air724.c | 45 |
1 files changed, 20 insertions, 25 deletions
diff --git a/class/vendor/usbh_air724.c b/class/vendor/usbh_air724.c index a6ee7790..72ffcab3 100644 --- a/class/vendor/usbh_air724.c +++ b/class/vendor/usbh_air724.c @@ -39,38 +39,33 @@ int usbh_air724_connect(struct usbh_hubport *hport, uint8_t intf) hport->config.intf[intf].priv = cdc_custom_class; - for (uint8_t i = 0; i < hport->config.intf[intf].intf_desc.bNumEndpoints; i++) { - ep_desc = &hport->config.intf[intf].ep[i].ep_desc; + for (uint8_t i = 0; i < hport->config.intf[intf].altsetting[0].intf_desc.bNumEndpoints; i++) { + ep_desc = &hport->config.intf[intf].altsetting[0].ep[i].ep_desc; - ep_cfg.ep_addr = ep_desc->bEndpointAddress; - ep_cfg.ep_type = ep_desc->bmAttributes & USB_ENDPOINT_TYPE_MASK; - ep_cfg.ep_mps = ep_desc->wMaxPacketSize; - ep_cfg.ep_interval = ep_desc->bInterval; - ep_cfg.hport = hport; if (ep_desc->bEndpointAddress & 0x80) { - usbh_pipe_alloc(&cdc_custom_class->bulkin, &ep_cfg); + usbh_hport_activate_epx(&cdc_custom_class->bulkin, hport, ep_desc); } else { - usbh_pipe_alloc(&cdc_custom_class->bulkout, &ep_cfg); + usbh_hport_activate_epx(&cdc_custom_class->bulkout, hport, ep_desc); } } USB_LOG_INFO("Register air724 Class:%s\r\n", hport->config.intf[intf].devname); - uint8_t cdc_buffer[32] = {0X41,0X54,0x0d,0x0a}; - ret = usbh_ep_bulk_transfer(cdc_custom_class->bulkout, cdc_buffer, 4, 3000); - if (ret < 0) { - USB_LOG_ERR("bulk out error,ret:%d\r\n", ret); - } else { - USB_LOG_RAW("send over:%d\r\n", ret); - } - ret = usbh_ep_bulk_transfer(cdc_custom_class->bulkin, cdc_buffer, 10, 3000); - if (ret < 0) { - USB_LOG_ERR("bulk in error,ret:%d\r\n", ret); - } else { - USB_LOG_RAW("recv over:%d\r\n", ret); - for (size_t i = 0; i < ret; i++) { - USB_LOG_RAW("0x%02x ", cdc_buffer[i]); - } - } +// uint8_t cdc_buffer[32] = {0X41,0X54,0x0d,0x0a}; +// ret = usbh_ep_bulk_transfer(cdc_custom_class->bulkout, cdc_buffer, 4, 3000); +// if (ret < 0) { +// USB_LOG_ERR("bulk out error,ret:%d\r\n", ret); +// } else { +// USB_LOG_RAW("send over:%d\r\n", ret); +// } +// ret = usbh_ep_bulk_transfer(cdc_custom_class->bulkin, cdc_buffer, 10, 3000); +// if (ret < 0) { +// USB_LOG_ERR("bulk in error,ret:%d\r\n", ret); +// } else { +// USB_LOG_RAW("recv over:%d\r\n", ret); +// for (size_t i = 0; i < ret; i++) { +// USB_LOG_RAW("0x%02x ", cdc_buffer[i]); +// } +// } return ret; } |
