1616 */
1717
1818#include "bfa_modules.h"
19- #include "bfa_cb_ioim .h"
19+ #include "bfa_os_inc .h"
2020
2121BFA_TRC_FILE (HAL , FCPIM );
2222BFA_MODULE (fcpim );
@@ -263,7 +263,7 @@ static void bfa_ioim_sm_cmnd_retry(struct bfa_ioim_s *ioim,
263263static void __bfa_cb_tskim_done (void * cbarg , bfa_boolean_t complete );
264264static void __bfa_cb_tskim_failed (void * cbarg , bfa_boolean_t complete );
265265static bfa_boolean_t bfa_tskim_match_scope (struct bfa_tskim_s * tskim ,
266- lun_t lun );
266+ struct scsi_lun lun );
267267static void bfa_tskim_gather_ios (struct bfa_tskim_s * tskim );
268268static void bfa_tskim_cleanp_comp (void * tskim_cbarg );
269269static 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)
27692777void
27702778bfa_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
31883196static 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 */
34963508void
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 ;
0 commit comments