# Tests of DL_PHYS_ADDR_REQ, DL_SET_PHYS_ADDR_REQ
#	1) Error conditions:
#	    DL_OUTSTATE -- stream in state DL_UNATTACHED 
#	    DL_BADADDR -- address information invalid
#	    DL_BUSY -- one or more streams bound for same PPA
#	2) Normal use of DL_PHYS_ADDR_REQ -- verify can get default
#	    and current address before and after a set.


###### Test case #1 ######
open 1

# Try to send DL_PHYS_ADDR_REQ, DL_SET_PHYS_ADDR_REQ when in state DL_UNATTACHED
phys_addr $1 1		dl_error_ack dl_outstate
set_phys_addr $1 0:1:2:3:4:5		dl_error_ack dl_outstate

attach $1 43

# Try to specify a bad address
set_phys_addr $1 0:1:2:3:4:5,40		dl_error_ack dl_badaddr

bind $1 40 1 0 0 0

# Try to set address when one or more streams bound
set_phys_addr $1 0:1:2:3:4:5		dl_error_ack dl_busy

close $1

###### Test case #2 ######
open 1

attach $1 43

# Get default address
phys_addr $1 1

# Current should be the same
phys_addr $1 2

# Set current address
set_phys_addr $1 0:1:2:3:4:5

# Default should be unchanged
phys_addr $1 1

# Current should be new
phys_addr $1 2

# Restore
set_phys_addr $1 0:0:0:0:0:0

# Get default address
phys_addr $1 1

# Current should be the same
phys_addr $1 2

close $1
