[net.bugs.4bsd] Standalone use of uda on non-zero unibus under 4.1bsd

arwhite@watrose.UUCP (Alex White) (10/06/83)

Both the uda50 and ts11 drivers have to map in a communications area
to talk to the device.  They do this with a dummy struct iob which they
call ubasetup with after setting the communications regions address and
size; the problem is that ubasetup does the mapping for the unibus specified
in io_unit, this is zero for the dummy struct which is correct for uba0
but if you want to work for other unibuses you should set this in udaopen:

	if (ud_ubaddr == 0) {
		cudbuf.i_ma = (caddr_t)&uda;
		cudbuf.i_cc = sizeof(uda);
		cudbuf.i_unit = io->i_unit;	/* Extra line */
		ud_ubaddr = (struct uda *)ubasetup(&cudbuf, 2);
	}

By the way, I really don't think these drivers are at all re-entrant
in so much as they set ud_ubaddr and never clear it, thus if you do
	Boot
	: ra(0,0)vmunix
	vmunix not found
	: ra(8,0)vmunix		# Get vmunix from backup disk on other uba
will hence use the info from the first open since ud_ubaddr is non-zero
now.