1 /* Copyright (c) 2004 Coraid, Inc. See COPYING for GPL terms. */
4 #define DEVICE_NAME "aoe"
6 #define AOE_PARTITIONS 16
8 #define SYSMINOR(aoemajor, aoeminor) ((aoemajor) * 10 + (aoeminor))
9 #define AOEMAJOR(sysminor) ((sysminor) / 10)
10 #define AOEMINOR(sysminor) ((sysminor) % 10)
11 #define WHITESPACE " \t\v\f\n"
22 AOEAFL_ASYNC = (1<<1),
23 AOEAFL_WRITE = (1<<0),
37 unsigned char type[2];
40 unsigned char major[2];
48 unsigned char errfeat;
50 unsigned char cmdstat;
61 unsigned char bufcnt[2];
62 unsigned char fwver[2];
64 unsigned char aoeccmd;
65 unsigned char cslen[2];
69 DEVFL_UP = 1, /* device is installed in system and ready for AoE->ATA commands */
70 DEVFL_TKILL = (1<<1), /* flag for timer to know when to kill self */
71 DEVFL_EXT = (1<<2), /* device accepts lba48 commands */
72 DEVFL_CLOSEWAIT = (1<<3), /* device is waiting for all closes to revalidate */
73 DEVFL_WC_UPDATE = (1<<4), /* this device needs to update write cache status */
74 DEVFL_WORKON = (1<<4),
87 struct list_head bufs;
106 /* largest possible */
107 unsigned char data[sizeof(struct aoe_hdr) + sizeof(struct aoe_atahdr)];
112 unsigned char addr[6]; /* remote mac addr */
117 ulong nopen; /* (bd_openers isn't available without sleeping) */
118 ulong rttavg; /* round trip average of requests/responses */
119 u16 fw_ver; /* version of blade's firmware */
120 struct work_struct work;/* disk create work struct */
122 request_queue_t blkq;
123 struct hd_geometry geo;
125 struct timer_list timer;
127 struct net_device *ifp; /* interface ed is attached to */
128 struct sk_buff *skblist;/* packets needing to be sent */
129 mempool_t *bufpool; /* for deadlock-free Buf allocation */
130 struct list_head bufq; /* queue of bios to work on */
131 struct buf *inprocess; /* the one we're currently working on */
132 ulong lasttag; /* last tag sent */
133 ulong nframes; /* number of frames below */
134 struct frame *frames;
138 int aoeblk_init(void);
139 void aoeblk_exit(void);
140 void aoeblk_gdalloc(void *);
141 void aoedisk_rm_sysfs(struct aoedev *d);
143 int aoechr_init(void);
144 void aoechr_exit(void);
145 void aoechr_error(char *);
147 void aoecmd_work(struct aoedev *d);
148 void aoecmd_cfg(ushort, unsigned char);
149 void aoecmd_ata_rsp(struct sk_buff *);
150 void aoecmd_cfg_rsp(struct sk_buff *);
152 int aoedev_init(void);
153 void aoedev_exit(void);
154 struct aoedev *aoedev_bymac(unsigned char *);
155 void aoedev_downdev(struct aoedev *d);
156 struct aoedev *aoedev_set(ulong, unsigned char *, struct net_device *, ulong);
157 int aoedev_busy(void);
159 int aoenet_init(void);
160 void aoenet_exit(void);
161 void aoenet_xmit(struct sk_buff *);
162 int is_aoe_netif(struct net_device *ifp);
163 int set_aoe_iflist(const char __user *str, size_t size);
165 u64 mac_addr(char addr[6]);