summaryrefslogtreecommitdiff
path: root/src/typec/tcd.h
diff options
context:
space:
mode:
authorhathach <[email protected]>2023-06-12 16:42:27 +0700
committerhathach <[email protected]>2023-06-12 16:42:27 +0700
commit6941a5af81b53cd0df52632d403cccdb7d22cf30 (patch)
tree2ae2aa6214287c3b995f6f9bfebbc93680d29cd6 /src/typec/tcd.h
parentc28503060c0c3cb09d8e2ce63d1b0009affbdf72 (diff)
wrap up initial PD support for G4
Diffstat (limited to 'src/typec/tcd.h')
-rw-r--r--src/typec/tcd.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/typec/tcd.h b/src/typec/tcd.h
index ee73943bd..86499c951 100644
--- a/src/typec/tcd.h
+++ b/src/typec/tcd.h
@@ -48,8 +48,7 @@ enum {
TCD_EVENT_TX_COMPLETE,
};
-
-typedef struct {
+typedef struct TU_ATTR_PACKED {
uint8_t rhport;
uint8_t event_id;
@@ -58,10 +57,10 @@ typedef struct {
uint8_t cc_state[2];
} cc_changed;
- struct {
- uint16_t xferred_bytes;
- uint8_t result;
- } rx_complete;
+ struct TU_ATTR_PACKED {
+ uint16_t result : 2;
+ uint16_t xferred_bytes : 14;
+ } xfer_complete;
};
} tcd_event_t;;
@@ -114,7 +113,7 @@ void tcd_event_rx_complete(uint8_t rhport, uint16_t xferred_bytes, uint8_t resul
tcd_event_t event = {
.rhport = rhport,
.event_id = TCD_EVENT_RX_COMPLETE,
- .rx_complete = {
+ .xfer_complete = {
.xferred_bytes = xferred_bytes,
.result = result
}
@@ -128,7 +127,7 @@ void tcd_event_tx_complete(uint8_t rhport, uint16_t xferred_bytes, uint8_t resul
tcd_event_t event = {
.rhport = rhport,
.event_id = TCD_EVENT_TX_COMPLETE,
- .rx_complete = {
+ .xfer_complete = {
.xferred_bytes = xferred_bytes,
.result = result
}