//----------------------------------------------------------------- // set_address: //----------------------------------------------------------------- static void set_address(struct device_request *request) { unsigned char addr = (LO_BYTE(request->wValue)) & USB_ADDRESS_MASK; usbhw_set_address(addr); usbhw_control_endpoint_ack(); log_printf(USBLOG_INFO, "USB: Set address %x\n", addr); }
void usb_set_address(u8 adr) { if (adr==flags.address) return; #ifdef USB_DEFERRED_ADDRESS usb_set_state(USB_STATE_WILL_ADDRESS); flags.address=adr; #else usbhw_set_address(adr); usb_set_state(USB_STATE_ADDRESS); #endif }