Skip to content

Commit

Permalink
[SCSI] bfa: remove all SCSI IO callbacks
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Maggie Zhang authored and James Bottomley committed Dec 21, 2010
1 parent e3e7d3e commit f314878
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 204 deletions.
169 changes: 0 additions & 169 deletions drivers/scsi/bfa/bfa_cb_ioim.h

This file was deleted.

4 changes: 2 additions & 2 deletions drivers/scsi/bfa/bfa_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -446,8 +446,8 @@ enum bfa_boot_bootopt {
* Boot lun information.
*/
struct bfa_boot_bootlun_s {
wwn_t pwwn; /* port wwn of target */
lun_t lun; /* 64-bit lun */
wwn_t pwwn; /* port wwn of target */
struct scsi_lun lun; /* 64-bit lun */
};
#pragma pack()

Expand Down
5 changes: 2 additions & 3 deletions drivers/scsi/bfa/bfa_fc.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include "bfa_os_inc.h"

typedef u64 wwn_t;
typedef u64 lun_t;

#define WWN_NULL (0)
#define FC_SYMNAME_MAX 256 /* max name server symbolic name size */
Expand Down Expand Up @@ -1176,8 +1175,8 @@ struct fc_srr_s {
#define FCP_CMND_LUN_LEN 8

struct fcp_cmnd_s {
lun_t lun; /* 64-bit LU number */
u8 crn; /* command reference number */
struct scsi_lun lun; /* 64-bit LU number */
u8 crn; /* command reference number */
#ifdef __BIGENDIAN
u8 resvd:1,
priority:4, /* FCP-3: SAM-3 priority */
Expand Down
53 changes: 33 additions & 20 deletions drivers/scsi/bfa/bfa_fcpim.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/

#include "bfa_modules.h"
#include "bfa_cb_ioim.h"
#include "bfa_os_inc.h"

BFA_TRC_FILE(HAL, FCPIM);
BFA_MODULE(fcpim);
Expand Down Expand Up @@ -263,7 +263,7 @@ static void bfa_ioim_sm_cmnd_retry(struct bfa_ioim_s *ioim,
static void __bfa_cb_tskim_done(void *cbarg, bfa_boolean_t complete);
static void __bfa_cb_tskim_failed(void *cbarg, bfa_boolean_t complete);
static bfa_boolean_t bfa_tskim_match_scope(struct bfa_tskim_s *tskim,
lun_t lun);
struct scsi_lun lun);
static void bfa_tskim_gather_ios(struct bfa_tskim_s *tskim);
static void bfa_tskim_cleanp_comp(void *tskim_cbarg);
static void bfa_tskim_cleanup_ios(struct bfa_tskim_s *tskim);
Expand Down Expand Up @@ -2315,7 +2315,7 @@ bfa_ioim_send_ioreq(struct bfa_ioim_s *ioim)
{
struct bfa_itnim_s *itnim = ioim->itnim;
struct bfi_ioim_req_s *m;
static struct fcp_cmnd_s cmnd_z0 = { 0 };
static struct fcp_cmnd_s cmnd_z0 = {{{0}}};
struct bfi_sge_s *sge, *sgpge;
u32 pgdlen = 0;
u32 fcp_dl;
Expand All @@ -2324,6 +2324,7 @@ bfa_ioim_send_ioreq(struct bfa_ioim_s *ioim)
struct bfa_sgpg_s *sgpg;
struct scsi_cmnd *cmnd = (struct scsi_cmnd *) ioim->dio;
u32 i, sge_id, pgcumsz;
enum dma_data_direction dmadir;

/*
* check for room in queue to send request now
Expand All @@ -2341,7 +2342,7 @@ bfa_ioim_send_ioreq(struct bfa_ioim_s *ioim)
*/
m->io_tag = cpu_to_be16(ioim->iotag);
m->rport_hdl = ioim->itnim->rport->fw_handle;
m->io_timeout = bfa_cb_ioim_get_timeout(ioim->dio);
m->io_timeout = 0;

sge = &m->sges[0];
sgpg = ioim->sgpg;
Expand Down Expand Up @@ -2412,10 +2413,17 @@ bfa_ioim_send_ioreq(struct bfa_ioim_s *ioim)
* set up I/O command parameters
*/
m->cmnd = cmnd_z0;
m->cmnd.lun = bfa_cb_ioim_get_lun(ioim->dio);
m->cmnd.iodir = bfa_cb_ioim_get_iodir(ioim->dio);
m->cmnd.cdb = *(scsi_cdb_t *)bfa_cb_ioim_get_cdb(ioim->dio);
fcp_dl = bfa_cb_ioim_get_size(ioim->dio);
int_to_scsilun(cmnd->device->lun, &m->cmnd.lun);
dmadir = cmnd->sc_data_direction;
if (dmadir == DMA_TO_DEVICE)
m->cmnd.iodir = FCP_IODIR_WRITE;
else if (dmadir == DMA_FROM_DEVICE)
m->cmnd.iodir = FCP_IODIR_READ;
else
m->cmnd.iodir = FCP_IODIR_NONE;

m->cmnd.cdb = *(scsi_cdb_t *) cmnd->cmnd;
fcp_dl = scsi_bufflen(cmnd);
m->cmnd.fcp_dl = cpu_to_be32(fcp_dl);

/*
Expand All @@ -2439,7 +2447,7 @@ bfa_ioim_send_ioreq(struct bfa_ioim_s *ioim)
bfi_h2i_set(m->mh, BFI_MC_IOIM_IO, 0, bfa_lpuid(ioim->bfa));
}
if (itnim->seq_rec ||
(bfa_cb_ioim_get_size(ioim->dio) & (sizeof(u32) - 1)))
(scsi_bufflen(cmnd) & (sizeof(u32) - 1)))
bfi_h2i_set(m->mh, BFI_MC_IOIM_IO, 0, bfa_lpuid(ioim->bfa));

/*
Expand Down Expand Up @@ -2769,7 +2777,8 @@ bfa_ioim_profile_start(struct bfa_ioim_s *ioim)
void
bfa_ioim_profile_comp(struct bfa_ioim_s *ioim)
{
u32 fcp_dl = bfa_cb_ioim_get_size(ioim->dio);
struct scsi_cmnd *cmnd = (struct scsi_cmnd *) ioim->dio;
u32 fcp_dl = scsi_bufflen(cmnd);
u32 index = bfa_ioim_get_index(fcp_dl);
u64 end_time = jiffies;
struct bfa_itnim_latency_s *io_lat =
Expand Down Expand Up @@ -2895,8 +2904,7 @@ bfa_ioim_start(struct bfa_ioim_s *ioim)
* Obtain the queue over which this request has to be issued
*/
ioim->reqq = bfa_fcpim_ioredirect_enabled(ioim->bfa) ?
bfa_cb_ioim_get_reqq(ioim->dio) :
bfa_itnim_get_reqq(ioim);
BFA_FALSE : bfa_itnim_get_reqq(ioim);

bfa_sm_send_event(ioim, BFA_IOIM_SM_START);
}
Expand Down Expand Up @@ -3186,7 +3194,7 @@ __bfa_cb_tskim_failed(void *cbarg, bfa_boolean_t complete)
}

static bfa_boolean_t
bfa_tskim_match_scope(struct bfa_tskim_s *tskim, lun_t lun)
bfa_tskim_match_scope(struct bfa_tskim_s *tskim, struct scsi_lun lun)
{
switch (tskim->tm_cmnd) {
case FCP_TM_TARGET_RESET:
Expand All @@ -3196,7 +3204,7 @@ bfa_tskim_match_scope(struct bfa_tskim_s *tskim, lun_t lun)
case FCP_TM_CLEAR_TASK_SET:
case FCP_TM_LUN_RESET:
case FCP_TM_CLEAR_ACA:
return (tskim->lun == lun);
return (!memcmp(&tskim->lun, &lun, sizeof(lun)));

default:
bfa_assert(0);
Expand All @@ -3213,7 +3221,9 @@ bfa_tskim_gather_ios(struct bfa_tskim_s *tskim)
{
struct bfa_itnim_s *itnim = tskim->itnim;
struct bfa_ioim_s *ioim;
struct list_head *qe, *qen;
struct list_head *qe, *qen;
struct scsi_cmnd *cmnd;
struct scsi_lun scsilun;

INIT_LIST_HEAD(&tskim->io_q);

Expand All @@ -3222,8 +3232,9 @@ bfa_tskim_gather_ios(struct bfa_tskim_s *tskim)
*/
list_for_each_safe(qe, qen, &itnim->io_q) {
ioim = (struct bfa_ioim_s *) qe;
if (bfa_tskim_match_scope
(tskim, bfa_cb_ioim_get_lun(ioim->dio))) {
cmnd = (struct scsi_cmnd *) ioim->dio;
int_to_scsilun(cmnd->device->lun, &scsilun);
if (bfa_tskim_match_scope(tskim, scsilun)) {
list_del(&ioim->qe);
list_add_tail(&ioim->qe, &tskim->io_q);
}
Expand All @@ -3234,8 +3245,9 @@ bfa_tskim_gather_ios(struct bfa_tskim_s *tskim)
*/
list_for_each_safe(qe, qen, &itnim->pending_q) {
ioim = (struct bfa_ioim_s *) qe;
if (bfa_tskim_match_scope
(tskim, bfa_cb_ioim_get_lun(ioim->dio))) {
cmnd = (struct scsi_cmnd *) ioim->dio;
int_to_scsilun(cmnd->device->lun, &scsilun);
if (bfa_tskim_match_scope(tskim, scsilun)) {
list_del(&ioim->qe);
list_add_tail(&ioim->qe, &ioim->fcpim->ioim_comp_q);
bfa_ioim_tov(ioim);
Expand Down Expand Up @@ -3494,7 +3506,8 @@ bfa_tskim_free(struct bfa_tskim_s *tskim)
* @return None.
*/
void
bfa_tskim_start(struct bfa_tskim_s *tskim, struct bfa_itnim_s *itnim, lun_t lun,
bfa_tskim_start(struct bfa_tskim_s *tskim, struct bfa_itnim_s *itnim,
struct scsi_lun lun,
enum fcp_tm_cmnd tm_cmnd, u8 tsecs)
{
tskim->itnim = itnim;
Expand Down
8 changes: 4 additions & 4 deletions drivers/scsi/bfa/bfa_fcpim.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ struct bfa_tskim_s {
struct bfa_s *bfa; /* BFA module */
struct bfa_fcpim_mod_s *fcpim; /* parent fcpim module */
struct bfa_itnim_s *itnim; /* i-t-n nexus for this IO */
struct bfad_tskim_s *dtsk; /* driver task mgmt cmnd */
bfa_boolean_t notify; /* notify itnim on TM comp */
lun_t lun; /* lun if applicable */
struct bfad_tskim_s *dtsk; /* driver task mgmt cmnd */
bfa_boolean_t notify; /* notify itnim on TM comp */
struct scsi_lun lun; /* lun if applicable */
enum fcp_tm_cmnd tm_cmnd; /* task management command */
u16 tsk_tag; /* FWI IO tag */
u8 tsecs; /* timeout in seconds */
Expand Down Expand Up @@ -389,7 +389,7 @@ struct bfa_tskim_s *bfa_tskim_alloc(struct bfa_s *bfa,
struct bfad_tskim_s *dtsk);
void bfa_tskim_free(struct bfa_tskim_s *tskim);
void bfa_tskim_start(struct bfa_tskim_s *tskim,
struct bfa_itnim_s *itnim, lun_t lun,
struct bfa_itnim_s *itnim, struct scsi_lun lun,
enum fcp_tm_cmnd tm, u8 t_secs);
void bfa_cb_tskim_done(void *bfad, struct bfad_tskim_s *dtsk,
enum bfi_tskim_status tsk_status);
Expand Down
Loading

0 comments on commit f314878

Please sign in to comment.