fix warning
This commit is contained in:
@@ -108,7 +108,7 @@ static int _usbh_hub_get_hub_descriptor(struct usbh_hub *hub, uint8_t *buffer)
|
|||||||
memcpy(buffer, g_hub_buf, USB_SIZEOF_HUB_DESC);
|
memcpy(buffer, g_hub_buf, USB_SIZEOF_HUB_DESC);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
#if 0
|
||||||
static int _usbh_hub_get_status(struct usbh_hub *hub, uint8_t *buffer)
|
static int _usbh_hub_get_status(struct usbh_hub *hub, uint8_t *buffer)
|
||||||
{
|
{
|
||||||
struct usb_setup_packet *setup;
|
struct usb_setup_packet *setup;
|
||||||
@@ -130,6 +130,7 @@ static int _usbh_hub_get_status(struct usbh_hub *hub, uint8_t *buffer)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
static int _usbh_hub_get_portstatus(struct usbh_hub *hub, uint8_t port, struct hub_port_status *port_status)
|
static int _usbh_hub_get_portstatus(struct usbh_hub *hub, uint8_t port, struct hub_port_status *port_status)
|
||||||
{
|
{
|
||||||
|
|||||||
28
class/vendor/air72x/usbh_air724.c
vendored
28
class/vendor/air72x/usbh_air724.c
vendored
@@ -16,6 +16,8 @@ struct usbh_cdc_custom_air724 {
|
|||||||
struct usbh_urb bulkout_urb; /* Bulk OUT urb */
|
struct usbh_urb bulkout_urb; /* Bulk OUT urb */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
USB_NOCACHE_RAM_SECTION USB_MEM_ALIGNX uint8_t g_air724_buf[32];
|
||||||
|
|
||||||
static inline int usbh_air724_bulk_out_transfer(struct usbh_cdc_custom_air724 *cdc_custom_class, uint8_t *buffer, uint32_t buflen, uint32_t timeout)
|
static inline int usbh_air724_bulk_out_transfer(struct usbh_cdc_custom_air724 *cdc_custom_class, uint8_t *buffer, uint32_t buflen, uint32_t timeout)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
@@ -30,12 +32,26 @@ static inline int usbh_air724_bulk_out_transfer(struct usbh_cdc_custom_air724 *c
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline int usbh_air724_bulk_in_transfer(struct usbh_cdc_custom_air724 *cdc_custom_class, uint8_t *buffer, uint32_t buflen, uint32_t timeout)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
struct usbh_urb *urb = &cdc_custom_class->bulkin_urb;
|
||||||
|
memset(urb, 0, sizeof(struct usbh_urb));
|
||||||
|
|
||||||
|
usbh_bulk_urb_fill(urb, cdc_custom_class->bulkin, buffer, buflen, timeout, NULL, NULL);
|
||||||
|
ret = usbh_submit_urb(urb);
|
||||||
|
if (ret == 0) {
|
||||||
|
ret = urb->actual_length;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
int usbh_air724_connect(struct usbh_hubport *hport, uint8_t intf)
|
int usbh_air724_connect(struct usbh_hubport *hport, uint8_t intf)
|
||||||
{
|
{
|
||||||
struct usbh_endpoint_cfg ep_cfg = { 0 };
|
|
||||||
struct usb_endpoint_descriptor *ep_desc;
|
struct usb_endpoint_descriptor *ep_desc;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
/* interface 3 is AT command */
|
||||||
if (intf != 3) {
|
if (intf != 3) {
|
||||||
USB_LOG_WRN("ignore intf:%d\r\n", intf);
|
USB_LOG_WRN("ignore intf:%d\r\n", intf);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -65,20 +81,22 @@ int usbh_air724_connect(struct usbh_hubport *hport, uint8_t intf)
|
|||||||
|
|
||||||
USB_LOG_INFO("Register air724 Class:%s\r\n", hport->config.intf[intf].devname);
|
USB_LOG_INFO("Register air724 Class:%s\r\n", hport->config.intf[intf].devname);
|
||||||
|
|
||||||
uint8_t cdc_buffer[32] = { 0x41, 0x54, 0x0d, 0x0a };
|
const uint8_t AT[4] = { 0x41, 0x54, 0x0d, 0x0a };
|
||||||
ret = usbh_air724_bulk_out_transfer(cdc_custom_class->bulkout, cdc_buffer, 4, 3000);
|
|
||||||
|
memcpy(g_air724_buf, AT, 4);
|
||||||
|
ret = usbh_air724_bulk_out_transfer(cdc_custom_class, g_air724_buf, 4, 3000);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
USB_LOG_ERR("bulk out error,ret:%d\r\n", ret);
|
USB_LOG_ERR("bulk out error,ret:%d\r\n", ret);
|
||||||
} else {
|
} else {
|
||||||
USB_LOG_RAW("send over:%d\r\n", ret);
|
USB_LOG_RAW("send over:%d\r\n", ret);
|
||||||
}
|
}
|
||||||
ret = usbh_air724_bulk_out_transfer(cdc_custom_class->bulkin, cdc_buffer, 10, 3000);
|
ret = usbh_air724_bulk_in_transfer(cdc_custom_class, g_air724_buf, 10, 3000);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
USB_LOG_ERR("bulk in error,ret:%d\r\n", ret);
|
USB_LOG_ERR("bulk in error,ret:%d\r\n", ret);
|
||||||
} else {
|
} else {
|
||||||
USB_LOG_RAW("recv over:%d\r\n", ret);
|
USB_LOG_RAW("recv over:%d\r\n", ret);
|
||||||
for (size_t i = 0; i < ret; i++) {
|
for (size_t i = 0; i < ret; i++) {
|
||||||
USB_LOG_RAW("0x%02x ", cdc_buffer[i]);
|
USB_LOG_RAW("0x%02x ", g_air724_buf[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -260,7 +260,6 @@ int usbh_rndis_keepalive(struct usbh_rndis *rndis_class)
|
|||||||
|
|
||||||
static int usbh_rndis_connect(struct usbh_hubport *hport, uint8_t intf)
|
static int usbh_rndis_connect(struct usbh_hubport *hport, uint8_t intf)
|
||||||
{
|
{
|
||||||
struct usbh_endpoint_cfg ep_cfg = { 0 };
|
|
||||||
struct usb_endpoint_descriptor *ep_desc;
|
struct usb_endpoint_descriptor *ep_desc;
|
||||||
int ret;
|
int ret;
|
||||||
uint32_t *oid_support_list;
|
uint32_t *oid_support_list;
|
||||||
|
|||||||
Reference in New Issue
Block a user