diff options
author | Krishna Gudipati <kgudipat@brocade.com> | 2011-06-13 15:39:36 -0700 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-06-29 15:24:46 -0500 |
commit | 85ce928dbb87585042e7dfebe513f724eadebd5e (patch) | |
tree | 121604b0dfe16ea282b378901e1b00d85f215f97 /drivers/scsi/bfa/bfa_ioc.h | |
parent | 4d08e731bd6e3c5fd0b65bcfba22dc159fec3487 (diff) | |
download | blackbird-op-linux-85ce928dbb87585042e7dfebe513f724eadebd5e.tar.gz blackbird-op-linux-85ce928dbb87585042e7dfebe513f724eadebd5e.zip |
[SCSI] bfa: Introduced generic address len pair to represent DMA memory chunk.
- Avoid the use of hardware defined structure bfi_sge_s for DMA
requests in host.
- Defined a generic address len pair to represent a DMA memory chunk
(bfi_alen_s).
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/bfa/bfa_ioc.h')
-rw-r--r-- | drivers/scsi/bfa/bfa_ioc.h | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/drivers/scsi/bfa/bfa_ioc.h b/drivers/scsi/bfa/bfa_ioc.h index c85182a704fb..62318d24f85e 100644 --- a/drivers/scsi/bfa/bfa_ioc.h +++ b/drivers/scsi/bfa/bfa_ioc.h @@ -112,18 +112,6 @@ struct bfa_dma_s { #define BFI_SMEM_CB_SIZE 0x200000U /* ! 2MB for crossbow */ #define BFI_SMEM_CT_SIZE 0x280000U /* ! 2.5MB for catapult */ - -#define bfa_dma_addr_set(dma_addr, pa) \ - __bfa_dma_addr_set(&dma_addr, (u64)pa) - -static inline void -__bfa_dma_addr_set(union bfi_addr_u *dma_addr, u64 pa) -{ - dma_addr->a32.addr_lo = (__be32) pa; - dma_addr->a32.addr_hi = (__be32) (pa >> 32); -} - - #define bfa_dma_be_addr_set(dma_addr, pa) \ __bfa_dma_be_addr_set(&dma_addr, (u64)pa) static inline void @@ -133,6 +121,16 @@ __bfa_dma_be_addr_set(union bfi_addr_u *dma_addr, u64 pa) dma_addr->a32.addr_hi = cpu_to_be32(pa >> 32); } +#define bfa_alen_set(__alen, __len, __pa) \ + __bfa_alen_set(__alen, __len, (u64)__pa) + +static inline void +__bfa_alen_set(struct bfi_alen_s *alen, u32 len, u64 pa) +{ + alen->al_len = cpu_to_be32(len); + bfa_dma_be_addr_set(alen->al_addr, pa); +} + struct bfa_ioc_regs_s { void __iomem *hfn_mbox_cmd; void __iomem *hfn_mbox; |