Merge branch 'master' of git://git.ucc.asn.au/acess2
[tpg/acess2.git] / Modules / USB / Core / usb.c
1 /*
2  * Acess 2 USB Stack
3  * USB Packet Control
4  */
5 #define DEBUG   1
6 #include <acess.h>
7 #include <vfs.h>
8 #include <drv_pci.h>
9 #include "usb.h"
10
11
12 // === CODE ===
13 void USB_MakeToken(void *Buf, int PID, int Addr, int EndP)
14 {
15         Uint8   *tok = Buf;
16          int    crc = 0;
17         
18         tok[0] = PID & 0xFF;
19         tok[1] = (Addr & 0x7F) | ((EndP&1)<<7);
20         tok[2] = ((EndP >> 1) & 0x7) | crc;
21 }
22
23 #if 0
24 void USB_SendData(int Controller, int Dev, int Endpoint, void *Data, int Length)
25 {
26         Uint8   buf[Length+3+2/*?*/];
27         
28         USB_MakeToken(buf, PID_DATA0, Dev, Endpoint);
29         
30         switch(Controller & 0xF00)
31         {
32         case 1: // UHCI
33                 UHCI_SendPacket(Controller & 0xFF);
34                 break;
35         }
36 }
37 #endif

UCC git Repository :: git.ucc.asn.au