summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraozima <[email protected]>2022-03-19 11:23:40 +0800
committersakumisu <[email protected]>2022-03-19 12:26:37 +0800
commit5e455c2331d720892612e501b8755e419d615f02 (patch)
tree665fe8d9688462c368e08db665e0d5ccb0ea9e6b
parentfd574baeb728f2da39b5b2ea366f12b23bd4db59 (diff)
update host class driver struct: add hport.
-rw-r--r--class/cdc/usbh_cdc_acm.c3
-rw-r--r--class/cdc/usbh_cdc_acm.h4
-rw-r--r--class/hid/usbh_hid.c3
-rw-r--r--class/hid/usbh_hid.h4
-rw-r--r--class/msc/usbh_msc.c3
-rw-r--r--class/msc/usbh_msc.h4
6 files changed, 15 insertions, 6 deletions
diff --git a/class/cdc/usbh_cdc_acm.c b/class/cdc/usbh_cdc_acm.c
index 4fe60a69..5eb0489f 100644
--- a/class/cdc/usbh_cdc_acm.c
+++ b/class/cdc/usbh_cdc_acm.c
@@ -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
-}; \ No newline at end of file
+};
diff --git a/class/cdc/usbh_cdc_acm.h b/class/cdc/usbh_cdc_acm.h
index 1ef8d516..4e9ea8a4 100644
--- a/class/cdc/usbh_cdc_acm.h
+++ b/class/cdc/usbh_cdc_acm.h
@@ -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 \ No newline at end of file
+#endif
diff --git a/class/hid/usbh_hid.c b/class/hid/usbh_hid.c
index 691c86ad..64582041 100644
--- a/class/hid/usbh_hid.c
+++ b/class/hid/usbh_hid.c
@@ -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
-}; \ No newline at end of file
+};
diff --git a/class/hid/usbh_hid.h b/class/hid/usbh_hid.h
index 0d32ffd1..ccc051de 100644
--- a/class/hid/usbh_hid.h
+++ b/class/hid/usbh_hid.h
@@ -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 \ No newline at end of file
+#endif
diff --git a/class/msc/usbh_msc.c b/class/msc/usbh_msc.c
index f2056566..d265534c 100644
--- a/class/msc/usbh_msc.c
+++ b/class/msc/usbh_msc.c
@@ -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
-}; \ No newline at end of file
+};
diff --git a/class/msc/usbh_msc.h b/class/msc/usbh_msc.h
index f1d48980..c37b7bf8 100644
--- a/class/msc/usbh_msc.h
+++ b/class/msc/usbh_msc.h
@@ -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 \ No newline at end of file
+#endif