Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 2017 → Rev 2111

/drivers/usb/uhci/hcd.inc
54,6 → 54,10
/* Turn off PIRQ enable and SMI enable. (This also turns off the
* BIOS's USB Legacy Support.) Turn off all the R/WC bits too.
*/
 
out16(hc->iobase + UHCI_USBCMD, 0);
out16(hc->iobase + UHCI_USBINTR, 0);
 
pciWriteWord(hc->PciTag, UHCI_USBLEGSUP, UHCI_USBLEGSUP_RWC);
 
/* Reset the HC - this will force us to get a
120,32 → 124,24
return 1;
}
 
void hc_interrupt()
int hc_interrupt(void *data)
{
hc_t *hc;
hc_t *hc = (hc_t*)data;
 
// printf("USB interrupt\n");
 
hc = (hc_t*)hc_list.next;
 
while( &hc->list != &hc_list)
{
hc_t *htmp;
request_t *rq;
u16_t status;
 
htmp = hc;
status = in16(hc->iobase + USBSTS);
if (!(status & ~USBSTS_HCH)) /* shared interrupt, not mine */
return 0;
 
hc = (hc_t*)hc->list.next;
out16(hc->iobase + USBSTS, status); /* Clear it */
 
status = in16(htmp->iobase + USBSTS);
if (!(status & ~USBSTS_HCH)) /* shared interrupt, not mine */
continue;
out16(htmp->iobase + USBSTS, status); /* Clear it */
rq = (request_t*)hc->rq_list.next;
 
rq = (request_t*)htmp->rq_list.next;
 
while( &rq->list != &htmp->rq_list)
while( &rq->list != &hc->rq_list)
{
request_t *rtmp;
td_t *td;
162,7 → 158,8
 
RaiseEvent(rtmp->evh, 0, &rtmp->event);
};
}
 
return 1;
};
 
 
263,8 → 260,14
 
out16(hc->iobase + UHCI_USBINTR, 4);
 
AttachIntHandler(hc->irq_line, hc_interrupt, 0);
printf("set handler %d ", hc->irq_line);
delay(100/10);
AttachIntHandler(hc->irq_line, hc_interrupt, hc);
printf("done\n");
 
delay(100/10);
 
 
pciWriteWord(hc->PciTag, UHCI_USBLEGSUP, UHCI_USBLEGSUP_DEFAULT);
 
out16(hc->iobase + USBCMD, USBCMD_RS | USBCMD_CF |
588,7 → 591,7
 
safe_sti(efl);
 
WaitEvent(rq->evh.handle, rq->evh.euid);
WaitEvent(rq->evh);
 
dbgprintf("td0 status 0x%0x\n", td0->status);
dbgprintf("td status 0x%0x\n", td->status);
/drivers/usb/uhci/hid.inc
121,6 → 121,7
struct boot_packet *pkt;
pkt = (struct boot_packet *)rq->data;
SetMouseData(pkt->buttons, pkt->x, -pkt->y, -pkt->z, 0);
memset(pkt,0, sizeof(*pkt));
};
td->status = TD_CTRL_ACTIVE | TD_CTRL_IOC | dev->speed;
td->token ^= DATA1;
/drivers/usb/uhci/makefile
1,14 → 1,12
 
CC = gcc
 
 
DRV_DIR = $(CURDIR)/../..
 
DRV_INCLUDES = $(DRV_DIR)/include
 
INCLUDES = -I$(DRV_INCLUDES) -I$(DRV_INCLUDES)/linux
 
INCLUDES = -I$(DRV_INCLUDES) -I$(DRV_DIR)/include/linux
 
DEFINES = -D__KERNEL__ -DCONFIG_X86_32
 
CFLAGS = -c -O2 -fomit-frame-pointer -fno-builtin-printf
/drivers/usb/uhci/pci.inc
1,5 → 1,23
 
#define PCI_MAP_REG_START 0x10
#define PCI_MAP_ROM_REG 0x30
 
#define PCI_MAP_MEMORY 0x00000000
#define PCI_MAP_IO 0x00000001
 
#define PCI_MAP_MEMORY_TYPE 0x00000007
#define PCI_MAP_IO_TYPE 0x00000003
 
#define PCI_MAP_MEMORY_TYPE_32BIT 0x00000000
#define PCI_MAP_MEMORY_TYPE_32BIT_1M 0x00000002
#define PCI_MAP_MEMORY_TYPE_64BIT 0x00000004
#define PCI_MAP_MEMORY_TYPE_MASK 0x00000006
#define PCI_MAP_MEMORY_CACHABLE 0x00000008
#define PCI_MAP_MEMORY_ATTR_MASK 0x0000000e
#define PCI_MAP_MEMORY_ADDRESS_MASK 0xfffffff0
 
#define PCI_MAP_IO_ATTR_MASK 0x00000003
 
u32_t pciGetBaseSize(int bus, int devfn, int index,
bool destructive, bool *min)
{
/drivers/usb/uhci/usb.c
2,6 → 2,7
 
#include <ddk.h>
#include <mutex.h>
#include <linux/errno.h>
#include <pci.h>
#include <linux/dmapool.h>
#include <linux/string.h>