Subversion Repositories Kolibri OS

Rev

Rev 1613 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1613 Rev 1616
Line 1... Line 1...
1
#include 
1
#include 
2
#include 
2
#include 
3
#include 
3
#include 
4
 
-
 
5
//#include 
-
 
6
//#include 
4
#include 
7
//#include 
-
 
8
 
-
 
9
 
-
 
10
#include 
5
#include 
11
#include "usb.h"
6
#include "usb.h"
Line 12... Line -...
12
 
-
 
13
 
7
 
Line 14... Line 8...
14
int __stdcall srv_usb(ioctl_t *io);
8
int __stdcall srv_usb(ioctl_t *io);
Line 15... Line 9...
15
 
9
 
16
bool init_hc(hc_t *hc);
-
 
Line 17... Line 10...
17
 
10
bool init_hc(hc_t *hc);
18
static slab_t   qh_slab;
11
 
19
static slab_t   td_slab;
12
static slab_t   qh_slab;
Line 61... Line 54...
61
        p->r1     = 0;
54
        p->r1     = 0;
62
     };
55
     };
63
 
56
 
64
     td_slab.available = 128;
57
    hc = (hc_t*)hc_list.next;
Line 65... Line -...
65
     td_slab.start     = KernelAlloc(4096);
-
 
66
     td_slab.nextavail = (addr_t)td_slab.start;
-
 
67
     td_slab.dma       = GetPgAddr(td_slab.start);
-
 
68
 
-
 
69
     td_t *td;
-
 
70
     for (i = 0, td = (td_t*)td_slab.start, dma = td_slab.dma;
-
 
71
          i < 128; i++, td++, dma+= sizeof(td_t))
-
 
72
     {
-
 
73
        td->link   = (addr_t)(td+1);
-
 
74
        td->status = 0;
-
 
75
        td->token  = 0;
-
 
76
        td->buffer = 0;
-
 
77
        td->dma    = dma;
-
 
78
     };
-
 
79
 
-
 
80
 
-
 
81
    hc = (hc_t*)hc_list.next;
-
 
82
 
58
 
Line 83... Line 59...
83
    while( &hc->list != &hc_list)
59
    while( &hc->list != &hc_list)
84
    {
60
    {
85
        init_hc(hc);
61
        hc_t *tmp = hc;
86
        hc = (hc_t*)hc->list.next;
62
        hc = (hc_t*)hc->list.next;
-
 
63
 
-
 
64
        if( !init_hc(tmp))
-
 
65
            list_del(&tmp->list);
87
    }
66
    };
Line 88... Line 67...
88
 
67
 
Line 89... Line 68...
89
    dbgprintf("\n");
68
    dbgprintf("\n");
90
 
69
 
Line 182... Line 161...
182
     qh_slab.available++;
161
     qh_slab.available++;
183
};
162
};
184
 
163
 
185
static td_t* alloc_td()
164
 
Line 186... Line -...
186
{
-
 
187
    if( td_slab.available )
-
 
188
    {
-
 
189
        td_t *td;
-
 
190
 
-
 
191
        td_slab.available--;
-
 
192
        td = (td_t*)td_slab.nextavail;
-
 
193
        td_slab.nextavail = td->link;
-
 
194
        return td;
-
 
195
     }
-
 
196
     return NULL;
-
 
197
};
-
 
198
 
-
 
199
static void  free_td(td_t *td)
-
 
200
{
-
 
201
     td->link = td_slab.nextavail;
-
 
202
     td_slab.nextavail = (addr_t)td;
-
 
203
     td_slab.available++;
-
 
204
};
-
 
205
 
-
 
Line 206... Line 165...
206
#include "pci.inc"
165
#include "pci.inc"
207
#include "detect.inc"
166
#include "detect.inc"
208
#include "hcd.inc"
167
#include "hcd.inc"
209
#include "hid.inc"
168
#include "hid.inc"