Something to add on gaurav's post, the one he shared is a Qlogic card on kernel 2.4
--> For emulex cards, it will be /proc/scsi/lpfc/1 (1 here is hba#1, look for parameter called "nodename")
For kernel 2.6 --> it will be in /sys/class/fc_host/host1 (where host1 is the directory, look for port)
Alternatively, you can refer back to your HBA card documentation. They have their own commands for listing the WWN port name.
i.e for emulex cards:
# hbacmd listhbas (use this to list the hba cards)
# hbacmd hbattribs WWN (use this for firmware checks and so on)