aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla4xxx/ql4_def.h
diff options
context:
space:
mode:
authorManish Rangankar <manish.rangankar@qlogic.com>2011-07-25 14:48:53 -0400
committerJames Bottomley <JBottomley@Parallels.com>2011-08-27 10:36:24 -0400
commitb3a271a94d0034dd3bab10b8d8cd432843be629e (patch)
treee6b3db659daf0aa5c18394e0e58eb43c0a1c68af /drivers/scsi/qla4xxx/ql4_def.h
parent17fa575eec7254fb089f858cae135d64cd015440 (diff)
[SCSI] qla4xxx: support iscsiadm session mgmt
Add scsi_transport_iscsi hooks in qla4xxx to support iSCSI session management using iscsiadm. This patch is based on discussion here http://groups.google.com/group/open-iscsi/browse_thread/thread/e89fd888baf656a0# Now users can use iscsiadm to do target discovery and do login/logout to individual targets using the qla4xxx iSCSI class interface. This patch leaves some dead code, but to make it easier to review we are leaving and in the next patch we will remove that old code. V2 - NOTE: Added code to avoid waiting for AEN during login/logout in the driver, instead added a kernel to user event to notify iscsid about login status. Because of this iscsid will not get blocked. Signed-off-by: Manish Rangankar <manish.rangankar@qlogic.com> Signed-off-by: Lalit Chandivade <lalit.chandivade@qlogic.com> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/qla4xxx/ql4_def.h')
-rw-r--r--drivers/scsi/qla4xxx/ql4_def.h36
1 files changed, 32 insertions, 4 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_def.h b/drivers/scsi/qla4xxx/ql4_def.h
index b17f5c43bbe4..3e404fe8e36d 100644
--- a/drivers/scsi/qla4xxx/ql4_def.h
+++ b/drivers/scsi/qla4xxx/ql4_def.h
@@ -36,9 +36,12 @@
36#include <scsi/scsi_transport_iscsi.h> 36#include <scsi/scsi_transport_iscsi.h>
37#include <scsi/scsi_bsg_iscsi.h> 37#include <scsi/scsi_bsg_iscsi.h>
38#include <scsi/scsi_netlink.h> 38#include <scsi/scsi_netlink.h>
39#include <scsi/libiscsi.h>
39 40
40#include "ql4_dbg.h" 41#include "ql4_dbg.h"
41#include "ql4_nx.h" 42#include "ql4_nx.h"
43#include "ql4_fw.h"
44#include "ql4_nvram.h"
42 45
43#ifndef PCI_DEVICE_ID_QLOGIC_ISP4010 46#ifndef PCI_DEVICE_ID_QLOGIC_ISP4010
44#define PCI_DEVICE_ID_QLOGIC_ISP4010 0x4010 47#define PCI_DEVICE_ID_QLOGIC_ISP4010 0x4010
@@ -112,7 +115,7 @@
112#define MAX_BUSES 1 115#define MAX_BUSES 1
113#define MAX_TARGETS MAX_DEV_DB_ENTRIES 116#define MAX_TARGETS MAX_DEV_DB_ENTRIES
114#define MAX_LUNS 0xffff 117#define MAX_LUNS 0xffff
115#define MAX_AEN_ENTRIES 256 /* should be > EXT_DEF_MAX_AEN_QUEUE */ 118#define MAX_AEN_ENTRIES MAX_DEV_DB_ENTRIES
116#define MAX_DDB_ENTRIES MAX_DEV_DB_ENTRIES 119#define MAX_DDB_ENTRIES MAX_DEV_DB_ENTRIES
117#define MAX_PDU_ENTRIES 32 120#define MAX_PDU_ENTRIES 32
118#define INVALID_ENTRY 0xFFFF 121#define INVALID_ENTRY 0xFFFF
@@ -296,8 +299,6 @@ struct ddb_entry {
296#define DF_FO_MASKED 3 299#define DF_FO_MASKED 3
297 300
298 301
299#include "ql4_fw.h"
300#include "ql4_nvram.h"
301 302
302struct ql82xx_hw_data { 303struct ql82xx_hw_data {
303 /* Offsets for flash/nvram access (set to ~0 if not used). */ 304 /* Offsets for flash/nvram access (set to ~0 if not used). */
@@ -607,6 +608,33 @@ struct scsi_qla_host {
607#define QLFLASH_WAITING 0 608#define QLFLASH_WAITING 0
608#define QLFLASH_READING 1 609#define QLFLASH_READING 1
609#define QLFLASH_WRITING 2 610#define QLFLASH_WRITING 2
611 struct dma_pool *chap_dma_pool;
612#define CHAP_DMA_BLOCK_SIZE 512
613 struct workqueue_struct *task_wq;
614 unsigned long ddb_idx_map[MAX_DDB_ENTRIES / BITS_PER_LONG];
615};
616
617struct ql4_task_data {
618 struct scsi_qla_host *ha;
619 uint8_t iocb_req_cnt;
620 dma_addr_t data_dma;
621 void *req_buffer;
622 dma_addr_t req_dma;
623 void *resp_buffer;
624 dma_addr_t resp_dma;
625 uint32_t resp_len;
626 struct iscsi_task *task;
627 struct passthru_status sts;
628 struct work_struct task_work;
629};
630
631struct qla_endpoint {
632 struct Scsi_Host *host;
633 struct sockaddr dst_addr;
634};
635
636struct qla_conn {
637 struct qla_endpoint *qla_ep;
610}; 638};
611 639
612static inline int is_ipv4_enabled(struct scsi_qla_host *ha) 640static inline int is_ipv4_enabled(struct scsi_qla_host *ha)
@@ -657,7 +685,7 @@ static inline int adapter_up(struct scsi_qla_host *ha)
657 685
658static inline struct scsi_qla_host* to_qla_host(struct Scsi_Host *shost) 686static inline struct scsi_qla_host* to_qla_host(struct Scsi_Host *shost)
659{ 687{
660 return (struct scsi_qla_host *)shost->hostdata; 688 return (struct scsi_qla_host *)iscsi_host_priv(shost);
661} 689}
662 690
663static inline void __iomem* isp_semaphore(struct scsi_qla_host *ha) 691static inline void __iomem* isp_semaphore(struct scsi_qla_host *ha)