Lines Matching refs:device

36 	usb_device			device;
59 raw_device *device = (raw_device *)malloc(sizeof(raw_device));
61 mutex_init(&device->lock, "usb_raw device lock");
63 device->notify = create_sem(0, "usb_raw callback notify");
64 if (device->notify < B_OK) {
65 mutex_destroy(&device->lock);
66 free(device);
73 snprintf(device->name, sizeof(device->name), "bus/usb/%s", deviceName);
75 snprintf(device->name, sizeof(device->name), "bus/usb/%08" B_PRIx32,
79 device->device = newDevice;
80 device->reference_count = 0;
83 device->link = (void *)gDeviceList;
84 gDeviceList = device;
88 TRACE((DRIVER_NAME": new device: 0x%p\n", device));
89 *cookie = (void *)device;
98 raw_device *device = (raw_device *)cookie;
103 gUSBModule->get_configuration(device->device);
112 if (gDeviceList == device) {
113 gDeviceList = (raw_device *)device->link;
117 if (element->link == device) {
118 element->link = device->link;
128 device->device = 0;
129 if (device->reference_count == 0) {
130 mutex_lock(&device->lock);
131 mutex_destroy(&device->lock);
132 delete_sem(device->notify);
133 free(device);
146 usb_raw_get_configuration(raw_device *device, uint32 configIndex,
150 device->device, configIndex);
161 usb_raw_get_interface(raw_device *device, uint32 configIndex,
165 = usb_raw_get_configuration(device, configIndex, status);
233 raw_device *device = (raw_device *)cookie;
234 device->reference_count--;
235 if (device->device == 0) {
236 mutex_lock(&device->lock);
237 mutex_destroy(&device->lock);
238 delete_sem(device->notify);
239 free(device);
251 raw_device *device = (raw_device *)cookie;
255 device->status = B_USB_RAW_STATUS_SUCCESS;
258 device->status = B_USB_RAW_STATUS_TIMEOUT;
261 device->status = B_USB_RAW_STATUS_ABORTED;
264 device->status = B_USB_RAW_STATUS_CRC_ERROR;
267 device->status = B_USB_RAW_STATUS_STALLED;
270 device->status = B_USB_RAW_STATUS_FAILED;
274 device->actual_length = actualLength;
275 release_sem(device->notify);
283 raw_device *device = (raw_device *)cookie;
284 if (device->device == 0)
309 if (length < sizeof(command.device))
314 gUSBModule->get_device_descriptor(device->device);
318 if (!IS_USER_ADDRESS(command.device.descriptor)
319 || user_memcpy(command.device.descriptor, deviceDescriptor,
324 command.device.status = B_USB_RAW_STATUS_SUCCESS;
340 usb_raw_get_configuration(device, command.config.config_index,
369 usb_raw_get_configuration(device,
408 interfaceInfo = usb_raw_get_interface(device,
417 interfaceInfo = usb_raw_get_interface(device,
447 interfaceInfo = usb_raw_get_interface(device,
457 interfaceInfo = usb_raw_get_interface(device,
495 interfaceInfo = usb_raw_get_interface(device,
506 interfaceInfo = usb_raw_get_interface(device,
550 if (gUSBModule->get_descriptor(device->device,
562 if (gUSBModule->get_descriptor(device->device,
581 if (gUSBModule->get_descriptor(device->device,
613 if (gUSBModule->get_descriptor(device->device,
634 if (gUSBModule->get_descriptor(device->device,
665 usb_raw_get_configuration(device, command.config.config_index,
670 if (gUSBModule->set_configuration(device->device,
687 usb_raw_get_configuration(device,
706 if (gUSBModule->set_alt_interface(device->device,
734 MutexLocker deviceLocker(device->lock);
735 if (gUSBModule->queue_request(device->device,
739 usb_raw_callback, device) < B_OK) {
746 status = acquire_sem_etc(device->notify, 1, B_KILL_CAN_INTERRUPT, 0);
748 gUSBModule->cancel_queued_requests(device->device);
749 acquire_sem(device->notify);
752 command.control.status = device->status;
753 command.control.length = device->actual_length;
774 gUSBModule->get_configuration(device->device);
850 MutexLocker deviceLocker(device->lock);
854 usb_raw_callback, device);
858 usb_raw_callback, device);
863 0, usb_raw_callback, device);
873 status = acquire_sem_etc(device->notify, 1, B_KILL_CAN_INTERRUPT, 0);
876 acquire_sem(device->notify);
879 command.transfer.status = device->status;
880 command.transfer.length = device->actual_length;
950 mutex_init(&gDeviceListLock, "usb_raw device list lock");