driver interface to OS implemented and tested
This commit is contained in:
@@ -908,7 +908,7 @@ static void hc_free_buffers(struct ehci *ehci)
|
||||
|
||||
if (ehci->descriptor != NULL)
|
||||
{
|
||||
usb_free(ehci->descriptor);
|
||||
driver_mem_free(ehci->descriptor);
|
||||
ehci->descriptor = NULL;
|
||||
}
|
||||
|
||||
@@ -916,20 +916,20 @@ static void hc_free_buffers(struct ehci *ehci)
|
||||
{
|
||||
if (ehci->td_unaligned[i] != NULL)
|
||||
{
|
||||
usb_free(ehci->td_unaligned[i]);
|
||||
driver_mem_free(ehci->td_unaligned[i]);
|
||||
ehci->td_unaligned[i] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (ehci->qh_unaligned != NULL)
|
||||
{
|
||||
usb_free(ehci->qh_unaligned);
|
||||
driver_mem_free(ehci->qh_unaligned);
|
||||
ehci->qh_unaligned = NULL;
|
||||
}
|
||||
|
||||
if (ehci->qh_list_unaligned != NULL)
|
||||
{
|
||||
usb_free(ehci->qh_list_unaligned);
|
||||
driver_mem_free(ehci->qh_list_unaligned);
|
||||
ehci->qh_list_unaligned = NULL;
|
||||
}
|
||||
}
|
||||
@@ -952,7 +952,7 @@ int ehci_usb_lowlevel_init(long handle, const struct pci_device_id *ent, void **
|
||||
else if (!gehci.handle) /* for restart USB cmd */
|
||||
return(-1);
|
||||
|
||||
gehci.qh_list_unaligned = (struct QH *)usb_malloc(sizeof(struct QH) + 32);
|
||||
gehci.qh_list_unaligned = (struct QH *)driver_mem_alloc(sizeof(struct QH) + 32);
|
||||
if (gehci.qh_list_unaligned == NULL)
|
||||
{
|
||||
debug("QHs malloc failed");
|
||||
@@ -962,7 +962,7 @@ int ehci_usb_lowlevel_init(long handle, const struct pci_device_id *ent, void **
|
||||
|
||||
gehci.qh_list = (struct QH *)(((uint32_t)gehci.qh_list_unaligned + 31) & ~31);
|
||||
memset(gehci.qh_list, 0, sizeof(struct QH));
|
||||
gehci.qh_unaligned = (struct QH *)usb_malloc(sizeof(struct QH) + 32);
|
||||
gehci.qh_unaligned = (struct QH *)driver_mem_alloc(sizeof(struct QH) + 32);
|
||||
|
||||
if (gehci.qh_unaligned == NULL)
|
||||
{
|
||||
@@ -975,7 +975,7 @@ int ehci_usb_lowlevel_init(long handle, const struct pci_device_id *ent, void **
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
gehci.td_unaligned[i] = (struct qTD *)usb_malloc(sizeof(struct qTD) + 32);
|
||||
gehci.td_unaligned[i] = (struct qTD *)driver_mem_alloc(sizeof(struct qTD) + 32);
|
||||
if (gehci.td_unaligned[i] == NULL)
|
||||
{
|
||||
debug("TDs malloc failed");
|
||||
@@ -986,7 +986,7 @@ int ehci_usb_lowlevel_init(long handle, const struct pci_device_id *ent, void **
|
||||
memset(gehci.td[i], 0, sizeof(struct qTD));
|
||||
}
|
||||
|
||||
gehci.descriptor = (struct descriptor *)usb_malloc(sizeof(struct descriptor));
|
||||
gehci.descriptor = (struct descriptor *)driver_mem_alloc(sizeof(struct descriptor));
|
||||
if (gehci.descriptor == NULL)
|
||||
{
|
||||
debug("decriptor malloc failed");
|
||||
|
||||
@@ -226,7 +226,7 @@ static void urb_free_priv(urb_priv_t *urb)
|
||||
}
|
||||
}
|
||||
}
|
||||
/* FIXME: usb_free(urb); */
|
||||
/* FIXME: driver_mem_free(urb); */
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
@@ -1509,7 +1509,7 @@ static int submit_common_msg(ohci_t *ohci, struct usb_device *dev, uint32_t pipe
|
||||
int stat = 0;
|
||||
int maxsize = usb_maxpacket(dev, pipe);
|
||||
int timeout;
|
||||
urb_priv_t *urb = (urb_priv_t *) usb_malloc(sizeof(urb_priv_t));
|
||||
urb_priv_t *urb = (urb_priv_t *) driver_mem_alloc(sizeof(urb_priv_t));
|
||||
|
||||
if (urb == NULL)
|
||||
{
|
||||
@@ -2021,17 +2021,17 @@ static void hc_free_buffers(ohci_t *ohci)
|
||||
{
|
||||
if (ohci->td_unaligned != NULL)
|
||||
{
|
||||
/* FIXME: usb_free(ohci->td_unaligned); */
|
||||
/* FIXME: driver_mem_free(ohci->td_unaligned); */
|
||||
ohci->td_unaligned = NULL;
|
||||
}
|
||||
if (ohci->ohci_dev_unaligned != NULL)
|
||||
{
|
||||
/* FIXME: usb_free(ohci->ohci_dev_unaligned); */
|
||||
/* FIXME: driver_mem_free(ohci->ohci_dev_unaligned); */
|
||||
ohci->ohci_dev_unaligned = NULL;
|
||||
}
|
||||
if (ohci->hcca_unaligned != NULL)
|
||||
{
|
||||
/* FIXME: usb_free(ohci->hcca_unaligned); */
|
||||
/* FIXME: driver_mem_free(ohci->hcca_unaligned); */
|
||||
ohci->hcca_unaligned = NULL;
|
||||
}
|
||||
}
|
||||
@@ -2060,7 +2060,7 @@ int ohci_usb_lowlevel_init(int32_t handle, const struct pci_device_id *ent, void
|
||||
ohci->controller = (ohci->handle >> 16) & 3; /* PCI function */
|
||||
|
||||
/* this must be aligned to a 256 byte boundary */
|
||||
ohci->hcca_unaligned = (struct ohci_hcca *) usb_malloc(sizeof(struct ohci_hcca) + 256);
|
||||
ohci->hcca_unaligned = (struct ohci_hcca *) driver_mem_alloc(sizeof(struct ohci_hcca) + 256);
|
||||
if (ohci->hcca_unaligned == NULL)
|
||||
{
|
||||
err("HCCA malloc failed");
|
||||
@@ -2071,7 +2071,7 @@ int ohci_usb_lowlevel_init(int32_t handle, const struct pci_device_id *ent, void
|
||||
ohci->hcca = (struct ohci_hcca *) (((uint32_t)ohci->hcca_unaligned + 255) & ~255);
|
||||
memset(ohci->hcca, 0, sizeof(struct ohci_hcca));
|
||||
info("aligned ghcca %p", ohci->hcca);
|
||||
ohci->ohci_dev_unaligned = (struct ohci_device *) usb_malloc(sizeof(struct ohci_device) + 8);
|
||||
ohci->ohci_dev_unaligned = (struct ohci_device *) driver_mem_alloc(sizeof(struct ohci_device) + 8);
|
||||
if (ohci->ohci_dev_unaligned == NULL)
|
||||
{
|
||||
err("EDs malloc failed");
|
||||
@@ -2082,7 +2082,7 @@ int ohci_usb_lowlevel_init(int32_t handle, const struct pci_device_id *ent, void
|
||||
memset(ohci->ohci_dev, 0, sizeof(struct ohci_device));
|
||||
info("aligned EDs %p", ohci->ohci_dev);
|
||||
|
||||
ohci->td_unaligned = (struct td *) usb_malloc(sizeof(struct td) * (NUM_TD + 1));
|
||||
ohci->td_unaligned = (struct td *) driver_mem_alloc(sizeof(struct td) * (NUM_TD + 1));
|
||||
if (ohci->td_unaligned == NULL)
|
||||
{
|
||||
err("TDs malloc failed");
|
||||
|
||||
@@ -148,6 +148,7 @@ __attribute__((interrupt)) void xlb_pci_interrupt(void)
|
||||
|
||||
__attribute__((interrupt)) void pci_interrupt(void)
|
||||
{
|
||||
debug_printf("PCI interrupt\r\n");
|
||||
}
|
||||
|
||||
static int32_t pci_get_interrupt_cause(int32_t *handles)
|
||||
@@ -646,7 +647,7 @@ static void pci_device_config(uint16_t bus, uint16_t device, uint16_t function)
|
||||
|
||||
/* check if device requests an interrupt */
|
||||
il = pci_read_config_byte(handle, PCIIPR);
|
||||
xprintf("device requests interrupts on interrupt pin %d\r\n", il);
|
||||
debug_printf("device requests interrupts on interrupt pin %d\r\n", il);
|
||||
|
||||
/* if so, register interrupts */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user