Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Acked-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Johannes Thumshirn and committed by
Martin K. Petersen
75cc8cfc bf0f2d38

+139 -164
+2 -2
drivers/s390/scsi/zfcp_ext.h
··· 84 84 extern void zfcp_fc_wka_ports_force_offline(struct zfcp_fc_wka_ports *); 85 85 extern int zfcp_fc_gs_setup(struct zfcp_adapter *); 86 86 extern void zfcp_fc_gs_destroy(struct zfcp_adapter *); 87 - extern int zfcp_fc_exec_bsg_job(struct fc_bsg_job *); 88 - extern int zfcp_fc_timeout_bsg_job(struct fc_bsg_job *); 87 + extern int zfcp_fc_exec_bsg_job(struct bsg_job *); 88 + extern int zfcp_fc_timeout_bsg_job(struct bsg_job *); 89 89 extern void zfcp_fc_sym_name_update(struct work_struct *); 90 90 extern unsigned int zfcp_fc_port_scan_backoff(void); 91 91 extern void zfcp_fc_conditional_port_scan(struct zfcp_adapter *);
+8 -7
drivers/s390/scsi/zfcp_fc.c
··· 13 13 #include <linux/slab.h> 14 14 #include <linux/utsname.h> 15 15 #include <linux/random.h> 16 + #include <linux/bsg-lib.h> 16 17 #include <scsi/fc/fc_els.h> 17 18 #include <scsi/libfc.h> 18 19 #include "zfcp_ext.h" ··· 886 885 887 886 static void zfcp_fc_ct_els_job_handler(void *data) 888 887 { 889 - struct fc_bsg_job *job = data; 888 + struct bsg_job *job = data; 890 889 struct zfcp_fsf_ct_els *zfcp_ct_els = job->dd_data; 891 890 struct fc_bsg_reply *jr = job->reply; 892 891 ··· 896 895 fc_bsg_jobdone(job, jr->result, jr->reply_payload_rcv_len); 897 896 } 898 897 899 - static struct zfcp_fc_wka_port *zfcp_fc_job_wka_port(struct fc_bsg_job *job) 898 + static struct zfcp_fc_wka_port *zfcp_fc_job_wka_port(struct bsg_job *job) 900 899 { 901 900 u32 preamble_word1; 902 901 u8 gs_type; ··· 929 928 930 929 static void zfcp_fc_ct_job_handler(void *data) 931 930 { 932 - struct fc_bsg_job *job = data; 931 + struct bsg_job *job = data; 933 932 struct zfcp_fc_wka_port *wka_port; 934 933 935 934 wka_port = zfcp_fc_job_wka_port(job); ··· 938 937 zfcp_fc_ct_els_job_handler(data); 939 938 } 940 939 941 - static int zfcp_fc_exec_els_job(struct fc_bsg_job *job, 940 + static int zfcp_fc_exec_els_job(struct bsg_job *job, 942 941 struct zfcp_adapter *adapter) 943 942 { 944 943 struct zfcp_fsf_ct_els *els = job->dd_data; ··· 961 960 return zfcp_fsf_send_els(adapter, d_id, els, job->req->timeout / HZ); 962 961 } 963 962 964 - static int zfcp_fc_exec_ct_job(struct fc_bsg_job *job, 963 + static int zfcp_fc_exec_ct_job(struct bsg_job *job, 965 964 struct zfcp_adapter *adapter) 966 965 { 967 966 int ret; ··· 984 983 return ret; 985 984 } 986 985 987 - int zfcp_fc_exec_bsg_job(struct fc_bsg_job *job) 986 + int zfcp_fc_exec_bsg_job(struct bsg_job *job) 988 987 { 989 988 struct Scsi_Host *shost; 990 989 struct zfcp_adapter *adapter; ··· 1014 1013 } 1015 1014 } 1016 1015 1017 - int zfcp_fc_timeout_bsg_job(struct fc_bsg_job *job) 1016 + int zfcp_fc_timeout_bsg_job(struct bsg_job *job) 1018 1017 { 1019 1018 /* hardware tracks timeout, reset bsg timeout to not interfere */ 1020 1019 return -EAGAIN;
+5 -5
drivers/scsi/bfa/bfad_bsg.c
··· 3130 3130 } 3131 3131 3132 3132 static int 3133 - bfad_im_bsg_vendor_request(struct fc_bsg_job *job) 3133 + bfad_im_bsg_vendor_request(struct bsg_job *job) 3134 3134 { 3135 3135 struct fc_bsg_request *bsg_request = job->request; 3136 3136 struct fc_bsg_reply *bsg_reply = job->reply; ··· 3314 3314 } 3315 3315 3316 3316 int 3317 - bfad_fcxp_bsg_send(struct fc_bsg_job *job, struct bfad_fcxp *drv_fcxp, 3317 + bfad_fcxp_bsg_send(struct bsg_job *job, struct bfad_fcxp *drv_fcxp, 3318 3318 bfa_bsg_fcpt_t *bsg_fcpt) 3319 3319 { 3320 3320 struct bfa_fcxp_s *hal_fcxp; ··· 3354 3354 } 3355 3355 3356 3356 int 3357 - bfad_im_bsg_els_ct_request(struct fc_bsg_job *job) 3357 + bfad_im_bsg_els_ct_request(struct bsg_job *job) 3358 3358 { 3359 3359 struct bfa_bsg_data *bsg_data; 3360 3360 struct bfad_im_port_s *im_port = shost_priv(fc_bsg_to_shost(job)); ··· 3562 3562 } 3563 3563 3564 3564 int 3565 - bfad_im_bsg_request(struct fc_bsg_job *job) 3565 + bfad_im_bsg_request(struct bsg_job *job) 3566 3566 { 3567 3567 struct fc_bsg_request *bsg_request = job->request; 3568 3568 struct fc_bsg_reply *bsg_reply = job->reply; ··· 3590 3590 } 3591 3591 3592 3592 int 3593 - bfad_im_bsg_timeout(struct fc_bsg_job *job) 3593 + bfad_im_bsg_timeout(struct bsg_job *job) 3594 3594 { 3595 3595 /* Don't complete the BSG job request - return -EAGAIN 3596 3596 * to reset bsg job timeout : for ELS/CT pass thru we
+2 -2
drivers/scsi/bfa/bfad_im.h
··· 166 166 167 167 irqreturn_t bfad_intx(int irq, void *dev_id); 168 168 169 - int bfad_im_bsg_request(struct fc_bsg_job *job); 170 - int bfad_im_bsg_timeout(struct fc_bsg_job *job); 169 + int bfad_im_bsg_request(struct bsg_job *job); 170 + int bfad_im_bsg_timeout(struct bsg_job *job); 171 171 172 172 /* 173 173 * Macro to set the SCSI device sdev_bflags - sdev_bflags are used by the
+5 -4
drivers/scsi/ibmvscsi/ibmvfc.c
··· 32 32 #include <linux/of.h> 33 33 #include <linux/pm.h> 34 34 #include <linux/stringify.h> 35 + #include <linux/bsg-lib.h> 35 36 #include <asm/firmware.h> 36 37 #include <asm/irq.h> 37 38 #include <asm/vio.h> ··· 1702 1701 1703 1702 /** 1704 1703 * ibmvfc_bsg_timeout - Handle a BSG timeout 1705 - * @job: struct fc_bsg_job that timed out 1704 + * @job: struct bsg_job that timed out 1706 1705 * 1707 1706 * Returns: 1708 1707 * 0 on success / other on failure 1709 1708 **/ 1710 - static int ibmvfc_bsg_timeout(struct fc_bsg_job *job) 1709 + static int ibmvfc_bsg_timeout(struct bsg_job *job) 1711 1710 { 1712 1711 struct ibmvfc_host *vhost = shost_priv(fc_bsg_to_shost(job)); 1713 1712 unsigned long port_id = (unsigned long)job->dd_data; ··· 1815 1814 1816 1815 /** 1817 1816 * ibmvfc_bsg_request - Handle a BSG request 1818 - * @job: struct fc_bsg_job to be executed 1817 + * @job: struct bsg_job to be executed 1819 1818 * 1820 1819 * Returns: 1821 1820 * 0 on success / other on failure 1822 1821 **/ 1823 - static int ibmvfc_bsg_request(struct fc_bsg_job *job) 1822 + static int ibmvfc_bsg_request(struct bsg_job *job) 1824 1823 { 1825 1824 struct ibmvfc_host *vhost = shost_priv(fc_bsg_to_shost(job)); 1826 1825 struct fc_rport *rport = fc_bsg_to_rport(job);
+5 -5
drivers/scsi/libfc/fc_lport.c
··· 149 149 * @offset: The offset into the response data 150 150 */ 151 151 struct fc_bsg_info { 152 - struct fc_bsg_job *job; 152 + struct bsg_job *job; 153 153 struct fc_lport *lport; 154 154 u16 rsp_code; 155 155 struct scatterlist *sg; ··· 1901 1901 void *info_arg) 1902 1902 { 1903 1903 struct fc_bsg_info *info = info_arg; 1904 - struct fc_bsg_job *job = info->job; 1904 + struct bsg_job *job = info->job; 1905 1905 struct fc_bsg_reply *bsg_reply = job->reply; 1906 1906 struct fc_lport *lport = info->lport; 1907 1907 struct fc_frame_header *fh; ··· 1964 1964 * Locking Note: The lport lock is expected to be held before calling 1965 1965 * this routine. 1966 1966 */ 1967 - static int fc_lport_els_request(struct fc_bsg_job *job, 1967 + static int fc_lport_els_request(struct bsg_job *job, 1968 1968 struct fc_lport *lport, 1969 1969 u32 did, u32 tov) 1970 1970 { ··· 2025 2025 * Locking Note: The lport lock is expected to be held before calling 2026 2026 * this routine. 2027 2027 */ 2028 - static int fc_lport_ct_request(struct fc_bsg_job *job, 2028 + static int fc_lport_ct_request(struct bsg_job *job, 2029 2029 struct fc_lport *lport, u32 did, u32 tov) 2030 2030 { 2031 2031 struct fc_bsg_info *info; ··· 2081 2081 * FC Passthrough requests 2082 2082 * @job: The BSG passthrough job 2083 2083 */ 2084 - int fc_lport_bsg_request(struct fc_bsg_job *job) 2084 + int fc_lport_bsg_request(struct bsg_job *job) 2085 2085 { 2086 2086 struct fc_bsg_request *bsg_request = job->request; 2087 2087 struct fc_bsg_reply *bsg_reply = job->reply;
+38 -38
drivers/scsi/lpfc/lpfc_bsg.c
··· 98 98 #define TYPE_MENLO 4 99 99 struct bsg_job_data { 100 100 uint32_t type; 101 - struct fc_bsg_job *set_job; /* job waiting for this iocb to finish */ 101 + struct bsg_job *set_job; /* job waiting for this iocb to finish */ 102 102 union { 103 103 struct lpfc_bsg_event *evt; 104 104 struct lpfc_bsg_iocb iocb; ··· 298 298 struct lpfc_iocbq *rspiocbq) 299 299 { 300 300 struct bsg_job_data *dd_data; 301 - struct fc_bsg_job *job; 301 + struct bsg_job *job; 302 302 struct fc_bsg_reply *bsg_reply; 303 303 IOCB_t *rsp; 304 304 struct lpfc_dmabuf *bmp, *cmp, *rmp; ··· 382 382 * @job: fc_bsg_job to handle 383 383 **/ 384 384 static int 385 - lpfc_bsg_send_mgmt_cmd(struct fc_bsg_job *job) 385 + lpfc_bsg_send_mgmt_cmd(struct bsg_job *job) 386 386 { 387 387 struct lpfc_vport *vport = shost_priv(fc_bsg_to_shost(job)); 388 388 struct lpfc_hba *phba = vport->phba; ··· 575 575 struct lpfc_iocbq *rspiocbq) 576 576 { 577 577 struct bsg_job_data *dd_data; 578 - struct fc_bsg_job *job; 578 + struct bsg_job *job; 579 579 struct fc_bsg_reply *bsg_reply; 580 580 IOCB_t *rsp; 581 581 struct lpfc_nodelist *ndlp; ··· 656 656 * @job: fc_bsg_job to handle 657 657 **/ 658 658 static int 659 - lpfc_bsg_rport_els(struct fc_bsg_job *job) 659 + lpfc_bsg_rport_els(struct bsg_job *job) 660 660 { 661 661 struct lpfc_vport *vport = shost_priv(fc_bsg_to_shost(job)); 662 662 struct lpfc_hba *phba = vport->phba; ··· 927 927 struct lpfc_dmabuf *bdeBuf2 = piocbq->context3; 928 928 struct lpfc_hbq_entry *hbqe; 929 929 struct lpfc_sli_ct_request *ct_req; 930 - struct fc_bsg_job *job = NULL; 930 + struct bsg_job *job = NULL; 931 931 struct fc_bsg_reply *bsg_reply; 932 932 struct bsg_job_data *dd_data = NULL; 933 933 unsigned long flags; ··· 1200 1200 * @job: SET_EVENT fc_bsg_job 1201 1201 **/ 1202 1202 static int 1203 - lpfc_bsg_hba_set_event(struct fc_bsg_job *job) 1203 + lpfc_bsg_hba_set_event(struct bsg_job *job) 1204 1204 { 1205 1205 struct lpfc_vport *vport = shost_priv(fc_bsg_to_shost(job)); 1206 1206 struct lpfc_hba *phba = vport->phba; ··· 1285 1285 * @job: GET_EVENT fc_bsg_job 1286 1286 **/ 1287 1287 static int 1288 - lpfc_bsg_hba_get_event(struct fc_bsg_job *job) 1288 + lpfc_bsg_hba_get_event(struct bsg_job *job) 1289 1289 { 1290 1290 struct lpfc_vport *vport = shost_priv(fc_bsg_to_shost(job)); 1291 1291 struct lpfc_hba *phba = vport->phba; ··· 1397 1397 struct lpfc_iocbq *rspiocbq) 1398 1398 { 1399 1399 struct bsg_job_data *dd_data; 1400 - struct fc_bsg_job *job; 1400 + struct bsg_job *job; 1401 1401 struct fc_bsg_reply *bsg_reply; 1402 1402 IOCB_t *rsp; 1403 1403 struct lpfc_dmabuf *bmp, *cmp; ··· 1477 1477 * @num_entry: Number of enties in the bde. 1478 1478 **/ 1479 1479 static int 1480 - lpfc_issue_ct_rsp(struct lpfc_hba *phba, struct fc_bsg_job *job, uint32_t tag, 1480 + lpfc_issue_ct_rsp(struct lpfc_hba *phba, struct bsg_job *job, uint32_t tag, 1481 1481 struct lpfc_dmabuf *cmp, struct lpfc_dmabuf *bmp, 1482 1482 int num_entry) 1483 1483 { ··· 1623 1623 * @job: SEND_MGMT_RESP fc_bsg_job 1624 1624 **/ 1625 1625 static int 1626 - lpfc_bsg_send_mgmt_rsp(struct fc_bsg_job *job) 1626 + lpfc_bsg_send_mgmt_rsp(struct bsg_job *job) 1627 1627 { 1628 1628 struct lpfc_vport *vport = shost_priv(fc_bsg_to_shost(job)); 1629 1629 struct lpfc_hba *phba = vport->phba; ··· 1782 1782 * All of this is done in-line. 1783 1783 */ 1784 1784 static int 1785 - lpfc_sli3_bsg_diag_loopback_mode(struct lpfc_hba *phba, struct fc_bsg_job *job) 1785 + lpfc_sli3_bsg_diag_loopback_mode(struct lpfc_hba *phba, struct bsg_job *job) 1786 1786 { 1787 1787 struct fc_bsg_request *bsg_request = job->request; 1788 1788 struct fc_bsg_reply *bsg_reply = job->reply; ··· 2040 2040 * loopback mode in order to perform a diagnostic loopback test. 2041 2041 */ 2042 2042 static int 2043 - lpfc_sli4_bsg_diag_loopback_mode(struct lpfc_hba *phba, struct fc_bsg_job *job) 2043 + lpfc_sli4_bsg_diag_loopback_mode(struct lpfc_hba *phba, struct bsg_job *job) 2044 2044 { 2045 2045 struct fc_bsg_request *bsg_request = job->request; 2046 2046 struct fc_bsg_reply *bsg_reply = job->reply; ··· 2194 2194 * command from the user to proper driver action routines. 2195 2195 */ 2196 2196 static int 2197 - lpfc_bsg_diag_loopback_mode(struct fc_bsg_job *job) 2197 + lpfc_bsg_diag_loopback_mode(struct bsg_job *job) 2198 2198 { 2199 2199 struct Scsi_Host *shost; 2200 2200 struct lpfc_vport *vport; ··· 2230 2230 * command from the user to proper driver action routines. 2231 2231 */ 2232 2232 static int 2233 - lpfc_sli4_bsg_diag_mode_end(struct fc_bsg_job *job) 2233 + lpfc_sli4_bsg_diag_mode_end(struct bsg_job *job) 2234 2234 { 2235 2235 struct fc_bsg_request *bsg_request = job->request; 2236 2236 struct fc_bsg_reply *bsg_reply = job->reply; ··· 2309 2309 * applicaiton. 2310 2310 */ 2311 2311 static int 2312 - lpfc_sli4_bsg_link_diag_test(struct fc_bsg_job *job) 2312 + lpfc_sli4_bsg_link_diag_test(struct bsg_job *job) 2313 2313 { 2314 2314 struct fc_bsg_request *bsg_request = job->request; 2315 2315 struct fc_bsg_reply *bsg_reply = job->reply; ··· 3016 3016 * of loopback mode. 3017 3017 **/ 3018 3018 static int 3019 - lpfc_bsg_diag_loopback_run(struct fc_bsg_job *job) 3019 + lpfc_bsg_diag_loopback_run(struct bsg_job *job) 3020 3020 { 3021 3021 struct lpfc_vport *vport = shost_priv(fc_bsg_to_shost(job)); 3022 3022 struct fc_bsg_reply *bsg_reply = job->reply; ··· 3320 3320 * @job: GET_DFC_REV fc_bsg_job 3321 3321 **/ 3322 3322 static int 3323 - lpfc_bsg_get_dfc_rev(struct fc_bsg_job *job) 3323 + lpfc_bsg_get_dfc_rev(struct bsg_job *job) 3324 3324 { 3325 3325 struct lpfc_vport *vport = shost_priv(fc_bsg_to_shost(job)); 3326 3326 struct fc_bsg_reply *bsg_reply = job->reply; ··· 3375 3375 { 3376 3376 struct bsg_job_data *dd_data; 3377 3377 struct fc_bsg_reply *bsg_reply; 3378 - struct fc_bsg_job *job; 3378 + struct bsg_job *job; 3379 3379 uint32_t size; 3380 3380 unsigned long flags; 3381 3381 uint8_t *pmb, *pmb_buf; ··· 3551 3551 * This is routine handles BSG job for mailbox commands completions with 3552 3552 * multiple external buffers. 3553 3553 **/ 3554 - static struct fc_bsg_job * 3554 + static struct bsg_job * 3555 3555 lpfc_bsg_issue_mbox_ext_handle_job(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmboxq) 3556 3556 { 3557 3557 struct bsg_job_data *dd_data; 3558 - struct fc_bsg_job *job; 3558 + struct bsg_job *job; 3559 3559 struct fc_bsg_reply *bsg_reply; 3560 3560 uint8_t *pmb, *pmb_buf; 3561 3561 unsigned long flags; ··· 3646 3646 static void 3647 3647 lpfc_bsg_issue_read_mbox_ext_cmpl(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmboxq) 3648 3648 { 3649 - struct fc_bsg_job *job; 3649 + struct bsg_job *job; 3650 3650 struct fc_bsg_reply *bsg_reply; 3651 3651 3652 3652 job = lpfc_bsg_issue_mbox_ext_handle_job(phba, pmboxq); ··· 3686 3686 static void 3687 3687 lpfc_bsg_issue_write_mbox_ext_cmpl(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmboxq) 3688 3688 { 3689 - struct fc_bsg_job *job; 3689 + struct bsg_job *job; 3690 3690 struct fc_bsg_reply *bsg_reply; 3691 3691 3692 3692 job = lpfc_bsg_issue_mbox_ext_handle_job(phba, pmboxq); ··· 3818 3818 * non-embedded external bufffers. 3819 3819 **/ 3820 3820 static int 3821 - lpfc_bsg_sli_cfg_read_cmd_ext(struct lpfc_hba *phba, struct fc_bsg_job *job, 3821 + lpfc_bsg_sli_cfg_read_cmd_ext(struct lpfc_hba *phba, struct bsg_job *job, 3822 3822 enum nemb_type nemb_tp, 3823 3823 struct lpfc_dmabuf *dmabuf) 3824 3824 { ··· 4006 4006 * non-embedded external bufffers. 4007 4007 **/ 4008 4008 static int 4009 - lpfc_bsg_sli_cfg_write_cmd_ext(struct lpfc_hba *phba, struct fc_bsg_job *job, 4009 + lpfc_bsg_sli_cfg_write_cmd_ext(struct lpfc_hba *phba, struct bsg_job *job, 4010 4010 enum nemb_type nemb_tp, 4011 4011 struct lpfc_dmabuf *dmabuf) 4012 4012 { ··· 4173 4173 * with embedded sussystem 0x1 and opcodes with external HBDs. 4174 4174 **/ 4175 4175 static int 4176 - lpfc_bsg_handle_sli_cfg_mbox(struct lpfc_hba *phba, struct fc_bsg_job *job, 4176 + lpfc_bsg_handle_sli_cfg_mbox(struct lpfc_hba *phba, struct bsg_job *job, 4177 4177 struct lpfc_dmabuf *dmabuf) 4178 4178 { 4179 4179 struct lpfc_sli_config_mbox *sli_cfg_mbx; ··· 4322 4322 * user space through BSG. 4323 4323 **/ 4324 4324 static int 4325 - lpfc_bsg_read_ebuf_get(struct lpfc_hba *phba, struct fc_bsg_job *job) 4325 + lpfc_bsg_read_ebuf_get(struct lpfc_hba *phba, struct bsg_job *job) 4326 4326 { 4327 4327 struct fc_bsg_reply *bsg_reply = job->reply; 4328 4328 struct lpfc_sli_config_mbox *sli_cfg_mbx; ··· 4392 4392 * from user space through BSG. 4393 4393 **/ 4394 4394 static int 4395 - lpfc_bsg_write_ebuf_set(struct lpfc_hba *phba, struct fc_bsg_job *job, 4395 + lpfc_bsg_write_ebuf_set(struct lpfc_hba *phba, struct bsg_job *job, 4396 4396 struct lpfc_dmabuf *dmabuf) 4397 4397 { 4398 4398 struct fc_bsg_reply *bsg_reply = job->reply; ··· 4515 4515 * command with multiple non-embedded external buffers. 4516 4516 **/ 4517 4517 static int 4518 - lpfc_bsg_handle_sli_cfg_ebuf(struct lpfc_hba *phba, struct fc_bsg_job *job, 4518 + lpfc_bsg_handle_sli_cfg_ebuf(struct lpfc_hba *phba, struct bsg_job *job, 4519 4519 struct lpfc_dmabuf *dmabuf) 4520 4520 { 4521 4521 int rc; ··· 4560 4560 * (0x9B) mailbox commands and external buffers. 4561 4561 **/ 4562 4562 static int 4563 - lpfc_bsg_handle_sli_cfg_ext(struct lpfc_hba *phba, struct fc_bsg_job *job, 4563 + lpfc_bsg_handle_sli_cfg_ext(struct lpfc_hba *phba, struct bsg_job *job, 4564 4564 struct lpfc_dmabuf *dmabuf) 4565 4565 { 4566 4566 struct fc_bsg_request *bsg_request = job->request; ··· 4638 4638 * let our completion handler finish the command. 4639 4639 **/ 4640 4640 static int 4641 - lpfc_bsg_issue_mbox(struct lpfc_hba *phba, struct fc_bsg_job *job, 4641 + lpfc_bsg_issue_mbox(struct lpfc_hba *phba, struct bsg_job *job, 4642 4642 struct lpfc_vport *vport) 4643 4643 { 4644 4644 struct fc_bsg_request *bsg_request = job->request; ··· 4931 4931 * @job: MBOX fc_bsg_job for LPFC_BSG_VENDOR_MBOX. 4932 4932 **/ 4933 4933 static int 4934 - lpfc_bsg_mbox_cmd(struct fc_bsg_job *job) 4934 + lpfc_bsg_mbox_cmd(struct bsg_job *job) 4935 4935 { 4936 4936 struct lpfc_vport *vport = shost_priv(fc_bsg_to_shost(job)); 4937 4937 struct fc_bsg_request *bsg_request = job->request; ··· 5000 5000 struct lpfc_iocbq *rspiocbq) 5001 5001 { 5002 5002 struct bsg_job_data *dd_data; 5003 - struct fc_bsg_job *job; 5003 + struct bsg_job *job; 5004 5004 struct fc_bsg_reply *bsg_reply; 5005 5005 IOCB_t *rsp; 5006 5006 struct lpfc_dmabuf *bmp, *cmp, *rmp; ··· 5091 5091 * supplied in the menlo request header xri field. 5092 5092 **/ 5093 5093 static int 5094 - lpfc_menlo_cmd(struct fc_bsg_job *job) 5094 + lpfc_menlo_cmd(struct bsg_job *job) 5095 5095 { 5096 5096 struct lpfc_vport *vport = shost_priv(fc_bsg_to_shost(job)); 5097 5097 struct fc_bsg_request *bsg_request = job->request; ··· 5255 5255 } 5256 5256 5257 5257 static int 5258 - lpfc_forced_link_speed(struct fc_bsg_job *job) 5258 + lpfc_forced_link_speed(struct bsg_job *job) 5259 5259 { 5260 5260 struct Scsi_Host *shost = fc_bsg_to_shost(job); 5261 5261 struct lpfc_vport *vport = shost_priv(shost); ··· 5303 5303 * @job: fc_bsg_job to handle 5304 5304 **/ 5305 5305 static int 5306 - lpfc_bsg_hst_vendor(struct fc_bsg_job *job) 5306 + lpfc_bsg_hst_vendor(struct bsg_job *job) 5307 5307 { 5308 5308 struct fc_bsg_request *bsg_request = job->request; 5309 5309 struct fc_bsg_reply *bsg_reply = job->reply; ··· 5361 5361 * @job: fc_bsg_job to handle 5362 5362 **/ 5363 5363 int 5364 - lpfc_bsg_request(struct fc_bsg_job *job) 5364 + lpfc_bsg_request(struct bsg_job *job) 5365 5365 { 5366 5366 struct fc_bsg_request *bsg_request = job->request; 5367 5367 struct fc_bsg_reply *bsg_reply = job->reply; ··· 5398 5398 * the waiting function which will handle passing the error back to userspace 5399 5399 **/ 5400 5400 int 5401 - lpfc_bsg_timeout(struct fc_bsg_job *job) 5401 + lpfc_bsg_timeout(struct bsg_job *job) 5402 5402 { 5403 5403 struct lpfc_vport *vport = shost_priv(fc_bsg_to_shost(job)); 5404 5404 struct lpfc_hba *phba = vport->phba;
+2 -2
drivers/scsi/lpfc/lpfc_crtn.h
··· 429 429 #define HBA_EVENT_LINK_DOWN 3 430 430 431 431 /* functions to support SGIOv4/bsg interface */ 432 - int lpfc_bsg_request(struct fc_bsg_job *); 433 - int lpfc_bsg_timeout(struct fc_bsg_job *); 432 + int lpfc_bsg_request(struct bsg_job *); 433 + int lpfc_bsg_timeout(struct bsg_job *); 434 434 int lpfc_bsg_ct_unsol_event(struct lpfc_hba *, struct lpfc_sli_ring *, 435 435 struct lpfc_iocbq *); 436 436 int lpfc_bsg_ct_unsol_abort(struct lpfc_hba *, struct hbq_dmabuf *);
+31 -30
drivers/scsi/qla2xxx/qla_bsg.c
··· 9 9 #include <linux/kthread.h> 10 10 #include <linux/vmalloc.h> 11 11 #include <linux/delay.h> 12 + #include <linux/bsg-lib.h> 12 13 13 14 /* BSG support for ELS/CT pass through */ 14 15 void ··· 17 16 { 18 17 srb_t *sp = (srb_t *)ptr; 19 18 struct scsi_qla_host *vha = (scsi_qla_host_t *)data; 20 - struct fc_bsg_job *bsg_job = sp->u.bsg_job; 19 + struct bsg_job *bsg_job = sp->u.bsg_job; 21 20 struct fc_bsg_reply *bsg_reply = bsg_job->reply; 22 21 23 22 bsg_reply->result = res; ··· 31 30 { 32 31 srb_t *sp = (srb_t *)ptr; 33 32 struct scsi_qla_host *vha = sp->fcport->vha; 34 - struct fc_bsg_job *bsg_job = sp->u.bsg_job; 33 + struct bsg_job *bsg_job = sp->u.bsg_job; 35 34 struct fc_bsg_request *bsg_request = bsg_job->request; 36 35 37 36 struct qla_hw_data *ha = vha->hw; ··· 121 120 } 122 121 123 122 static int 124 - qla24xx_proc_fcp_prio_cfg_cmd(struct fc_bsg_job *bsg_job) 123 + qla24xx_proc_fcp_prio_cfg_cmd(struct bsg_job *bsg_job) 125 124 { 126 125 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); 127 126 struct fc_bsg_request *bsg_request = bsg_job->request; ··· 250 249 } 251 250 252 251 static int 253 - qla2x00_process_els(struct fc_bsg_job *bsg_job) 252 + qla2x00_process_els(struct bsg_job *bsg_job) 254 253 { 255 254 struct fc_bsg_request *bsg_request = bsg_job->request; 256 255 struct fc_rport *rport; ··· 429 428 } 430 429 431 430 static int 432 - qla2x00_process_ct(struct fc_bsg_job *bsg_job) 431 + qla2x00_process_ct(struct bsg_job *bsg_job) 433 432 { 434 433 srb_t *sp; 435 434 struct fc_bsg_request *bsg_request = bsg_job->request; ··· 707 706 } 708 707 709 708 static int 710 - qla2x00_process_loopback(struct fc_bsg_job *bsg_job) 709 + qla2x00_process_loopback(struct bsg_job *bsg_job) 711 710 { 712 711 struct fc_bsg_request *bsg_request = bsg_job->request; 713 712 struct fc_bsg_reply *bsg_reply = bsg_job->reply; ··· 948 947 } 949 948 950 949 static int 951 - qla84xx_reset(struct fc_bsg_job *bsg_job) 950 + qla84xx_reset(struct bsg_job *bsg_job) 952 951 { 953 952 struct fc_bsg_request *bsg_request = bsg_job->request; 954 953 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); ··· 984 983 } 985 984 986 985 static int 987 - qla84xx_updatefw(struct fc_bsg_job *bsg_job) 986 + qla84xx_updatefw(struct bsg_job *bsg_job) 988 987 { 989 988 struct fc_bsg_request *bsg_request = bsg_job->request; 990 989 struct fc_bsg_reply *bsg_reply = bsg_job->reply; ··· 1096 1095 } 1097 1096 1098 1097 static int 1099 - qla84xx_mgmt_cmd(struct fc_bsg_job *bsg_job) 1098 + qla84xx_mgmt_cmd(struct bsg_job *bsg_job) 1100 1099 { 1101 1100 struct fc_bsg_request *bsg_request = bsg_job->request; 1102 1101 struct fc_bsg_reply *bsg_reply = bsg_job->reply; ··· 1294 1293 } 1295 1294 1296 1295 static int 1297 - qla24xx_iidma(struct fc_bsg_job *bsg_job) 1296 + qla24xx_iidma(struct bsg_job *bsg_job) 1298 1297 { 1299 1298 struct fc_bsg_request *bsg_request = bsg_job->request; 1300 1299 struct fc_bsg_reply *bsg_reply = bsg_job->reply; ··· 1383 1382 } 1384 1383 1385 1384 static int 1386 - qla2x00_optrom_setup(struct fc_bsg_job *bsg_job, scsi_qla_host_t *vha, 1385 + qla2x00_optrom_setup(struct bsg_job *bsg_job, scsi_qla_host_t *vha, 1387 1386 uint8_t is_update) 1388 1387 { 1389 1388 struct fc_bsg_request *bsg_request = bsg_job->request; ··· 1453 1452 } 1454 1453 1455 1454 static int 1456 - qla2x00_read_optrom(struct fc_bsg_job *bsg_job) 1455 + qla2x00_read_optrom(struct bsg_job *bsg_job) 1457 1456 { 1458 1457 struct fc_bsg_reply *bsg_reply = bsg_job->reply; 1459 1458 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); ··· 1490 1489 } 1491 1490 1492 1491 static int 1493 - qla2x00_update_optrom(struct fc_bsg_job *bsg_job) 1492 + qla2x00_update_optrom(struct bsg_job *bsg_job) 1494 1493 { 1495 1494 struct fc_bsg_reply *bsg_reply = bsg_job->reply; 1496 1495 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); ··· 1526 1525 } 1527 1526 1528 1527 static int 1529 - qla2x00_update_fru_versions(struct fc_bsg_job *bsg_job) 1528 + qla2x00_update_fru_versions(struct bsg_job *bsg_job) 1530 1529 { 1531 1530 struct fc_bsg_reply *bsg_reply = bsg_job->reply; 1532 1531 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); ··· 1578 1577 } 1579 1578 1580 1579 static int 1581 - qla2x00_read_fru_status(struct fc_bsg_job *bsg_job) 1580 + qla2x00_read_fru_status(struct bsg_job *bsg_job) 1582 1581 { 1583 1582 struct fc_bsg_reply *bsg_reply = bsg_job->reply; 1584 1583 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); ··· 1628 1627 } 1629 1628 1630 1629 static int 1631 - qla2x00_write_fru_status(struct fc_bsg_job *bsg_job) 1630 + qla2x00_write_fru_status(struct bsg_job *bsg_job) 1632 1631 { 1633 1632 struct fc_bsg_reply *bsg_reply = bsg_job->reply; 1634 1633 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); ··· 1674 1673 } 1675 1674 1676 1675 static int 1677 - qla2x00_write_i2c(struct fc_bsg_job *bsg_job) 1676 + qla2x00_write_i2c(struct bsg_job *bsg_job) 1678 1677 { 1679 1678 struct fc_bsg_reply *bsg_reply = bsg_job->reply; 1680 1679 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); ··· 1719 1718 } 1720 1719 1721 1720 static int 1722 - qla2x00_read_i2c(struct fc_bsg_job *bsg_job) 1721 + qla2x00_read_i2c(struct bsg_job *bsg_job) 1723 1722 { 1724 1723 struct fc_bsg_reply *bsg_reply = bsg_job->reply; 1725 1724 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); ··· 1768 1767 } 1769 1768 1770 1769 static int 1771 - qla24xx_process_bidir_cmd(struct fc_bsg_job *bsg_job) 1770 + qla24xx_process_bidir_cmd(struct bsg_job *bsg_job) 1772 1771 { 1773 1772 struct fc_bsg_reply *bsg_reply = bsg_job->reply; 1774 1773 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); ··· 1947 1946 } 1948 1947 1949 1948 static int 1950 - qlafx00_mgmt_cmd(struct fc_bsg_job *bsg_job) 1949 + qlafx00_mgmt_cmd(struct bsg_job *bsg_job) 1951 1950 { 1952 1951 struct fc_bsg_request *bsg_request = bsg_job->request; 1953 1952 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); ··· 2070 2069 } 2071 2070 2072 2071 static int 2073 - qla26xx_serdes_op(struct fc_bsg_job *bsg_job) 2072 + qla26xx_serdes_op(struct bsg_job *bsg_job) 2074 2073 { 2075 2074 struct fc_bsg_reply *bsg_reply = bsg_job->reply; 2076 2075 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); ··· 2112 2111 } 2113 2112 2114 2113 static int 2115 - qla8044_serdes_op(struct fc_bsg_job *bsg_job) 2114 + qla8044_serdes_op(struct bsg_job *bsg_job) 2116 2115 { 2117 2116 struct fc_bsg_reply *bsg_reply = bsg_job->reply; 2118 2117 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); ··· 2154 2153 } 2155 2154 2156 2155 static int 2157 - qla27xx_get_flash_upd_cap(struct fc_bsg_job *bsg_job) 2156 + qla27xx_get_flash_upd_cap(struct bsg_job *bsg_job) 2158 2157 { 2159 2158 struct fc_bsg_reply *bsg_reply = bsg_job->reply; 2160 2159 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); ··· 2186 2185 } 2187 2186 2188 2187 static int 2189 - qla27xx_set_flash_upd_cap(struct fc_bsg_job *bsg_job) 2188 + qla27xx_set_flash_upd_cap(struct bsg_job *bsg_job) 2190 2189 { 2191 2190 struct fc_bsg_reply *bsg_reply = bsg_job->reply; 2192 2191 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); ··· 2232 2231 } 2233 2232 2234 2233 static int 2235 - qla27xx_get_bbcr_data(struct fc_bsg_job *bsg_job) 2234 + qla27xx_get_bbcr_data(struct bsg_job *bsg_job) 2236 2235 { 2237 2236 struct fc_bsg_reply *bsg_reply = bsg_job->reply; 2238 2237 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); ··· 2291 2290 } 2292 2291 2293 2292 static int 2294 - qla2x00_get_priv_stats(struct fc_bsg_job *bsg_job) 2293 + qla2x00_get_priv_stats(struct bsg_job *bsg_job) 2295 2294 { 2296 2295 struct fc_bsg_request *bsg_request = bsg_job->request; 2297 2296 struct fc_bsg_reply *bsg_reply = bsg_job->reply; ··· 2352 2351 } 2353 2352 2354 2353 static int 2355 - qla2x00_do_dport_diagnostics(struct fc_bsg_job *bsg_job) 2354 + qla2x00_do_dport_diagnostics(struct bsg_job *bsg_job) 2356 2355 { 2357 2356 struct fc_bsg_reply *bsg_reply = bsg_job->reply; 2358 2357 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); ··· 2395 2394 } 2396 2395 2397 2396 static int 2398 - qla2x00_process_vendor_specific(struct fc_bsg_job *bsg_job) 2397 + qla2x00_process_vendor_specific(struct bsg_job *bsg_job) 2399 2398 { 2400 2399 struct fc_bsg_request *bsg_request = bsg_job->request; 2401 2400 ··· 2473 2472 } 2474 2473 2475 2474 int 2476 - qla24xx_bsg_request(struct fc_bsg_job *bsg_job) 2475 + qla24xx_bsg_request(struct bsg_job *bsg_job) 2477 2476 { 2478 2477 struct fc_bsg_request *bsg_request = bsg_job->request; 2479 2478 struct fc_bsg_reply *bsg_reply = bsg_job->reply; ··· 2526 2525 } 2527 2526 2528 2527 int 2529 - qla24xx_bsg_timeout(struct fc_bsg_job *bsg_job) 2528 + qla24xx_bsg_timeout(struct bsg_job *bsg_job) 2530 2529 { 2531 2530 struct fc_bsg_reply *bsg_reply = bsg_job->reply; 2532 2531 scsi_qla_host_t *vha = shost_priv(fc_bsg_to_shost(bsg_job));
+1 -1
drivers/scsi/qla2xxx/qla_def.h
··· 403 403 int iocbs; 404 404 union { 405 405 struct srb_iocb iocb_cmd; 406 - struct fc_bsg_job *bsg_job; 406 + struct bsg_job *bsg_job; 407 407 struct srb_cmd scmd; 408 408 } u; 409 409 void (*done)(void *, void *, int);
+2 -2
drivers/scsi/qla2xxx/qla_gbl.h
··· 733 733 extern int qla8044_read_temperature(scsi_qla_host_t *); 734 734 735 735 /* BSG related functions */ 736 - extern int qla24xx_bsg_request(struct fc_bsg_job *); 737 - extern int qla24xx_bsg_timeout(struct fc_bsg_job *); 736 + extern int qla24xx_bsg_request(struct bsg_job *); 737 + extern int qla24xx_bsg_timeout(struct bsg_job *); 738 738 extern int qla84xx_reset_chip(scsi_qla_host_t *, uint16_t); 739 739 extern int qla2x00_issue_iocb_timeout(scsi_qla_host_t *, void *, 740 740 dma_addr_t, size_t, uint32_t);
+4 -4
drivers/scsi/qla2xxx/qla_iocb.c
··· 2197 2197 static void 2198 2198 qla24xx_els_iocb(srb_t *sp, struct els_entry_24xx *els_iocb) 2199 2199 { 2200 - struct fc_bsg_job *bsg_job = sp->u.bsg_job; 2200 + struct bsg_job *bsg_job = sp->u.bsg_job; 2201 2201 struct fc_bsg_request *bsg_request = bsg_job->request; 2202 2202 2203 2203 els_iocb->entry_type = ELS_IOCB_TYPE; ··· 2251 2251 uint16_t tot_dsds; 2252 2252 scsi_qla_host_t *vha = sp->fcport->vha; 2253 2253 struct qla_hw_data *ha = vha->hw; 2254 - struct fc_bsg_job *bsg_job = sp->u.bsg_job; 2254 + struct bsg_job *bsg_job = sp->u.bsg_job; 2255 2255 int loop_iterartion = 0; 2256 2256 int entry_count = 1; 2257 2257 ··· 2328 2328 uint16_t tot_dsds; 2329 2329 scsi_qla_host_t *vha = sp->fcport->vha; 2330 2330 struct qla_hw_data *ha = vha->hw; 2331 - struct fc_bsg_job *bsg_job = sp->u.bsg_job; 2331 + struct bsg_job *bsg_job = sp->u.bsg_job; 2332 2332 int loop_iterartion = 0; 2333 2333 int entry_count = 1; 2334 2334 ··· 2834 2834 struct scatterlist *sg; 2835 2835 int index; 2836 2836 int entry_count = 1; 2837 - struct fc_bsg_job *bsg_job = sp->u.bsg_job; 2837 + struct bsg_job *bsg_job = sp->u.bsg_job; 2838 2838 2839 2839 /*Update entry type to indicate bidir command */ 2840 2840 *((uint32_t *)(&cmd_pkt->entry_type)) =
+3 -3
drivers/scsi/qla2xxx/qla_isr.c
··· 1356 1356 const char func[] = "CT_IOCB"; 1357 1357 const char *type; 1358 1358 srb_t *sp; 1359 - struct fc_bsg_job *bsg_job; 1359 + struct bsg_job *bsg_job; 1360 1360 struct fc_bsg_reply *bsg_reply; 1361 1361 uint16_t comp_status; 1362 1362 int res; ··· 1415 1415 const char func[] = "ELS_CT_IOCB"; 1416 1416 const char *type; 1417 1417 srb_t *sp; 1418 - struct fc_bsg_job *bsg_job; 1418 + struct bsg_job *bsg_job; 1419 1419 struct fc_bsg_reply *bsg_reply; 1420 1420 uint16_t comp_status; 1421 1421 uint32_t fw_status[3]; ··· 1908 1908 uint16_t scsi_status; 1909 1909 uint16_t thread_id; 1910 1910 uint32_t rval = EXT_STATUS_OK; 1911 - struct fc_bsg_job *bsg_job = NULL; 1911 + struct bsg_job *bsg_job = NULL; 1912 1912 struct fc_bsg_request *bsg_request; 1913 1913 struct fc_bsg_reply *bsg_reply; 1914 1914 sts_entry_t *sts;
+3 -2
drivers/scsi/qla2xxx/qla_mr.c
··· 10 10 #include <linux/pci.h> 11 11 #include <linux/ratelimit.h> 12 12 #include <linux/vmalloc.h> 13 + #include <linux/bsg-lib.h> 13 14 #include <scsi/scsi_tcq.h> 14 15 #include <linux/utsname.h> 15 16 ··· 2207 2206 { 2208 2207 const char func[] = "IOSB_IOCB"; 2209 2208 srb_t *sp; 2210 - struct fc_bsg_job *bsg_job; 2209 + struct bsg_job *bsg_job; 2211 2210 struct fc_bsg_reply *bsg_reply; 2212 2211 struct srb_iocb *iocb_job; 2213 2212 int res; ··· 3255 3254 { 3256 3255 struct srb_iocb *fxio = &sp->u.iocb_cmd; 3257 3256 struct qla_mt_iocb_rqst_fx00 *piocb_rqst; 3258 - struct fc_bsg_job *bsg_job; 3257 + struct bsg_job *bsg_job; 3259 3258 struct fc_bsg_request *bsg_request; 3260 3259 struct fxdisc_entry_fx00 fx_iocb; 3261 3260 uint8_t entry_cnt = 1;
+9 -11
drivers/scsi/scsi_transport_fc.c
··· 3562 3562 static void 3563 3563 fc_destroy_bsgjob(struct kref *kref) 3564 3564 { 3565 - struct fc_bsg_job *job = container_of(kref, struct fc_bsg_job, kref); 3565 + struct bsg_job *job = container_of(kref, struct bsg_job, kref); 3566 3566 struct request *rq = job->req; 3567 3567 3568 3568 blk_end_request_all(rq, rq->errors); ··· 3581 3581 * @result: job reply result 3582 3582 * @reply_payload_rcv_len: length of payload received 3583 3583 */ 3584 - void fc_bsg_jobdone(struct fc_bsg_job *job, int result, 3584 + void fc_bsg_jobdone(struct bsg_job *job, int result, 3585 3585 unsigned int reply_payload_rcv_len) 3586 3586 { 3587 3587 struct request *req = job->req; ··· 3615 3615 */ 3616 3616 static void fc_bsg_softirq_done(struct request *rq) 3617 3617 { 3618 - struct fc_bsg_job *job = rq->special; 3618 + struct bsg_job *job = rq->special; 3619 3619 3620 3620 kref_put(&job->kref, fc_destroy_bsgjob); 3621 3621 } ··· 3627 3627 static enum blk_eh_timer_return 3628 3628 fc_bsg_job_timeout(struct request *req) 3629 3629 { 3630 - struct fc_bsg_job *job = (void *) req->special; 3630 + struct bsg_job *job = (void *) req->special; 3631 3631 struct Scsi_Host *shost = fc_bsg_to_shost(job); 3632 3632 struct fc_rport *rport = fc_bsg_to_rport(job); 3633 3633 struct fc_internal *i = to_fc_internal(shost->transportt); ··· 3686 3686 { 3687 3687 struct fc_internal *i = to_fc_internal(shost->transportt); 3688 3688 struct request *rsp = req->next_rq; 3689 - struct fc_bsg_job *job; 3689 + struct bsg_job *job; 3690 3690 int ret; 3691 3691 3692 3692 BUG_ON(req->special); 3693 3693 3694 - job = kzalloc(sizeof(struct fc_bsg_job) + i->f->dd_bsg_size, 3694 + job = kzalloc(sizeof(struct bsg_job) + i->f->dd_bsg_size, 3695 3695 GFP_KERNEL); 3696 3696 if (!job) 3697 3697 return -ENOMEM; ··· 3706 3706 */ 3707 3707 3708 3708 req->special = job; 3709 - job->shost = shost; 3710 - job->rport = rport; 3711 3709 job->req = req; 3712 3710 if (i->f->dd_bsg_size) 3713 3711 job->dd_data = (void *)&job[1]; ··· 3758 3760 */ 3759 3761 static enum fc_dispatch_result 3760 3762 fc_bsg_host_dispatch(struct request_queue *q, struct Scsi_Host *shost, 3761 - struct fc_bsg_job *job) 3763 + struct bsg_job *job) 3762 3764 { 3763 3765 struct fc_internal *i = to_fc_internal(shost->transportt); 3764 3766 struct fc_bsg_request *bsg_request = job->request; ··· 3860 3862 */ 3861 3863 static enum fc_dispatch_result 3862 3864 fc_bsg_rport_dispatch(struct request_queue *q, struct Scsi_Host *shost, 3863 - struct fc_rport *rport, struct fc_bsg_job *job) 3865 + struct fc_rport *rport, struct bsg_job *job) 3864 3866 { 3865 3867 struct fc_internal *i = to_fc_internal(shost->transportt); 3866 3868 struct fc_bsg_request *bsg_request = job->request; ··· 3923 3925 struct fc_rport *rport, struct device *dev) 3924 3926 { 3925 3927 struct request *req; 3926 - struct fc_bsg_job *job; 3928 + struct bsg_job *job; 3927 3929 enum fc_dispatch_result ret; 3928 3930 struct fc_bsg_reply *bsg_reply; 3929 3931
+1 -1
include/scsi/libfc.h
··· 912 912 int fc_set_mfs(struct fc_lport *, u32 mfs); 913 913 struct fc_lport *libfc_vport_create(struct fc_vport *, int privsize); 914 914 struct fc_lport *fc_vport_id_lookup(struct fc_lport *, u32 port_id); 915 - int fc_lport_bsg_request(struct fc_bsg_job *); 915 + int fc_lport_bsg_request(struct bsg_job *); 916 916 void fc_lport_set_local_id(struct fc_lport *, u32 port_id); 917 917 void fc_lport_iterate(void (*func)(struct fc_lport *, void *), void *); 918 918
+18 -45
include/scsi/scsi_transport_fc.h
··· 32 32 #include <asm/unaligned.h> 33 33 #include <scsi/scsi.h> 34 34 #include <scsi/scsi_netlink.h> 35 + #include <scsi/scsi_host.h> 35 36 36 37 struct scsi_transport_template; 37 38 ··· 626 625 #define fc_host_dev_loss_tmo(x) \ 627 626 (((struct fc_host_attrs *)(x)->shost_data)->dev_loss_tmo) 628 627 629 - /* Values for fc_bsg_job->state_flags (bitflags) */ 630 - #define FC_RQST_STATE_INPROGRESS 0 631 - #define FC_RQST_STATE_DONE 1 632 - 633 - struct fc_bsg_job { 634 - struct Scsi_Host *shost; 635 - struct fc_rport *rport; 636 - struct device *dev; 637 - struct request *req; 638 - struct kref kref; 639 - 640 - struct fc_bsg_request *request; 641 - struct fc_bsg_reply *reply; 642 - unsigned int request_len; 643 - unsigned int reply_len; 644 - /* 645 - * On entry : reply_len indicates the buffer size allocated for 646 - * the reply. 647 - * 648 - * Upon completion : the message handler must set reply_len 649 - * to indicates the size of the reply to be returned to the 650 - * caller. 651 - */ 652 - 653 - /* DMA payloads for the request/response */ 654 - struct bsg_buffer request_payload; 655 - struct bsg_buffer reply_payload; 656 - 657 - void *dd_data; /* Used for driver-specific storage */ 658 - }; 659 - 660 - 661 628 /* The functions by which the transport class and the driver communicate */ 662 629 struct fc_function_template { 663 630 void (*get_rport_dev_loss_tmo)(struct fc_rport *); ··· 662 693 int (* it_nexus_response)(struct Scsi_Host *, u64, int); 663 694 664 695 /* bsg support */ 665 - int (*bsg_request)(struct fc_bsg_job *); 666 - int (*bsg_timeout)(struct fc_bsg_job *); 696 + int (*bsg_request)(struct bsg_job *); 697 + int (*bsg_timeout)(struct bsg_job *); 667 698 668 699 /* allocation lengths for host-specific data */ 669 700 u32 dd_fcrport_size; ··· 786 817 vport->vport_state = new_state; 787 818 } 788 819 789 - static inline struct Scsi_Host *fc_bsg_to_shost(struct fc_bsg_job *job) 790 - { 791 - return job->shost; 792 - } 793 - 794 - static inline struct fc_rport *fc_bsg_to_rport(struct fc_bsg_job *job) 795 - { 796 - return job->rport; 797 - } 798 - 799 820 struct scsi_transport_template *fc_attach_transport( 800 821 struct fc_function_template *); 801 822 void fc_release_transport(struct scsi_transport_template *); ··· 808 849 struct fc_vport_identifiers *); 809 850 int fc_vport_terminate(struct fc_vport *vport); 810 851 int fc_block_scsi_eh(struct scsi_cmnd *cmnd); 811 - void fc_bsg_jobdone(struct fc_bsg_job *job, int result, 852 + void fc_bsg_jobdone(struct bsg_job *job, int result, 812 853 unsigned int reply_payload_rcv_len); 854 + 855 + static inline struct Scsi_Host *fc_bsg_to_shost(struct bsg_job *job) 856 + { 857 + if (scsi_is_host_device(job->dev)) 858 + return dev_to_shost(job->dev); 859 + return rport_to_shost(dev_to_rport(job->dev)); 860 + } 861 + 862 + static inline struct fc_rport *fc_bsg_to_rport(struct bsg_job *job) 863 + { 864 + if (scsi_is_fc_rport(job->dev)) 865 + return dev_to_rport(job->dev); 866 + return NULL; 867 + } 813 868 814 869 #endif /* SCSI_TRANSPORT_FC_H */