Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 75cc8cfc authored by Johannes Thumshirn's avatar Johannes Thumshirn Committed by Martin K. Petersen
Browse files

scsi: change FC drivers to use 'struct bsg_job'



Change FC drivers to use 'struct bsg_job' from bsg-lib.h instead of
'struct fc_bsg_job' from scsi_transport_fc.h and remove 'struct
fc_bsg_job'.

Signed-off-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
Acked-by: default avatarTyrel Datwyler <tyreld@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent bf0f2d38
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -84,8 +84,8 @@ extern void zfcp_fc_link_test_work(struct work_struct *);
extern void zfcp_fc_wka_ports_force_offline(struct zfcp_fc_wka_ports *);
extern void zfcp_fc_wka_ports_force_offline(struct zfcp_fc_wka_ports *);
extern int zfcp_fc_gs_setup(struct zfcp_adapter *);
extern int zfcp_fc_gs_setup(struct zfcp_adapter *);
extern void zfcp_fc_gs_destroy(struct zfcp_adapter *);
extern void zfcp_fc_gs_destroy(struct zfcp_adapter *);
extern int zfcp_fc_exec_bsg_job(struct fc_bsg_job *);
extern int zfcp_fc_exec_bsg_job(struct bsg_job *);
extern int zfcp_fc_timeout_bsg_job(struct fc_bsg_job *);
extern int zfcp_fc_timeout_bsg_job(struct bsg_job *);
extern void zfcp_fc_sym_name_update(struct work_struct *);
extern void zfcp_fc_sym_name_update(struct work_struct *);
extern unsigned int zfcp_fc_port_scan_backoff(void);
extern unsigned int zfcp_fc_port_scan_backoff(void);
extern void zfcp_fc_conditional_port_scan(struct zfcp_adapter *);
extern void zfcp_fc_conditional_port_scan(struct zfcp_adapter *);
+8 −7
Original line number Original line Diff line number Diff line
@@ -13,6 +13,7 @@
#include <linux/slab.h>
#include <linux/slab.h>
#include <linux/utsname.h>
#include <linux/utsname.h>
#include <linux/random.h>
#include <linux/random.h>
#include <linux/bsg-lib.h>
#include <scsi/fc/fc_els.h>
#include <scsi/fc/fc_els.h>
#include <scsi/libfc.h>
#include <scsi/libfc.h>
#include "zfcp_ext.h"
#include "zfcp_ext.h"
@@ -885,7 +886,7 @@ void zfcp_fc_sym_name_update(struct work_struct *work)


static void zfcp_fc_ct_els_job_handler(void *data)
static void zfcp_fc_ct_els_job_handler(void *data)
{
{
	struct fc_bsg_job *job = data;
	struct bsg_job *job = data;
	struct zfcp_fsf_ct_els *zfcp_ct_els = job->dd_data;
	struct zfcp_fsf_ct_els *zfcp_ct_els = job->dd_data;
	struct fc_bsg_reply *jr = job->reply;
	struct fc_bsg_reply *jr = job->reply;


@@ -895,7 +896,7 @@ static void zfcp_fc_ct_els_job_handler(void *data)
	fc_bsg_jobdone(job, jr->result, jr->reply_payload_rcv_len);
	fc_bsg_jobdone(job, jr->result, jr->reply_payload_rcv_len);
}
}


