sys/dev/netif/ar/if_ar_isa.c
static int
ar_isa_probe(device_t device)
{
	int error;
	u_long membase, memsize;
	struct ar_hardc *hc;

	error = ISA_PNP_PROBE(device_get_parent(device), device, ar_ids);
	if(error == ENXIO || error == 0)
		return (error);

	hc = (struct ar_hardc *)device_get_softc(device);

	if((error = ar_allocate_ioport(device, 0, ARC_IO_SIZ))) {
		return (ENXIO);
	}

	/*
	 * Now see if the card is realy there.
	 *
	 * XXX For now I just check the undocumented ports
	 * for "570". We will probably have to do more checking.
	 */
	if((ar_inb(hc, AR_ID_5) != '5') ||
	   (ar_inb(hc, AR_ID_7) != '7') ||
	   (ar_inb(hc, AR_ID_0) != '0')) {
		ar_deallocate_resources(device);
		return (ENXIO);
	}
	membase = bus_get_resource_start(device, SYS_RES_MEMORY, 0);
	memsize = ar_inb(hc, AR_REV);
	memsize = 1 << ((memsize & AR_WSIZ_MSK) >> AR_WSIZ_SHFT);
	memsize *= ARC_WIN_SIZ;
	error = bus_set_resource(device, SYS_RES_MEMORY, 0, membase, memsize,
	    -1);
	ar_deallocate_resources(device);

	return (error);
}
/*
 * Probe to see if it is there.
 * Get its information and fill it in.
 */
Probe to see if it is there.
Get its information and fill it in.
Probe to see if it is there . Get its information and fill it in .
static int
ar_isa_probe(device_t device)
{
	int error;
	u_long membase, memsize;
	struct ar_hardc *hc;
	error = ISA_PNP_PROBE(device_get_parent(device), device, ar_ids);
	if(error == ENXIO || error == 0)
		return (error);
	hc = (struct ar_hardc *)device_get_softc(device);
	if((error = ar_allocate_ioport(device, 0, ARC_IO_SIZ))) {
		return (ENXIO);
	}
	if((ar_inb(hc, AR_ID_5) != '5') ||
	   (ar_inb(hc, AR_ID_7) != '7') ||
	   (ar_inb(hc, AR_ID_0) != '0')) {
		ar_deallocate_resources(device);
		return (ENXIO);
	}
	membase = bus_get_resource_start(device, SYS_RES_MEMORY, 0);
	memsize = ar_inb(hc, AR_REV);
	memsize = 1 << ((memsize & AR_WSIZ_MSK) >> AR_WSIZ_SHFT);
	memsize *= ARC_WIN_SIZ;
	error = bus_set_resource(device, SYS_RES_MEMORY, 0, membase, memsize,
	    -1);
	ar_deallocate_resources(device);
	return (error);
}
static int ar_isa_probe ( device_t device ) { int error ; u_long membase , memsize ; struct ar_hardc * hc ; error = ISA_PNP_PROBE ( device_get_parent ( device ) , device , ar_ids ) ; if ( error == ENXIO || error == 0 ) return ( error ) ; hc = ( struct ar_hardc * ) device_get_softc ( device ) ; if ( ( error = ar_allocate_ioport ( device , 0 , ARC_IO_SIZ ) ) ) { return ( ENXIO ) ; } if ( ( ar_inb ( hc , AR_ID_5 ) != ' ' ) || ( ar_inb ( hc , AR_ID_7 ) != ' ' ) || ( ar_inb ( hc , AR_ID_0 ) != ' ' ) ) { ar_deallocate_resources ( device ) ; return ( ENXIO ) ; } membase = bus_get_resource_start ( device , SYS_RES_MEMORY , 0 ) ; memsize = ar_inb ( hc , AR_REV ) ; memsize = 1 << ( ( memsize & AR_WSIZ_MSK ) >> AR_WSIZ_SHFT ) ; memsize *= ARC_WIN_SIZ ; error = bus_set_resource ( device , SYS_RES_MEMORY , 0 , membase , memsize , -1 ) ; ar_deallocate_resources ( device ) ; return ( error ) ; }
Probe to see if it is there.
Probe to see if it is there .
/*
	 * Now see if the card is realy there.
	 *
	 * XXX For now I just check the undocumented ports
	 * for "570". We will probably have to do more checking.
	 */