scsi: qla2xxx: Add beacon LED config sysfs interface
authorJoe Carnuccio <joe.carnuccio@cavium.com>
Wed, 12 Feb 2020 21:44:12 +0000 (13:44 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 21 Feb 2020 23:30:59 +0000 (18:30 -0500)
commit07553b1e83b46414caa693ba10d1a16487409b61
tree818e966461e60ab6b556da49d03ff90ff4a3f6d6
parent1bf630fddd505e4d3e1c7e857eb54f8da787fe9a
scsi: qla2xxx: Add beacon LED config sysfs interface

This patch provides an interface to do the following (using MBC 0x3B):

 - Displays (in hex) the LED config words for all three LEDs.

 - Programs the config words for one LED or for all three LEDs.

The sysfs node defined is named beacon_config.

First, to allow driver to gain LED control, do this:
 # echo 1 > /sys/class/scsi_host/host#/beacon

Then, to display config words for all three LEDs do this:
 # cat /sys/class/scsi_host/host#/beacon_config

To set config words for all three LEDs do this:
 # echo 3 xxxx yyyy zzzz > /sys/class/scsi_host/host#/beacon_config

Or, to set config word for a specific single LED n do this:
 # echo n xxxx > /sys/class/scsi_host/host#/beacon_config
  where n is the LED number (0, 1, 2)

Finally, to restore LED control back to firmware, do this:
 # echo 0 > /sys/class/scsi_host/host#/beacon

Link: https://lore.kernel.org/r/20200212214436.25532-2-hmadhani@marvell.com
Signed-off-by: Joe Carnuccio <joe.carnuccio@cavium.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qla2xxx/qla_attr.c
drivers/scsi/qla2xxx/qla_def.h
drivers/scsi/qla2xxx/qla_gbl.h
drivers/scsi/qla2xxx/qla_mbx.c