1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28#ifndef _AIC94XX_H_
29#define _AIC94XX_H_
30
31#include <linux/slab.h>
32#include <linux/ctype.h>
33#include <scsi/libsas.h>
34
35#define ASD_DRIVER_NAME "aic94xx"
36#define ASD_DRIVER_DESCRIPTION "Adaptec aic94xx SAS/SATA driver"
37
38#define asd_printk(fmt, ...) printk(KERN_NOTICE ASD_DRIVER_NAME ": " fmt, ## __VA_ARGS__)
39
40#ifdef ASD_ENTER_EXIT
41#define ENTER printk(KERN_NOTICE "%s: ENTER %s\n", ASD_DRIVER_NAME, \
42 __func__)
43#define EXIT printk(KERN_NOTICE "%s: --EXIT %s\n", ASD_DRIVER_NAME, \
44 __func__)
45#else
46#define ENTER
47#define EXIT
48#endif
49
50#ifdef ASD_DEBUG
51#define ASD_DPRINTK asd_printk
52#else
53#define ASD_DPRINTK(fmt, ...)
54#endif
55
56
57#define AIC94XX_SCB_TIMEOUT (5*HZ)
58
59extern struct kmem_cache *asd_dma_token_cache;
60extern struct kmem_cache *asd_ascb_cache;
61
62static inline void asd_stringify_sas_addr(char *p, const u8 *sas_addr)
63{
64 int i;
65 for (i = 0; i < SAS_ADDR_SIZE; i++, p += 2)
66 snprintf(p, 3, "%02X", sas_addr[i]);
67 *p = '\0';
68}
69
70struct asd_ha_struct;
71struct asd_ascb;
72
73int asd_read_ocm(struct asd_ha_struct *asd_ha);
74int asd_read_flash(struct asd_ha_struct *asd_ha);
75
76int asd_dev_found(struct domain_device *dev);
77void asd_dev_gone(struct domain_device *dev);
78
79void asd_invalidate_edb(struct asd_ascb *ascb, int edb_id);
80
81int asd_execute_task(struct sas_task *task, gfp_t gfp_flags);
82
83void asd_set_dmamode(struct domain_device *dev);
84
85
86int asd_abort_task(struct sas_task *);
87int asd_abort_task_set(struct domain_device *, u8 *lun);
88int asd_clear_aca(struct domain_device *, u8 *lun);
89int asd_clear_task_set(struct domain_device *, u8 *lun);
90int asd_lu_reset(struct domain_device *, u8 *lun);
91int asd_I_T_nexus_reset(struct domain_device *dev);
92int asd_query_task(struct sas_task *);
93
94
95int asd_clear_nexus_port(struct asd_sas_port *port);
96int asd_clear_nexus_ha(struct sas_ha_struct *sas_ha);
97
98
99int asd_control_phy(struct asd_sas_phy *phy, enum phy_func func, void *arg);
100
101#endif
102