#include <linux/gfp.h>
#ifndef SYM_HIPD_H
#define SYM_HIPD_H
#if 0
#define SYM_OPT_HANDLE_DEVICE_QUEUEING
#define SYM_OPT_LIMIT_COMMAND_REORDERING
#endif
#define DEBUG_ALLOC …
#define DEBUG_PHASE …
#define DEBUG_POLL …
#define DEBUG_QUEUE …
#define DEBUG_RESULT …
#define DEBUG_SCATTER …
#define DEBUG_SCRIPT …
#define DEBUG_TINY …
#define DEBUG_TIMING …
#define DEBUG_NEGO …
#define DEBUG_TAGS …
#define DEBUG_POINTER …
#ifndef DEBUG_FLAGS
#define DEBUG_FLAGS …
#endif
#ifndef sym_verbose
#define sym_verbose …
#endif
#ifndef assert
#define assert(expression) …
#endif
#if SYM_CONF_MAX_TAG_ORDER > 8
#error "more than 256 tags per logical unit not allowed."
#endif
#define SYM_CONF_MAX_TASK …
#ifndef SYM_CONF_MAX_TAG
#define SYM_CONF_MAX_TAG …
#endif
#if SYM_CONF_MAX_TAG > SYM_CONF_MAX_TASK
#undef SYM_CONF_MAX_TAG
#define SYM_CONF_MAX_TAG …
#endif
#define NO_TAG …
#if SYM_CONF_MAX_TARGET > 16
#error "more than 16 targets not allowed."
#endif
#if SYM_CONF_MAX_LUN > 64
#error "more than 64 logical units per target not allowed."
#endif
#define SYM_CONF_MIN_ASYNC …
#define SYM_MEM_WARN …
#define SYM_MEM_PAGE_ORDER …
#define SYM_MEM_CLUSTER_SHIFT …
#define SYM_MEM_FREE_UNUSED …
#define SYM_MEM_SHIFT …
#define SYM_MEM_CLUSTER_SIZE …
#define SYM_MEM_CLUSTER_MASK …
#ifdef SYM_CONF_MAX_START
#define SYM_CONF_MAX_QUEUE …
#else
#define SYM_CONF_MAX_QUEUE …
#define SYM_CONF_MAX_START …
#endif
#if SYM_CONF_MAX_QUEUE > SYM_MEM_CLUSTER_SIZE/8
#undef SYM_CONF_MAX_QUEUE
#define SYM_CONF_MAX_QUEUE …
#undef SYM_CONF_MAX_START
#define SYM_CONF_MAX_START …
#endif
#define MAX_QUEUE …
#define INB_OFF(np, o) …
#define INW_OFF(np, o) …
#define INL_OFF(np, o) …
#define OUTB_OFF(np, o, val) …
#define OUTW_OFF(np, o, val) …
#define OUTL_OFF(np, o, val) …
#define INB(np, r) …
#define INW(np, r) …
#define INL(np, r) …
#define OUTB(np, r, v) …
#define OUTW(np, r, v) …
#define OUTL(np, r, v) …
#define OUTONB(np, r, m) …
#define OUTOFFB(np, r, m) …
#define OUTONW(np, r, m) …
#define OUTOFFW(np, r, m) …
#define OUTONL(np, r, m) …
#define OUTOFFL(np, r, m) …
#define OUTL_DSP(np, v) …
#define OUTONB_STD() …
#define HS_IDLE …
#define HS_BUSY …
#define HS_NEGOTIATE …
#define HS_DISCONNECT …
#define HS_WAIT …
#define HS_DONEMASK …
#define HS_COMPLETE …
#define HS_SEL_TIMEOUT …
#define HS_UNEXPECTED …
#define HS_COMP_ERR …
#define SIR_BAD_SCSI_STATUS …
#define SIR_SEL_ATN_NO_MSG_OUT …
#define SIR_MSG_RECEIVED …
#define SIR_MSG_WEIRD …
#define SIR_NEGO_FAILED …
#define SIR_NEGO_PROTO …
#define SIR_SCRIPT_STOPPED …
#define SIR_REJECT_TO_SEND …
#define SIR_SWIDE_OVERRUN …
#define SIR_SODL_UNDERRUN …
#define SIR_RESEL_NO_MSG_IN …
#define SIR_RESEL_NO_IDENTIFY …
#define SIR_RESEL_BAD_LUN …
#define SIR_TARGET_SELECTED …
#define SIR_RESEL_BAD_I_T_L …
#define SIR_RESEL_BAD_I_T_L_Q …
#define SIR_ABORT_SENT …
#define SIR_RESEL_ABORTED …
#define SIR_MSG_OUT_DONE …
#define SIR_COMPLETE_ERROR …
#define SIR_DATA_OVERRUN …
#define SIR_BAD_PHASE …
#if SYM_CONF_DMA_ADDRESSING_MODE == 2
#define SIR_DMAP_DIRTY …
#define SIR_MAX …
#else
#define SIR_MAX …
#endif
#define XE_EXTRA_DATA …
#define XE_BAD_PHASE …
#define XE_PARITY_ERR …
#define XE_SODL_UNRUN …
#define XE_SWIDE_OVRUN …
#define NS_SYNC …
#define NS_WIDE …
#define NS_PPR …
#define CCB_HASH_SHIFT …
#define CCB_HASH_SIZE …
#define CCB_HASH_MASK …
#if 1
#define CCB_HASH_CODE(dsa) …
#else
#define CCB_HASH_CODE …
#endif
#if SYM_CONF_DMA_ADDRESSING_MODE == 2
#define SYM_DMAP_SHIFT …
#define SYM_DMAP_SIZE …
#define SYM_DMAP_MASK …
#endif
#define SYM_DISC_ENABLED …
#define SYM_TAGS_ENABLED …
#define SYM_SCAN_BOOT_DISABLED …
#define SYM_SCAN_LUNS_DISABLED …
#define SYM_AVOID_BUS_RESET …
#define SYM_SNOOP_TIMEOUT …
#define BUS_8_BIT …
#define BUS_16_BIT …
struct sym_trans { … };
struct sym_tcbh { … };
struct sym_tcb { … };
struct sym_lcbh { … };
struct sym_lcb { … };
struct sym_actscr { … };
struct sym_pmc { … };
#if SYM_CONF_MAX_LUN <= 1
#define sym_lp …
#else
#define sym_lp(tp, lun) …
#endif
#define HX_REG …
#define HX_PRT …
#define HS_REG …
#define HS_PRT …
#define SS_REG …
#define SS_PRT …
#define HF_REG …
#define HF_PRT …
#define host_xflags …
#define host_status …
#define ssss_status …
#define host_flags …
#define HF_IN_PM0 …
#define HF_IN_PM1 …
#define HF_ACT_PM …
#define HF_DP_SAVED …
#define HF_SENSE …
#define HF_EXT_ERR …
#define HF_DATA_IN …
#ifdef SYM_CONF_IARB_SUPPORT
#define HF_HINT_IARB …
#endif
#if SYM_CONF_DMA_ADDRESSING_MODE == 2
#define HX_DMAP_DIRTY …
#endif
struct sym_ccbh { … };
#if SYM_CONF_GENERIC_SUPPORT
#define sym_set_script_dp(np, cp, dp) …
#define sym_get_script_dp(np, cp) …
#else
#define sym_set_script_dp …
#define sym_get_script_dp …
#endif
struct sym_dsb { … };
struct sym_ccb { … };
#define CCB_BA(cp,lbl) …
m_pool_ident_t;
struct sym_hcb { … };
#if SYM_CONF_DMA_ADDRESSING_MODE == 0
#define use_dac …
#define set_dac …
#else
#define use_dac(np) …
#define set_dac(np) …
#endif
#define HCB_BA(np, lbl) …
struct sym_fw * sym_find_firmware(struct sym_chip *chip);
void sym_fw_bind_script(struct sym_hcb *np, u32 *start, int len);
char *sym_driver_name(void);
void sym_print_xerr(struct scsi_cmnd *cmd, int x_status);
int sym_reset_scsi_bus(struct sym_hcb *np, int enab_int);
struct sym_chip *sym_lookup_chip_table(u_short device_id, u_char revision);
#ifdef SYM_OPT_HANDLE_DEVICE_QUEUEING
void sym_start_next_ccbs(struct sym_hcb *np, struct sym_lcb *lp, int maxn);
#else
void sym_put_start_queue(struct sym_hcb *np, struct sym_ccb *cp);
#endif
void sym_start_up(struct Scsi_Host *, int reason);
irqreturn_t sym_interrupt(struct Scsi_Host *);
int sym_clear_tasks(struct sym_hcb *np, int cam_status, int target, int lun, int task);
struct sym_ccb *sym_get_ccb(struct sym_hcb *np, struct scsi_cmnd *cmd, u_char tag_order);
void sym_free_ccb(struct sym_hcb *np, struct sym_ccb *cp);
struct sym_lcb *sym_alloc_lcb(struct sym_hcb *np, u_char tn, u_char ln);
int sym_free_lcb(struct sym_hcb *np, u_char tn, u_char ln);
int sym_queue_scsiio(struct sym_hcb *np, struct scsi_cmnd *csio, struct sym_ccb *cp);
int sym_abort_scsiio(struct sym_hcb *np, struct scsi_cmnd *ccb, int timed_out);
int sym_reset_scsi_target(struct sym_hcb *np, int target);
void sym_hcb_free(struct sym_hcb *np);
int sym_hcb_attach(struct Scsi_Host *shost, struct sym_fw *fw, struct sym_nvram *nvram);
#if SYM_CONF_DMA_ADDRESSING_MODE == 0
#define DMA_DAC_MASK …
#define sym_build_sge …
#elif SYM_CONF_DMA_ADDRESSING_MODE == 1
#define DMA_DAC_MASK …
#define sym_build_sge(np, data, badd, len) …
#elif SYM_CONF_DMA_ADDRESSING_MODE == 2
#define DMA_DAC_MASK …
int sym_lookup_dmap(struct sym_hcb *np, u32 h, int s);
static inline void
sym_build_sge(struct sym_hcb *np, struct sym_tblmove *data, u64 badd, int len)
{
u32 h = (badd>>32);
int s = (h&SYM_DMAP_MASK);
if (h != np->dmap_bah[s])
goto bad;
good:
(data)->addr = cpu_to_scr(badd);
(data)->size = cpu_to_scr((s<<24) + len);
return;
bad:
s = sym_lookup_dmap(np, h, s);
goto good;
}
#else
#error "Unsupported DMA addressing mode"
#endif
#define sym_get_mem_cluster() …
#define sym_free_mem_cluster(p) …
m_link_p;
m_vtob_p;
#define VTOB_HASH_SHIFT …
#define VTOB_HASH_SIZE …
#define VTOB_HASH_MASK …
#define VTOB_HASH_CODE(m) …
m_pool_p;
void *__sym_calloc_dma(m_pool_ident_t dev_dmat, int size, char *name);
void __sym_mfree_dma(m_pool_ident_t dev_dmat, void *m, int size, char *name);
dma_addr_t __vtobus(m_pool_ident_t dev_dmat, void *m);
#define _uvptv_(p) …
#define _sym_calloc_dma(np, l, n) …
#define _sym_mfree_dma(np, p, l, n) …
#define sym_calloc_dma(l, n) …
#define sym_mfree_dma(p, l, n) …
#define vtobus(p) …
#define sym_m_pool_match(mp_id1, mp_id2) …
static inline void *sym_m_get_dma_mem_cluster(m_pool_p mp, m_vtob_p vbp)
{ … }
static inline void sym_m_free_dma_mem_cluster(m_pool_p mp, m_vtob_p vbp)
{ … }
#endif