reenable forgotten memory deallocations

This commit is contained in:
Markus Fröschle
2021-07-17 23:06:22 +02:00
parent da982d1e5c
commit 253ba1aec1

View File

@@ -155,7 +155,7 @@ struct pci_device_id ohci_usb_pci_table[] =
/* global ohci_t */ /* global ohci_t */
static ohci_t gohci[10]; static ohci_t gohci[10];
int ohci_inited; static int ohci_inited;
static inline uint32_t roothub_a(volatile ohci_t *ohci) { return readl(&ohci->regs->roothub.a); } static inline uint32_t roothub_a(volatile ohci_t *ohci) { return readl(&ohci->regs->roothub.a); }
static inline uint32_t roothub_b(volatile ohci_t *ohci) { return readl(&ohci->regs->roothub.b); } static inline uint32_t roothub_b(volatile ohci_t *ohci) { return readl(&ohci->regs->roothub.b); }
@@ -287,7 +287,7 @@ void write_registers(volatile ohci_t *ohci)
void dump_hcca(ohci_t *ohci) void dump_hcca(ohci_t *ohci)
{ {
struct ohci_hcca *hcca = ohci->hcca; volatile struct ohci_hcca *hcca = ohci->hcca;
dbg("hcca pad1: 0x%lx\r\n", hcca->pad1); dbg("hcca pad1: 0x%lx\r\n", hcca->pad1);
dbg("hcca frame no: 0x%x\r\n", hcca->frame_no); dbg("hcca frame no: 0x%x\r\n", hcca->frame_no);
@@ -299,6 +299,7 @@ void dump_hcca(ohci_t *ohci)
hexdump(hcca->reserved_for_hc, sizeof(hcca->reserved_for_hc)); hexdump(hcca->reserved_for_hc, sizeof(hcca->reserved_for_hc));
#endif #endif
} }
static struct td *ptd; static struct td *ptd;
/* TDs ... */ /* TDs ... */
@@ -345,7 +346,7 @@ static void urb_free_priv(volatile urb_priv_t *urb)
} }
} }
} }
/* FIXME: driver_mem_free(urb); */ driver_mem_free(urb);
} }
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
@@ -366,8 +367,8 @@ static void pkt_print(ohci_t *ohci, urb_priv_t *purb, struct usb_device *dev,
usb_pipedevice(pipe), usb_pipedevice(pipe),
usb_pipeendpoint(pipe), usb_pipeendpoint(pipe),
usb_pipeout(pipe)? 'O': 'I', usb_pipeout(pipe)? 'O': 'I',
usb_pipetype(pipe) < 2 ? \ usb_pipetype(pipe) < 2 ?
(usb_pipeint(pipe)? "INTR": "ISOC"): \ (usb_pipeint(pipe) ? "INTR": "ISOC") :
(usb_pipecontrol(pipe)? "CTRL": "BULK"), (usb_pipecontrol(pipe)? "CTRL": "BULK"),
(purb ? purb->actual_length : 0), (purb ? purb->actual_length : 0),
transfer_len, dev->status); transfer_len, dev->status);
@@ -521,8 +522,8 @@ static void ohci_dump_roothub(ohci_t *controller, int verbose)
temp = roothub_a(controller); temp = roothub_a(controller);
(void) temp; (void) temp;
// ndp = (temp & RH_A_NDP); ndp = (temp & RH_A_NDP);
ndp = controller->ndp; // ndp = controller->ndp;
if (verbose) if (verbose)
{ {
dbg("roothub.a: %08x POTPGT=%d%s%s%s%s%s NDP=%d\r\n", temp, dbg("roothub.a: %08x POTPGT=%d%s%s%s%s%s NDP=%d\r\n", temp,
@@ -1454,8 +1455,8 @@ static unsigned char root_hub_str_index1[] =
#define OK(x) len = (x); break #define OK(x) len = (x); break
#ifdef DEBUG_OHCI #ifdef DEBUG_OHCI
#define WR_RH_STAT(x) { err("WR:status %#8x", (x)); writel((x), &ohci->regs->roothub.status); } #define WR_RH_STAT(x) { inf("WR:status %#8x", (x)); writel((x), &ohci->regs->roothub.status); }
#define WR_RH_PORTSTAT(x) { err("WR:portstatus[%d] %#8x", wIndex - 1, (x)); writel((x), &ohci->regs->roothub.portstatus[wIndex - 1]); } #define WR_RH_PORTSTAT(x) { inf("WR:portstatus[%d] %#8x", wIndex - 1, (x)); writel((x), &ohci->regs->roothub.portstatus[wIndex - 1]); }
#else #else
#define WR_RH_STAT(x) { writel((x), &ohci->regs->roothub.status); } #define WR_RH_STAT(x) { writel((x), &ohci->regs->roothub.status); }
#define WR_RH_PORTSTAT(x) { writel((x), &ohci->regs->roothub.portstatus[wIndex - 1]); } #define WR_RH_PORTSTAT(x) { writel((x), &ohci->regs->roothub.portstatus[wIndex - 1]); }
@@ -1512,7 +1513,7 @@ static int ohci_submit_rh_msg(volatile ohci_t *ohci, struct usb_device *dev, uin
#else #else
if (ohci->irq) if (ohci->irq)
{ {
wait_ms(10); wait_ms(1);
} }
#endif #endif
@@ -1767,7 +1768,7 @@ static int submit_common_msg(volatile ohci_t *ohci, struct usb_device *dev, uint
#else #else
if (ohci->irq) if (ohci->irq)
{ {
wait_us(10); wait_ms(1);
} }
#endif #endif
@@ -1841,7 +1842,7 @@ static int submit_common_msg(volatile ohci_t *ohci, struct usb_device *dev, uint
if (--timeout) if (--timeout)
{ {
wait_ms(10); wait_ms(1);
// if (!urb->finished) // if (!urb->finished)
// xprintf("*\r\n"); // xprintf("*\r\n");
} }
@@ -2289,17 +2290,17 @@ static void hc_free_buffers(volatile ohci_t *ohci)
{ {
if (ohci->td_unaligned != NULL) if (ohci->td_unaligned != NULL)
{ {
/* FIXME: driver_mem_free(ohci->td_unaligned); */ driver_mem_free(ohci->td_unaligned);
ohci->td_unaligned = NULL; ohci->td_unaligned = NULL;
} }
if (ohci->ohci_dev_unaligned != NULL) if (ohci->ohci_dev_unaligned != NULL)
{ {
/* FIXME: driver_mem_free(ohci->ohci_dev_unaligned); */ driver_mem_free(ohci->ohci_dev_unaligned);
ohci->ohci_dev_unaligned = NULL; ohci->ohci_dev_unaligned = NULL;
} }
if (ohci->hcca_unaligned != NULL) if (ohci->hcca_unaligned != NULL)
{ {
/* FIXME: driver_mem_free(ohci->hcca_unaligned); */ driver_mem_free(ohci->hcca_unaligned);
ohci->hcca_unaligned = NULL; ohci->hcca_unaligned = NULL;
} }
} }