Re: [PATCH 1/1] Sync iscsi fw boot flags

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 02/03/2015 06:28 PM, michaelc@xxxxxxxxxxx wrote:
> From: Mike Christie <michaelc@xxxxxxxxxxx>
> 
> 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 <michaelc@xxxxxxxxxxx>
> ---
>  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(-)
> 
> diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
> index f319340..cd4aff9 100644
> --- a/drivers/scsi/be2iscsi/be_main.c
> +++ b/drivers/scsi/be2iscsi/be_main.c
> @@ -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;
> diff --git a/drivers/scsi/qla4xxx/ql4_def.h b/drivers/scsi/qla4xxx/ql4_def.h
> index 8f6d0fb..0380669 100644
> --- a/drivers/scsi/qla4xxx/ql4_def.h
> +++ b/drivers/scsi/qla4xxx/ql4_def.h
> @@ -796,7 +796,6 @@ struct scsi_qla_host {
>  #define CHAP_DMA_BLOCK_SIZE    512
>  	struct workqueue_struct *task_wq;
>  	unsigned long ddb_idx_map[MAX_DDB_ENTRIES / BITS_PER_LONG];
> -#define SYSFS_FLAG_FW_SEL_BOOT 2
>  	struct iscsi_boot_kset *boot_kset;
>  	struct ql4_boot_tgt_info boot_tgt;
>  	uint16_t phy_port_num;
> diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
> index 6d25879..b63985f 100644
> --- a/drivers/scsi/qla4xxx/ql4_os.c
> +++ b/drivers/scsi/qla4xxx/ql4_os.c
> @@ -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");
> diff --git a/include/linux/iscsi_boot_sysfs.h b/include/linux/iscsi_boot_sysfs.h
> index 2a8b165..3f273d6 100644
> --- a/include/linux/iscsi_boot_sysfs.h
> +++ b/include/linux/iscsi_boot_sysfs.h
> @@ -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.
>  */
> 

Reviewed-by: Lee Duncan <lduncan@xxxxxxxx>

-- 
Lee Duncan
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux