summaryrefslogtreecommitdiff
path: root/src/host/hub.h
diff options
context:
space:
mode:
authorhathach <[email protected]>2020-09-05 20:20:45 +0700
committerhathach <[email protected]>2020-09-05 20:20:45 +0700
commit828f720207d4ded25ed533ea6c52da49c799b476 (patch)
tree54c0dbfdf9eeb0a01f5ee23ea1f380da526284f3 /src/host/hub.h
parent7ffb6acc1625022d8a79c1d408b11240707136ca (diff)
refactor hub class
- separate connect/disconnect handling - hub work with full speed, but doesn't seem to work with Low speed device (with mcb1800) - need to update msc host after migrating from isr to xfer_cb (blocked at inquiry)
Diffstat (limited to 'src/host/hub.h')
-rw-r--r--src/host/hub.h32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/host/hub.h b/src/host/hub.h
index 8f307190b..71dd39b8d 100644
--- a/src/host/hub.h
+++ b/src/host/hub.h
@@ -142,7 +142,7 @@ typedef struct {
};
uint16_t value;
- } status, status_change;
+ } status, change;
} hub_status_response_t;
TU_VERIFY_STATIC( sizeof(hub_status_response_t) == 4, "size is not correct");
@@ -151,30 +151,30 @@ TU_VERIFY_STATIC( sizeof(hub_status_response_t) == 4, "size is not correct");
typedef struct {
union {
struct TU_ATTR_PACKED {
- uint16_t connect_status : 1;
- uint16_t port_enable : 1;
- uint16_t suspend : 1;
- uint16_t over_current : 1;
- uint16_t reset : 1;
+ uint16_t connection : 1;
+ uint16_t port_enable : 1;
+ uint16_t suspend : 1;
+ uint16_t over_current : 1;
+ uint16_t reset : 1;
- uint16_t : 3;
- uint16_t port_power : 1;
- uint16_t low_speed_device_attached : 1;
- uint16_t high_speed_device_attached : 1;
- uint16_t port_test_mode : 1;
- uint16_t port_indicator_control : 1;
+ uint16_t : 3;
+ uint16_t port_power : 1;
+ uint16_t low_speed : 1;
+ uint16_t high_speed : 1;
+ uint16_t port_test_mode : 1;
+ uint16_t port_indicator_control : 1;
uint16_t : 0;
};
uint16_t value;
- } status_current, status_change;
+ } status, change;
} hub_port_status_response_t;
TU_VERIFY_STATIC( sizeof(hub_port_status_response_t) == 4, "size is not correct");
-bool hub_port_reset_subtask(uint8_t hub_addr, uint8_t hub_port);
-bool hub_port_clear_feature_subtask(uint8_t hub_addr, uint8_t hub_port, uint8_t feature);
-tusb_speed_t hub_port_get_speed(void);
+bool hub_port_reset(uint8_t hub_addr, uint8_t hub_port);
+bool hub_port_get_status(uint8_t hub_addr, uint8_t hub_port, hub_port_status_response_t* resp);
+bool hub_port_clear_feature(uint8_t hub_addr, uint8_t hub_port, uint8_t feature);
bool hub_status_pipe_queue(uint8_t dev_addr);
//--------------------------------------------------------------------+