summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsakumisu <[email protected]>2024-04-24 22:40:55 +0800
committersakumisu <[email protected]>2024-04-24 22:40:55 +0800
commit23e2787a43c552ba417e7f81abb5733876940854 (patch)
tree180bf8a0984e8b1788bb235712bc00ec342614b6
parenta3302584ce8e9c2ca9b1b5b89d2c2c7e524845f9 (diff)
add user_data param in host class for users
-rw-r--r--class/audio/usbh_audio.h2
-rw-r--r--class/cdc/usbh_cdc_acm.h2
-rw-r--r--class/cdc/usbh_cdc_ecm.h4
-rw-r--r--class/cdc/usbh_cdc_ncm.h2
-rw-r--r--class/hid/usbh_hid.h4
-rw-r--r--class/msc/usbh_msc.h2
-rw-r--r--class/template/usbh_xxx.h2
-rw-r--r--class/vendor/net/usbh_asix.h2
-rw-r--r--class/vendor/net/usbh_rtl8152.h2
-rw-r--r--class/vendor/serial/usbh_ch34x.h2
-rw-r--r--class/vendor/serial/usbh_cp210x.h10
-rw-r--r--class/vendor/serial/usbh_ftdi.h2
-rw-r--r--class/video/usbh_video.h2
-rw-r--r--class/wireless/usbh_bluetooth.h2
-rw-r--r--class/wireless/usbh_rndis.h2
15 files changed, 36 insertions, 6 deletions
diff --git a/class/audio/usbh_audio.h b/class/audio/usbh_audio.h
index f963dd0b..038a8f7e 100644
--- a/class/audio/usbh_audio.h
+++ b/class/audio/usbh_audio.h
@@ -53,6 +53,8 @@ struct usbh_audio {
uint8_t num_of_intf_altsettings;
struct usbh_audio_module module[2];
uint8_t module_num;
+
+ void *user_data;
};
#ifdef __cplusplus
diff --git a/class/cdc/usbh_cdc_acm.h b/class/cdc/usbh_cdc_acm.h
index ac6f191c..80800bf9 100644
--- a/class/cdc/usbh_cdc_acm.h
+++ b/class/cdc/usbh_cdc_acm.h
@@ -25,6 +25,8 @@ struct usbh_cdc_acm {
uint8_t intf;
uint8_t minor;
+
+ void *user_data;
};
#ifdef __cplusplus
diff --git a/class/cdc/usbh_cdc_ecm.h b/class/cdc/usbh_cdc_ecm.h
index ab81794e..6066bd05 100644
--- a/class/cdc/usbh_cdc_ecm.h
+++ b/class/cdc/usbh_cdc_ecm.h
@@ -23,7 +23,7 @@ struct usbh_cdc_ecm {
uint8_t ctrl_intf; /* Control interface number */
uint8_t data_intf; /* Data interface number */
uint8_t minor;
-
+
uint8_t mac[6];
bool connect_status;
uint16_t max_segment_size;
@@ -32,6 +32,8 @@ struct usbh_cdc_ecm {
ip_addr_t ipaddr;
ip_addr_t netmask;
ip_addr_t gateway;
+
+ void *user_data;
};
#ifdef __cplusplus
diff --git a/class/cdc/usbh_cdc_ncm.h b/class/cdc/usbh_cdc_ncm.h
index d8012550..b3cc7d49 100644
--- a/class/cdc/usbh_cdc_ncm.h
+++ b/class/cdc/usbh_cdc_ncm.h
@@ -36,6 +36,8 @@ struct usbh_cdc_ncm {
ip_addr_t ipaddr;
ip_addr_t netmask;
ip_addr_t gateway;
+
+ void *user_data;
};
#ifdef __cplusplus
diff --git a/class/hid/usbh_hid.h b/class/hid/usbh_hid.h
index 4d655fad..17caaba2 100644
--- a/class/hid/usbh_hid.h
+++ b/class/hid/usbh_hid.h
@@ -15,9 +15,11 @@ struct usbh_hid {
struct usbh_urb intin_urb; /* INTR IN urb */
struct usbh_urb intout_urb; /* INTR OUT urb */
- uint8_t report_desc[128];
+ uint8_t report_desc[256];
uint8_t intf; /* interface number */
uint8_t minor;
+
+ void *user_data;
};
#ifdef __cplusplus
diff --git a/class/msc/usbh_msc.h b/class/msc/usbh_msc.h
index 93c99f1a..50a61a9c 100644
--- a/class/msc/usbh_msc.h
+++ b/class/msc/usbh_msc.h
@@ -20,6 +20,8 @@ struct usbh_msc {
uint8_t sdchar;
uint32_t blocknum; /* Number of blocks on the USB mass storage device */
uint16_t blocksize; /* Block size of USB mass storage device */
+
+ void *user_data;
};
struct usbh_msc_modeswitch_config {
diff --git a/class/template/usbh_xxx.h b/class/template/usbh_xxx.h
index 655d5e8e..0858f51d 100644
--- a/class/template/usbh_xxx.h
+++ b/class/template/usbh_xxx.h
@@ -12,6 +12,8 @@ struct usbh_xxx {
uint8_t intf; /* interface number */
uint8_t minor;
+
+ void *user_data;
};
void usbh_xxx_run(struct usbh_xxx *xxx_class);
diff --git a/class/vendor/net/usbh_asix.h b/class/vendor/net/usbh_asix.h
index 8be79dfd..0642578b 100644
--- a/class/vendor/net/usbh_asix.h
+++ b/class/vendor/net/usbh_asix.h
@@ -159,6 +159,8 @@ struct usbh_asix {
ip_addr_t ipaddr;
ip_addr_t netmask;
ip_addr_t gateway;
+
+ void *user_data;
};
#ifdef __cplusplus
diff --git a/class/vendor/net/usbh_rtl8152.h b/class/vendor/net/usbh_rtl8152.h
index 9c18d5ab..4386ebb7 100644
--- a/class/vendor/net/usbh_rtl8152.h
+++ b/class/vendor/net/usbh_rtl8152.h
@@ -50,6 +50,8 @@ struct usbh_rtl8152 {
void (*autosuspend_en)(struct usbh_rtl8152 *tp, bool enable);
void (*change_mtu)(struct usbh_rtl8152 *tp);
} rtl_ops;
+
+ void *user_data;
};
#ifdef __cplusplus
diff --git a/class/vendor/serial/usbh_ch34x.h b/class/vendor/serial/usbh_ch34x.h
index 9918c3be..c90bf9bd 100644
--- a/class/vendor/serial/usbh_ch34x.h
+++ b/class/vendor/serial/usbh_ch34x.h
@@ -51,6 +51,8 @@ struct usbh_ch34x {
uint8_t intf;
uint8_t minor;
+
+ void *user_data;
};
#ifdef __cplusplus
diff --git a/class/vendor/serial/usbh_cp210x.h b/class/vendor/serial/usbh_cp210x.h
index 597328ec..d380c36c 100644
--- a/class/vendor/serial/usbh_cp210x.h
+++ b/class/vendor/serial/usbh_cp210x.h
@@ -17,7 +17,7 @@
#define CP210X_SET_BREAK 0x05
#define CP210X_IMM_CHAR 0x06
#define CP210X_SET_MHS 0x07 // Set DTR, RTS
-#define CP210X_GET_MDMSTS 0x08
+#define CP210X_GET_MDMSTS 0x08
#define CP210X_SET_XON 0x09
#define CP210X_SET_XOFF 0x0A
#define CP210X_SET_EVENTMASK 0x0B
@@ -33,9 +33,9 @@
#define CP210X_EMBED_EVENTS 0x15
#define CP210X_GET_EVENTSTATE 0x16
#define CP210X_SET_CHARS 0x19
-#define CP210X_GET_BAUDRATE 0x1D
+#define CP210X_GET_BAUDRATE 0x1D
#define CP210X_SET_BAUDRATE 0x1E // Set baudrate
-#define CP210X_VENDOR_SPECIFIC 0xFF
+#define CP210X_VENDOR_SPECIFIC 0xFF
struct usbh_cp210x {
struct usbh_hubport *hport;
@@ -45,9 +45,11 @@ struct usbh_cp210x {
struct usbh_urb bulkin_urb;
struct cdc_line_coding line_coding;
-
+
uint8_t intf;
uint8_t minor;
+
+ void *user_data;
};
#ifdef __cplusplus
diff --git a/class/vendor/serial/usbh_ftdi.h b/class/vendor/serial/usbh_ftdi.h
index 300ee6ab..faaf5214 100644
--- a/class/vendor/serial/usbh_ftdi.h
+++ b/class/vendor/serial/usbh_ftdi.h
@@ -51,6 +51,8 @@ struct usbh_ftdi {
uint8_t intf;
uint8_t minor;
uint8_t modem_status[2];
+
+ void *user_data;
};
#ifdef __cplusplus
diff --git a/class/video/usbh_video.h b/class/video/usbh_video.h
index 8458ec2d..dac5792c 100644
--- a/class/video/usbh_video.h
+++ b/class/video/usbh_video.h
@@ -55,6 +55,8 @@ struct usbh_video {
uint8_t num_of_intf_altsettings;
uint8_t num_of_formats;
struct usbh_video_format format[3];
+
+ void *user_data;
};
#ifdef __cplusplus
diff --git a/class/wireless/usbh_bluetooth.h b/class/wireless/usbh_bluetooth.h
index 3f79c025..868ff2c2 100644
--- a/class/wireless/usbh_bluetooth.h
+++ b/class/wireless/usbh_bluetooth.h
@@ -29,6 +29,8 @@ struct usbh_bluetooth {
struct usbh_urb *isoout_urb; /* Bulk OUT urb */
uint8_t num_of_intf_altsettings;
#endif
+
+ void *user_data;
};
#ifdef __cplusplus
diff --git a/class/wireless/usbh_rndis.h b/class/wireless/usbh_rndis.h
index 0257e450..b4e99c3d 100644
--- a/class/wireless/usbh_rndis.h
+++ b/class/wireless/usbh_rndis.h
@@ -33,6 +33,8 @@ struct usbh_rndis {
ip_addr_t ipaddr;
ip_addr_t netmask;
ip_addr_t gateway;
+
+ void *user_data;
};
#ifdef __cplusplus