update host class driver struct: add hport.

This commit is contained in:
aozima
2022-03-19 11:23:40 +08:00
committed by sakumisu
parent fd574baeb7
commit 5e455c2331
6 changed files with 15 additions and 6 deletions

View File

@@ -168,6 +168,7 @@ int usbh_cdc_acm_connect(struct usbh_hubport *hport, uint8_t intf)
}
memset(cdc_acm_class, 0, sizeof(struct usbh_cdc_acm));
cdc_acm_class->hport = hport;
usbh_cdc_acm_devno_alloc(cdc_acm_class);
snprintf(hport->config.intf[intf].devname, CONFIG_USBHOST_DEV_NAMELEN, DEV_FORMAT, cdc_acm_class->minor);
@@ -271,4 +272,4 @@ const struct usbh_class_driver cdc_acm_class_driver = {
.driver_name = "cdc_acm",
.connect = usbh_cdc_acm_connect,
.disconnect = usbh_cdc_acm_disconnect
};
};

View File

@@ -26,6 +26,8 @@
#include "usb_cdc.h"
struct usbh_cdc_acm {
struct usbh_hubport *hport;
struct cdc_line_coding *linecoding;
uint8_t ctrl_intf; /* Control interface number */
uint8_t data_intf; /* Data interface number */
@@ -49,4 +51,4 @@ extern "C" {
}
#endif
#endif
#endif

View File

@@ -159,6 +159,7 @@ int usbh_hid_connect(struct usbh_hubport *hport, uint8_t intf)
}
memset(hid_class, 0, sizeof(struct usbh_hid));
hid_class->hport = hport;
usbh_hid_devno_alloc(hid_class);
snprintf(hport->config.intf[intf].devname, CONFIG_USBHOST_DEV_NAMELEN, DEV_FORMAT, hid_class->minor);
@@ -238,4 +239,4 @@ const struct usbh_class_driver hid_class_driver = {
.driver_name = "hid",
.connect = usbh_hid_connect,
.disconnect = usbh_hid_disconnect
};
};

View File

@@ -26,6 +26,8 @@
#include "usb_hid.h"
struct usbh_hid {
struct usbh_hubport *hport;
uint8_t intf; /* interface number */
uint8_t minor;
usbh_epinfo_t intin; /* INTR IN endpoint */
@@ -42,4 +44,4 @@ extern "C" {
}
#endif
#endif
#endif

View File

@@ -338,6 +338,7 @@ int usbh_msc_connect(struct usbh_hubport *hport, uint8_t intf)
}
memset(msc_class, 0, sizeof(struct usbh_msc));
msc_class->hport = hport;
usbh_msc_devno_alloc(msc_class);
snprintf(hport->config.intf[intf].devname, CONFIG_USBHOST_DEV_NAMELEN, DEV_FORMAT, msc_class->sdchar);
@@ -427,4 +428,4 @@ const struct usbh_class_driver msc_class_driver = {
.driver_name = "msc",
.connect = usbh_msc_connect,
.disconnect = usbh_msc_disconnect
};
};

View File

@@ -27,6 +27,8 @@
#include "usb_scsi.h"
struct usbh_msc {
struct usbh_hubport *hport;
uint8_t intf; /* Data interface number */
uint8_t sdchar;
usbh_epinfo_t bulkin; /* Bulk IN endpoint */
@@ -49,4 +51,4 @@ extern "C" {
}
#endif
#endif
#endif