Changeset 92f924c8 in mainline for uspace/drv/uhci/root_hub/port.c
- Timestamp:
- 2011-01-07T13:27:58Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7bd34e5
- Parents:
- 28f660d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci/root_hub/port.c
r28f660d r92f924c8 1 1 2 #include <atomic.h> 3 #include <errno.h> 2 4 #include <usb/devreq.h> 3 5 #include <usb/usb.h> 4 #include <errno.h>5 6 6 7 #include "debug.h" … … 8 9 #include "port.h" 9 10 #include "port_status.h" 11 #include "utils/hc_synchronizer.h" 10 12 11 13 struct usb_match { … … 104 106 pio_write_16( port->address, port_status.raw_value ); 105 107 106 uhci_print_info( "Enabled port %d.\n", port );108 uhci_print_info( "Enabled port %d.\n", port->number ); 107 109 return EOK; 108 110 } … … 191 193 /* get new address */ 192 194 const usb_address_t usb_address = 193 usb_address_keeping_request( &uhci_instance->address_manager ); 195 usb_address_keeping_request(&uhci_instance->address_manager); 196 197 if (usb_address <= 0) { 198 return usb_address; 199 } 194 200 195 201 /* assign new address */ 196 202 usb_target_t new_device = { USB_ADDRESS_DEFAULT, 0 }; 197 usb_device_request_setup_packet_t data; 203 usb_device_request_setup_packet_t data = 204 { 205 .request_type = 0, 206 .request = USB_DEVREQ_SET_ADDRESS, 207 { .value = usb_address }, 208 .index = 0, 209 .length = 0 210 }; 211 212 sync_value_t value; 198 213 199 214 uhci_setup( 200 hc, new_device, USB_TRANSFER_CONTROL, &data, sizeof(data), NULL, NULL ); 201 uhci_print_verbose( "address assignment sent, waiting to complete.\n" ); 202 215 hc, new_device, USB_TRANSFER_CONTROL, &data, sizeof(data), 216 sync_out_callback, (void*)&value ); 217 uhci_print_verbose("address assignment sent, waiting to complete.\n"); 218 219 // sync_wait_for(&value); 203 220 204 221 uhci_print_info( "Assigned address %#x.\n", usb_address );
Note:
See TracChangeset
for help on using the changeset viewer.