mirror of
https://github.com/opnsense/src.git
synced 2026-03-12 05:32:15 -04:00
Move getb1 and putb1 from pcic_isa.c to pcic.c. Rename them to
pcic_{get,put}b_io. There are some pci bridges (the CL-PD6729 and
maybe others) that do not have memory mapped registers, so we'll need
these in both places. Declare them in pcicvar.h.
This commit is contained in:
parent
8fa5674d69
commit
99efcc2bb9
3 changed files with 24 additions and 22 deletions
|
|
@ -77,6 +77,26 @@ static struct slot_ctrl pcic_cinfo = {
|
|||
PCIC_IO_WIN
|
||||
};
|
||||
|
||||
/*
|
||||
* Read a register from the PCIC.
|
||||
*/
|
||||
unsigned char
|
||||
pcic_getb_io(struct pcic_slot *sp, int reg)
|
||||
{
|
||||
outb(sp->index, sp->offset + reg);
|
||||
return (inb(sp->data));
|
||||
}
|
||||
|
||||
/*
|
||||
* Write a register on the PCIC
|
||||
*/
|
||||
void
|
||||
pcic_putb_io(struct pcic_slot *sp, int reg, unsigned char val)
|
||||
{
|
||||
outb(sp->index, sp->offset + reg);
|
||||
outb(sp->data, val);
|
||||
}
|
||||
|
||||
/*
|
||||
* Clear bit(s) of a register.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -72,26 +72,6 @@ static struct {
|
|||
{ "Intel i82365SL-DF", PCIC_DF_POWER}
|
||||
};
|
||||
|
||||
/*
|
||||
* Read a register from the PCIC.
|
||||
*/
|
||||
static unsigned char
|
||||
getb1(struct pcic_slot *sp, int reg)
|
||||
{
|
||||
outb(sp->index, sp->offset + reg);
|
||||
return (inb(sp->data));
|
||||
}
|
||||
|
||||
/*
|
||||
* Write a register on the PCIC
|
||||
*/
|
||||
static void
|
||||
putb1(struct pcic_slot *sp, int reg, unsigned char val)
|
||||
{
|
||||
outb(sp->index, sp->offset + reg);
|
||||
outb(sp->data, val);
|
||||
}
|
||||
|
||||
/*
|
||||
* Look for an Intel PCIC (or compatible).
|
||||
* For each available slot, allocate a PC-CARD slot.
|
||||
|
|
@ -132,8 +112,8 @@ pcic_isa_probe(device_t dev)
|
|||
/*
|
||||
* Initialise the PCIC slot table.
|
||||
*/
|
||||
sp->getb = getb1;
|
||||
sp->putb = putb1;
|
||||
sp->getb = pcic_getb_io;
|
||||
sp->putb = pcic_putb_io;
|
||||
sp->index = rman_get_start(r);
|
||||
sp->data = sp->index + 1;
|
||||
sp->offset = slotnum * PCIC_SLOT_SIZE;
|
||||
|
|
|
|||
|
|
@ -84,3 +84,5 @@ int pcic_set_memory_offset(device_t bus, device_t child, int rid,
|
|||
void pcic_clrb(struct pcic_slot *sp, int reg, unsigned char mask);
|
||||
void pcic_setb(struct pcic_slot *sp, int reg, unsigned char mask);
|
||||
void pcic_dealloc(device_t dev);
|
||||
unsigned char pcic_getb_io(struct pcic_slot *sp, int reg);
|
||||
void pcic_putb_io(struct pcic_slot *sp, int reg, unsigned char val);
|
||||
|
|
|
|||
Loading…
Reference in a new issue