Sync iscsi fw boot flags
PATCH 1/1 Sync iscsi fw boot flags
From: Mike Christie <[email protected]>
iBFT and non-iBFT drivers use the same iscsi boot sysfs interface. For iBFT we just directly export whatever is left by the FW. For non-iBFT drivers we do vendor specific commands to get the info or its just hard coded.
This patch syncs up how non-iBFT drivers export boot flag info. The boot flags being defined in this patch match the iBFT flags that indicate if the boot info found was valid and if it was used for to boot with.
--- drivers/scsi/be2iscsi/be_main.c | 8 +++++--- drivers/scsi/qla4xxx/ql4_def.h | 1 - drivers/scsi/qla4xxx/ql4_os.c | 6 ++++-- include/linux/iscsi_boot_sysfs.h | 3 +++ 4 files changed, 12 insertions(+), 6 deletions(-)
drivers/scsi/be2iscsi/be_main.c +5 -3
@@ -429,7 +429,8 @@ static ssize_t beiscsi_show_boot_tgt_info(void *data, int type, char *buf) auth_data.chap.intr_secret);break ;case ISCSI_BOOT_TGT_FLAGS : - rc =sprintf (str,"2\n" ); + rc =sprintf (str,"%u\n" , +ISCSI_BOOT_FLAG_VALID |ISCSI_BOOT_FLAG_FW_BOOT_SEL );break ;case ISCSI_BOOT_TGT_NIC_ASSOC : rc =sprintf (str,"0\n" );
@@ -466,8 +467,9 @@ static ssize_t beiscsi_show_boot_eth_info(void *data, int type, char *buf)switch (type) {case ISCSI_BOOT_ETH_FLAGS : - rc =sprintf (str,"2\n" ); -break ; + rc =sprintf (str,"%u\n" , +ISCSI_BOOT_FLAG_VALID |ISCSI_BOOT_FLAG_FW_BOOT_SEL ); +break ;case ISCSI_BOOT_ETH_INDEX : rc =sprintf (str,"0\n" );break ;
drivers/scsi/qla4xxx/ql4_def.h +0 -1
@@ -796,7 +796,6 @@ struct scsi_qla_host {#define CHAP_DMA_BLOCK_SIZE 512struct workqueue_struct *task_wq;unsigned long ddb_idx_map[MAX_DDB_ENTRIES /BITS_PER_LONG ]; -#define SYSFS_FLAG_FW_SEL_BOOT 2struct iscsi_boot_kset *boot_kset;struct ql4_boot_tgt_info boot_tgt;uint16_t phy_port_num;
drivers/scsi/qla4xxx/ql4_os.c +4 -2
@@ -5705,7 +5705,8 @@ static ssize_t qla4xxx_show_boot_eth_info(void *data, int type, char *buf)switch (type) {case ISCSI_BOOT_ETH_FLAGS : - rc =sprintf (str,"%d\n" ,SYSFS_FLAG_FW_SEL_BOOT ); + rc =sprintf (str,"%d\n" , +ISCSI_BOOT_FLAG_VALID |ISCSI_BOOT_FLAG_FW_BOOT_SEL );break ;case ISCSI_BOOT_ETH_INDEX : rc =sprintf (str,"0\n" );
@@ -5814,7 +5815,8 @@ qla4xxx_show_boot_tgt_info(struct ql4_boot_session_info *boot_sess, int type, (char *)&boot_conn->chap.intr_secret);break ;case ISCSI_BOOT_TGT_FLAGS : - rc =sprintf (str,"%d\n" ,SYSFS_FLAG_FW_SEL_BOOT ); + rc =sprintf (str,"%d\n" , +ISCSI_BOOT_FLAG_VALID |ISCSI_BOOT_FLAG_FW_BOOT_SEL );break ;case ISCSI_BOOT_TGT_NIC_ASSOC : rc =sprintf (str,"0\n" );
include/linux/iscsi_boot_sysfs.h +3 -0
@@ -16,6 +16,9 @@#ifndef _ISCSI_BOOT_SYSFS_#define _ISCSI_BOOT_SYSFS_ +#define ISCSI_BOOT_FLAG_VALID 0x1 +#define ISCSI_BOOT_FLAG_FW_BOOT_SEL 0x2 +/* * The text attributes names for each of the kobjects. */
Signature · 1 line
1.8.3.1
Quoted 88 lines · On 02/03/2015 06:28 PM, [email protected] wrote:
From: Mike Christie <[email protected]>
iBFT and non-iBFT drivers use the same iscsi boot sysfs interface. For iBFT we just directly export whatever is left by the FW. For non-iBFT drivers we do vendor specific commands to get the info or its just hard coded.
This patch syncs up how non-iBFT drivers export boot flag info. The boot flags being defined in this patch match the iBFT flags that indicate if the boot info found was valid and if it was used for to boot with.
Signed-off-by Mike Christie <[email protected]>--- drivers/scsi/be2iscsi/be_main.c | 8 +++++--- drivers/scsi/qla4xxx/ql4_def.h | 1 - drivers/scsi/qla4xxx/ql4_os.c | 6 ++++-- include/linux/iscsi_boot_sysfs.h | 3 +++ 4 files changed, 12 insertions(+), 6 deletions(-)drivers/scsi/be2iscsi/be_main.c +5
-3@@ -429,7 +429,8 @@ static ssize_t beiscsi_show_boot_tgt_info(void *data, int type, char *buf) auth_data.chap.intr_secret);break ;case ISCSI_BOOT_TGT_FLAGS : - rc =sprintf (str,"2\n" ); + rc =sprintf (str,"%u\n" , +ISCSI_BOOT_FLAG_VALID |ISCSI_BOOT_FLAG_FW_BOOT_SEL );break ;case ISCSI_BOOT_TGT_NIC_ASSOC : rc =sprintf (str,"0\n" );@@ -466,8 +467,9 @@ static ssize_t beiscsi_show_boot_eth_info(void *data, int type, char *buf)switch (type) {case ISCSI_BOOT_ETH_FLAGS : - rc =sprintf (str,"2\n" ); -break ; + rc =sprintf (str,"%u\n" , +ISCSI_BOOT_FLAG_VALID |ISCSI_BOOT_FLAG_FW_BOOT_SEL ); +break ;case ISCSI_BOOT_ETH_INDEX : rc =sprintf (str,"0\n" );break ;drivers/scsi/qla4xxx/ql4_def.h +0
-1@@ -796,7 +796,6 @@ struct scsi_qla_host {#define CHAP_DMA_BLOCK_SIZE 512struct workqueue_struct *task_wq;unsigned long ddb_idx_map[MAX_DDB_ENTRIES /BITS_PER_LONG ]; -#define SYSFS_FLAG_FW_SEL_BOOT 2struct iscsi_boot_kset *boot_kset;struct ql4_boot_tgt_info boot_tgt;uint16_t phy_port_num;drivers/scsi/qla4xxx/ql4_os.c +4
-2@@ -5705,7 +5705,8 @@ static ssize_t qla4xxx_show_boot_eth_info(void *data, int type, char *buf)switch (type) {case ISCSI_BOOT_ETH_FLAGS : - rc =sprintf (str,"%d\n" ,SYSFS_FLAG_FW_SEL_BOOT ); + rc =sprintf (str,"%d\n" , +ISCSI_BOOT_FLAG_VALID |ISCSI_BOOT_FLAG_FW_BOOT_SEL );break ;case ISCSI_BOOT_ETH_INDEX : rc =sprintf (str,"0\n" );@@ -5814,7 +5815,8 @@ qla4xxx_show_boot_tgt_info(struct ql4_boot_session_info *boot_sess, int type, (char *)&boot_conn->chap.intr_secret);break ;case ISCSI_BOOT_TGT_FLAGS : - rc =sprintf (str,"%d\n" ,SYSFS_FLAG_FW_SEL_BOOT ); + rc =sprintf (str,"%d\n" , +ISCSI_BOOT_FLAG_VALID |ISCSI_BOOT_FLAG_FW_BOOT_SEL );break ;case ISCSI_BOOT_TGT_NIC_ASSOC : rc =sprintf (str,"0\n" );include/linux/iscsi_boot_sysfs.h +0
-0
include/linux/iscsi_boot_sysfs.h line 24
Quoted 9 lines
include/linux/iscsi_boot_sysfs.h +3
-0@@ -16,6 +16,9 @@#ifndef _ISCSI_BOOT_SYSFS_#define _ISCSI_BOOT_SYSFS_ +#define ISCSI_BOOT_FLAG_VALID 0x1 +#define ISCSI_BOOT_FLAG_FW_BOOT_SEL 0x2 +/* * The text attributes names for each of the kobjects. */
Signature · 2 lines
Lee Duncan SUSE Labs