FreeBSD kernel usb device Code
|
#include <sys/stdint.h>
#include <sys/stddef.h>
#include <sys/param.h>
#include <sys/queue.h>
#include <sys/types.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/bus.h>
#include <sys/module.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/condvar.h>
#include <sys/sysctl.h>
#include <sys/sx.h>
#include <sys/unistd.h>
#include <sys/callout.h>
#include <sys/malloc.h>
#include <sys/priv.h>
#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
#include "usbdevs.h"
#include "usb_if.h"
#include <dev/usb/usb_debug.h>
Go to the source code of this file.
Data Structures | |
struct | __packed |
struct | ustorage_fs_lun |
struct | ustorage_fs_softc |
Variables | |
static uint8_t * | ustorage_fs_ramdisk |
static device_probe_t | ustorage_fs_probe |
static device_attach_t | ustorage_fs_attach |
static device_detach_t | ustorage_fs_detach |
static device_suspend_t | ustorage_fs_suspend |
static device_resume_t | ustorage_fs_resume |
static usb_handle_request_t | ustorage_fs_handle_request |
static usb_callback_t | ustorage_fs_t_bbb_command_callback |
static usb_callback_t | ustorage_fs_t_bbb_data_dump_callback |
static usb_callback_t | ustorage_fs_t_bbb_data_read_callback |
static usb_callback_t | ustorage_fs_t_bbb_data_write_callback |
static usb_callback_t | ustorage_fs_t_bbb_status_callback |
static device_method_t | ustorage_fs_methods [] |
static driver_t | ustorage_fs_driver |
static devclass_t | ustorage_fs_devclass |
static struct usb_config | ustorage_fs_bbb_config [USTORAGE_FS_T_BBB_MAX] |
#define ASC | ( | x | ) | ((uint8_t) ((x) >> 8)) |
Definition at line 892 of file ustorage_fs.c.
#define ASCQ | ( | x | ) | ((uint8_t) (x)) |
Definition at line 893 of file ustorage_fs.c.
#define CBWCDBLENGTH 16 |
Definition at line 147 of file ustorage_fs.c.
#define CBWFLAGS_IN 0x80 |
Definition at line 144 of file ustorage_fs.c.
#define CBWFLAGS_OUT 0x00 |
Definition at line 143 of file ustorage_fs.c.
#define CBWSIGNATURE 0x43425355 |
Definition at line 139 of file ustorage_fs.c.
#define CSWSIGNATURE 0x53425355 |
Definition at line 156 of file ustorage_fs.c.
#define CSWSTATUS_FAILED 0x1 |
Definition at line 161 of file ustorage_fs.c.
#define CSWSTATUS_GOOD 0x0 |
Definition at line 160 of file ustorage_fs.c.
#define CSWSTATUS_PHASE 0x2 |
Definition at line 162 of file ustorage_fs.c.
#define DIR_NONE 0 |
Definition at line 127 of file ustorage_fs.c.
#define DIR_READ 1 |
Definition at line 128 of file ustorage_fs.c.
#define DIR_WRITE 2 |
Definition at line 129 of file ustorage_fs.c.
#define SC_FORMAT_UNIT 0x04 |
Definition at line 851 of file ustorage_fs.c.
#define SC_INQUIRY 0x12 |
Definition at line 852 of file ustorage_fs.c.
#define SC_MODE_SELECT_10 0x55 |
Definition at line 854 of file ustorage_fs.c.
#define SC_MODE_SELECT_6 0x15 |
Definition at line 853 of file ustorage_fs.c.
#define SC_MODE_SENSE_10 0x5a |
Definition at line 856 of file ustorage_fs.c.
#define SC_MODE_SENSE_6 0x1a |
Definition at line 855 of file ustorage_fs.c.
#define SC_PREVENT_ALLOW_MEDIUM_REMOVAL 0x1e |
Definition at line 857 of file ustorage_fs.c.
#define SC_READ_10 0x28 |
Definition at line 859 of file ustorage_fs.c.
#define SC_READ_12 0xa8 |
Definition at line 860 of file ustorage_fs.c.
#define SC_READ_6 0x08 |
Definition at line 858 of file ustorage_fs.c.
#define SC_READ_CAPACITY 0x25 |
Definition at line 861 of file ustorage_fs.c.
#define SC_READ_FORMAT_CAPACITIES 0x23 |
Definition at line 862 of file ustorage_fs.c.
#define SC_RELEASE 0x17 |
Definition at line 863 of file ustorage_fs.c.
#define SC_REQUEST_SENSE 0x03 |
Definition at line 864 of file ustorage_fs.c.
#define SC_RESERVE 0x16 |
Definition at line 865 of file ustorage_fs.c.
#define SC_SEND_DIAGNOSTIC 0x1d |
Definition at line 866 of file ustorage_fs.c.
#define SC_START_STOP_UNIT 0x1b |
Definition at line 867 of file ustorage_fs.c.
#define SC_SYNCHRONIZE_CACHE 0x35 |
Definition at line 868 of file ustorage_fs.c.
#define SC_TEST_UNIT_READY 0x00 |
Definition at line 869 of file ustorage_fs.c.
#define SC_VERIFY 0x2f |
Definition at line 870 of file ustorage_fs.c.
#define SC_WRITE_10 0x2a |
Definition at line 872 of file ustorage_fs.c.
#define SC_WRITE_12 0xaa |
Definition at line 873 of file ustorage_fs.c.
#define SC_WRITE_6 0x0a |
Definition at line 871 of file ustorage_fs.c.
#define SK | ( | x | ) | ((uint8_t) ((x) >> 16)) /* Sense Key byte, etc. */ |
Definition at line 891 of file ustorage_fs.c.
#define SS_COMMUNICATION_FAILURE 0x040800 |
Definition at line 877 of file ustorage_fs.c.
#define SS_INVALID_COMMAND 0x052000 |
Definition at line 878 of file ustorage_fs.c.
#define SS_INVALID_FIELD_IN_CDB 0x052400 |
Definition at line 879 of file ustorage_fs.c.
#define SS_LOGICAL_BLOCK_ADDRESS_OUT_OF_RANGE 0x052100 |
Definition at line 880 of file ustorage_fs.c.
#define SS_LOGICAL_UNIT_NOT_SUPPORTED 0x052500 |
Definition at line 881 of file ustorage_fs.c.
#define SS_MEDIUM_NOT_PRESENT 0x023a00 |
Definition at line 882 of file ustorage_fs.c.
#define SS_MEDIUM_REMOVAL_PREVENTED 0x055302 |
Definition at line 883 of file ustorage_fs.c.
#define SS_NO_SENSE 0 |
Definition at line 876 of file ustorage_fs.c.
#define SS_NOT_READY_TO_READY_TRANSITION 0x062800 |
Definition at line 884 of file ustorage_fs.c.
#define SS_RESET_OCCURRED 0x062900 |
Definition at line 885 of file ustorage_fs.c.
#define SS_SAVING_PARAMETERS_NOT_SUPPORTED 0x053900 |
Definition at line 886 of file ustorage_fs.c.
#define SS_UNRECOVERED_READ_ERROR 0x031100 |
Definition at line 887 of file ustorage_fs.c.
#define SS_WRITE_ERROR 0x030c02 |
Definition at line 888 of file ustorage_fs.c.
#define SS_WRITE_PROTECTED 0x072700 |
Definition at line 889 of file ustorage_fs.c.
#define UR_BBB_GET_MAX_LUN 0xfe /* Get maximum lun */ |
Definition at line 134 of file ustorage_fs.c.
#define UR_BBB_RESET 0xff /* Bulk-Only reset */ |
Definition at line 133 of file ustorage_fs.c.
#define USB_DEBUG_VAR ustorage_fs_debug |
Definition at line 68 of file ustorage_fs.c.
#define USTORAGE_FS_BBB_CBW_SIZE 31 |
Definition at line 151 of file ustorage_fs.c.
#define USTORAGE_FS_BBB_CSW_SIZE 13 |
Definition at line 165 of file ustorage_fs.c.
#define USTORAGE_FS_BULK_SIZE (1U << 17) /* bytes */ |
Definition at line 84 of file ustorage_fs.c.
#define USTORAGE_FS_ID_STRING |
Definition at line 100 of file ustorage_fs.c.
#define USTORAGE_FS_MAX_LUN 8 /* units */ |
Definition at line 88 of file ustorage_fs.c.
#define USTORAGE_FS_RAM_SECT (1UL << 13) |
Definition at line 111 of file ustorage_fs.c.
#define USTORAGE_FS_T_BBB_COMMAND 0 |
Definition at line 118 of file ustorage_fs.c.
#define USTORAGE_FS_T_BBB_DATA_DUMP 1 |
Definition at line 119 of file ustorage_fs.c.
#define USTORAGE_FS_T_BBB_DATA_READ 2 |
Definition at line 120 of file ustorage_fs.c.
#define USTORAGE_FS_T_BBB_DATA_WRITE 3 |
Definition at line 121 of file ustorage_fs.c.
#define USTORAGE_FS_T_BBB_MAX 5 |
Definition at line 123 of file ustorage_fs.c.
#define USTORAGE_FS_T_BBB_STATUS 4 |
Definition at line 122 of file ustorage_fs.c.
#define USTORAGE_QDATA_MAX 40 /* bytes */ |
Definition at line 92 of file ustorage_fs.c.
DRIVER_MODULE | ( | ustorage_fs | , |
uhub | , | ||
ustorage_fs_driver | , | ||
ustorage_fs_devclass | , | ||
NULL | , | ||
0 | |||
) |
|
static |
Definition at line 898 of file ustorage_fs.c.
Referenced by ustorage_fs_do_cmd(), ustorage_fs_read(), ustorage_fs_verify(), and ustorage_fs_write().
|
static |
Definition at line 904 of file ustorage_fs.c.
Referenced by ustorage_fs_do_cmd(), ustorage_fs_read(), ustorage_fs_read_capacity(), ustorage_fs_verify(), and ustorage_fs_write().
MODULE_DEPEND | ( | ustorage_fs | , |
usb | , | ||
1 | , | ||
1 | , | ||
1 | |||
) |
MODULE_VERSION | ( | ustorage_fs | , |
0 | |||
) |
|
static |
Definition at line 911 of file ustorage_fs.c.
References val.
Referenced by ustorage_fs_mode_sense().
|
static |
Definition at line 918 of file ustorage_fs.c.
References val.
Referenced by ustorage_fs_read_capacity(), ustorage_fs_read_format_capacities(), and ustorage_fs_request_sense().
|
static |
Definition at line 351 of file ustorage_fs.c.
References usbd_lookup_info::bIfaceIndex, dev, usb_attach_arg::device, device_set_usb_desc(), id, usb_attach_arg::iface, usb_attach_arg::info, ustorage_fs_lun::memory_image, ustorage_fs_lun::num_sectors, ustorage_fs_lun::removable, ustorage_fs_softc::sc_cbw, ustorage_fs_softc::sc_csw, ustorage_fs_softc::sc_dev, ustorage_fs_softc::sc_dma_ptr, ustorage_fs_softc::sc_iface_no, ustorage_fs_softc::sc_lun, ustorage_fs_softc::sc_mtx, ustorage_fs_softc::sc_udev, ustorage_fs_softc::sc_xfer, USB_POWER_MODE_SAVE, usbd_errstr(), usbd_get_interface_descriptor(), usbd_set_power_mode(), usbd_transfer_setup(), usbd_xfer_get_frame_buffer(), ustorage_fs_bbb_config, ustorage_fs_detach, USTORAGE_FS_RAM_SECT, ustorage_fs_ramdisk, USTORAGE_FS_T_BBB_COMMAND, USTORAGE_FS_T_BBB_DATA_READ, USTORAGE_FS_T_BBB_MAX, USTORAGE_FS_T_BBB_STATUS, and ustorage_fs_transfer_start().
|
static |
Definition at line 1525 of file ustorage_fs.c.
References ustorage_fs_softc::cmd_len, CSWSTATUS_PHASE, ustorage_fs_softc::currlun, DPRINTF, ustorage_fs_lun::info_valid, ustorage_fs_softc::lun, ustorage_fs_lun::memory_image, ustorage_fs_softc::sc_cbw, ustorage_fs_softc::sc_csw, SC_INQUIRY, ustorage_fs_softc::sc_last_lun, ustorage_fs_softc::sc_lun, SC_REQUEST_SENSE, ustorage_fs_softc::sc_transfer, ustorage_fs_lun::sense_data, ustorage_fs_lun::sense_data_info, SS_INVALID_FIELD_IN_CDB, SS_MEDIUM_NOT_PRESENT, SS_NO_SENSE, and ustorage_fs_lun::unit_attention_data.
Referenced by ustorage_fs_do_cmd().
|
static |
Definition at line 432 of file ustorage_fs.c.
References dev, ustorage_fs_softc::sc_mtx, ustorage_fs_softc::sc_xfer, usbd_transfer_unsetup(), and USTORAGE_FS_T_BBB_MAX.
|
static |
Definition at line 1611 of file ustorage_fs.c.
References ustorage_fs_softc::cmd_dir, ustorage_fs_softc::cmd_len, CSWSTATUS_FAILED, ustorage_fs_softc::currlun, ustorage_fs_softc::data_ptr, ustorage_fs_softc::data_rem, DIR_READ, DIR_WRITE, DPRINTF, error, get_be16(), get_be32(), ustorage_fs_softc::sc_cbw, ustorage_fs_softc::sc_csw, SC_FORMAT_UNIT, SC_INQUIRY, SC_MODE_SELECT_10, SC_MODE_SELECT_6, SC_MODE_SENSE_10, SC_MODE_SENSE_6, SC_PREVENT_ALLOW_MEDIUM_REMOVAL, ustorage_fs_softc::sc_qdata, SC_READ_10, SC_READ_12, SC_READ_6, SC_READ_CAPACITY, SC_READ_FORMAT_CAPACITIES, SC_RELEASE, SC_REQUEST_SENSE, SC_RESERVE, SC_SEND_DIAGNOSTIC, SC_START_STOP_UNIT, SC_SYNCHRONIZE_CACHE, SC_TEST_UNIT_READY, ustorage_fs_softc::sc_transfer, SC_VERIFY, SC_WRITE_10, SC_WRITE_12, SC_WRITE_6, ustorage_fs_lun::sense_data, SS_INVALID_COMMAND, ustorage_fs_check_cmd(), ustorage_fs_inquiry(), ustorage_fs_min_len(), ustorage_fs_mode_select(), ustorage_fs_mode_sense(), ustorage_fs_prevent_allow(), ustorage_fs_read(), ustorage_fs_read_capacity(), ustorage_fs_read_format_capacities(), ustorage_fs_request_sense(), ustorage_fs_start_stop(), ustorage_fs_synchronize_cache(), ustorage_fs_verify(), and ustorage_fs_write().
Referenced by ustorage_fs_t_bbb_command_callback().
|
static |
Definition at line 482 of file ustorage_fs.c.
References ustorage_fs_softc::data_error, dev, offset, plen, pptr, pstate, req, ustorage_fs_softc::sc_last_lun, ustorage_fs_softc::sc_mtx, ustorage_fs_softc::sc_transfer, UR_BBB_GET_MAX_LUN, UR_BBB_RESET, USTORAGE_FS_T_BBB_COMMAND, ustorage_fs_transfer_start(), ustorage_fs_transfer_stop(), UT_READ_CLASS_INTERFACE, and UT_WRITE_CLASS_INTERFACE.
|
static |
Definition at line 989 of file ustorage_fs.c.
References ustorage_fs_softc::currlun, ustorage_fs_softc::data_ptr, ustorage_fs_lun::removable, ustorage_fs_softc::sc_transfer, USTORAGE_FS_ID_STRING, and ustorage_fs_min_len().
Referenced by ustorage_fs_do_cmd().
|
static |
Definition at line 1485 of file ustorage_fs.c.
References ustorage_fs_softc::cbw_dir, CSWSTATUS_PHASE, ustorage_fs_softc::data_rem, ustorage_fs_softc::data_short, DIR_READ, len, ustorage_fs_softc::sc_csw, and ustorage_fs_softc::sc_transfer.
Referenced by ustorage_fs_do_cmd(), ustorage_fs_inquiry(), ustorage_fs_mode_sense(), ustorage_fs_read_capacity(), ustorage_fs_read_format_capacities(), ustorage_fs_request_sense(), and ustorage_fs_verify().
|
static |
Definition at line 1327 of file ustorage_fs.c.
References ustorage_fs_softc::currlun, ustorage_fs_softc::sc_transfer, ustorage_fs_lun::sense_data, and SS_INVALID_COMMAND.
Referenced by ustorage_fs_do_cmd().
|
static |
Definition at line 1130 of file ustorage_fs.c.
References ustorage_fs_softc::currlun, ustorage_fs_softc::data_ptr, len, put_be16(), ustorage_fs_lun::read_only, ustorage_fs_softc::sc_cbw, SC_MODE_SENSE_6, ustorage_fs_softc::sc_transfer, ustorage_fs_lun::sense_data, SS_INVALID_FIELD_IN_CDB, SS_SAVING_PARAMETERS_NOT_SUPPORTED, and ustorage_fs_min_len().
Referenced by ustorage_fs_do_cmd().
|
static |
Definition at line 1266 of file ustorage_fs.c.
References ustorage_fs_softc::currlun, ustorage_fs_lun::prevent_medium_removal, ustorage_fs_lun::removable, ustorage_fs_softc::sc_cbw, ustorage_fs_softc::sc_transfer, ustorage_fs_lun::sense_data, SS_INVALID_COMMAND, and SS_INVALID_FIELD_IN_CDB.
Referenced by ustorage_fs_do_cmd().
|
static |
Definition at line 331 of file ustorage_fs.c.
References dev, id, usb_attach_arg::iface, UICLASS_MASS, UIPROTO_MASS_BBB, UISUBCLASS_SCSI, usb_attach_arg::usb_mode, USB_MODE_DEVICE, and usbd_get_interface_descriptor().
|
static |
Definition at line 1369 of file ustorage_fs.c.
References ustorage_fs_softc::currlun, ustorage_fs_softc::data_ptr, ustorage_fs_softc::data_rem, get_be16(), get_be32(), len, ustorage_fs_lun::memory_image, ustorage_fs_lun::num_sectors, ustorage_fs_softc::sc_cbw, SC_READ_6, ustorage_fs_softc::sc_transfer, ustorage_fs_lun::sense_data, SS_INVALID_FIELD_IN_CDB, and SS_LOGICAL_BLOCK_ADDRESS_OUT_OF_RANGE.
Referenced by ustorage_fs_do_cmd().
|
static |
Definition at line 1099 of file ustorage_fs.c.
References ustorage_fs_softc::currlun, ustorage_fs_softc::data_ptr, get_be32(), ustorage_fs_lun::num_sectors, put_be32(), ustorage_fs_softc::sc_cbw, ustorage_fs_softc::sc_transfer, ustorage_fs_lun::sense_data, SS_INVALID_FIELD_IN_CDB, and ustorage_fs_min_len().
Referenced by ustorage_fs_do_cmd().
|
static |
Definition at line 1296 of file ustorage_fs.c.
References ustorage_fs_softc::currlun, ustorage_fs_softc::data_ptr, ustorage_fs_lun::num_sectors, put_be32(), ustorage_fs_softc::sc_transfer, and ustorage_fs_min_len().
Referenced by ustorage_fs_do_cmd().
|
static |
Definition at line 1030 of file ustorage_fs.c.
References ASC, ASCQ, ustorage_fs_softc::currlun, ustorage_fs_softc::data_ptr, ustorage_fs_lun::info_valid, put_be32(), ustorage_fs_softc::sc_transfer, ustorage_fs_lun::sense_data, ustorage_fs_lun::sense_data_info, SK, SS_LOGICAL_UNIT_NOT_SUPPORTED, SS_NO_SENSE, ustorage_fs_lun::unit_attention_data, and ustorage_fs_min_len().
Referenced by ustorage_fs_do_cmd().
|
static |
Definition at line 453 of file ustorage_fs.c.
References dev.
|
static |
Definition at line 1237 of file ustorage_fs.c.
References ustorage_fs_softc::currlun, ustorage_fs_lun::removable, ustorage_fs_softc::sc_cbw, ustorage_fs_softc::sc_transfer, ustorage_fs_lun::sense_data, SS_INVALID_COMMAND, and start.
Referenced by ustorage_fs_do_cmd().
|
static |
Definition at line 446 of file ustorage_fs.c.
References dev.
|
static |
Definition at line 1344 of file ustorage_fs.c.
References ustorage_fs_softc::currlun, ustorage_fs_softc::sc_transfer, ustorage_fs_lun::sense_data, and SS_WRITE_ERROR.
Referenced by ustorage_fs_do_cmd().
|
static |
Definition at line 516 of file ustorage_fs.c.
References ustorage_fs_softc::cbw_dir, CBWFLAGS_IN, CBWSIGNATURE, ustorage_fs_softc::cmd_dir, ustorage_fs_softc::cmd_len, CSWSTATUS_FAILED, ustorage_fs_softc::data_error, ustorage_fs_softc::data_rem, ustorage_fs_softc::data_short, DIR_NONE, DIR_READ, DIR_WRITE, DPRINTF, error, ustorage_fs_softc::lun, ustorage_fs_softc::offset, ustorage_fs_softc::sc_cbw, ustorage_fs_softc::sc_csw, ustorage_fs_softc::sc_transfer, UGETDW, USB_ERR_CANCELLED, USB_GET_STATE, USB_ST_SETUP, USB_ST_TRANSFERRED, usbd_transfer_submit(), usbd_xfer_is_stalled(), usbd_xfer_set_frame_len(), usbd_xfer_set_stall(), usbd_xfer_softc(), USETDW, ustorage_fs_do_cmd(), USTORAGE_FS_T_BBB_DATA_DUMP, USTORAGE_FS_T_BBB_DATA_READ, USTORAGE_FS_T_BBB_DATA_WRITE, USTORAGE_FS_T_BBB_STATUS, and ustorage_fs_transfer_start().
|
static |
Definition at line 643 of file ustorage_fs.c.
References ustorage_fs_softc::data_error, ustorage_fs_softc::data_rem, DPRINTF, error, ustorage_fs_softc::offset, ustorage_fs_softc::sc_transfer, USB_ERR_CANCELLED, USB_GET_STATE, USB_ST_SETUP, USB_ST_TRANSFERRED, usbd_transfer_submit(), usbd_xfer_is_stalled(), usbd_xfer_max_len(), usbd_xfer_set_frame_len(), usbd_xfer_set_stall(), usbd_xfer_softc(), usbd_xfer_status(), USTORAGE_FS_T_BBB_STATUS, and ustorage_fs_transfer_start().
|
static |
Definition at line 695 of file ustorage_fs.c.
References ustorage_fs_softc::data_error, ustorage_fs_softc::data_ptr, ustorage_fs_softc::data_rem, DPRINTF, error, ustorage_fs_softc::offset, ustorage_fs_softc::sc_dma_ptr, ustorage_fs_softc::sc_transfer, USB_ERR_CANCELLED, USB_GET_STATE, USB_ST_SETUP, USB_ST_TRANSFERRED, usbd_transfer_submit(), usbd_xfer_is_stalled(), usbd_xfer_max_len(), usbd_xfer_set_frame_data(), usbd_xfer_set_stall(), usbd_xfer_softc(), usbd_xfer_status(), USTORAGE_FS_T_BBB_STATUS, and ustorage_fs_transfer_start().
|
static |
Definition at line 750 of file ustorage_fs.c.
References ustorage_fs_softc::data_error, ustorage_fs_softc::data_ptr, ustorage_fs_softc::data_rem, ustorage_fs_softc::data_short, DPRINTF, error, ustorage_fs_softc::offset, ustorage_fs_softc::sc_dma_ptr, ustorage_fs_softc::sc_transfer, USB_ERR_CANCELLED, USB_FORCE_SHORT_XFER, USB_GET_STATE, USB_ST_SETUP, USB_ST_TRANSFERRED, usbd_transfer_submit(), usbd_xfer_clr_flag(), usbd_xfer_is_stalled(), usbd_xfer_max_len(), usbd_xfer_set_flag(), usbd_xfer_set_frame_data(), usbd_xfer_set_stall(), usbd_xfer_softc(), usbd_xfer_status(), USTORAGE_FS_T_BBB_STATUS, and ustorage_fs_transfer_start().
|
static |
Definition at line 812 of file ustorage_fs.c.
References CSWSIGNATURE, ustorage_fs_softc::data_error, ustorage_fs_softc::data_rem, DPRINTF, error, ustorage_fs_softc::sc_csw, ustorage_fs_softc::sc_transfer, USB_ERR_CANCELLED, USB_GET_STATE, USB_ST_SETUP, USB_ST_TRANSFERRED, usbd_transfer_submit(), usbd_xfer_is_stalled(), usbd_xfer_set_frame_len(), usbd_xfer_set_stall(), usbd_xfer_softc(), USETDW, USTORAGE_FS_T_BBB_COMMAND, and ustorage_fs_transfer_start().
|
static |
Definition at line 464 of file ustorage_fs.c.
References ustorage_fs_softc::sc_last_xfer_index, ustorage_fs_softc::sc_xfer, and usbd_transfer_start().
Referenced by ustorage_fs_attach(), ustorage_fs_handle_request(), ustorage_fs_t_bbb_command_callback(), ustorage_fs_t_bbb_data_dump_callback(), ustorage_fs_t_bbb_data_read_callback(), ustorage_fs_t_bbb_data_write_callback(), and ustorage_fs_t_bbb_status_callback().
|
static |
Definition at line 473 of file ustorage_fs.c.
References ustorage_fs_softc::sc_last_xfer_index, ustorage_fs_softc::sc_mtx, ustorage_fs_softc::sc_xfer, usbd_transfer_drain(), and usbd_transfer_stop().
Referenced by ustorage_fs_handle_request().
|
static |
Definition at line 934 of file ustorage_fs.c.
References ustorage_fs_softc::currlun, get_be16(), get_be32(), ustorage_fs_lun::num_sectors, ustorage_fs_softc::sc_cbw, ustorage_fs_softc::sc_transfer, ustorage_fs_lun::sense_data, SS_INVALID_FIELD_IN_CDB, SS_LOGICAL_BLOCK_ADDRESS_OUT_OF_RANGE, and ustorage_fs_min_len().
Referenced by ustorage_fs_do_cmd().
|
static |
Definition at line 1421 of file ustorage_fs.c.
References ustorage_fs_softc::currlun, ustorage_fs_softc::data_ptr, ustorage_fs_softc::data_rem, get_be16(), get_be32(), len, ustorage_fs_lun::memory_image, ustorage_fs_lun::num_sectors, ustorage_fs_lun::read_only, ustorage_fs_softc::sc_cbw, ustorage_fs_softc::sc_transfer, SC_WRITE_6, ustorage_fs_lun::sense_data, SS_INVALID_FIELD_IN_CDB, SS_LOGICAL_BLOCK_ADDRESS_OUT_OF_RANGE, and SS_WRITE_PROTECTED.
Referenced by ustorage_fs_do_cmd().
|
static |
Definition at line 219 of file ustorage_fs.c.
|
static |
Definition at line 275 of file ustorage_fs.c.
Referenced by ustorage_fs_attach().
|
static |
Definition at line 220 of file ustorage_fs.c.
Referenced by ustorage_fs_attach().
|
static |
Definition at line 269 of file ustorage_fs.c.
|
static |
Definition at line 263 of file ustorage_fs.c.
|
static |
Definition at line 223 of file ustorage_fs.c.
|
static |
Definition at line 249 of file ustorage_fs.c.
|
static |
Definition at line 218 of file ustorage_fs.c.
|
static |
Definition at line 114 of file ustorage_fs.c.
Referenced by ustorage_fs_attach().
|
static |
Definition at line 222 of file ustorage_fs.c.
|
static |
Definition at line 221 of file ustorage_fs.c.
|
static |
Definition at line 225 of file ustorage_fs.c.
|
static |
Definition at line 226 of file ustorage_fs.c.
|
static |
Definition at line 227 of file ustorage_fs.c.
|
static |
Definition at line 228 of file ustorage_fs.c.
|
static |
Definition at line 229 of file ustorage_fs.c.