Check the HBA WWNs using luxadm command...

# luxadm -e port < -- check the link status.

Found path to 3 HBA ports

/devices/pci@8,600000/SUNW,qlc@4/fp@0,0:devctl CONNECTED

/devices/pci@8,700000/lpfc@2/fp@0,0:devctl CONNECTED

/devices/pci@8,700000/fibre-channel@3/fp@0,0:devctl CONNECTED

root: / >

# luxadm -e dump_map /devices/pci@8,700000/lpfc@2/fp@0,0:devctl <----------------- Use the HBA path here

Pos Port_ID Hard_Addr Port WWN Node WWN Type

0 140001 0 5005076300c3a73d 5005076300c0a73d 0x1f (Unknown Type)

1 14000b 0 5005076300cba73d 5005076300c0a73d 0x1f (Unknown Type)

2 14000c 0 5005076300cfa73d 5005076300c0a73d 0x1f (Unknown Type)

3 14000d 0 5005076300c7a73d 5005076300c0a73d 0x1f (Unknown Type)

4 a5e662 0 5005076300c79565 5005076300c09565 0x0 (Disk device)

5 a5e663 0 5005076300c39565 5005076300c09565 0x0 (Disk device)

6 20024 0 10000000c9430869 20000000c9430869 0x1f (Unknown Type,Host Bus Adapter) < --------------------- WWN in Green

root : >

#

Check the process with the help of port....

#!/bin/ksh

line='---------------------------------------------'
pids=$(/usr/bin/ps -ef | sed 1d | awk '{print $2}')

if [ $# -eq 0 ]; then
read ans?"Enter port you would like to know pid for: "
else
ans=$1
fi

for f in $pids
do
/usr/proc/bin/pfiles $f 2>/dev/null | /usr/xpg4/bin/grep -q "port: $ans"
if [ $? -eq 0 ]; then
echo $line
echo "Port: $ans is being used by PID:\c"
/usr/bin/ps -ef -o pid -o args | egrep -v "grep|pfiles" | grep $f
fi
done
exit 0


--------------------------------------------------------------

# ./portcheck.sh
Enter port you would like to know pid for:22
---------------------------------------------
Port: 22 is being used by PID: 5936 ssh ncens180
---------------------------------------------
Port: 22 is being used by PID: 462 /usr/local/sbin/sshd
---------------------------------------------
Port: 22 is being used by PID:27325 ssh usnencs006
---------------------------------------------
Port: 22 is being used by PID: 5397 /usr/local/sbin/sshd
---------------------------------------------
Port: 22 is being used by PID: 7026 ssh usnencs009
---------------------------------------------
Port: 22 is being used by PID: 898 /usr/local/sbin/sshd
---------------------------------------------
Port: 22 is being used by PID:14100 /usr/local/sbin/sshd
---------------------------------------------
Port: 22 is being used by PID: 8931 ssh ncens185
---------------------------------------------
Port: 22 is being used by PID:26979 /usr/local/sbin/sshd
---------------------------------------------
Port: 22 is being used by PID: 8025 ssh ncens185
---------------------------------------------
Port: 22 is being used by PID: 3915 /usr/local/sbin/sshd
---------------------------------------------
Port: 22 is being used by PID: 5699 /usr/local/sbin/sshd
---------------------------------------------
Port: 22 is being used by PID: 8467 ssh usnencs201
---------------------------------------------
Port: 22 is being used by PID: 6658 ssh ncens185
---------------------------------------------
Port: 22 is being used by PID:13167 /usr/local/sbin/sshd
---------------------------------------------
Port: 22 is being used by PID: 6656 /usr/local/sbin/sshd
---------------------------------------------
Port: 22 is being used by PID: 7718 /usr/local/sbin/sshd
root: />