XenevaOS
Loading...
Searching...
No Matches
usbmassdevice.h
Go to the documentation of this file.
1//
2// usbmassdevice.h
3//
4// USPi - An USB driver for Raspberry Pi written in C
5// Copyright (C) 2014-2018 R. Stange <rsta2@o2online.de>
6//
7// This program is free software: you can redistribute it and/or modify
8// it under the terms of the GNU General Public License as published by
9// the Free Software Foundation, either version 3 of the License, or
10// (at your option) any later version.
11//
12// This program is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15// GNU General Public License for more details.
16//
17// You should have received a copy of the GNU General Public License
18// along with this program. If not, see <http://www.gnu.org/licenses/>.
19//
20#ifndef _uspi_usbmassdevice_h
21#define _uspi_usbmassdevice_h
22
23#include "uspi/usbfunction.h"
24#include "uspi/usbendpoint.h"
25#include "uspi/types.h"
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31#define UMSD_BLOCK_SIZE 512
32#define UMSD_BLOCK_MASK (UMSD_BLOCK_SIZE-1)
33#define UMSD_BLOCK_SHIFT 9
34
35#define UMSD_MAX_OFFSET 0x1FFFFFFFFFFULL // 2TB
36
49
52
54
55int USBBulkOnlyMassStorageDeviceRead (TUSBBulkOnlyMassStorageDevice *pThis, void *pBuffer, unsigned nCount);
56int USBBulkOnlyMassStorageDeviceWrite (TUSBBulkOnlyMassStorageDevice *pThis, const void *pBuffer, unsigned nCount);
57
58unsigned long long USBBulkOnlyMassStorageDeviceSeek (TUSBBulkOnlyMassStorageDevice *pThis, unsigned long long ullOffset);
59
61
62#ifdef __cplusplus
63}
64#endif
65
66#endif
Definition usbmassdevice.h:38
unsigned m_nBlockCount
Definition usbmassdevice.h:45
TUSBFunction m_USBFunction
Definition usbmassdevice.h:39
unsigned m_nCWBTag
Definition usbmassdevice.h:44
TUSBEndpoint * m_pEndpointOut
Definition usbmassdevice.h:42
unsigned long long m_ullOffset
Definition usbmassdevice.h:46
TUSBEndpoint * m_pEndpointIn
Definition usbmassdevice.h:41
Definition usbendpoint.h:41
Definition usbfunction.h:33
int USBBulkOnlyMassStorageDeviceWrite(TUSBBulkOnlyMassStorageDevice *pThis, const void *pBuffer, unsigned nCount)
Definition usbmassdevice.c:452
void USBBulkOnlyMassStorageDevice(TUSBBulkOnlyMassStorageDevice *pThis, TUSBFunction *pFunction)
Definition usbmassdevice.c:212
void _USBBulkOnlyMassStorageDevice(TUSBBulkOnlyMassStorageDevice *pThis)
Definition usbmassdevice.c:226
unsigned USBBulkOnlyMassStorageDeviceGetCapacity(TUSBBulkOnlyMassStorageDevice *pThis)
Definition usbmassdevice.c:488
boolean USBBulkOnlyMassStorageDeviceConfigure(TUSBFunction *pUSBFunction)
Definition usbmassdevice.c:247
int USBBulkOnlyMassStorageDeviceRead(TUSBBulkOnlyMassStorageDevice *pThis, void *pBuffer, unsigned nCount)
Definition usbmassdevice.c:425
unsigned long long USBBulkOnlyMassStorageDeviceSeek(TUSBBulkOnlyMassStorageDevice *pThis, unsigned long long ullOffset)
Definition usbmassdevice.c:479