Skip to contentSkip to conversation

be2iscsi: Adding bsg Interface

PATCH In review Jayamohan Kallickal 2 participants 2 messages Nov 3, 2009 – Nov 4, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 be2iscsi: Adding bsg Interface

This patch adds bsg Interface to the driver.

This patch is dependent on the patch from James Smart

http://mail.spinics.net/lists/linux-scsi/msg40079.html

---
 drivers/scsi/be2iscsi/be_main.c |   25 +++++++++++++++
 drivers/scsi/be2iscsi/be_mgmt.c |   62 +++++++++++++++++++++++++++++++++++++++
 drivers/scsi/be2iscsi/be_mgmt.h |    5 +++
 3 files changed, 92 insertions(+), 0 deletions(-)
drivers/scsi/be2iscsi/be_main.c +25 -0
index 06e1aa6..e72a9bb 100644
@@ -28,6 +28,7 @@
 
 #include <scsi/libiscsi.h>
 #include <scsi/scsi_transport_iscsi.h>
+#include <scsi/scsi_bsg_iscsi.h>
 #include <scsi/scsi_transport.h>
 #include <scsi/scsi_cmnd.h>
 #include <scsi/scsi_device.h>
@@ -3656,6 +3657,29 @@ static int beiscsi_task_xmit(struct iscsi_task *task)
 	return beiscsi_iotask(task, sg, num_sg, xferlen, writedir);
 }
 
+/**
+* beiscsi_bsg_request - handle bsg request from ISCSI transport
+ * @job: iscsi_bsg_job to handle
+ */
+static int beiscsi_bsg_request(struct iscsi_bsg_job *job)
+{
+	uint32_t msgcode;
+	int rc = -EINVAL;
+	struct beiscsi_hba *phba;
+
+	msgcode = job->request->msgcode;
+	phba = iscsi_host_priv(job->shost);
+	switch (msgcode) {
+	case ISCSI_BSG_HST_VENDOR:
+		rc = mgmt_fw_cmd(&phba->ctrl, phba, job);
+		break;
+	default:
+		break;
+	}
+
+	return rc;
+}
+
 static void beiscsi_remove(struct pci_dev *pcidev)
 {
 	struct beiscsi_hba *phba = NULL;
@@ -3897,6 +3921,7 @@ struct iscsi_transport beiscsi_iscsi_transport = {
 	.ep_poll = beiscsi_ep_poll,
 	.ep_disconnect = beiscsi_ep_disconnect,
 	.session_recovery_timedout = iscsi_session_recovery_timedout,
+	.bsg_request = beiscsi_bsg_request,
 };
 
 static struct pci_driver beiscsi_pci_driver = {
drivers/scsi/be2iscsi/be_mgmt.c +62 -0

74 lines not on this page · raw message

drivers/scsi/be2iscsi/be_mgmt.h +5 -0
index b97c3cd..2cba2f4 100644
@@ -248,4 +248,9 @@ unsigned char mgmt_invalidate_connection(struct beiscsi_hba *phba,
 					 unsigned short cid,
 					 unsigned short issue_reset,
 					 unsigned short savecfg_flag);
+
+int  mgmt_fw_cmd(struct be_ctrl_info *ctrl,
+		 struct beiscsi_hba *phba,
+		 struct iscsi_bsg_job *job);
+
 #endif
Signature · 1 line
1.6.4