be2iscsi: Adding bsg Interface
Subsystems (2)
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
Signed-off-by Jayamohan Kallickal <[email protected]>
--- 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
@@ -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
@@ -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
Quoted 6 lines · Jayamohan Kallickal
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
Do you have userspace code that can use this now?