Subversion Repositories Kolibri OS

Rev

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

Rev 1875 Rev 2111
Line 52... Line 52...
52
{
52
{
53
	/* Turn off PIRQ enable and SMI enable.  (This also turns off the
53
	/* Turn off PIRQ enable and SMI enable.  (This also turns off the
54
	 * BIOS's USB Legacy Support.)  Turn off all the R/WC bits too.
54
	 * BIOS's USB Legacy Support.)  Turn off all the R/WC bits too.
55
	 */
55
	 */
56
    pciWriteWord(hc->PciTag, UHCI_USBLEGSUP, UHCI_USBLEGSUP_RWC);
56
 
-
 
57
    out16(hc->iobase + UHCI_USBCMD, 0);
-
 
58
    out16(hc->iobase + UHCI_USBINTR, 0);
-
 
59
 
-
 
60
    pciWriteWord(hc->PciTag, UHCI_USBLEGSUP, UHCI_USBLEGSUP_RWC);
57
 
61
 
Line 58... Line 62...
58
	/* Reset the HC - this will force us to get a
62
	/* Reset the HC - this will force us to get a
59
	 * new notification of any already connected
63
	 * new notification of any already connected
60
	 * ports due to the virtual disconnect that it
64
	 * ports due to the virtual disconnect that it
Line 118... Line 122...
118
    uhci_reset_hc(hc);
122
    uhci_reset_hc(hc);
119
	return 1;
123
	return 1;
120
}
124
}
121
 
125
 
Line 122... Line 126...
122
void hc_interrupt()
126
int hc_interrupt(void *data)
123
{
127
{
124
    hc_t   *hc;
128
    hc_t   *hc = (hc_t*)data;
Line 125... Line 129...
125
 
129
 
Line 126... Line -...
126
//    printf("USB interrupt\n");
-
 
127
 
-
 
128
    hc = (hc_t*)hc_list.next;
-
 
129
 
-
 
130
    while( &hc->list != &hc_list)
-
 
131
    {
130
   // printf("USB interrupt\n");
132
        hc_t       *htmp;
131
 
Line 133... Line -...
133
        request_t  *rq;
-
 
134
        u16_t  status;
-
 
135
 
-
 
136
        htmp = hc;
-
 
137
 
132
    request_t  *rq;
138
        hc = (hc_t*)hc->list.next;
133
    u16_t  status;
139
 
134
 
-
 
135
    status = in16(hc->iobase + USBSTS);
140
        status = in16(htmp->iobase + USBSTS);
136
    if (!(status & ~USBSTS_HCH))            /* shared interrupt, not mine */
Line 141... Line 137...
141
        if (!(status & ~USBSTS_HCH))            /* shared interrupt, not mine */
137
        return 0;
Line 142... Line 138...
142
            continue;
138
 
143
        out16(htmp->iobase + USBSTS, status);     /* Clear it */
139
    out16(hc->iobase + USBSTS, status);     /* Clear it */
144
 
140
 
145
        rq = (request_t*)htmp->rq_list.next;
141
    rq = (request_t*)hc->rq_list.next;
Line 146... Line 142...
146
 
142
 
Line 160... Line 156...
160
            list_del(&rtmp->list);
156
        list_del(&rtmp->list);
Line 161... Line 157...
161
 
157
 
162
            RaiseEvent(rtmp->evh, 0, &rtmp->event);
158
        RaiseEvent(rtmp->evh, 0, &rtmp->event);
-
 
159
    };
163
        };
160
 
164
    }
161
    return 1;
Line 165... Line 162...
165
};
162
};
Line 261... Line 258...
261
    out16(hc->iobase + USBSTS, 0x3F);
258
    out16(hc->iobase + USBSTS, 0x3F);
Line 262... Line 259...
262
 
259
 
Line -... Line 260...
-
 
260
    out16(hc->iobase + UHCI_USBINTR, 4);
-
 
261
 
263
    out16(hc->iobase + UHCI_USBINTR, 4);
262
    printf("set handler %d  ", hc->irq_line);
-
 
263
    delay(100/10);
-
 
264
    AttachIntHandler(hc->irq_line, hc_interrupt, hc);
-
 
265
    printf("done\n");
-
 
266
 
Line 264... Line 267...
264
 
267
    delay(100/10);
Line 265... Line 268...
265
    AttachIntHandler(hc->irq_line, hc_interrupt, 0);
268
 
266
 
269
 
Line 586... Line 589...
586
    mb();
589
    mb();
Line 587... Line 590...
587
 
590
 
Line 588... Line 591...
588
    safe_sti(efl);
591
    safe_sti(efl);
Line 589... Line 592...
589
 
592
 
590
    WaitEvent(rq->evh.handle, rq->evh.euid);
593
    WaitEvent(rq->evh);
Line 591... Line 594...
591
 
594