renamed struct pci_resource_descriptor to struct pci_rd

This commit is contained in:
Markus Fröschle
2013-11-05 05:56:19 +00:00
parent 942f417b13
commit d6210afa3a
4 changed files with 14 additions and 14 deletions

View File

@@ -91,7 +91,7 @@
#define PCI_IO_LIMIT_UPPER16 0x32 #define PCI_IO_LIMIT_UPPER16 0x32
#define PCI_BRIDGE_CONTROL 0x3E /* Bridge Control */ #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 next; /* length of the following structure */
unsigned short flags; /* type of resource and misc. flags */ 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_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 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_hook_interrupt(uint16_t handle, void *interrupt_handler, void *parameter);
extern int16_t pci_unhook_interrupt(uint16_t handle); extern int16_t pci_unhook_interrupt(uint16_t handle);

View File

@@ -853,7 +853,7 @@ int ehci_usb_lowlevel_init(long handle, const struct pci_device_id *ent, void **
uint32_t reg; uint32_t reg;
uint32_t cmd; uint32_t cmd;
uint32_t usb_base_addr = 0xFFFFFFFF; 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 */ pci_rsc_desc = pci_get_resource(handle); /* USB EHCI */
if (handle && (ent != NULL)) 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; 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)); while(!(flags & FLG_LAST));
} }

View File

@@ -1590,7 +1590,7 @@ static int hc_reset(ohci_t *ohci)
{ {
int timeout = 1000; int timeout = 1000;
uint32_t usb_base_addr = 0xFFFFFFFF; 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 */ pci_rsc_desc = pci_get_resource(handle); /* USB OHCI */
if ((long)pci_rsc_desc >= 0) if ((long)pci_rsc_desc >= 0)
{ {
@@ -1616,7 +1616,7 @@ static int hc_reset(ohci_t *ohci)
} }
} }
flags = pci_rsc_desc->flags; 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)); 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; uint32_t usb_base_addr = 0xFFFFFFFF;
ohci_t *ohci = &gohci[PCI_FUNCTION_FROM_HANDLE(handle) & 1]; 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)) 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; 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)); while (!(flags & FLG_LAST));
} }

View File

@@ -63,7 +63,7 @@ static int num_classes = sizeof(pci_classes) / sizeof(struct pci_class);
#define NUM_CARDS 10 #define NUM_CARDS 10
#define NUM_RESOURCES 6 #define NUM_RESOURCES 6
uint16_t handles[NUM_CARDS]; /* holds the handle of a card at position = array index */ 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) 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 * 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 i;
int index = -1; int index = -1;
@@ -264,7 +264,7 @@ static void pci_device_config(uint16_t bus, uint16_t slot, uint16_t function)
uint32_t address; uint32_t address;
uint16_t handle; uint16_t handle;
uint16_t index = - 1; uint16_t index = - 1;
struct pci_resource_descriptor *descriptors; struct pci_rd *descriptors;
int i; int i;
/* determine pci handle from bus, slot + function number */ /* 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); //xprintf("BAR[%d] configured to %08x, size %x\r\n", i, value, size);
/* fill resource descriptor */ /* 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].flags = 0 | FLG_8BIT | FLG_16BIT | FLG_32BIT | 1;
descriptors[barnum].start = mem_address; descriptors[barnum].start = mem_address;
descriptors[barnum].length = size; 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); //xprintf("BAR[%d] mapped to %08x, size %x\r\n", i, value, size);
/* fill resource descriptor */ /* 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].flags = FLG_IO | FLG_8BIT | FLG_16BIT | FLG_32BIT | 1;
descriptors[barnum].start = io_address; descriptors[barnum].start = io_address;
descriptors[barnum].offset = PCI_MEMORY_OFFSET; descriptors[barnum].offset = PCI_MEMORY_OFFSET;
@@ -483,7 +483,7 @@ void init_pci(void)
xprintf("finished\r\n"); xprintf("finished\r\n");
/* initialize resource descriptor table */ /* 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(); pci_scan();
} }