Turnstone Operating System
Loading...
Searching...
No Matches
usb_mass_storage.64.c File Reference

USB Mass Storage Device Class (MSC) driver. More...

#include <driver/usb.h>
#include <logging.h>
#include <driver/scsi.h>
#include <future.h>
#include <random.h>
#include <time/timer.h>
#include <disk.h>
#include <driver/usb_mass_storage_disk.h>
#include <hashmap.h>

Classes

struct  usb_driver_t
 
struct  usb_mass_storage_cbw_t
 
struct  usb_mass_storage_csw_t
 
struct  usb_mass_storage_disk_impl_context_t
 

Macros

#define USB_MASS_STORAGE_REQUEST_GET_MAX_LUN   0xFE
 
#define USB_MASS_STORAGE_REQUEST_RESET   0xFF
 
#define USB_MASS_STORAGE_CBW_SIGNATURE   0x43425355
 
#define USB_MASS_STORAGE_CSW_SIGNATURE   0x53425355
 
#define USB_MASS_STORAGE_CBW_FLAG_DATA_OUT   0x00
 
#define USB_MASS_STORAGE_CBW_FLAG_DATA_IN   0x80
 
#define USB_MASS_STORAGE_CBW_FLAG_NO_DATA   0x00
 

Typedefs

typedef struct usb_driver_t usb_driver_t
 
typedef struct usb_mass_storage_cbw_t usb_mass_storage_cbw_t
 
typedef struct usb_mass_storage_csw_t usb_mass_storage_csw_t
 
typedef struct usb_mass_storage_disk_impl_context_t usb_mass_storage_disk_impl_context_t
 

Functions

 MODULE ("turnstone.kernel.hw.usb.mass_storage")
 
boolean_t usb_mass_storage_send_cbw (usb_driver_t *usb_driver, uint32_t dtl, uint8_t flags, uint8_t lun, uint8_t command_length, uint8_t *command)
 
boolean_t usb_mass_storage_get_csw (usb_driver_t *usb_driver)
 
boolean_t usb_mass_storage_read_write (usb_driver_t *usb_driver, boolean_t read, uint32_t dtl, uint8_t *data)
 
int8_t usb_mass_storage_init (usb_device_t *usb_device)
 
uint64_t usb_mass_storage_get_disk_count (void)
 
usb_driver_tusb_mass_storage_get_disk_by_id (uint64_t id)
 
uint64_t usb_mass_storage_disk_impl_get_size (const disk_or_partition_t *d)
 
uint64_t usb_mass_storage_disk_impl_get_block_size (const disk_or_partition_t *d)
 
int8_t usb_mass_storage_disk_impl_write (const disk_or_partition_t *d, uint64_t lba, uint64_t count, uint8_t *data)
 
int8_t usb_mass_storage_disk_impl_read (const disk_or_partition_t *d, uint64_t lba, uint64_t count, uint8_t **data)
 
int8_t usb_mass_storage_disk_impl_flush (const disk_or_partition_t *d)
 
int8_t usb_mass_storage_disk_impl_close (const disk_or_partition_t *d)
 
disk_tusb_mass_storage_disk_impl_open (usb_driver_t *usb_mass_storage, uint8_t lun)
 

Variables

hashmap_tusb_mass_storage_disks = NULL
 

Detailed Description

USB Mass Storage Device Class (MSC) driver.

This work is licensed under TURNSTONE OS Public License. Please read and understand latest version of Licence.