Subversion Repositories Kolibri OS

Rev

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

Rev 1430 Rev 1600
Line -... Line 1...
-
 
1
#include 
1
#include "types.h"
2
#include 
2
#include "link.h"
3
#include 
Line 3... Line 4...
3
 
4
 
4
#include 
5
//#include 
5
#include 
6
//#include 
Line 6... Line -...
6
#include 
-
 
Line 7... Line 7...
7
 
7
//#include 
8
#include "pci.h"
8
 
Line 9... Line 9...
9
 
9
 
Line 10... Line 10...
10
#include "syscall.h"
10
#include 
Line 11... Line 11...
11
#include "usb.h"
11
#include "usb.h"
12
 
12
 
Line 13... Line 13...
13
 
13
 
14
int __stdcall srv_usb(ioctl_t *io);
14
int __stdcall srv_usb(ioctl_t *io);
15
 
15
 
Line 16... Line 16...
16
Bool init_hc(hc_t *hc);
16
bool init_hc(hc_t *hc);
17
 
17
 
18
static slab_t   qh_slab;
18
static slab_t   qh_slab;
19
static slab_t   td_slab;
19
static slab_t   td_slab;
20
 
20
 
Line 39... Line 39...
39
        return 0;
39
        return 0;
40
    }
40
    }
41
 
41
 
42
    list_initialize(&hc_list);
42
    if( !FindUSBControllers() ) {
Line 43... Line -...
43
    list_initialize(&newdev_list);
-
 
44
    list_initialize(&rq_list);
-
 
45
 
-
 
46
    if( !FindPciDevice() ) {
-
 
47
        dbgprintf("no uhci devices found\n");
43
        dbgprintf("no uhci devices found\n");
48
        return 0;
44
        return 0;
49
    };
45
    };
50
 
46
 
Line 51... Line 47...
51
     qh_slab.available = 256;
47
     qh_slab.available = 256;
Line 84... Line 80...
84
 
80
 
Line 85... Line 81...
85
    hc = (hc_t*)hc_list.next;
81
    hc = (hc_t*)hc_list.next;
Line 86... Line 82...
86
 
82
 
87
    while( &hc->link != &hc_list)
83
    while( &hc->list != &hc_list)
88
    {
84
    {
89
        init_hc(hc);
85
        init_hc(hc);
90
        hc = (hc_t*)hc->link.next;
86
        hc = (hc_t*)hc->list.next;
Line 91... Line 87...
91
    }
87
    }
Line 92... Line 88...
92
 
88
 
93
    dbgprintf("\n");
89
    dbgprintf("\n");
94
 
90
 
95
    dev = (udev_t*)newdev_list.next;
91
    dev = (udev_t*)newdev_list.next;
96
    while( &dev->link != &newdev_list)
92
    while( &dev->list != &newdev_list)
Line 97... Line 93...
97
    {
93
    {
98
        udev_t *tmp = dev;
94
        udev_t *tmp = dev;
99
        dev = (udev_t*)dev->link.next;
95
        dev = (udev_t*)dev->list.next;
Line 108... Line 104...
108
        request_t *rq;
104
        request_t *rq;
109
 
105
 
110
        rq = (request_t*)rq_list.next;
106
        rq = (request_t*)rq_list.next;
Line 111... Line 107...
111
        while( &rq->link != &rq_list)
107
        while( &rq->list != &rq_list)
112
        {
108
        {
113
            qh_t      *qh;
109
            qh_t      *qh;
114
            td_t      *td;
110
            td_t      *td;
115
 
111
 
Line 116... Line 112...
116
            td  = rq->td_head;
112
            td  = rq->td_head;
Line 120... Line 116...
120
            qh->qelem = td->dma;
116
            qh->qelem = td->dma;
Line 121... Line 117...
121
 
117
 
Line 122... Line 118...
122
            __asm__ __volatile__ ("":::"memory");
118
            __asm__ __volatile__ ("":::"memory");
123
            rq = (request_t*)rq->link.next;
119
            rq = (request_t*)rq->list.next;
124
        };
120
        };
Line 125... Line 121...
125
 
121
 
Line 126... Line 122...
126
        delay(10/10);
122
        delay(10/10);
127
 
123
 
128
        rq = (request_t*)rq_list.next;
124
        rq = (request_t*)rq_list.next;
129
        while( &rq->link != &rq_list)
125
        while( &rq->list != &rq_list)
130
        {
126
        {
Line 131... Line 127...
131
            request_t *tmp;
127
            request_t *tmp;
132
            td_t      *td;
128
            td_t      *td;
Line 133... Line 129...
133
 
129
 
Line 134... Line 130...
134
            tmp = rq;
130
            tmp = rq;
135
            rq = (request_t*)rq->link.next;
131
            rq = (request_t*)rq->list.next;