| On a uVAX2, at the console, >>> E/P/W/N:5 20001920 will show the DEQNA's
physical address. It appears in the low byte of each of the five words
displayed. %x20001920 corresponds to the I/O address %o774440. If you
can go poking at the devices like E/P does, I imagine you could read
this with a program.
In general, you'll have to find the I/O address somehow. DEUNAs live
at a different place than DEQNAs, etc...
-piper
|
| Actually, SENSEMODE's seem to work fine on XE's and XQ's, without any privs.
(Or perhaps when I did this I used SENSECHAR's; they get the same information.)
For some simple code that uses the XE/XQ QIO interface, have a look at the files
in RANI::USER$5:[LEICHTERJ.LINDAIO].
[The above is a limited-time offer; I put the files there for someone who
wanted to look at them, and they will eventually vanish.]
-- Jerry
|
| { Program to read ethernet adaptor hardware address and define it }
{ as a DCL symbol. Invoked as: }
{ }
{ $ define/user deqna xqa0: }
{ $ run deqna.exe }
{ }
{ Sets local DCL symbol DEQNA_ADDRESS to the ethernet adaptor }
{ hardware address. }
{ }
{ Requires LOG_IO priviledge. }
program deqna (output);
{ Declarations copied from STARLET.PAS }
[HIDDEN] TYPE (**** Pre-declared data types ****)
$UBYTE = [BYTE] 0..255;
$UWORD = [WORD] 0..65535;
$UQUAD = [QUAD,UNSAFE] RECORD
L0,L1:UNSIGNED; END;
(* $ASSIGN *)
(* *)
(* Assign I/O Channel *)
(* *)
(* $ASSIGN devnam ,chan ,[acmode] ,[mbxnam] *)
(* *)
(* devnam = address of device name or logical name string *)
(* descriptor *)
(* chan = address of word to receive channel number assigned *)
(* acmode = access mode associated with channel *)
(* mbxnam = address of mailbox logical name string descriptor, if *)
(* mailbox associated with device *)
(* *)
[ASYNCHRONOUS,EXTERNAL(SYS$ASSIGN)] FUNCTION $ASSIGN (
DEVNAM : [CLASS_S] PACKED ARRAY [$l1..$u1:INTEGER] OF CHAR;
VAR CHAN : [VOLATILE]$UWORD;
%IMMED ACMODE : UNSIGNED := %IMMED 0;
MBXNAM : [CLASS_S] PACKED ARRAY [$l4..$u4:INTEGER] OF CHAR := %IMMED 0) : INTEGER; EXTERNAL;
(* *)
(* Queue I/O Request *)
(* *)
(* $QIO [efn] ,chan ,func ,[iosb] ,[astadr] ,[astprm] *)
(* ($QIOW) ,[p1] ,[p2] ,[p3] ,[p4] ,[p5] ,[p6] *)
(* *)
(* efn = number of event flag to set on completion *)
(* *)
(* chan = number of channel on which I/O is directed *)
(* *)
(* func = function code specifying action to be performed *)
(* *)
(* iosb = address of quadword I/O status block to receive final *)
(* completion status *)
(* *)
(* astadr = address of entry mask of AST routine *)
(* *)
(* astprm = value to be passed to AST routine as argument *)
(* *)
(* p1... = optional device- and function-specific parameters *)
(* *)
[ASYNCHRONOUS,EXTERNAL(SYS$QIO)] FUNCTION $QIO (
%IMMED EFN : UNSIGNED := %IMMED 0;
%IMMED CHAN : INTEGER;
%IMMED FUNC : INTEGER;
VAR IOSB : [VOLATILE]$UQUAD := %IMMED 0;
%IMMED [UNBOUND, ASYNCHRONOUS] PROCEDURE ASTADR := %IMMED 0;
%IMMED ASTPRM : UNSIGNED := %IMMED 0;
%REF P1 : [UNSAFE] ARRAY [$l7..$u7:INTEGER] OF $UBYTE := %IMMED 0;
%IMMED P2 : INTEGER := %IMMED 0;
%IMMED P3 : INTEGER := %IMMED 0;
%IMMED P4 : INTEGER := %IMMED 0;
%IMMED P5 : INTEGER := %IMMED 0;
%IMMED P6 : INTEGER := %IMMED 0) : INTEGER; EXTERNAL;
[ASYNCHRONOUS,EXTERNAL(SYS$QIOW)] FUNCTION $QIOW (
%IMMED EFN : UNSIGNED := %IMMED 0;
%IMMED CHAN : INTEGER;
%IMMED FUNC : INTEGER;
VAR IOSB : [VOLATILE]$UQUAD := %IMMED 0;
%IMMED [UNBOUND, ASYNCHRONOUS] PROCEDURE ASTADR := %IMMED 0;
%IMMED ASTPRM : UNSIGNED := %IMMED 0;
%REF P1 : [UNSAFE] ARRAY [$l7..$u7:INTEGER] OF $UBYTE := %IMMED 0;
%IMMED P2 : INTEGER := %IMMED 0;
%IMMED P3 : INTEGER := %IMMED 0;
%IMMED P4 : INTEGER := %IMMED 0;
%IMMED P5 : INTEGER := %IMMED 0;
%IMMED P6 : INTEGER := %IMMED 0) : INTEGER; EXTERNAL;
[external,asynchronous] procedure lib$stop (
%immed condition: [unsafe] integer;
%immed fao_params: [unsafe,list] integer); external;
[external] function lib$set_symbol (
%stdescr sym: [readonly] packed array [$l1..$u1: integer] of char;
%stdescr val: [readonly] packed array [$l2..$u2: integer] of char):
integer; external;
var
io$_sensechar: [value, external] integer;
io$m_ctrl: [value, external] integer;
ss$_normal: [value, external] integer;
const
nma$c_pcli_hwa = 1160; { from sys$library:lib.mlb }
devnam = 'DEQNA:' ;
symnam = 'DEQNA_ADDRESS';
bufl = 256;
type
bufb = packed array [1..bufl] of $ubyte;
bufc = packed array [1..bufl] of char;
var
chan: $uword ;
sts: integer;
iosb: $uquad;
buf: bufb;
lin: packed array [1..17] of char;
i: integer;
cd,ln,lc: integer;
crock: $uword;
hexdig: packed array [1..16] of char := '0123456789ABCDEF';
begin
sts := $assign ( devnam, chan );
if sts <> ss$_normal then lib$stop(sts);
for i := 1 to bufl do buf[i] := 0;
sts := $qiow ( chan := chan, iosb := iosb,
func := io$_sensechar+io$m_ctrl, p2 := %stdescr buf::bufc);
if sts <> ss$_normal then lib$stop(sts);
crock := (iosb.L0)::$uword;
if crock <> ss$_normal then lib$stop(iosb.L0);
i := 1;
repeat
cd := int(buf[i+1]*256 + buf[i]);
if uand(cd,4096) = 0 then begin
lc := i + 2;
ln := 4;
end else begin
lc := i + 4;
ln := int(buf[i+3]*256 + buf[i+2]);
end;
i := lc + ln;
until (uand(cd,4095) = nma$c_pcli_hwa) or (cd = 0);
if cd <> nma$c_pcli_hwa+4096 then begin
writeln ( ' Cannot find Ethernet adaptor hardware address.');
halt;
end;
if ln <> 6 then begin
writeln ( ' Ethernet adaptor hardware address has unexpected format.');
halt;
end;
lin := '00-00-00-00-00-00' ;
for i := 0 to 5 do begin
lin[i*3+1] := hexdig[ buf[lc+i] div 16 + 1 ];
lin[i*3+2] := hexdig[ buf[lc+i] mod 16 + 1 ];
end;
sts := lib$set_symbol( symnam, lin );
if sts <> ss$_normal then lib$stop(sts);
end.
|