static struct zfcp_fc_wka_port *zfcp_fc_job_wka_port(struct fc_bsg_job *job)
static struct zfcp_fc_wka_port *zfcp_fc_job_wka_port(struct bsg_job *job)
{
{
	u32 preamble_word1;
	u32 preamble_word1;
	u8 gs_type;
	u8 gs_type;
@@ -928,7 +929,7 @@ static struct zfcp_fc_wka_port *zfcp_fc_job_wka_port(struct fc_bsg_job *job)


static void zfcp_fc_ct_job_handler(void *data)
static void zfcp_fc_ct_job_handler(void *data)
{
{
	struct fc_bsg_job *job = data;
	struct bsg_job *job = data;
	struct zfcp_fc_wka_port *wka_port;
	struct zfcp_fc_wka_port *wka_port;


	wka_port = zfcp_fc_job_wka_port(job);
	wka_port = zfcp_fc_job_wka_port(job);
@@ -937,7 +938,7 @@ static void zfcp_fc_ct_job_handler(void *data)
	zfcp_fc_ct_els_job_handler(data);
	zfcp_fc_ct_els_job_handler(data);
}
}


static int zfcp_fc_exec_els_job(struct fc_bsg_job *job,
static int zfcp_fc_exec_els_job(struct bsg_job *job,
				struct zfcp_adapter *adapter)
				struct zfcp_adapter *adapter)
{
{
	struct zfcp_fsf_ct_els *els = job->dd_data;
	struct zfcp_fsf_ct_els *els = job->dd_data;
@@ -960,7 +961,7 @@ static int zfcp_fc_exec_els_job(struct fc_bsg_job *job,
	return zfcp_fsf_send_els(adapter, d_id, els, job->req->timeout / HZ);
	return zfcp_fsf_send_els(adapter, d_id, els, job->req->timeout / HZ);
}
}


static int zfcp_fc_exec_ct_job(struct fc_bsg_job *job,
static int zfcp_fc_exec_ct_job(struct bsg_job *job,
			       struct zfcp_adapter *adapter)
			       struct zfcp_adapter *adapter)
{
{
	int ret;
	int ret;
@@ -983,7 +984,7 @@ static int zfcp_fc_exec_ct_job(struct fc_bsg_job *job,
	return ret;
	return ret;
}
}


int zfcp_fc_exec_bsg_job(struct fc_bsg_job *job)
int zfcp_fc_exec_bsg_job(struct bsg_job *job)
{
{
	struct Scsi_Host *shost;
	struct Scsi_Host *shost;
	struct zfcp_adapter *adapter;
	struct zfcp_adapter *adapter;
@@ -1013,7 +1014,7 @@ int zfcp_fc_exec_bsg_job(struct fc_bsg_job *job)
	}
	}
}
}


int zfcp_fc_timeout_bsg_job(struct fc_bsg_job *job)
int zfcp_fc_timeout_bsg_job(struct bsg_job *job)
{
{
	/* hardware tracks timeout, reset bsg timeout to not interfere */
	/* hardware tracks timeout, reset bsg timeout to not interfere */
	return -EAGAIN;
	return -EAGAIN;
+5 −5
Original line number Original line Diff line number Diff line
@@ -3130,7 +3130,7 @@ bfad_iocmd_handler(struct bfad_s *bfad, unsigned int cmd, void *iocmd,
}
}


static int
static int
bfad_im_bsg_vendor_request(struct fc_bsg_job *job)
bfad_im_bsg_vendor_request(struct bsg_job *job)
{
{
	struct fc_bsg_request *bsg_request = job->request;
	struct fc_bsg_request *bsg_request = job->request;
	struct fc_bsg_reply *bsg_reply = job->reply;
	struct fc_bsg_reply *bsg_reply = job->reply;
@@ -3314,7 +3314,7 @@ bfad_fcxp_free_mem(struct bfad_s *bfad, struct bfad_buf_info *buf_base,
}
}


int
int
bfad_fcxp_bsg_send(struct fc_bsg_job *job, struct bfad_fcxp *drv_fcxp,
bfad_fcxp_bsg_send(struct bsg_job *job, struct bfad_fcxp *drv_fcxp,
		   bfa_bsg_fcpt_t *bsg_fcpt)
		   bfa_bsg_fcpt_t *bsg_fcpt)
{
{
	struct bfa_fcxp_s *hal_fcxp;
	struct bfa_fcxp_s *hal_fcxp;
@@ -3354,7 +3354,7 @@ bfad_fcxp_bsg_send(struct fc_bsg_job *job, struct bfad_fcxp *drv_fcxp,
}
}


int
int
bfad_im_bsg_els_ct_request(struct fc_bsg_job *job)
bfad_im_bsg_els_ct_request(struct bsg_job *job)
{
{
	struct bfa_bsg_data *bsg_data;
	struct bfa_bsg_data *bsg_data;
	struct bfad_im_port_s *im_port = shost_priv(fc_bsg_to_shost(job));
	struct bfad_im_port_s *im_port = shost_priv(fc_bsg_to_shost(job));
@@ -3562,7 +3562,7 @@ bfad_im_bsg_els_ct_request(struct fc_bsg_job *job)
}
}


int
int
bfad_im_bsg_request(struct fc_bsg_job *job)
bfad_im_bsg_request(struct bsg_job *job)
{
{
	struct fc_bsg_request *bsg_request = job->request;
	struct fc_bsg_request *bsg_request = job->request;
	struct fc_bsg_reply *bsg_reply = job->reply;
	struct fc_bsg_reply *bsg_reply = job->reply;
@@ -3590,7 +3590,7 @@ bfad_im_bsg_request(struct fc_bsg_job *job)
}
}


int
int
bfad_im_bsg_timeout(struct fc_bsg_job *job)
bfad_im_bsg_timeout(struct bsg_job *job)
{
{
	/* Don't complete the BSG job request - return -EAGAIN
	/* Don't complete the BSG job request - return -EAGAIN
	 * to reset bsg job timeout : for ELS/CT pass thru we
	 * to reset bsg job timeout : for ELS/CT pass thru we
+2 −2
Original line number Original line Diff line number Diff line
@@ -166,8 +166,8 @@ extern struct device_attribute *bfad_im_vport_attrs[];


irqreturn_t bfad_intx(int irq, void *dev_id);
irqreturn_t bfad_intx(int irq, void *dev_id);


int bfad_im_bsg_request(struct fc_bsg_job *job);
int bfad_im_bsg_request(struct bsg_job *job);
int bfad_im_bsg_timeout(struct fc_bsg_job *job);
int bfad_im_bsg_timeout(struct bsg_job *job);


/*
/*
 * Macro to set the SCSI device sdev_bflags - sdev_bflags are used by the
 * Macro to set the SCSI device sdev_bflags - sdev_bflags are used by the
+5 −4
Original line number Original line Diff line number Diff line
@@ -32,6 +32,7 @@
#include <linux/of.h>
#include <linux/of.h>
#include <linux/pm.h>
#include <linux/pm.h>
#include <linux/stringify.h>
#include <linux/stringify.h>
#include <linux/bsg-lib.h>
#include <asm/firmware.h>
#include <asm/firmware.h>
#include <asm/irq.h>
#include <asm/irq.h>
#include <asm/vio.h>
#include <asm/vio.h>
@@ -1701,12 +1702,12 @@ static void ibmvfc_bsg_timeout_done(struct ibmvfc_event *evt)


/**
/**
 * ibmvfc_bsg_timeout - Handle a BSG timeout
 * ibmvfc_bsg_timeout - Handle a BSG timeout
 * @job:	struct fc_bsg_job that timed out
 * @job:	struct bsg_job that timed out
 *
 *
 * Returns:
 * Returns:
 *	0 on success / other on failure
 *	0 on success / other on failure
 **/
 **/
static int ibmvfc_bsg_timeout(struct fc_bsg_job *job)
static int ibmvfc_bsg_timeout(struct bsg_job *job)
{
{
	struct ibmvfc_host *vhost = shost_priv(fc_bsg_to_shost(job));
	struct ibmvfc_host *vhost = shost_priv(fc_bsg_to_shost(job));
	unsigned long port_id = (unsigned long)job->dd_data;
	unsigned long port_id = (unsigned long)job->dd_data;
@@ -1814,12 +1815,12 @@ static int ibmvfc_bsg_plogi(struct ibmvfc_host *vhost, unsigned int port_id)


/**
/**
 * ibmvfc_bsg_request - Handle a BSG request
 * ibmvfc_bsg_request - Handle a BSG request
 * @job:	struct fc_bsg_job to be executed
 * @job:	struct bsg_job to be executed
 *
 *
 * Returns:
 * Returns:
 *	0 on success / other on failure
 *	0 on success / other on failure
 **/
 **/
static int ibmvfc_bsg_request(struct fc_bsg_job *job)
static int ibmvfc_bsg_request(struct bsg_job *job)
{
{
	struct ibmvfc_host *vhost = shost_priv(fc_bsg_to_shost(job));
	struct ibmvfc_host *vhost = shost_priv(fc_bsg_to_shost(job));
	struct fc_rport *rport = fc_bsg_to_rport(job);
	struct fc_rport *rport = fc_bsg_to_rport(job);
Loading