FreeBSD/sys/mips/rmi/xlr_pcmcia.c
/*
 * We add all the devices which we know about.
 * The generic attach routine will attach them if they are alive.
 */
We add all the devices which we know about.
The generic attach routine will attach them if they are alive.
We add all the devices which we know about . The generic attach routine will attach them if they are alive .
static int
xlr_pcmcia_attach(device_t dev)
{
	struct ata_channel *ch = device_get_softc(dev);
	int i;
	int rid =0;
	struct resource *mem_res;
	mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid,  RF_ACTIVE);
	for (i = 0; i < ATA_MAX_RES; i++)
		ch->r_io[i].res = mem_res;
	ch->r_io[ATA_DATA].offset 	= XLR_PCMCIA_DATA_REG;
	ch->r_io[ATA_FEATURE].offset 	= XLR_PCMCIA_ERROR_REG;
	ch->r_io[ATA_COUNT].offset 	= XLR_PCMCIA_SECT_CNT_REG;
	ch->r_io[ATA_SECTOR].offset 	= XLR_PCMCIA_SECT_NUM_REG;
	ch->r_io[ATA_CYL_LSB].offset 	= XLR_PCMCIA_CYLINDER_LOW_REG;
	ch->r_io[ATA_CYL_MSB].offset 	= XLR_PCMCIA_CYLINDER_HIGH_REG;
	ch->r_io[ATA_DRIVE].offset 	= XLR_PCMCIA_SECT_DRIVE_HEAD_REG;
	ch->r_io[ATA_COMMAND].offset 	= XLR_PCMCIA_CMD_STATUS_REG;
	ch->r_io[ATA_ERROR].offset 	= XLR_PCMCIA_ERROR_REG;
	ch->r_io[ATA_IREASON].offset 	= XLR_PCMCIA_SECT_CNT_REG;
	ch->r_io[ATA_STATUS].offset 	= XLR_PCMCIA_CMD_STATUS_REG;
	ch->r_io[ATA_ALTSTAT].offset 	= XLR_PCMCIA_ALT_STATUS_REG;
	ch->r_io[ATA_CONTROL].offset 	= XLR_PCMCIA_CONTROL_REG;
	ch->r_io[ATA_IDX_ADDR].offset = XLR_PCMCIA_DATA_REG;
	ata_generic_hw(dev);
	return (ata_attach(dev)); 
}
static int xlr_pcmcia_attach ( device_t dev ) { struct ata_channel * ch = device_get_softc ( dev ) ; int i ; int rid = 0 ; struct resource * mem_res ; mem_res = bus_alloc_resource_any ( dev , SYS_RES_MEMORY , & rid , RF_ACTIVE ) ; for ( i = 0 ; i < ATA_MAX_RES ; i ++ ) ch -> r_io [ i ] . res = mem_res ; ch -> r_io [ ATA_DATA ] . offset = XLR_PCMCIA_DATA_REG ; ch -> r_io [ ATA_FEATURE ] . offset = XLR_PCMCIA_ERROR_REG ; ch -> r_io [ ATA_COUNT ] . offset = XLR_PCMCIA_SECT_CNT_REG ; ch -> r_io [ ATA_SECTOR ] . offset = XLR_PCMCIA_SECT_NUM_REG ; ch -> r_io [ ATA_CYL_LSB ] . offset = XLR_PCMCIA_CYLINDER_LOW_REG ; ch -> r_io [ ATA_CYL_MSB ] . offset = XLR_PCMCIA_CYLINDER_HIGH_REG ; ch -> r_io [ ATA_DRIVE ] . offset = XLR_PCMCIA_SECT_DRIVE_HEAD_REG ; ch -> r_io [ ATA_COMMAND ] . offset = XLR_PCMCIA_CMD_STATUS_REG ; ch -> r_io [ ATA_ERROR ] . offset = XLR_PCMCIA_ERROR_REG ; ch -> r_io [ ATA_IREASON ] . offset = XLR_PCMCIA_SECT_CNT_REG ; ch -> r_io [ ATA_STATUS ] . offset = XLR_PCMCIA_CMD_STATUS_REG ; ch -> r_io [ ATA_ALTSTAT ] . offset = XLR_PCMCIA_ALT_STATUS_REG ; ch -> r_io [ ATA_CONTROL ] . offset = XLR_PCMCIA_CONTROL_REG ; ch -> r_io [ ATA_IDX_ADDR ] . offset = XLR_PCMCIA_DATA_REG ; ata_generic_hw ( dev ) ; return ( ata_attach ( dev ) ) ; }
We add all the devices which we know about.
We add all the devices which we know about .
/*
	 * CF+ Specification.
	 */ /* Should point at the base of registers. */