1 /* Copyright (c) 2004 Coraid, Inc. See COPYING for GPL terms. */
4 #define DEVICE_NAME "aoe"
6 /* set AOE_PARTITIONS to 1 to use whole-disks only
7 * default is 16, which is 15 partitions plus the whole disk
10 #define AOE_PARTITIONS 16
13 #define SYSMINOR(aoemajor, aoeminor) ((aoemajor) * 10 + (aoeminor))
14 #define AOEMAJOR(sysminor) ((sysminor) / 10)
15 #define AOEMINOR(sysminor) ((sysminor) % 10)
16 #define WHITESPACE " \t\v\f\n"
27 AOEAFL_ASYNC
= (1<<1),
28 AOEAFL_WRITE
= (1<<0),
53 unsigned char errfeat
;
55 unsigned char cmdstat
;
69 unsigned char aoeccmd
;
70 unsigned char cslen
[2];
74 DEVFL_UP
= 1, /* device is installed in system and ready for AoE->ATA commands */
75 DEVFL_TKILL
= (1<<1), /* flag for timer to know when to kill self */
76 DEVFL_EXT
= (1<<2), /* device accepts lba48 commands */
77 DEVFL_CLOSEWAIT
= (1<<3), /* device is waiting for all closes to revalidate */
78 DEVFL_WC_UPDATE
= (1<<4), /* this device needs to update write cache status */
79 DEVFL_WORKON
= (1<<4),
92 struct list_head bufs
;
111 /* largest possible */
112 unsigned char data
[sizeof(struct aoe_hdr
) + sizeof(struct aoe_atahdr
)];
117 unsigned char addr
[6]; /* remote mac addr */
122 ulong nopen
; /* (bd_openers isn't available without sleeping) */
123 ulong rttavg
; /* round trip average of requests/responses */
124 u16 fw_ver
; /* version of blade's firmware */
125 struct work_struct work
;/* disk create work struct */
127 request_queue_t blkq
;
128 struct hd_geometry geo
;
130 struct timer_list timer
;
132 struct net_device
*ifp
; /* interface ed is attached to */
133 struct sk_buff
*skblist
;/* packets needing to be sent */
134 mempool_t
*bufpool
; /* for deadlock-free Buf allocation */
135 struct list_head bufq
; /* queue of bios to work on */
136 struct buf
*inprocess
; /* the one we're currently working on */
137 ulong lasttag
; /* last tag sent */
138 ulong nframes
; /* number of frames below */
139 struct frame
*frames
;
143 int aoeblk_init(void);
144 void aoeblk_exit(void);
145 void aoeblk_gdalloc(void *);
146 void aoedisk_rm_sysfs(struct aoedev
*d
);
148 int aoechr_init(void);
149 void aoechr_exit(void);
150 void aoechr_error(char *);
152 void aoecmd_work(struct aoedev
*d
);
153 void aoecmd_cfg(ushort
, unsigned char);
154 void aoecmd_ata_rsp(struct sk_buff
*);
155 void aoecmd_cfg_rsp(struct sk_buff
*);
157 int aoedev_init(void);
158 void aoedev_exit(void);
159 struct aoedev
*aoedev_by_aoeaddr(int maj
, int min
);
160 void aoedev_downdev(struct aoedev
*d
);
161 struct aoedev
*aoedev_set(ulong
, unsigned char *, struct net_device
*, ulong
);
162 int aoedev_busy(void);
164 int aoenet_init(void);
165 void aoenet_exit(void);
166 void aoenet_xmit(struct sk_buff
*);
167 int is_aoe_netif(struct net_device
*ifp
);
168 int set_aoe_iflist(const char __user
*str
, size_t size
);
170 u64
mac_addr(char addr
[6]);