* Copyright (c) 1982, 1990 The Regents of the University of California.
* %sccs.include.redist.c%
* @(#)hpib.c 7.4 (Berkeley) %G%
#include "../dev/device.h"
int internalhpib
= 0x478000;
int fhpibppoll(), nhpibppoll();
struct hpib_softc hpib_softc
[NHPIB
];
#define hpibunit(x) ((x) >> 3)
#define hpibslave(x) ((x) & 7)
extern struct hp_hw sc_table
[];
register struct hp_hw
*hw
;
register struct hpib_softc
*hs
;
for (hw
= sc_table
; i
< NHPIB
&& hw
< &sc_table
[MAX_CTLR
]; hw
++) {
hs
->sc_addr
= hw
->hw_addr
;
printf("hpib%d at sc%d\n", i
, hw
->hw_sc
);
* Adjust devtype on first call. This routine assumes that
* adaptor is in the high byte of devtype.
if (first
&& ((devtype
>> 24) & 0xff) == hw
->hw_sc
) {
devtype
= (devtype
& 0x00ffffff) | (i
<< 24);
if (unit
>= NHPIB
|| hpib_softc
[unit
].sc_alive
== 0)
register struct hpib_softc
*hs
= &hpib_softc
[hpibunit(unit
)];
if (hs
->sc_type
== HPIBC
)
slave
= fhpibrecv(unit
, 31, slave
, &id
, 2);
slave
= nhpibrecv(unit
, 31, slave
, &id
, 2);
hpibsend(unit
, sec
, buf
, cnt
)
register struct hpib_softc
*hs
= &hpib_softc
[hpibunit(unit
)];
if (hs
->sc_type
== HPIBC
)
return (fhpibsend(unit
, slave
, sec
, buf
, cnt
));
return (nhpibsend(unit
, slave
, sec
, buf
, cnt
));
hpibrecv(unit
, sec
, buf
, cnt
)
register struct hpib_softc
*hs
= &hpib_softc
[hpibunit(unit
)];
if (hs
->sc_type
== HPIBC
)
return (fhpibrecv(unit
, slave
, sec
, buf
, cnt
));
return (nhpibrecv(unit
, slave
, sec
, buf
, cnt
));
register int timo
= 1000000;
register int slave
= 0x80 >> hpibslave(unit
);
if (hpib_softc
[unit
].sc_type
== HPIBC
)
while (((*poll
)(unit
) & slave
) == 0)
hpibgo(unit
, sec
, addr
, count
, flag
)
if (hpib_softc
[unit
].sc_type
== HPIBC
)
fhpibrecv(unit
, slave
, sec
, addr
, count
);
fhpibsend(unit
, slave
, sec
, addr
, count
);
nhpibrecv(unit
, slave
, sec
, addr
, count
);
nhpibsend(unit
, slave
, sec
, addr
, count
);