.title sys_find_ether_device .ident "X1-003" ;+ ; Version: X1-003 ; ; Facility: General system routines. ; ; Abstract: Locate and return the name of the first ethernet device on ; the system. ; ; Environment: User mode. ; ; History: ; ; 20-Nov-1991, DBS; Version X1-001 ; 001 - Original version. ; 19-Jan-1996, DBS; Version X1-002 ; 002 - Added code for alpha. ; 26-May-2004, DBS; version X1-003 ; 003 - Removed the checking for specific devices -- just use dc$_scom. ; This was done originally (on VAX) but was changed to skip certain ; non-ethernet devices. It is possible to get a device that is not ; an ethernet device. ;- ;++ ; Functional Description: ; This routine uses the device scan system service to locate the first, ; if any, ethernet device on the system. ; ; Calling Sequence: ; call sys_find_ether_device (device_name) ; -or- ; pushaq device-name ; calls #1, g^sys_find_ether_device ; ; Formal Argument(s): ; device_name.wt.ds Address of a string descriptor pointing to the ; string that will contain the returned device name. ; ; Implicit Inputs: ; None ; ; Implicit Outputs: ; None ; ; Routine Value: ; As returned by $device_scan. ; ; Side Effects: ; None ;-- .library "SYS$LIBRARY:LIB.MLB" .library "SYS$LIBRARY:STARLET.MLB" .library "DBSLIBRARY:SYS_MACROS.MLB" .link "SYS$SYSTEM:SYS.STB" /selective_search .iif defined, alpha, .disable flagging .iif defined, ia64, .disable flagging .disable global $dcdef $devdef $dvidef $dvsdef $gblini GLOBAL def_psect _sys_data, type=DATA, alignment=LONG def_psect _sys_code, type=CODE, alignment=LONG set_psect _sys_data dvs_device_class: .long dc$_scom dvs_search_name: .ascid "*" alloc_string dvs_device_name, 64 dvs_context: .quad 0 dvs_item_list: .word 4 .word dvs$_devclass .address dvs_device_class .long 0 .long 0 ; to end the list reset_psect set_psect _sys_code .entry - sys_find_ether_device, ^m pushr #^m movq @4(ap), r0 movzwl r0, r0 movc5 #0, ., #32, r0, (r1) ; clear the result first popr #^m 10$: $device_scan_s - return_devnam=dvs_device_name_ds, - retlen=dvs_device_name, - search_devnam=dvs_search_name, - itmlst=dvs_item_list, - contxt=dvs_context blbc r0, 90$ pushr #^m movq @4(ap), r0 movzwl r0, r0 movc5 dvs_device_name, - dvs_device_name_t, #32, - r0, (r1) popr #^m 90$: ret .end