/
mass_storage.h
54 lines (45 loc) · 1.74 KB
/
mass_storage.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/**
* @file drivers/usb/host/class/mass_storage.h
*
* @section License
* Copyright (C) 2014-2016, Erik Moqvist
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* This file is part of the Simba project.
*/
#ifndef __DRIVERS_USB_HOST_CLASS_MASS_STORAGE_H__
#define __DRIVERS_USB_HOST_CLASS_MASS_STORAGE_H__
#include "simba.h"
struct usb_host_class_mass_storage_device_t {
uint8_t buf[1];
};
struct usb_host_class_mass_storage_driver_t {
struct usb_host_driver_t *usb_p;
struct usb_host_class_mass_storage_device_t *devices_p;
size_t length;
struct {
size_t size;
} report;
struct usb_host_device_driver_t device_driver;
};
int usb_host_class_mass_storage_init(struct usb_host_class_mass_storage_driver_t *self_p,
struct usb_host_driver_t *usb_p,
struct usb_host_class_mass_storage_device_t *devices_p,
size_t length);
int usb_host_class_mass_storage_start(struct usb_host_class_mass_storage_driver_t *self_p);
int usb_host_class_mass_storage_stop(struct usb_host_class_mass_storage_driver_t *self_p);
ssize_t usb_host_class_mass_storage_device_read(
struct usb_host_device_t *device_p,
void *buf_p,
size_t address,
size_t size);
#endif