*
* Store this function in the HCD's struct pci_driver as probe().
*/
-int STDCALL usb_hcd_pci_probe (struct pci_dev *dev, const struct pci_device_id *id)
+int STDCALL
+usb_hcd_pci_probe (struct pci_dev *dev, const struct pci_device_id *id)
{
struct hc_driver *driver;
PHYSICAL_ADDRESS resource;
const char *description; /* "ehci-hcd" etc */
/* irq handler */
- void (*irq) (struct usb_hcd *hcd, struct pt_regs *regs);
+ int (*irq) (struct usb_hcd *hcd, struct pt_regs *regs);
int flags;
#define HCD_MEMORY 0x0001 /* HC regs use memory (else I/O) */
might_sleep ();
if (!dev) {
- pr_debug ("%s nodev\n", __FUNCTION__);
+// pr_debug ("%s nodev\n", __FUNCTION__);
+ DPRINT ("%s nodev\n", __FUNCTION__);
return;
}
bus = dev->bus;
if (!bus) {
- pr_debug ("%s nobus\n", __FUNCTION__);
+// pr_debug ("%s nobus\n", __FUNCTION__);
+ DPRINT ("%s nobus\n", __FUNCTION__);
return;
}
ops = bus->op;
#include <ddk/ntddk.h>
#include <debug.h>
-NTSTATUS AddDevice(PDRIVER_OBJECT DriverObject, PDEVICE_OBJECT pdo)
+NTSTATUS STDCALL
+AddDevice(PDRIVER_OBJECT DriverObject, PDEVICE_OBJECT pdo)
{
DbgPrint("usbcore: AddDevice called\n");
return STATUS_SUCCESS;
}
-VOID DriverUnload(PDRIVER_OBJECT DriverObject)
+VOID STDCALL
+DriverUnload(PDRIVER_OBJECT DriverObject)
{
// nothing to do here yet
}
// Dispatch PNP
-NTSTATUS DispatchPnp(PDEVICE_OBJECT fdo, PIRP Irp)
+NTSTATUS STDCALL
+DispatchPnp(PDEVICE_OBJECT fdo, PIRP Irp)
{
ULONG fcn;
PIO_STACK_LOCATION stack;
return STATUS_SUCCESS;
}
-NTSTATUS DispatchPower(PDEVICE_OBJECT fido, PIRP Irp)
+NTSTATUS STDCALL
+DispatchPower(PDEVICE_OBJECT fido, PIRP Irp)
{
DbgPrint("IRP_MJ_POWER dispatch\n");
return STATUS_SUCCESS;
(void) readl (&ohci->regs->control);
// POTPGT delay is bits 24-31, in 2 ms units.
- mdelay ((roothub_a (ohci) >> 23) & 0x1fe);
+ mdelay (((int)(roothub_a (ohci) >> 23) & 0x1fe));
/* connect the virtual root hub */
bus = hcd_to_bus (&ohci->hcd);
/* an interrupt happens */
-static void ohci_irq (struct usb_hcd *hcd, struct pt_regs *ptregs)
+static
+int ohci_irq (struct usb_hcd *hcd, struct pt_regs *ptregs)
{
struct ohci_hcd *ohci = hcd_to_ohci (hcd);
struct ohci_regs *regs = ohci->regs;
} else if ((ints = readl (®s->intrstatus)) == ~(u32)0) {
disable (ohci);
ohci_dbg (ohci, "device removed!\n");
- return;
+ return 0;
/* interrupt for some other device? */
} else if ((ints &= readl (®s->intrenable)) == 0) {
- return;
+ return 0;
}
if (ints & OHCI_INTR_UE) {
writel (OHCI_INTR_MIE, ®s->intrenable);
// flush those pci writes
(void) readl (&ohci->regs->control);
+ return 0;
}
/*-------------------------------------------------------------------------*/
struct list_head node;
char *name;
const struct pci_device_id *id_table; /* must be non-NULL for probe to be called */
- int (*probe) (struct pci_dev *dev, const struct pci_device_id *id); /* New device inserted */
- void (*remove) (struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */
+ int STDCALL (*probe) (struct pci_dev *dev, const struct pci_device_id *id); /* New device inserted */
+ void STDCALL (*remove) (struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */
int (*save_state) (struct pci_dev *dev, u32 state); /* Save Device Context */
int (*suspend) (struct pci_dev *dev, u32 state); /* Device suspended */
int (*resume) (struct pci_dev *dev); /* Device woken up */
#define inw(x) READ_PORT_USHORT((PUSHORT)(x))
#define outw(x,p) WRITE_PORT_USHORT((PUSHORT)(p),(x))
-#define outl(x,p) WRITE_PORT_ULONG((PUSHORT)(p),(x))
+#define outl(x,p) WRITE_PORT_ULONG((PULONG)(p),(x))
/* The kernel macro for list_for_each_entry makes nonsense (have no clue
* why, this is just the same definition...) */
#define __KERNEL_DS 0x18
+int my_pci_write_config_word(struct pci_dev *, int, u16);
#define PCI_DEVICE_ID_NS_87560_LIO 0x000e
#define PCI_DEVICE_ID_INTEL_82371AB_2 0x7112
-#define PCI_CLASS_SERIAL_USB (PCI_CLASS_SERIAL_BUS_CTLR << 8 + PCI_SUBCLASS_SB_USB)
+#define PCI_CLASS_SERIAL_USB ((PCI_CLASS_SERIAL_BUS_CTLR << 8) + PCI_SUBCLASS_SB_USB)
#endif
O_TARGET := usbwrapper.o BootUSB.o linuxwrapper.o xpad.o xremote.o usbkey.o risefall.o
include $(TOPDIR)/Rules.make
+
{
int n;
// printk("handle irqs\n");
+ DPRINT1("Handle Irqs\n");
for(n=0;n<MAX_IRQS;n++)
{
if (reg_irqs[n].handler && (irq==reg_irqs[n].irq || irq==-1))
main_timer_list[n]=NULL; // remove timer
// printk("do timer %i fn %p\n",n,function);
+ DPRINT1("do timer %i fn %p\n",n,function);
function(data);
}
{
int n,found=0;
// printk("drv_num %i %p %p\n",drvs_num,m_drivers[0]->probe,m_drivers[1]->probe);
+ DPRINT1("drv_num %i %p %p\n",drvs_num,m_drivers[0]->probe,m_drivers[1]->probe);
+
if (dev->driver)
{
if (dev->driver->probe)
{
dev->driver=m_drivers[n];
// printk("probe%i %p ",n,m_drivers[n]->probe);
+ DPRINT1("probe%i %p ",n,m_drivers[n]->probe);
+
if (m_drivers[n]->probe(dev) == 0)
{
// return 0;
if (drvs_num<MAX_DRVS)
{
// printk("driver_register %i: %p %p",drvs_num,driver,driver->probe);
+ DPRINT1("driver_register %i: %p %p",drvs_num,driver,driver->probe);
+
m_drivers[drvs_num++]=driver;
return 0;
}
int wait=1;
x+=10; // safety
// printk("schedule_timeout %i\n",x);
+ DPRINT1("schedule_timeout %i\n",x);
+
while(x>0)
{
do_all_timers();
}
need_wakeup=0;
// printk("schedule DONE!!!!!!\n");
+ DPRINT1("schedule DONE!!!!!!\n");
+
return x;
}
/*------------------------------------------------------------------------*/
{
int n=100;
// printk("wait for completion\n");
+ DPRINT1("wait for completion\n");
+
while(!x->done && (n>0))
{
do_all_timers();
n--;
}
// printk("wait for completion done %i\n",x->done);
+ DPRINT1("wait for completion done %i\n",x->done);
+
}
/*------------------------------------------------------------------------*/
void my_interruptible_sleep_on(PKEVENT evnt)
const struct pci_device_id *id=NULL;
if (!pci_probe_dev)
{
- printk(KERN_ERR "PCI device not set!\n");
+ DPRINT1("PCI device not set!\n");
return 0;
}
x->probe(dev, id);
spin_unlock_irqrestore(&uhci->urb_remove_list_lock, flags);
}
-static void uhci_irq(struct usb_hcd *hcd, struct pt_regs *regs)
+static int uhci_irq(struct usb_hcd *hcd, struct pt_regs *regs)
{
struct uhci_hcd *uhci = hcd_to_uhci(hcd);
unsigned int io_addr = uhci->io_addr;
*/
status = inw(io_addr + USBSTS);
if (!status) /* shared interrupt, not mine */
- return;
+ return 0;
outw(status, io_addr + USBSTS); /* Clear it */
if (status & ~(USBSTS_USBINT | USBSTS_ERROR | USBSTS_RD)) {
spin_unlock(&uhci->urb_list_lock);
uhci_finish_completion(hcd, regs);
+
+ return 0;
}
static void reset_hc(struct uhci_hcd *uhci)
err("unable to allocate root hub");
goto err_alloc_root_hub;
}
- hcd->pdev->bus = udev; /* Fix bus pointer for initial device */
+ hcd->pdev->bus = (struct pci_bus *)udev; /* Fix bus pointer for initial device */
uhci->term_td = uhci_alloc_td(uhci, udev);
if (!uhci->term_td) {