You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
[SCSI] lpfc 8.3.4: Add bsg (SGIOv4) support for ELS/CT support
Add bsg (SGIOv4) support for sending and receiving ELS, CT commands This patch adds a new file, lpfc_bsg.c. Signed-off-by: James Smart <James.Smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
This commit is contained in:
committed by
James Bottomley
parent
1c6834a7e8
commit
f1c3b0fcbb
@@ -28,4 +28,4 @@ obj-$(CONFIG_SCSI_LPFC) := lpfc.o
|
|||||||
|
|
||||||
lpfc-objs := lpfc_mem.o lpfc_sli.o lpfc_ct.o lpfc_els.o lpfc_hbadisc.o \
|
lpfc-objs := lpfc_mem.o lpfc_sli.o lpfc_ct.o lpfc_els.o lpfc_hbadisc.o \
|
||||||
lpfc_init.o lpfc_mbox.o lpfc_nportdisc.o lpfc_scsi.o lpfc_attr.o \
|
lpfc_init.o lpfc_mbox.o lpfc_nportdisc.o lpfc_scsi.o lpfc_attr.o \
|
||||||
lpfc_vport.o lpfc_debugfs.o
|
lpfc_vport.o lpfc_debugfs.o lpfc_bsg.o
|
||||||
|
|||||||
@@ -441,6 +441,12 @@ enum intr_type_t {
|
|||||||
MSIX,
|
MSIX,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct unsol_rcv_ct_ctx {
|
||||||
|
uint32_t ctxt_id;
|
||||||
|
uint32_t SID;
|
||||||
|
uint32_t oxid;
|
||||||
|
};
|
||||||
|
|
||||||
struct lpfc_hba {
|
struct lpfc_hba {
|
||||||
/* SCSI interface function jump table entries */
|
/* SCSI interface function jump table entries */
|
||||||
int (*lpfc_new_scsi_buf)
|
int (*lpfc_new_scsi_buf)
|
||||||
@@ -776,6 +782,11 @@ struct lpfc_hba {
|
|||||||
uint8_t valid_vlan;
|
uint8_t valid_vlan;
|
||||||
uint16_t vlan_id;
|
uint16_t vlan_id;
|
||||||
struct list_head fcf_conn_rec_list;
|
struct list_head fcf_conn_rec_list;
|
||||||
|
|
||||||
|
struct mutex ct_event_mutex; /* synchronize access to ct_ev_waiters */
|
||||||
|
struct list_head ct_ev_waiters;
|
||||||
|
struct unsol_rcv_ct_ctx ct_ctx[64];
|
||||||
|
uint32_t ctx_idx;
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline struct Scsi_Host *
|
static inline struct Scsi_Host *
|
||||||
|
|||||||
@@ -4132,6 +4132,9 @@ struct fc_function_template lpfc_transport_functions = {
|
|||||||
.vport_disable = lpfc_vport_disable,
|
.vport_disable = lpfc_vport_disable,
|
||||||
|
|
||||||
.set_vport_symbolic_name = lpfc_set_vport_symbolic_name,
|
.set_vport_symbolic_name = lpfc_set_vport_symbolic_name,
|
||||||
|
|
||||||
|
.bsg_request = lpfc_bsg_request,
|
||||||
|
.bsg_timeout = lpfc_bsg_timeout,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct fc_function_template lpfc_vport_transport_functions = {
|
struct fc_function_template lpfc_vport_transport_functions = {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -137,6 +137,9 @@ int lpfc_els_disc_adisc(struct lpfc_vport *);
|
|||||||
int lpfc_els_disc_plogi(struct lpfc_vport *);
|
int lpfc_els_disc_plogi(struct lpfc_vport *);
|
||||||
void lpfc_els_timeout(unsigned long);
|
void lpfc_els_timeout(unsigned long);
|
||||||
void lpfc_els_timeout_handler(struct lpfc_vport *);
|
void lpfc_els_timeout_handler(struct lpfc_vport *);
|
||||||
|
struct lpfc_iocbq *lpfc_prep_els_iocb(struct lpfc_vport *, uint8_t, uint16_t,
|
||||||
|
uint8_t, struct lpfc_nodelist *,
|
||||||
|
uint32_t, uint32_t);
|
||||||
void lpfc_hb_timeout_handler(struct lpfc_hba *);
|
void lpfc_hb_timeout_handler(struct lpfc_hba *);
|
||||||
|
|
||||||
void lpfc_ct_unsol_event(struct lpfc_hba *, struct lpfc_sli_ring *,
|
void lpfc_ct_unsol_event(struct lpfc_hba *, struct lpfc_sli_ring *,
|
||||||
@@ -364,3 +367,8 @@ void lpfc_start_fdiscs(struct lpfc_hba *phba);
|
|||||||
#define HBA_EVENT_LINK_UP 2
|
#define HBA_EVENT_LINK_UP 2
|
||||||
#define HBA_EVENT_LINK_DOWN 3
|
#define HBA_EVENT_LINK_DOWN 3
|
||||||
|
|
||||||
|
/* functions to support SGIOv4/bsg interface */
|
||||||
|
int lpfc_bsg_request(struct fc_bsg_job *);
|
||||||
|
int lpfc_bsg_timeout(struct fc_bsg_job *);
|
||||||
|
void lpfc_bsg_ct_unsol_event(struct lpfc_hba *, struct lpfc_sli_ring *,
|
||||||
|
struct lpfc_iocbq *);
|
||||||
|
|||||||
@@ -97,6 +97,8 @@ lpfc_ct_unsol_event(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
|
|||||||
struct list_head head;
|
struct list_head head;
|
||||||
struct lpfc_dmabuf *bdeBuf;
|
struct lpfc_dmabuf *bdeBuf;
|
||||||
|
|
||||||
|
lpfc_bsg_ct_unsol_event(phba, pring, piocbq);
|
||||||
|
|
||||||
if (unlikely(icmd->ulpStatus == IOSTAT_NEED_BUFFER)) {
|
if (unlikely(icmd->ulpStatus == IOSTAT_NEED_BUFFER)) {
|
||||||
lpfc_sli_hbqbuf_add_hbqs(phba, LPFC_ELS_HBQ);
|
lpfc_sli_hbqbuf_add_hbqs(phba, LPFC_ELS_HBQ);
|
||||||
} else if ((icmd->ulpStatus == IOSTAT_LOCAL_REJECT) &&
|
} else if ((icmd->ulpStatus == IOSTAT_LOCAL_REJECT) &&
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ lpfc_els_chk_latt(struct lpfc_vport *vport)
|
|||||||
* Pointer to the newly allocated/prepared els iocb data structure
|
* Pointer to the newly allocated/prepared els iocb data structure
|
||||||
* NULL - when els iocb data structure allocation/preparation failed
|
* NULL - when els iocb data structure allocation/preparation failed
|
||||||
**/
|
**/
|
||||||
static struct lpfc_iocbq *
|
struct lpfc_iocbq *
|
||||||
lpfc_prep_els_iocb(struct lpfc_vport *vport, uint8_t expectRsp,
|
lpfc_prep_els_iocb(struct lpfc_vport *vport, uint8_t expectRsp,
|
||||||
uint16_t cmdSize, uint8_t retry,
|
uint16_t cmdSize, uint8_t retry,
|
||||||
struct lpfc_nodelist *ndlp, uint32_t did,
|
struct lpfc_nodelist *ndlp, uint32_t did,
|
||||||
|
|||||||
@@ -4171,6 +4171,9 @@ lpfc_hba_alloc(struct pci_dev *pdev)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mutex_init(&phba->ct_event_mutex);
|
||||||
|
INIT_LIST_HEAD(&phba->ct_ev_waiters);
|
||||||
|
|
||||||
return phba;
|
return phba;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -177,3 +177,23 @@ struct temp_event {
|
|||||||
uint32_t data;
|
uint32_t data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* bsg definitions */
|
||||||
|
#define LPFC_BSG_VENDOR_SET_CT_EVENT 1
|
||||||
|
#define LPFC_BSG_VENDOR_GET_CT_EVENT 2
|
||||||
|
|
||||||
|
struct set_ct_event {
|
||||||
|
uint32_t command;
|
||||||
|
uint32_t ev_req_id;
|
||||||
|
uint32_t ev_reg_id;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct get_ct_event {
|
||||||
|
uint32_t command;
|
||||||
|
uint32_t ev_reg_id;
|
||||||
|
uint32_t ev_req_id;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct get_ct_event_reply {
|
||||||
|
uint32_t immed_data;
|
||||||
|
uint32_t type;
|
||||||
|
};
|
||||||
|
|||||||
@@ -3584,6 +3584,7 @@ struct scsi_host_template lpfc_template = {
|
|||||||
.use_clustering = ENABLE_CLUSTERING,
|
.use_clustering = ENABLE_CLUSTERING,
|
||||||
.shost_attrs = lpfc_hba_attrs,
|
.shost_attrs = lpfc_hba_attrs,
|
||||||
.max_sectors = 0xFFFF,
|
.max_sectors = 0xFFFF,
|
||||||
|
.vendor_id = LPFC_NL_VENDOR_ID,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct scsi_host_template lpfc_vport_template = {
|
struct scsi_host_template lpfc_vport_template = {
|
||||||
|
|||||||
Reference in New Issue
Block a user