* [PATCH 1/1] Sync iscsi fw boot flags
@ 2015-02-04 2:28 michaelc
2015-02-05 16:09 ` Lee Duncan
0 siblings, 1 reply; 2+ messages in thread
From: michaelc @ 2015-02-04 2:28 UTC (permalink / raw)
To: linux-scsi
From: Mike Christie <michaelc@cs.wisc.edu>
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@cs.wisc.edu>
---
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.
*/
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/1] Sync iscsi fw boot flags
2015-02-04 2:28 [PATCH 1/1] Sync iscsi fw boot flags michaelc
@ 2015-02-05 16:09 ` Lee Duncan
0 siblings, 0 replies; 2+ messages in thread
From: Lee Duncan @ 2015-02-05 16:09 UTC (permalink / raw)
To: michaelc, linux-scsi
On 02/03/2015 06:28 PM, michaelc@cs.wisc.edu wrote:
> From: Mike Christie <michaelc@cs.wisc.edu>
>
> 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@cs.wisc.edu>
> ---
> 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@suse.com>
--
Lee Duncan
SUSE Labs
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-02-05 16:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-04 2:28 [PATCH 1/1] Sync iscsi fw boot flags michaelc
2015-02-05 16:09 ` Lee Duncan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).