Skip to content

Commit f314878

Browse files
Maggie ZhangJames Bottomley
authored andcommitted
[SCSI] bfa: remove all SCSI IO callbacks
Remove SCSI IO callbacks, and as a result remove bfa_cb_ioim.h. Signed-off-by: Maggie Zhang <xmzhang@brocade.com> Signed-off-by: Jing Huang <huangj@brocade.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
1 parent e3e7d3e commit f314878

8 files changed

Lines changed: 49 additions & 204 deletions

File tree

‎drivers/scsi/bfa/bfa_cb_ioim.h‎

Lines changed: 0 additions & 169 deletions
This file was deleted.

‎drivers/scsi/bfa/bfa_defs.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,8 +446,8 @@ enum bfa_boot_bootopt {
446446
* Boot lun information.
447447
*/
448448
struct bfa_boot_bootlun_s {
449-
wwn_t pwwn; /* port wwn of target */
450-
lun_t lun; /* 64-bit lun */
449+
wwn_t pwwn; /* port wwn of target */
450+
struct scsi_lun lun; /* 64-bit lun */
451451
};
452452
#pragma pack()
453453

‎drivers/scsi/bfa/bfa_fc.h‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include "bfa_os_inc.h"
2222

2323
typedef u64 wwn_t;
24-
typedef u64 lun_t;
2524

2625
#define WWN_NULL (0)
2726
#define FC_SYMNAME_MAX 256 /* max name server symbolic name size */
@@ -1176,8 +1175,8 @@ struct fc_srr_s {
11761175
#define FCP_CMND_LUN_LEN 8
11771176

11781177
struct fcp_cmnd_s {
1179-
lun_t lun; /* 64-bit LU number */
1180-
u8 crn; /* command reference number */
1178+
struct scsi_lun lun; /* 64-bit LU number */
1179+
u8 crn; /* command reference number */
11811180
#ifdef __BIGENDIAN
11821181
u8 resvd:1,
11831182
priority:4, /* FCP-3: SAM-3 priority */

‎drivers/scsi/bfa/bfa_fcpim.c‎

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717

1818
#include "bfa_modules.h"
19-
#include "bfa_cb_ioim.h"
19+
#include "bfa_os_inc.h"
2020

2121
BFA_TRC_FILE(HAL, FCPIM);
2222
BFA_MODULE(fcpim);
@@ -263,7 +263,7 @@ static void bfa_ioim_sm_cmnd_retry(struct bfa_ioim_s *ioim,
263263
static void __bfa_cb_tskim_done(void *cbarg, bfa_boolean_t complete);
264264
static void __bfa_cb_tskim_failed(void *cbarg, bfa_boolean_t complete);
265265
static bfa_boolean_t bfa_tskim_match_scope(struct bfa_tskim_s *tskim,
266-
lun_t lun);
266+
struct scsi_lun lun);
267267
static void bfa_tskim_gather_ios(struct bfa_tskim_s *tskim);
268268
static void bfa_tskim_cleanp_comp(void *tskim_cbarg);
269269
static void bfa_tskim_cleanup_ios(struct bfa_tskim_s *tskim);
@@ -2315,7 +2315,7 @@ bfa_ioim_send_ioreq(struct bfa_ioim_s *ioim)
23152315
{
23162316
struct bfa_itnim_s *itnim = ioim->itnim;
23172317
struct bfi_ioim_req_s *m;
2318-
static struct fcp_cmnd_s cmnd_z0 = { 0 };
2318+
static struct fcp_cmnd_s cmnd_z0 = {{{0}}};
23192319
struct bfi_sge_s *sge, *sgpge;
23202320
u32 pgdlen = 0;
23212321
u32 fcp_dl;
@@ -2324,6 +2324,7 @@ bfa_ioim_send_ioreq(struct bfa_ioim_s *ioim)
23242324
struct bfa_sgpg_s *sgpg;
23252325
struct scsi_cmnd *cmnd = (struct scsi_cmnd *) ioim->dio;
23262326
u32 i, sge_id, pgcumsz;
2327+
enum dma_data_direction dmadir;
23272328

23282329
/*
23292330
* check for room in queue to send request now
@@ -2341,7 +2342,7 @@ bfa_ioim_send_ioreq(struct bfa_ioim_s *ioim)
23412342
*/
23422343
m->io_tag = cpu_to_be16(ioim->iotag);
23432344
m->rport_hdl = ioim->itnim->rport->fw_handle;
2344-
m->io_timeout = bfa_cb_ioim_get_timeout(ioim->dio);
2345+
m->io_timeout = 0;
23452346

23462347
sge = &m->sges[0];
23472348
sgpg = ioim->sgpg;
@@ -2412,10 +2413,17 @@ bfa_ioim_send_ioreq(struct bfa_ioim_s *ioim)
24122413
* set up I/O command parameters
24132414
*/
24142415
m->cmnd = cmnd_z0;
2415-
m->cmnd.lun = bfa_cb_ioim_get_lun(ioim->dio);
2416-
m->cmnd.iodir = bfa_cb_ioim_get_iodir(ioim->dio);
2417-
m->cmnd.cdb = *(scsi_cdb_t *)bfa_cb_ioim_get_cdb(ioim->dio);
2418-
fcp_dl = bfa_cb_ioim_get_size(ioim->dio);
2416+
int_to_scsilun(cmnd->device->lun, &m->cmnd.lun);
2417+
dmadir = cmnd->sc_data_direction;
2418+
if (dmadir == DMA_TO_DEVICE)
2419+
m->cmnd.iodir = FCP_IODIR_WRITE;
2420+
else if (dmadir == DMA_FROM_DEVICE)
2421+
m->cmnd.iodir = FCP_IODIR_READ;
2422+
else
2423+
m->cmnd.iodir = FCP_IODIR_NONE;
2424+
2425+
m->cmnd.cdb = *(scsi_cdb_t *) cmnd->cmnd;
2426+
fcp_dl = scsi_bufflen(cmnd);
24192427
m->cmnd.fcp_dl = cpu_to_be32(fcp_dl);
24202428

24212429
/*
@@ -2439,7 +2447,7 @@ bfa_ioim_send_ioreq(struct bfa_ioim_s *ioim)
24392447
bfi_h2i_set(m->mh, BFI_MC_IOIM_IO, 0, bfa_lpuid(ioim->bfa));
24402448
}
24412449
if (itnim->seq_rec ||
2442-
(bfa_cb_ioim_get_size(ioim->dio) & (sizeof(u32) - 1)))
2450+
(scsi_bufflen(cmnd) & (sizeof(u32) - 1)))
24432451
bfi_h2i_set(m->mh, BFI_MC_IOIM_IO, 0, bfa_lpuid(ioim->bfa));
24442452

24452453
/*
@@ -2769,7 +2777,8 @@ bfa_ioim_profile_start(struct bfa_ioim_s *ioim)
27692777
void
27702778
bfa_ioim_profile_comp(struct bfa_ioim_s *ioim)
27712779
{
2772-
u32 fcp_dl = bfa_cb_ioim_get_size(ioim->dio);
2780+
struct scsi_cmnd *cmnd = (struct scsi_cmnd *) ioim->dio;
2781+
u32 fcp_dl = scsi_bufflen(cmnd);
27732782
u32 index = bfa_ioim_get_index(fcp_dl);
27742783
u64 end_time = jiffies;
27752784
struct bfa_itnim_latency_s *io_lat =
@@ -2895,8 +2904,7 @@ bfa_ioim_start(struct bfa_ioim_s *ioim)
28952904
* Obtain the queue over which this request has to be issued
28962905
*/
28972906
ioim->reqq = bfa_fcpim_ioredirect_enabled(ioim->bfa) ?
2898-
bfa_cb_ioim_get_reqq(ioim->dio) :
2899-
bfa_itnim_get_reqq(ioim);
2907+
BFA_FALSE : bfa_itnim_get_reqq(ioim);
29002908

29012909
bfa_sm_send_event(ioim, BFA_IOIM_SM_START);
29022910
}
@@ -3186,7 +3194,7 @@ __bfa_cb_tskim_failed(void *cbarg, bfa_boolean_t complete)
31863194
}
31873195

31883196
static bfa_boolean_t
3189-
bfa_tskim_match_scope(struct bfa_tskim_s *tskim, lun_t lun)
3197+
bfa_tskim_match_scope(struct bfa_tskim_s *tskim, struct scsi_lun lun)
31903198
{
31913199
switch (tskim->tm_cmnd) {
31923200
case FCP_TM_TARGET_RESET:
@@ -3196,7 +3204,7 @@ bfa_tskim_match_scope(struct bfa_tskim_s *tskim, lun_t lun)
31963204
case FCP_TM_CLEAR_TASK_SET:
31973205
case FCP_TM_LUN_RESET:
31983206
case FCP_TM_CLEAR_ACA:
3199-
return (tskim->lun == lun);
3207+
return (!memcmp(&tskim->lun, &lun, sizeof(lun)));
32003208

32013209
default:
32023210
bfa_assert(0);
@@ -3213,7 +3221,9 @@ bfa_tskim_gather_ios(struct bfa_tskim_s *tskim)
32133221
{
32143222
struct bfa_itnim_s *itnim = tskim->itnim;
32153223
struct bfa_ioim_s *ioim;
3216-
struct list_head *qe, *qen;
3224+
struct list_head *qe, *qen;
3225+
struct scsi_cmnd *cmnd;
3226+
struct scsi_lun scsilun;
32173227

32183228
INIT_LIST_HEAD(&tskim->io_q);
32193229

@@ -3222,8 +3232,9 @@ bfa_tskim_gather_ios(struct bfa_tskim_s *tskim)
32223232
*/
32233233
list_for_each_safe(qe, qen, &itnim->io_q) {
32243234
ioim = (struct bfa_ioim_s *) qe;
3225-
if (bfa_tskim_match_scope
3226-
(tskim, bfa_cb_ioim_get_lun(ioim->dio))) {
3235+
cmnd = (struct scsi_cmnd *) ioim->dio;
3236+
int_to_scsilun(cmnd->device->lun, &scsilun);
3237+
if (bfa_tskim_match_scope(tskim, scsilun)) {
32273238
list_del(&ioim->qe);
32283239
list_add_tail(&ioim->qe, &tskim->io_q);
32293240
}
@@ -3234,8 +3245,9 @@ bfa_tskim_gather_ios(struct bfa_tskim_s *tskim)
32343245
*/
32353246
list_for_each_safe(qe, qen, &itnim->pending_q) {
32363247
ioim = (struct bfa_ioim_s *) qe;
3237-
if (bfa_tskim_match_scope
3238-
(tskim, bfa_cb_ioim_get_lun(ioim->dio))) {
3248+
cmnd = (struct scsi_cmnd *) ioim->dio;
3249+
int_to_scsilun(cmnd->device->lun, &scsilun);
3250+
if (bfa_tskim_match_scope(tskim, scsilun)) {
32393251
list_del(&ioim->qe);
32403252
list_add_tail(&ioim->qe, &ioim->fcpim->ioim_comp_q);
32413253
bfa_ioim_tov(ioim);
@@ -3494,7 +3506,8 @@ bfa_tskim_free(struct bfa_tskim_s *tskim)
34943506
* @return None.
34953507
*/
34963508
void
3497-
bfa_tskim_start(struct bfa_tskim_s *tskim, struct bfa_itnim_s *itnim, lun_t lun,
3509+
bfa_tskim_start(struct bfa_tskim_s *tskim, struct bfa_itnim_s *itnim,
3510+
struct scsi_lun lun,
34983511
enum fcp_tm_cmnd tm_cmnd, u8 tsecs)
34993512
{
35003513
tskim->itnim = itnim;

‎drivers/scsi/bfa/bfa_fcpim.h‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,9 @@ struct bfa_tskim_s {
146146
struct bfa_s *bfa; /* BFA module */
147147
struct bfa_fcpim_mod_s *fcpim; /* parent fcpim module */
148148
struct bfa_itnim_s *itnim; /* i-t-n nexus for this IO */
149-
struct bfad_tskim_s *dtsk; /* driver task mgmt cmnd */
150-
bfa_boolean_t notify; /* notify itnim on TM comp */
151-
lun_t lun; /* lun if applicable */
149+
struct bfad_tskim_s *dtsk; /* driver task mgmt cmnd */
150+
bfa_boolean_t notify; /* notify itnim on TM comp */
151+
struct scsi_lun lun; /* lun if applicable */
152152
enum fcp_tm_cmnd tm_cmnd; /* task management command */
153153
u16 tsk_tag; /* FWI IO tag */
154154
u8 tsecs; /* timeout in seconds */
@@ -389,7 +389,7 @@ struct bfa_tskim_s *bfa_tskim_alloc(struct bfa_s *bfa,
389389
struct bfad_tskim_s *dtsk);
390390
void bfa_tskim_free(struct bfa_tskim_s *tskim);
391391
void bfa_tskim_start(struct bfa_tskim_s *tskim,
392-
struct bfa_itnim_s *itnim, lun_t lun,
392+
struct bfa_itnim_s *itnim, struct scsi_lun lun,
393393
enum fcp_tm_cmnd tm, u8 t_secs);
394394
void bfa_cb_tskim_done(void *bfad, struct bfad_tskim_s *dtsk,
395395
enum bfi_tskim_status tsk_status);

0 commit comments

Comments
 (0)