XenevaOS
Loading...
Searching...
No Matches
usbrequest.h
Go to the documentation of this file.
1//
2// usbrequest.h
3//
4// USPi - An USB driver for Raspberry Pi written in C
5// Copyright (C) 2014 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_usbrequest_h
21#define _uspi_usbrequest_h
22
23#include "uspi/usb.h"
24#include "uspi/usbendpoint.h"
25#include "uspi/types.h"
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31struct TUSBRequest;
32
33typedef void TURBCompletionRoutine (struct TUSBRequest *pURB, void *pParam, void *pContext);
34
51
52void USBRequest (TUSBRequest *pThis, TUSBEndpoint *pEndpoint, void *pBuffer, u32 nBufLen, TSetupData *pSetupData /* = 0 */);
53void _USBRequest (TUSBRequest *pThis);
54
56
57void USBRequestSetStatus (TUSBRequest *pThis, int bStatus);
58void USBRequestSetResultLen (TUSBRequest *pThis, u32 nLength);
59
62
64void *USBRequestGetBuffer (TUSBRequest *pThis);
66
67void USBRequestSetCompletionRoutine (TUSBRequest *pThis, TURBCompletionRoutine *pRoutine, void *pParam, void *pContext);
69
70#ifdef __cplusplus
71}
72#endif
73
74#endif
uint32_t u32
Definition kernel.h:22
Definition usb.h:54
Definition usbendpoint.h:41
Definition usbrequest.h:36
TUSBEndpoint * m_pEndpoint
Definition usbrequest.h:37
u32 m_nBufLen
Definition usbrequest.h:41
void * m_pCompletionParam
Definition usbrequest.h:47
void * m_pCompletionContext
Definition usbrequest.h:48
TURBCompletionRoutine * m_pCompletionRoutine
Definition usbrequest.h:46
u32 m_nResultLen
Definition usbrequest.h:44
TSetupData * m_pSetupData
Definition usbrequest.h:39
int m_bStatus
Definition usbrequest.h:43
void * m_pBuffer
Definition usbrequest.h:40
int USBRequestGetStatus(TUSBRequest *pThis)
Definition usbrequest.c:69
void USBRequestSetStatus(TUSBRequest *pThis, int bStatus)
Definition usbrequest.c:57
TUSBEndpoint * USBRequestGetEndpoint(TUSBRequest *pThis)
Definition usbrequest.c:50
u32 USBRequestGetBufLen(TUSBRequest *pThis)
Definition usbrequest.c:101
void * USBRequestGetBuffer(TUSBRequest *pThis)
Definition usbrequest.c:92
void USBRequestCallCompletionRoutine(TUSBRequest *pThis)
Definition usbrequest.c:117
void TURBCompletionRoutine(struct TUSBRequest *pURB, void *pParam, void *pContext)
Definition usbrequest.h:33
void USBRequestSetResultLen(TUSBRequest *pThis, u32 nLength)
Definition usbrequest.c:63
u32 USBRequestGetResultLength(TUSBRequest *pThis)
Definition usbrequest.c:75
void _USBRequest(TUSBRequest *pThis)
Definition usbrequest.c:41
TSetupData * USBRequestGetSetupData(TUSBRequest *pThis)
Definition usbrequest.c:83
void USBRequest(TUSBRequest *pThis, TUSBEndpoint *pEndpoint, void *pBuffer, u32 nBufLen, TSetupData *pSetupData)
Definition usbrequest.c:23
void USBRequestSetCompletionRoutine(TUSBRequest *pThis, TURBCompletionRoutine *pRoutine, void *pParam, void *pContext)
Definition usbrequest.c:107