aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_inline.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_inline.h')
-rw-r--r--drivers/scsi/qla2xxx/qla_inline.h87
1 files changed, 1 insertions, 86 deletions
diff --git a/drivers/scsi/qla2xxx/qla_inline.h b/drivers/scsi/qla2xxx/qla_inline.h
index 5d1a3f7c408f..e9bae27737d1 100644
--- a/drivers/scsi/qla2xxx/qla_inline.h
+++ b/drivers/scsi/qla2xxx/qla_inline.h
@@ -1,11 +1,10 @@
1/* 1/*
2 * QLogic Fibre Channel HBA Driver 2 * QLogic Fibre Channel HBA Driver
3 * Copyright (c) 2003-2005 QLogic Corporation 3 * Copyright (c) 2003-2008 QLogic Corporation
4 * 4 *
5 * See LICENSE.qla2xxx for copyright and licensing details. 5 * See LICENSE.qla2xxx for copyright and licensing details.
6 */ 6 */
7 7
8static __inline__ uint16_t qla2x00_debounce_register(volatile uint16_t __iomem *);
9/* 8/*
10 * qla2x00_debounce_register 9 * qla2x00_debounce_register
11 * Debounce register. 10 * Debounce register.
@@ -32,94 +31,12 @@ qla2x00_debounce_register(volatile uint16_t __iomem *addr)
32 return (first); 31 return (first);
33} 32}
34 33
35static __inline__ int qla2x00_normalize_dma_addr(
36 dma_addr_t *e_addr, uint32_t *e_len,
37 dma_addr_t *ne_addr, uint32_t *ne_len);
38
39/**
40 * qla2x00_normalize_dma_addr() - Normalize an DMA address.
41 * @e_addr: Raw DMA address
42 * @e_len: Raw DMA length
43 * @ne_addr: Normalized second DMA address
44 * @ne_len: Normalized second DMA length
45 *
46 * If the address does not span a 4GB page boundary, the contents of @ne_addr
47 * and @ne_len are undefined. @e_len is updated to reflect a normalization.
48 *
49 * Example:
50 *
51 * ffffabc0ffffeeee (e_addr) start of DMA address
52 * 0000000020000000 (e_len) length of DMA transfer
53 * ffffabc11fffeeed end of DMA transfer
54 *
55 * Is the 4GB boundary crossed?
56 *
57 * ffffabc0ffffeeee (e_addr)
58 * ffffabc11fffeeed (e_addr + e_len - 1)
59 * 00000001e0000003 ((e_addr ^ (e_addr + e_len - 1))
60 * 0000000100000000 ((e_addr ^ (e_addr + e_len - 1)) & ~(0xffffffff)
61 *
62 * Compute start of second DMA segment:
63 *
64 * ffffabc0ffffeeee (e_addr)
65 * ffffabc1ffffeeee (0x100000000 + e_addr)
66 * ffffabc100000000 (0x100000000 + e_addr) & ~(0xffffffff)
67 * ffffabc100000000 (ne_addr)
68 *
69 * Compute length of second DMA segment:
70 *
71 * 00000000ffffeeee (e_addr & 0xffffffff)
72 * 0000000000001112 (0x100000000 - (e_addr & 0xffffffff))
73 * 000000001fffeeee (e_len - (0x100000000 - (e_addr & 0xffffffff))
74 * 000000001fffeeee (ne_len)
75 *
76 * Adjust length of first DMA segment
77 *
78 * 0000000020000000 (e_len)
79 * 0000000000001112 (e_len - ne_len)
80 * 0000000000001112 (e_len)
81 *
82 * Returns non-zero if the specified address was normalized, else zero.
83 */
84static __inline__ int
85qla2x00_normalize_dma_addr(
86 dma_addr_t *e_addr, uint32_t *e_len,
87 dma_addr_t *ne_addr, uint32_t *ne_len)
88{
89 int normalized;
90
91 normalized = 0;
92 if ((*e_addr ^ (*e_addr + *e_len - 1)) & ~(0xFFFFFFFFULL)) {
93 /* Compute normalized crossed address and len */
94 *ne_addr = (0x100000000ULL + *e_addr) & ~(0xFFFFFFFFULL);
95 *ne_len = *e_len - (0x100000000ULL - (*e_addr & 0xFFFFFFFFULL));
96 *e_len -= *ne_len;
97
98 normalized++;
99 }
100 return (normalized);
101}
102
103static __inline__ void qla2x00_poll(scsi_qla_host_t *);
104static inline void 34static inline void
105qla2x00_poll(scsi_qla_host_t *ha) 35qla2x00_poll(scsi_qla_host_t *ha)
106{ 36{
107 ha->isp_ops->intr_handler(0, ha); 37 ha->isp_ops->intr_handler(0, ha);
108} 38}
109 39
110static __inline__ void qla2x00_check_fabric_devices(scsi_qla_host_t *);
111/*
112 * This routine will wait for fabric devices for
113 * the reset delay.
114 */
115static __inline__ void qla2x00_check_fabric_devices(scsi_qla_host_t *ha)
116{
117 uint16_t fw_state;
118
119 qla2x00_get_firmware_state(ha, &fw_state);
120}
121
122static __inline__ scsi_qla_host_t * to_qla_parent(scsi_qla_host_t *);
123static __inline__ scsi_qla_host_t * 40static __inline__ scsi_qla_host_t *
124to_qla_parent(scsi_qla_host_t *ha) 41to_qla_parent(scsi_qla_host_t *ha)
125{ 42{
@@ -152,7 +69,6 @@ qla2x00_issue_marker(scsi_qla_host_t *ha, int ha_locked)
152 return (QLA_SUCCESS); 69 return (QLA_SUCCESS);
153} 70}
154 71
155static inline uint8_t *host_to_fcp_swap(uint8_t *, uint32_t);
156static inline uint8_t * 72static inline uint8_t *
157host_to_fcp_swap(uint8_t *fcp, uint32_t bsize) 73host_to_fcp_swap(uint8_t *fcp, uint32_t bsize)
158{ 74{
@@ -166,7 +82,6 @@ host_to_fcp_swap(uint8_t *fcp, uint32_t bsize)
166 return fcp; 82 return fcp;
167} 83}
168 84
169static inline int qla2x00_is_reserved_id(scsi_qla_host_t *, uint16_t);
170static inline int 85static inline int
171qla2x00_is_reserved_id(scsi_qla_host_t *ha, uint16_t loop_id) 86qla2x00_is_reserved_id(scsi_qla_host_t *ha, uint16_t loop_id)
172{ 87{