diff options
author | Hans de Goede <hdegoede@redhat.com> | 2015-05-05 23:56:09 +0200 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-05-06 12:48:35 -0600 |
commit | 3c5497d831fe2450b47eead2c8b57602028ecdea (patch) | |
tree | a9a6ca7598a374c10a173de3f3d66813f2df0727 /drivers/usb/host/ohci.h | |
parent | 19d95d57299d1f9395934cd365625bebef399748 (diff) |
usb: ohci: Move the td array struct to inside the ohci_dev struct
This is a preparation patch for adding driver-model support.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Marek Vasut <marex@denx.de>
Diffstat (limited to 'drivers/usb/host/ohci.h')
-rw-r--r-- | drivers/usb/host/ohci.h | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/usb/host/ohci.h b/drivers/usb/host/ohci.h index c3191641ce9..96a0ac1ed44 100644 --- a/drivers/usb/host/ohci.h +++ b/drivers/usb/host/ohci.h @@ -410,8 +410,11 @@ typedef struct #define NUM_EDS 8 /* num of preallocated endpoint descriptors */ +#define NUM_TD 64 /* we need more TDs than EDs */ + typedef struct ohci_device { ed_t ed[NUM_EDS] __aligned(16); + td_t tds[NUM_TD] __aligned(32); int ed_cnt; } ohci_dev_t; @@ -425,7 +428,7 @@ typedef struct ohci_device { typedef struct ohci { /* this allocates EDs for all possible endpoints */ - struct ohci_device ohci_dev __aligned(16); + struct ohci_device ohci_dev __aligned(32); struct ohci_hcca *hcca; /* hcca */ /*dma_addr_t hcca_dma;*/ @@ -457,17 +460,9 @@ static ed_t *ep_add_ed(ohci_dev_t *ohci_dev, struct usb_device *usb_dev, /*-------------------------------------------------------------------------*/ -/* we need more TDs than EDs */ -#define NUM_TD 64 - -/* +1 so we can align the storage */ -td_t gtd[NUM_TD+1]; -/* pointers to aligned storage */ -td_t *ptd; - /* TDs ... */ static inline struct td * -td_alloc (struct usb_device *usb_dev) +td_alloc (ohci_dev_t *ohci_dev, struct usb_device *usb_dev) { int i; struct td *td; @@ -475,9 +470,9 @@ td_alloc (struct usb_device *usb_dev) td = NULL; for (i = 0; i < NUM_TD; i++) { - if (ptd[i].usb_dev == NULL) + if (ohci_dev->tds[i].usb_dev == NULL) { - td = &ptd[i]; + td = &ohci_dev->tds[i]; td->usb_dev = usb_dev; break; } |