diff options
author | Nilesh Javali <nilesh.javali@qlogic.com> | 2012-02-27 06:08:51 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-02-29 17:55:59 -0500 |
commit | 6260a5d221225f4e6befd98c6001325a3007a8c4 (patch) | |
tree | 710ae4cf58f56124fba9b6781b87745ec1dba9fa /include/scsi | |
parent | 8270ee2abb78c73b73e04f2909b0de15540c9017 (diff) |
[SCSI] iscsi_transport: Add support to display CHAP list and delete CHAP entry
For offload iSCSI like qla4xxx CHAP entries are stored in FLASH.
This patch adds support to list CHAP entries stored in FLASH and
delete specified CHAP entry from FLASH using iscsi tools.
Signed-off-by: Nilesh Javali <nilesh.javali@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'include/scsi')
-rw-r--r-- | include/scsi/iscsi_if.h | 29 | ||||
-rw-r--r-- | include/scsi/scsi_transport_iscsi.h | 4 |
2 files changed, 33 insertions, 0 deletions
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h index 7ff9678b7e79..228a8af05129 100644 --- a/include/scsi/iscsi_if.h +++ b/include/scsi/iscsi_if.h | |||
@@ -61,6 +61,8 @@ enum iscsi_uevent_e { | |||
61 | ISCSI_UEVENT_PATH_UPDATE = UEVENT_BASE + 20, | 61 | ISCSI_UEVENT_PATH_UPDATE = UEVENT_BASE + 20, |
62 | ISCSI_UEVENT_SET_IFACE_PARAMS = UEVENT_BASE + 21, | 62 | ISCSI_UEVENT_SET_IFACE_PARAMS = UEVENT_BASE + 21, |
63 | ISCSI_UEVENT_PING = UEVENT_BASE + 22, | 63 | ISCSI_UEVENT_PING = UEVENT_BASE + 22, |
64 | ISCSI_UEVENT_GET_CHAP = UEVENT_BASE + 23, | ||
65 | ISCSI_UEVENT_DELETE_CHAP = UEVENT_BASE + 24, | ||
64 | 66 | ||
65 | /* up events */ | 67 | /* up events */ |
66 | ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1, | 68 | ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1, |
@@ -196,6 +198,18 @@ struct iscsi_uevent { | |||
196 | uint32_t pid; /* unique ping id associated | 198 | uint32_t pid; /* unique ping id associated |
197 | with each ping request */ | 199 | with each ping request */ |
198 | } iscsi_ping; | 200 | } iscsi_ping; |
201 | struct msg_get_chap { | ||
202 | uint32_t host_no; | ||
203 | uint32_t num_entries; /* number of CHAP entries | ||
204 | * on request, number of | ||
205 | * valid CHAP entries on | ||
206 | * response */ | ||
207 | uint16_t chap_tbl_idx; | ||
208 | } get_chap; | ||
209 | struct msg_delete_chap { | ||
210 | uint32_t host_no; | ||
211 | uint16_t chap_tbl_idx; | ||
212 | } delete_chap; | ||
199 | } u; | 213 | } u; |
200 | union { | 214 | union { |
201 | /* messages k -> u */ | 215 | /* messages k -> u */ |
@@ -548,4 +562,19 @@ struct iscsi_stats { | |||
548 | __attribute__ ((aligned (sizeof(uint64_t)))); | 562 | __attribute__ ((aligned (sizeof(uint64_t)))); |
549 | }; | 563 | }; |
550 | 564 | ||
565 | enum chap_type_e { | ||
566 | CHAP_TYPE_OUT, | ||
567 | CHAP_TYPE_IN, | ||
568 | }; | ||
569 | |||
570 | #define ISCSI_CHAP_AUTH_NAME_MAX_LEN 256 | ||
571 | #define ISCSI_CHAP_AUTH_SECRET_MAX_LEN 256 | ||
572 | struct iscsi_chap_rec { | ||
573 | uint16_t chap_tbl_idx; | ||
574 | enum chap_type_e chap_type; | ||
575 | char username[ISCSI_CHAP_AUTH_NAME_MAX_LEN]; | ||
576 | uint8_t password[ISCSI_CHAP_AUTH_SECRET_MAX_LEN]; | ||
577 | uint8_t password_length; | ||
578 | } __packed; | ||
579 | |||
551 | #endif | 580 | #endif |
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h index aede513f99bd..53f0b361d668 100644 --- a/include/scsi/scsi_transport_iscsi.h +++ b/include/scsi/scsi_transport_iscsi.h | |||
@@ -147,6 +147,9 @@ struct iscsi_transport { | |||
147 | int (*send_ping) (struct Scsi_Host *shost, uint32_t iface_num, | 147 | int (*send_ping) (struct Scsi_Host *shost, uint32_t iface_num, |
148 | uint32_t iface_type, uint32_t payload_size, | 148 | uint32_t iface_type, uint32_t payload_size, |
149 | uint32_t pid, struct sockaddr *dst_addr); | 149 | uint32_t pid, struct sockaddr *dst_addr); |
150 | int (*get_chap) (struct Scsi_Host *shost, uint16_t chap_tbl_idx, | ||
151 | uint32_t *num_entries, char *buf); | ||
152 | int (*delete_chap) (struct Scsi_Host *shost, uint16_t chap_tbl_idx); | ||
150 | }; | 153 | }; |
151 | 154 | ||
152 | /* | 155 | /* |
@@ -325,5 +328,6 @@ extern void iscsi_destroy_iface(struct iscsi_iface *iface); | |||
325 | extern struct iscsi_iface *iscsi_lookup_iface(int handle); | 328 | extern struct iscsi_iface *iscsi_lookup_iface(int handle); |
326 | extern char *iscsi_get_port_speed_name(struct Scsi_Host *shost); | 329 | extern char *iscsi_get_port_speed_name(struct Scsi_Host *shost); |
327 | extern char *iscsi_get_port_state_name(struct Scsi_Host *shost); | 330 | extern char *iscsi_get_port_state_name(struct Scsi_Host *shost); |
331 | extern int iscsi_is_session_dev(const struct device *dev); | ||
328 | 332 | ||
329 | #endif | 333 | #endif |