Paparazzi UAS
v5.10_stable-5-g83a0da5-dirty
Paparazzi is a free software Unmanned Aircraft System.
|
#include <ch.h>
#include <hal.h>
#include "std.h"
Go to the source code of this file.
Data Structures | |
struct | PACK_STRUCT_STRUCT |
Response to a READ_CAPACITY_10 SCSI command. More... | |
struct | PACK_STRUCT_STRUCT |
Response to a READ_CAPACITY_10 SCSI command. More... | |
struct | PACK_STRUCT_STRUCT |
Response to a READ_CAPACITY_10 SCSI command. More... | |
struct | PACK_STRUCT_STRUCT |
Response to a READ_CAPACITY_10 SCSI command. More... | |
struct | USBMassStorageConfig |
Driver configuration structure. More... | |
struct | USBMassStorageDriver |
USB mass storage driver structure. More... | |
Macros | |
#define | PACK_STRUCT_BEGIN |
#define | PACK_STRUCT_END |
#define | PACK_STRUCT_STRUCT __attribute__((packed)) |
Enumerations | |
enum | msd_state_t { MSD_IDLE, MSD_READ_COMMAND_BLOCK, MSD_EJECTED } |
Possible states for the USB mass storage driver. More... | |
Functions | |
void | msdInit (USBMassStorageDriver *msdp) |
Initializes a USB mass storage driver. More... | |
void | msdStart (USBMassStorageDriver *msdp, const USBMassStorageConfig *config) |
Starts a USB mass storage driver. More... | |
void | msdStop (USBMassStorageDriver *msdp) |
Stops a USB mass storage driver. More... | |
void | msdConfigureHookI (USBMassStorageDriver *msdp) |
USB device configured handler. More... | |
bool | msdRequestsHook (USBDriver *usbp) |
Default requests hook. More... | |
struct PACK_STRUCT_STRUCT |
Response to a READ_CAPACITY_10 SCSI command.
structure holding the data to reply to an INQUIRY SCSI command
Structure holding sense data (status/error information)
Command Status Wrapper structure.
Command Block Wrapper structure.
Response to a READ_FORMAT_CAPACITIES SCSI command.
Data Fields | ||
---|---|---|
uint8_t | additional_length | |
uint32_t | block_count | |
uint32_t | block_size | |
uint8_t | bqueetc | |
uint8_t | byte[18] | |
uint8_t | capacity_list_length | |
uint8_t | cmdque | |
uint32_t | data_len | |
uint32_t | data_residue | |
uint32_t | desc_and_block_length | |
uint8_t | flags | |
uint32_t | last_block_addr | |
uint8_t | lun | |
uint8_t | peripheral | |
uint8_t | product_id[16] | |
uint8_t | product_rev[4] | |
uint8_t | removable | |
uint8_t | reserved[3] | |
uint8_t | response_data_format | |
uint8_t | sccstp | |
uint8_t | scsi_cmd_data[16] | |
uint8_t | scsi_cmd_len | |
uint32_t | signature | |
uint8_t | status | |
uint32_t | tag | |
uint8_t | vendor_id[8] | |
uint8_t | version |
struct PACK_STRUCT_STRUCT |
Response to a READ_CAPACITY_10 SCSI command.
structure holding the data to reply to an INQUIRY SCSI command
Structure holding sense data (status/error information)
Command Status Wrapper structure.
Command Block Wrapper structure.
Response to a READ_FORMAT_CAPACITIES SCSI command.
Data Fields | ||
---|---|---|
uint8_t | additional_length | |
uint32_t | block_count | |
uint32_t | block_size | |
uint8_t | bqueetc | |
uint8_t | byte[18] | |
uint8_t | capacity_list_length | |
uint8_t | cmdque | |
uint32_t | data_len | |
uint32_t | data_residue | |
uint32_t | desc_and_block_length | |
uint8_t | flags | |
uint32_t | last_block_addr | |
uint8_t | lun | |
uint8_t | peripheral | |
uint8_t | product_id[16] | |
uint8_t | product_rev[4] | |
uint8_t | removable | |
uint8_t | reserved[3] | |
uint8_t | response_data_format | |
uint8_t | sccstp | |
uint8_t | scsi_cmd_data[16] | |
uint8_t | scsi_cmd_len | |
uint32_t | signature | |
uint8_t | status | |
uint32_t | tag | |
uint8_t | vendor_id[8] | |
uint8_t | version |
struct PACK_STRUCT_STRUCT |
Response to a READ_CAPACITY_10 SCSI command.
structure holding the data to reply to an INQUIRY SCSI command
Structure holding sense data (status/error information)
Command Status Wrapper structure.
Command Block Wrapper structure.
Response to a READ_FORMAT_CAPACITIES SCSI command.
Data Fields | ||
---|---|---|
uint8_t | additional_length | |
uint32_t | block_count | |
uint32_t | block_size | |
uint8_t | bqueetc | |
uint8_t | byte[18] | |
uint8_t | capacity_list_length | |
uint8_t | cmdque | |
uint32_t | data_len | |
uint32_t | data_residue | |
uint32_t | desc_and_block_length | |
uint8_t | flags | |
uint32_t | last_block_addr | |
uint8_t | lun | |
uint8_t | peripheral | |
uint8_t | product_id[16] | |
uint8_t | product_rev[4] | |
uint8_t | removable | |
uint8_t | reserved[3] | |
uint8_t | response_data_format | |
uint8_t | sccstp | |
uint8_t | scsi_cmd_data[16] | |
uint8_t | scsi_cmd_len | |
uint32_t | signature | |
uint8_t | status | |
uint32_t | tag | |
uint8_t | vendor_id[8] | |
uint8_t | version |
struct PACK_STRUCT_STRUCT |
Response to a READ_CAPACITY_10 SCSI command.
structure holding the data to reply to an INQUIRY SCSI command
Structure holding sense data (status/error information)
Command Status Wrapper structure.
Command Block Wrapper structure.
Response to a READ_FORMAT_CAPACITIES SCSI command.
Data Fields | ||
---|---|---|
uint8_t | additional_length | |
uint32_t | block_count | |
uint32_t | block_size | |
uint8_t | bqueetc | |
uint8_t | byte[18] | |
uint8_t | capacity_list_length | |
uint8_t | cmdque | |
uint32_t | data_len | |
uint32_t | data_residue | |
uint32_t | desc_and_block_length | |
uint8_t | flags | |
uint32_t | last_block_addr | |
uint8_t | lun | |
uint8_t | peripheral | |
uint8_t | product_id[16] | |
uint8_t | product_rev[4] | |
uint8_t | removable | |
uint8_t | reserved[3] | |
uint8_t | response_data_format | |
uint8_t | sccstp | |
uint8_t | scsi_cmd_data[16] | |
uint8_t | scsi_cmd_len | |
uint32_t | signature | |
uint8_t | status | |
uint32_t | tag | |
uint8_t | vendor_id[8] | |
uint8_t | version |
struct USBMassStorageDriver |
USB mass storage driver structure.
This structure holds all the states and members of a USB mass storage driver.
Data Fields | ||
---|---|---|
BlockDeviceInfo | block_dev_info | |
binary_semaphore_t | bsem | |
msd_cbw_t | cbw | |
const USBMassStorageConfig * | config | |
msd_csw_t | csw | |
event_source_t | evt_connected | |
event_source_t | evt_ejected | |
msd_scsi_inquiry_response_t | inquiry | |
bool | result | |
msd_scsi_sense_response_t | sense | |
msd_state_t | state | |
thread_t * | thread |
#define PACK_STRUCT_STRUCT __attribute__((packed)) |
enum msd_state_t |
void msdConfigureHookI | ( | USBMassStorageDriver * | msdp | ) |
USB device configured handler.
[in] | msdp | pointer to the USBMassStorageDriver object |
Definition at line 173 of file usb_msd.c.
References USBMassStorageDriver::bsem, USBMassStorageConfig::bulk_ep, USBMassStorageDriver::config, USBMassStorageDriver::evt_connected, and USBMassStorageConfig::usbp.
Referenced by usbEvent().
void msdInit | ( | USBMassStorageDriver * | msdp | ) |
Initializes a USB mass storage driver.
Initializes a USB mass storage driver.
Definition at line 782 of file usb_msd.c.
References USBMassStorageDriver::bsem, USBMassStorageDriver::config, USBMassStorageDriver::evt_connected, USBMassStorageDriver::evt_ejected, USBMassStorageDriver::inquiry, MSD_IDLE, USBMassStorageDriver::sense, USBMassStorageDriver::state, and USBMassStorageDriver::thread.
Referenced by thdUsbStorage().
bool msdRequestsHook | ( | USBDriver * | usbp | ) |
Default requests hook.
Applications wanting to use the Mass Storage over USB driver can use this function as requests hook in the USB configuration. The following requests are emulated:
[in] | usbp | pointer to the USBDriver object |
true | Message handled internally. |
false | Message not handled. |
[in] | usbp | pointer to the USBDriver object |
true | Message handled internally. |
false | Message not handled. |
Definition at line 188 of file usb_msd.c.
References MSD_GET_MAX_LUN, MSD_REQ_RESET, MSD_SETUP_INDEX, MSD_SETUP_LENGTH, and MSD_SETUP_VALUE.
void msdStart | ( | USBMassStorageDriver * | msdp, |
const USBMassStorageConfig * | config | ||
) |
Starts a USB mass storage driver.
This function is sufficient to have USB mass storage running, it internally runs a thread that handles USB requests and transfers. The block device must be connected but no file system must be mounted, everything is handled by the host system.
Definition at line 820 of file usb_msd.c.
References USBMassStorageConfig::bbdp, USBMassStorageDriver::block_dev_info, USBMassStorageConfig::bulk_ep, config, USBMassStorageDriver::config, USBMassStorageDriver::inquiry, mass_storage_thread(), MSD_IDLE, USBMassStorageConfig::short_product_id, USBMassStorageConfig::short_product_version, USBMassStorageConfig::short_vendor_id, USBMassStorageDriver::state, USBMassStorageDriver::thread, and USBMassStorageConfig::usbp.
Referenced by thdUsbStorage().
void msdStop | ( | USBMassStorageDriver * | msdp | ) |
Stops a USB mass storage driver.
This function waits for current tasks to be finished, if any, and then stops the mass storage thread.
Definition at line 866 of file usb_msd.c.
References USBMassStorageDriver::bsem, USBMassStorageConfig::bulk_ep, USBMassStorageDriver::config, USBMassStorageDriver::thread, and USBMassStorageConfig::usbp.
Referenced by thdUsbStorage().