scsi: libfc: Rework PRLI handling
authorHannes Reinecke <hare@suse.de>
Thu, 13 Oct 2016 13:10:46 +0000 (15:10 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 8 Nov 2016 22:29:52 +0000 (17:29 -0500)
commit386b97b43c0c9e0d878eec7ea1db16af22b036ae
tree2a82df8247ce37fa7fbb4c39a10829e1542ddf1e
parent7c5a51b8f82fcfba1925fa64f08413c8258590d2
scsi: libfc: Rework PRLI handling

PRLI is only required if the port is acting as an initiator; ports
which support target functionality only do not need to send PRLI.
At the same time the PRLI state is only used if the port initiated
a PRLI transfer; if we received a PRLI request we should _not_
change the state as this would cause our PRLI response to be dropped.
And when we receive a PRLI response we need to check if an image
pair has been established; if not the remote port cannot act as a
target for us and we need to disable target functionality.

Signed-off-by: Hannes Reinecke <hare@suse.com>
Acked-by: Johannes Thumshirn <jth@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/libfc/fc_rport.c