Lines Matching refs:intf

21 extern rt_err_t rt_udisk_run(struct uhintf* intf);
22 extern rt_err_t rt_udisk_stop(struct uhintf* intf);
34 static rt_err_t _pipe_check(struct uhintf* intf, upipe_t pipe) in _pipe_check() argument
42 if(intf == RT_NULL || pipe == RT_NULL) in _pipe_check()
49 device = intf->device; in _pipe_check()
52 stor = (ustor_t)intf->user_data; in _pipe_check()
99 static rt_err_t rt_usb_bulk_only_xfer(struct uhintf* intf, in rt_usb_bulk_only_xfer() argument
110 if(intf == RT_NULL) in rt_usb_bulk_only_xfer()
117 stor = (ustor_t)intf->user_data; in rt_usb_bulk_only_xfer()
154 ret = _pipe_check(intf, stor->pipe_in); in rt_usb_bulk_only_xfer()
162 ret = _pipe_check(intf, stor->pipe_out); in rt_usb_bulk_only_xfer()
193 rt_err_t rt_usbh_storage_get_max_lun(struct uhintf* intf, rt_uint8_t* max_lun) in rt_usbh_storage_get_max_lun() argument
199 if(intf == RT_NULL) in rt_usbh_storage_get_max_lun()
206 RT_ASSERT(intf->device != RT_NULL); in rt_usbh_storage_get_max_lun()
210 device = intf->device; in rt_usbh_storage_get_max_lun()
216 setup.wValue = intf->intf_desc->bInterfaceNumber; in rt_usbh_storage_get_max_lun()
243 rt_err_t rt_usbh_storage_reset(struct uhintf* intf) in rt_usbh_storage_reset() argument
250 if(intf == RT_NULL) in rt_usbh_storage_reset()
256 RT_ASSERT(intf->device != RT_NULL); in rt_usbh_storage_reset()
260 device = intf->device; in rt_usbh_storage_reset()
266 setup.wIndex = intf->intf_desc->bInterfaceNumber; in rt_usbh_storage_reset()
291 rt_err_t rt_usbh_storage_read10(struct uhintf* intf, rt_uint8_t *buffer, in rt_usbh_storage_read10() argument
297 if(intf == RT_NULL) in rt_usbh_storage_read10()
303 RT_ASSERT(intf->device != RT_NULL); in rt_usbh_storage_read10()
324 return rt_usb_bulk_only_xfer(intf, &cmd, buffer, timeout); in rt_usbh_storage_read10()
337 rt_err_t rt_usbh_storage_write10(struct uhintf* intf, rt_uint8_t *buffer, in rt_usbh_storage_write10() argument
343 if(intf == RT_NULL) in rt_usbh_storage_write10()
349 RT_ASSERT(intf->device != RT_NULL); in rt_usbh_storage_write10()
370 return rt_usb_bulk_only_xfer(intf, &cmd, buffer, timeout); in rt_usbh_storage_write10()
381 rt_err_t rt_usbh_storage_request_sense(struct uhintf* intf, rt_uint8_t* buffer) in rt_usbh_storage_request_sense() argument
387 if(intf == RT_NULL) in rt_usbh_storage_request_sense()
393 RT_ASSERT(intf->device != RT_NULL); in rt_usbh_storage_request_sense()
407 return rt_usb_bulk_only_xfer(intf, &cmd, buffer, timeout); in rt_usbh_storage_request_sense()
417 rt_err_t rt_usbh_storage_test_unit_ready(struct uhintf* intf) in rt_usbh_storage_test_unit_ready() argument
423 if(intf == RT_NULL) in rt_usbh_storage_test_unit_ready()
429 RT_ASSERT(intf->device != RT_NULL); in rt_usbh_storage_test_unit_ready()
442 return rt_usb_bulk_only_xfer(intf, &cmd, RT_NULL, timeout); in rt_usbh_storage_test_unit_ready()
453 rt_err_t rt_usbh_storage_inquiry(struct uhintf* intf, rt_uint8_t* buffer) in rt_usbh_storage_inquiry() argument
459 if(intf == RT_NULL) in rt_usbh_storage_inquiry()
465 RT_ASSERT(intf->device != RT_NULL); in rt_usbh_storage_inquiry()
479 return rt_usb_bulk_only_xfer(intf, &cmd, buffer, timeout); in rt_usbh_storage_inquiry()
490 rt_err_t rt_usbh_storage_get_capacity(struct uhintf* intf, rt_uint8_t* buffer) in rt_usbh_storage_get_capacity() argument
496 if(intf == RT_NULL) in rt_usbh_storage_get_capacity()
502 RT_ASSERT(intf->device != RT_NULL); in rt_usbh_storage_get_capacity()
515 return rt_usb_bulk_only_xfer(intf, &cmd, buffer, timeout); in rt_usbh_storage_get_capacity()
532 struct uhintf* intf = (struct uhintf*)arg; in rt_usbh_storage_enable() local
535 if(intf == RT_NULL) in rt_usbh_storage_enable()
542 intf->intf_desc->bInterfaceSubClass, in rt_usbh_storage_enable()
543 intf->intf_desc->bInterfaceProtocol); in rt_usbh_storage_enable()
554 intf->user_data = (void*)stor; in rt_usbh_storage_enable()
556 for(i=0; i<intf->intf_desc->bNumEndpoints; i++) in rt_usbh_storage_enable()
561 rt_usbh_get_endpoint_descriptor(intf->intf_desc, i, &ep_desc); in rt_usbh_storage_enable()
576 stor->pipe_in = rt_usb_instance_find_pipe(intf->device,ep_desc->bEndpointAddress); in rt_usbh_storage_enable()
581 stor->pipe_out = rt_usb_instance_find_pipe(intf->device,ep_desc->bEndpointAddress); in rt_usbh_storage_enable()
593 ret = rt_udisk_run(intf); in rt_usbh_storage_enable()
610 struct uhintf* intf = (struct uhintf*)arg; in rt_usbh_storage_disable() local
613 RT_ASSERT(intf != RT_NULL); in rt_usbh_storage_disable()
614 RT_ASSERT(intf->user_data != RT_NULL); in rt_usbh_storage_disable()
615 RT_ASSERT(intf->device != RT_NULL); in rt_usbh_storage_disable()
620 stor = (ustor_t)intf->user_data; in rt_usbh_storage_disable()
622 rt_udisk_stop(intf); in rt_usbh_storage_disable()