Skip to content

Commit d367e8f

Browse files
committed
ohci: Expand roothub descriptors into unions
1 parent 3342635 commit d367e8f

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

src/portable/ohci/ohci.h

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,27 @@ typedef volatile struct
230230
uint32_t periodic_start;
231231
uint32_t lowspeed_threshold;
232232

233-
uint32_t rh_descriptorA;
234-
uint32_t rh_descriptorB;
233+
union {
234+
uint32_t rh_descriptorA;
235+
struct {
236+
uint32_t number_downstream_ports : 8;
237+
uint32_t power_switching_mode : 1;
238+
uint32_t no_power_switching : 1;
239+
uint32_t device_type : 1;
240+
uint32_t overcurrent_protection_mode : 1;
241+
uint32_t no_over_current_protection : 1;
242+
uint32_t reserved : 11;
243+
uint32_t power_on_to_good_time : 8;
244+
} rh_descriptorA_bit;
245+
};
246+
247+
union {
248+
uint32_t rh_descriptorB;
249+
struct {
250+
uint32_t device_removable : 16;
251+
uint32_t port_power_control_mask : 16;
252+
} rh_descriptorB_bit;
253+
};
235254

236255
union {
237256
uint32_t rh_status;

0 commit comments

Comments
 (0)