scsi: ibmvfc: Add helper for testing capability flags
authorTyrel Datwyler <tyreld@linux.ibm.com>
Wed, 18 Nov 2020 01:11:01 +0000 (19:11 -0600)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 20 Nov 2020 03:09:11 +0000 (22:09 -0500)
commita318c2b71ccee720134e9a43b9b1afbea50f0578
tree28524e25e64efd445218640c628c1f42cc1dd000
parentc16b8a6d8af15364e562ed4d61b05fb826151712
scsi: ibmvfc: Add helper for testing capability flags

Testing the NPIV Login response capabilities is a long winded process of
dereferencing the vhost->login_buf->resp.capabilities field, then byte
swapping that value to host endian, and performing the bitwise test.
Currently we only ever check this in ibmvfc_cancel_all(), but follow-up
patches will need to regularly check for targetWWPN and channelization
support.

Add a helper to simplify checking various VIOS capabilities, namely
ibmvfc_check_caps().

Link: https://lore.kernel.org/r/20201118011104.296999-4-tyreld@linux.ibm.com
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ibmvscsi/ibmvfc.c