Changes in uspace/lib/usbdev/src/request.c [3238506:49bd7ae2] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbdev/src/request.c
r3238506 r49bd7ae2 250 250 } 251 251 252 /** Change address of connected device. 253 * This function automatically updates the backing connection to point to 254 * the new address. 255 * 256 * @param pipe Control endpoint pipe (session must be already started). 257 * @param new_address New USB address to be set (in native endianness). 258 * @return Error code. 259 */ 260 int usb_request_set_address(usb_pipe_t *pipe, 261 usb_address_t new_address) 262 { 263 if ((new_address < 0) || (new_address >= USB11_ADDRESS_MAX)) { 264 return EINVAL; 265 } 266 267 uint16_t addr = uint16_host2usb((uint16_t)new_address); 268 269 int rc = usb_control_request_set(pipe, 270 USB_REQUEST_TYPE_STANDARD, USB_REQUEST_RECIPIENT_DEVICE, 271 USB_DEVREQ_SET_ADDRESS, 272 addr, 0, 273 NULL, 0); 274 275 if (rc != EOK) { 276 return rc; 277 } 278 279 assert(pipe->wire != NULL); 280 /* TODO: prevent other from accessing wire now. */ 281 pipe->wire->address = new_address; 282 283 return EOK; 284 } 285 252 286 /** Retrieve USB descriptor of a USB device. 253 287 *
Note:
See TracChangeset
for help on using the changeset viewer.