From d6210afa3ab0053b3ae23d76addf116f865b736b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Fr=C3=B6schle?= Date: Tue, 5 Nov 2013 05:56:19 +0000 Subject: [PATCH] renamed struct pci_resource_descriptor to struct pci_rd --- include/pci.h | 4 ++-- sources/ehci-hcd.c | 4 ++-- sources/ohci-hcd.c | 8 ++++---- sources/pci.c | 12 ++++++------ 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/pci.h b/include/pci.h index 235b338..806ce7f 100644 --- a/include/pci.h +++ b/include/pci.h @@ -91,7 +91,7 @@ #define PCI_IO_LIMIT_UPPER16 0x32 #define PCI_BRIDGE_CONTROL 0x3E /* Bridge Control */ -struct pci_resource_descriptor /* structure of resource descriptor */ +struct pci_rd /* structure of resource descriptor */ { unsigned short next; /* length of the following structure */ unsigned short flags; /* type of resource and misc. flags */ @@ -202,7 +202,7 @@ extern void pci_write_config_longword(uint16_t handle, uint16_t offset, uint32_t extern void pci_write_config_word(uint16_t handle, uint16_t offset, uint16_t value); extern void pci_write_config_byte(uint16_t handle, uint16_t offset, uint8_t value); -extern struct pci_resource_descriptor *pci_get_resource(uint16_t handle); +extern struct pci_rd *pci_get_resource(uint16_t handle); extern int16_t pci_hook_interrupt(uint16_t handle, void *interrupt_handler, void *parameter); extern int16_t pci_unhook_interrupt(uint16_t handle); diff --git a/sources/ehci-hcd.c b/sources/ehci-hcd.c index dd44093..0617750 100644 --- a/sources/ehci-hcd.c +++ b/sources/ehci-hcd.c @@ -853,7 +853,7 @@ int ehci_usb_lowlevel_init(long handle, const struct pci_device_id *ent, void ** uint32_t reg; uint32_t cmd; uint32_t usb_base_addr = 0xFFFFFFFF; - struct pci_resource_descriptor *pci_rsc_desc; + struct pci_rd *pci_rsc_desc; pci_rsc_desc = pci_get_resource(handle); /* USB EHCI */ if (handle && (ent != NULL)) { @@ -922,7 +922,7 @@ int ehci_usb_lowlevel_init(long handle, const struct pci_device_id *ent, void ** } } flags = pci_rsc_desc->flags; - pci_rsc_desc = (struct pci_resource_descriptor *)((uint32_t)pci_rsc_desc->next + (uint32_t)pci_rsc_desc); + pci_rsc_desc = (struct pci_rd *)((uint32_t)pci_rsc_desc->next + (uint32_t)pci_rsc_desc); } while(!(flags & FLG_LAST)); } diff --git a/sources/ohci-hcd.c b/sources/ohci-hcd.c index 26cd257..84cbe90 100644 --- a/sources/ohci-hcd.c +++ b/sources/ohci-hcd.c @@ -1590,7 +1590,7 @@ static int hc_reset(ohci_t *ohci) { int timeout = 1000; uint32_t usb_base_addr = 0xFFFFFFFF; - struct pci_resource_descriptor *pci_rsc_desc; + struct pci_rd *pci_rsc_desc; pci_rsc_desc = pci_get_resource(handle); /* USB OHCI */ if ((long)pci_rsc_desc >= 0) { @@ -1616,7 +1616,7 @@ static int hc_reset(ohci_t *ohci) } } flags = pci_rsc_desc->flags; - pci_rsc_desc = (struct pci_resource_descriptor *) ((uint32_t)pci_rsc_desc->next + (uint32_t)pci_rsc_desc); + pci_rsc_desc = (struct pci_rd *) ((uint32_t)pci_rsc_desc->next + (uint32_t)pci_rsc_desc); } while (!(flags & FLG_LAST)); } @@ -1927,7 +1927,7 @@ int ohci_usb_lowlevel_init(uint16_t handle, const struct pci_device_id *ent, voi { uint32_t usb_base_addr = 0xFFFFFFFF; ohci_t *ohci = &gohci[PCI_FUNCTION_FROM_HANDLE(handle) & 1]; - struct pci_resource_descriptor *pci_rsc_desc = pci_get_resource(handle); /* USB OHCI */ + struct pci_rd *pci_rsc_desc = pci_get_resource(handle); /* USB OHCI */ if (handle && (ent != NULL)) { @@ -2008,7 +2008,7 @@ int ohci_usb_lowlevel_init(uint16_t handle, const struct pci_device_id *ent, voi } } flags = pci_rsc_desc->flags; - pci_rsc_desc = (struct pci_resource_descriptor *)((uint32_t)pci_rsc_desc->next + (uint32_t)pci_rsc_desc); + pci_rsc_desc = (struct pci_rd *)((uint32_t)pci_rsc_desc->next + (uint32_t)pci_rsc_desc); } while (!(flags & FLG_LAST)); } diff --git a/sources/pci.c b/sources/pci.c index 7f8ffd2..b0ddc93 100644 --- a/sources/pci.c +++ b/sources/pci.c @@ -63,7 +63,7 @@ static int num_classes = sizeof(pci_classes) / sizeof(struct pci_class); #define NUM_CARDS 10 #define NUM_RESOURCES 6 uint16_t handles[NUM_CARDS]; /* holds the handle of a card at position = array index */ -static struct pci_resource_descriptor resource_descriptors[NUM_CARDS][NUM_RESOURCES]; /* FIXME: fix number of cards */ +static struct pci_rd resource_descriptors[NUM_CARDS][NUM_RESOURCES]; /* FIXME: fix number of cards */ static char *device_class(int classcode) { @@ -172,7 +172,7 @@ void pci_write_config_longword(uint16_t handle, uint16_t offset, uint32_t value) * * get resource descriptor chain for handle */ -struct pci_resource_descriptor *pci_get_resource(uint16_t handle) +struct pci_rd *pci_get_resource(uint16_t handle) { int i; int index = -1; @@ -264,7 +264,7 @@ static void pci_device_config(uint16_t bus, uint16_t slot, uint16_t function) uint32_t address; uint16_t handle; uint16_t index = - 1; - struct pci_resource_descriptor *descriptors; + struct pci_rd *descriptors; int i; /* determine pci handle from bus, slot + function number */ @@ -320,7 +320,7 @@ static void pci_device_config(uint16_t bus, uint16_t slot, uint16_t function) //xprintf("BAR[%d] configured to %08x, size %x\r\n", i, value, size); /* fill resource descriptor */ - descriptors[barnum].next = sizeof(struct pci_resource_descriptor); + descriptors[barnum].next = sizeof(struct pci_rd); descriptors[barnum].flags = 0 | FLG_8BIT | FLG_16BIT | FLG_32BIT | 1; descriptors[barnum].start = mem_address; descriptors[barnum].length = size; @@ -349,7 +349,7 @@ static void pci_device_config(uint16_t bus, uint16_t slot, uint16_t function) //xprintf("BAR[%d] mapped to %08x, size %x\r\n", i, value, size); /* fill resource descriptor */ - descriptors[barnum].next = sizeof(struct pci_resource_descriptor); + descriptors[barnum].next = sizeof(struct pci_rd); descriptors[barnum].flags = FLG_IO | FLG_8BIT | FLG_16BIT | FLG_32BIT | 1; descriptors[barnum].start = io_address; descriptors[barnum].offset = PCI_MEMORY_OFFSET; @@ -483,7 +483,7 @@ void init_pci(void) xprintf("finished\r\n"); /* initialize resource descriptor table */ - memset(&resource_descriptors, 0, NUM_CARDS * NUM_RESOURCES * sizeof(struct pci_resource_descriptor)); + memset(&resource_descriptors, 0, NUM_CARDS * NUM_RESOURCES * sizeof(struct pci_rd)); pci_scan(); }