/* Writing to device address space. * Offset comes before value to remind that the operation of * this function is *offs = val.
*/ staticvoid asd_write_byte(struct asd_ha_struct *asd_ha, unsignedlong offs, u8 val)
{ if (unlikely(asd_ha->iospace))
outb(val,
(unsignedlong)asd_ha->io_handle[0].addr + (offs & 0xFF)); else
writeb(val, asd_ha->io_handle[0].addr + offs);
wmb();
}
/* * A word about sliding windows: * MBAR0 is divided into sliding windows A, C and B, in that order. * SWA starts at offset 0 of MBAR0, up to 0x57, with size 0x58 bytes. * SWC starts at offset 0x58 of MBAR0, up to 0x60, with size 0x8 bytes. * From 0x60 to 0x7F, we have a copy of PCI config space 0x60-0x7F. * SWB starts at offset 0x80 of MBAR0 and extends to the end of MBAR0. * See asd_init_sw() in aic94xx_hwi.c * * We map the most common registers we'd access of the internal 4GB * host adapter memory space. If a register/internal memory location * is wanted which is not mapped, we slide SWB, by paging it, * see asd_move_swb() in aic94xx_reg.c.
*/
/** * asd_move_swb -- move sliding window B * @asd_ha: pointer to host adapter structure * @reg: register desired to be within range of the new window
*/ staticvoid asd_move_swb(struct asd_ha_struct *asd_ha, u32 reg)
{
u32 base = reg & ~(MBAR0_SWB_SIZE-1);
pci_write_config_dword(asd_ha->pcidev, PCI_CONF_MBAR0_SWB, base);
asd_ha->io_handle[0].swb_base = base;
}
/** * asd_read_reg_string -- read a string of bytes from io space memory * @asd_ha: pointer to host adapter structure * @dst: pointer to a destination buffer where data will be written to * @offs: start offset (register) to read from * @count: number of bytes to read
*/ void asd_read_reg_string(struct asd_ha_struct *asd_ha, void *dst,
u32 offs, int count)
{
u8 *p = dst; unsignedlong flags;
/** * asd_write_reg_string -- write a string of bytes to io space memory * @asd_ha: pointer to host adapter structure * @src: pointer to source buffer where data will be read from * @offs: start offset (register) to write to * @count: number of bytes to write
*/ void asd_write_reg_string(struct asd_ha_struct *asd_ha, void *src,
u32 offs, int count)
{
u8 *p = src; unsignedlong flags;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.