1 /* { dg-do compile } */
2 /* { dg-options "-O2 -mcpu=ev4" } */
8 unsigned cfg_total_seg_cnt
;
10 struct lpfc_scsi_buf
{
11 struct scsi_cmnd
*pCmd
;
16 extern void *sg_next(void *sg
);
17 extern void *scsi_sglist(struct scsi_cmnd
*cmd
);
18 extern unsigned scsi_sg_count(struct scsi_cmnd
*cmd
);
20 static inline void dma_map_sg_attrs(void *sg
, int nents
, int dir
)
24 for (i
= 0; i
< nents
; i
++, sg
= sg_next(sg
))
28 asm volatile( "call_pal %0" : : "i"(129));
31 static inline void lpfc_bg_setup_bpl(struct lpfc_hba
*phba
, struct scsi_cmnd
*sc
,
37 *pde5
= (((0x85 & 0x000000ff) << 24) | (*pde5
& ~(0x000000ff << 24)));
38 for (i
= 0, sgde
= scsi_sglist(sc
); i
< 2; i
++, sgde
= sg_next(sgde
))
42 void lpfc_bg_scsi_prep_dma_buf_s3(struct lpfc_hba
*phba
,
43 struct lpfc_scsi_buf
*lpfc_cmd
)
45 struct scsi_cmnd
*scsi_cmnd
= lpfc_cmd
->pCmd
;
46 unsigned *bpl
= lpfc_cmd
->fcp_bpl
;
48 dma_map_sg_attrs(scsi_sglist(scsi_cmnd
),
49 scsi_sg_count(scsi_cmnd
),
50 scsi_cmnd
->sc_data_direction
);
51 if (lpfc_cmd
->seg_cnt
> phba
->cfg_total_seg_cnt
)
52 lpfc_bg_setup_bpl(phba
, scsi_cmnd
, bpl
);