Print this page
8368 remove warlock leftovers from usr/src/uts
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/io/aac/aac.h
+++ new/usr/src/uts/common/io/aac/aac.h
1 1 /*
2 2 * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
3 3 */
4 4
5 5 /*
6 6 * Copyright 2005-06 Adaptec, Inc.
7 7 * Copyright (c) 2005-06 Adaptec Inc., Achim Leubner
8 8 * Copyright (c) 2000 Michael Smith
9 9 * Copyright (c) 2001 Scott Long
10 10 * Copyright (c) 2000 BSDi
11 11 * All rights reserved.
12 12 *
13 13 * Redistribution and use in source and binary forms, with or without
14 14 * modification, are permitted provided that the following conditions
15 15 * are met:
16 16 * 1. Redistributions of source code must retain the above copyright
17 17 * notice, this list of conditions and the following disclaimer.
18 18 * 2. Redistributions in binary form must reproduce the above copyright
19 19 * notice, this list of conditions and the following disclaimer in the
20 20 * documentation and/or other materials provided with the distribution.
21 21 *
22 22 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
23 23 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 25 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
26 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 32 * SUCH DAMAGE.
33 33 *
34 34 * $FreeBSD: src/sys/dev/aac/aacvar.h,v 1.47 2005/10/08 15:55:09 scottl Exp $
35 35 */
36 36
37 37 #ifndef _AAC_H_
38 38 #define _AAC_H_
39 39
40 40 #ifdef __cplusplus
41 41 extern "C" {
42 42 #endif
43 43
44 44 #define AAC_ROUNDUP(x, y) (((x) + (y) - 1) / (y) * (y))
45 45
46 46 #define AAC_TYPE_DEVO 1
47 47 #define AAC_TYPE_ALPHA 2
48 48 #define AAC_TYPE_BETA 3
49 49 #define AAC_TYPE_RELEASE 4
50 50
51 51 #ifndef AAC_DRIVER_BUILD
52 52 #define AAC_DRIVER_BUILD 1
53 53 #endif
54 54
55 55 #define AAC_DRIVER_MAJOR_VERSION 2
56 56 #define AAC_DRIVER_MINOR_VERSION 2
57 57 #define AAC_DRIVER_BUGFIX_LEVEL 11
58 58 #define AAC_DRIVER_TYPE AAC_TYPE_RELEASE
59 59
60 60 #define STR(s) # s
61 61 #define AAC_VERSION(a, b, c) STR(a.b.c)
62 62 #define AAC_DRIVER_VERSION AAC_VERSION(AAC_DRIVER_MAJOR_VERSION, \
63 63 AAC_DRIVER_MINOR_VERSION, \
64 64 AAC_DRIVER_BUGFIX_LEVEL)
65 65
66 66 #define AACOK 0
67 67 #define AACERR -1
68 68
69 69 #define AAC_MAX_ADAPTERS 64
70 70
71 71 /* Definitions for mode sense */
72 72 #ifndef SD_MODE_SENSE_PAGE3_CODE
73 73 #define SD_MODE_SENSE_PAGE3_CODE 0x03
74 74 #endif
75 75
76 76 #ifndef SD_MODE_SENSE_PAGE4_CODE
77 77 #define SD_MODE_SENSE_PAGE4_CODE 0x04
78 78 #endif
79 79
80 80 #ifndef SCMD_SYNCHRONIZE_CACHE
81 81 #define SCMD_SYNCHRONIZE_CACHE 0x35
82 82 #endif
83 83
84 84 /*
85 85 * The controller reports status events in AIFs. We hang on to a number of
86 86 * these in order to pass them out to user-space management tools.
87 87 */
88 88 #define AAC_AIFQ_LENGTH 64
89 89
90 90 #ifdef __x86
91 91 #define AAC_IMMEDIATE_TIMEOUT 30 /* seconds */
92 92 #else
93 93 #define AAC_IMMEDIATE_TIMEOUT 60 /* seconds */
94 94 #endif
95 95 #define AAC_FWUP_TIMEOUT 180 /* wait up to 3 minutes */
96 96 #define AAC_IOCTL_TIMEOUT 900 /* wait up to 15 minutes */
97 97 #define AAC_SYNC_TIMEOUT 900 /* wait up to 15 minutes */
98 98
99 99 /* Adapter hardware interface types */
100 100 #define AAC_HWIF_UNKNOWN 0
101 101 #define AAC_HWIF_I960RX 1
102 102 #define AAC_HWIF_RKT 2
103 103
104 104 #define AAC_TYPE_UNKNOWN 0
105 105 #define AAC_TYPE_SCSI 1
106 106 #define AAC_TYPE_SATA 2
107 107 #define AAC_TYPE_SAS 3
108 108
109 109 #define AAC_LS32(d) ((uint32_t)((d) & 0xffffffffull))
110 110 #define AAC_MS32(d) ((uint32_t)((d) >> 32))
111 111 #define AAC_LO32(p64) ((uint32_t *)(p64))
112 112 #define AAC_HI32(p64) ((uint32_t *)(p64) + 1)
113 113
114 114 /*
115 115 * Internal events that will be handled serially by aac_event_thread()
116 116 */
117 117 #define AAC_EVENT_AIF (1 << 0)
118 118 #define AAC_EVENT_TIMEOUT (1 << 1)
119 119 #define AAC_EVENT_SYNCTICK (1 << 2)
120 120
121 121 /*
122 122 * AAC_CMDQ_SYNC should be 0 and AAC_CMDQ_ASYNC be 1 for Sync FIB io
123 123 * to be served before async FIB io, see aac_start_waiting_io().
124 124 * So that io requests sent by interactive userland commands get
125 125 * responded asap.
126 126 */
127 127 enum aac_cmdq {
128 128 AAC_CMDQ_SYNC, /* sync FIB queue */
129 129 AAC_CMDQ_ASYNC, /* async FIB queue */
130 130 AAC_CMDQ_NUM
131 131 };
132 132
133 133 /*
134 134 * IO command flags
135 135 */
136 136 #define AAC_IOCMD_SYNC (1 << AAC_CMDQ_SYNC)
137 137 #define AAC_IOCMD_ASYNC (1 << AAC_CMDQ_ASYNC)
138 138 #define AAC_IOCMD_OUTSTANDING (1 << AAC_CMDQ_NUM)
139 139 #define AAC_IOCMD_ALL (AAC_IOCMD_SYNC | AAC_IOCMD_ASYNC | \
140 140 AAC_IOCMD_OUTSTANDING)
141 141
142 142 struct aac_cmd_queue {
143 143 struct aac_cmd *q_head; /* also as the header of aac_cmd */
144 144 struct aac_cmd *q_tail;
145 145 };
146 146
147 147 struct aac_card_type {
148 148 uint16_t vendor; /* PCI Vendor ID */
149 149 uint16_t device; /* PCI Device ID */
150 150 uint16_t subvendor; /* PCI Subsystem Vendor ID */
151 151 uint16_t subsys; /* PCI Subsystem ID */
152 152 uint16_t hwif; /* card chip type: i960 or Rocket */
153 153 uint16_t quirks; /* card odd limits */
154 154 uint16_t type; /* hard drive type */
155 155 char *vid; /* ASCII data for INQUIRY command vendor id */
156 156 char *desc; /* ASCII data for INQUIRY command product id */
157 157 };
158 158
159 159 /* Device types */
160 160 #define AAC_DEV_LD 0 /* logical device */
161 161 #define AAC_DEV_PD 1 /* physical device */
162 162
163 163 /* Device flags */
164 164 #define AAC_DFLAG_VALID (1 << 0)
165 165 #define AAC_DFLAG_CONFIGURING (1 << 1)
166 166
167 167 #define AAC_DEV_IS_VALID(dvp) ((dvp)->flags & AAC_DFLAG_VALID)
168 168 #define AAC_P2VTGT(softs, bus, tgt) \
169 169 ((softs)->tgt_max * (bus) + (tgt) + AAC_MAX_LD)
170 170
171 171 /*
172 172 * Device config change events
173 173 */
174 174 enum aac_cfg_event {
175 175 AAC_CFG_NULL_NOEXIST = 0, /* No change with no device */
176 176 AAC_CFG_NULL_EXIST, /* No change but have device */
177 177 AAC_CFG_ADD, /* Device added */
178 178 AAC_CFG_DELETE, /* Device deleted */
179 179 AAC_CFG_CHANGE /* Device changed */
180 180 };
181 181
182 182 struct aac_device {
183 183 int flags;
184 184
185 185 uint8_t type;
186 186 dev_info_t *dip;
187 187 int ncmds[AAC_CMDQ_NUM]; /* outstanding cmds of the device */
188 188 int throttle[AAC_CMDQ_NUM]; /* hold IO cmds for the device */
189 189 };
190 190
191 191 /* Array description */
192 192 struct aac_container {
193 193 struct aac_device dev;
194 194
195 195 uint32_t cid; /* container id */
196 196 uint32_t uid; /* container uid */
197 197 uint64_t size; /* in block */
198 198 uint8_t locked;
199 199 uint8_t deleted;
200 200 uint8_t reset; /* container is being reseted */
201 201 };
202 202
203 203 /* Non-DASD phys. device descrption, eg. CDROM or tape */
204 204 struct aac_nondasd {
205 205 struct aac_device dev;
206 206
207 207 uint32_t bus;
208 208 uint32_t tid;
209 209 };
210 210
211 211 /*
212 212 * The firmware can support a lot of outstanding commands. Each aac_slot
213 213 * is corresponding to one of such commands. It records the command and
214 214 * associated DMA resource for FIB command.
215 215 */
216 216 struct aac_slot {
217 217 struct aac_slot *next; /* next slot in the free slot list */
218 218 int index; /* index of this slot */
219 219 ddi_acc_handle_t fib_acc_handle;
220 220 ddi_dma_handle_t fib_dma_handle;
221 221 uint64_t fib_phyaddr; /* physical address of FIB memory */
222 222 struct aac_cmd *acp; /* command using this slot */
223 223 struct aac_fib *fibp; /* virtual address of FIB memory */
224 224 };
225 225
226 226 /*
227 227 * Scatter-gather list structure defined by HBA hardware
228 228 */
229 229 struct aac_sge {
230 230 uint32_t bcount; /* byte count */
231 231 union {
232 232 uint32_t ad32; /* 32 bit address */
233 233 struct {
234 234 uint32_t lo;
235 235 uint32_t hi;
236 236 } ad64; /* 64 bit address */
237 237 } addr;
238 238 };
239 239
240 240 /* aac_cmd flags */
241 241 #define AAC_CMD_CONSISTENT (1 << 0)
242 242 #define AAC_CMD_DMA_PARTIAL (1 << 1)
243 243 #define AAC_CMD_DMA_VALID (1 << 2)
244 244 #define AAC_CMD_BUF_READ (1 << 3)
245 245 #define AAC_CMD_BUF_WRITE (1 << 4)
246 246 #define AAC_CMD_SYNC (1 << 5) /* use sync FIB */
247 247 #define AAC_CMD_NO_INTR (1 << 6) /* poll IO, no intr */
248 248 #define AAC_CMD_NO_CB (1 << 7) /* sync IO, no callback */
249 249 #define AAC_CMD_NTAG (1 << 8)
250 250 #define AAC_CMD_CMPLT (1 << 9) /* cmd exec'ed by driver/fw */
251 251 #define AAC_CMD_ABORT (1 << 10)
252 252 #define AAC_CMD_TIMEOUT (1 << 11)
253 253 #define AAC_CMD_ERR (1 << 12)
254 254 #define AAC_CMD_IN_SYNC_SLOT (1 << 13)
255 255
256 256 struct aac_softstate;
257 257 typedef void (*aac_cmd_fib_t)(struct aac_softstate *, struct aac_cmd *);
258 258
259 259 struct aac_cmd {
260 260 /*
261 261 * Note: should be the first member for aac_cmd_queue to work
262 262 * correctly.
263 263 */
264 264 struct aac_cmd *next;
265 265 struct aac_cmd *prev;
266 266
267 267 struct scsi_pkt *pkt;
268 268 int cmdlen;
269 269 int flags;
270 270 uint32_t timeout; /* time when the cmd should have completed */
271 271 struct buf *bp;
272 272 ddi_dma_handle_t buf_dma_handle;
273 273
274 274 /* For non-aligned buffer and SRB */
275 275 caddr_t abp;
276 276 ddi_acc_handle_t abh;
277 277
278 278 /* Data transfer state */
279 279 ddi_dma_cookie_t cookie;
280 280 uint_t left_cookien;
281 281 uint_t cur_win;
282 282 uint_t total_nwin;
283 283 size_t total_xfer;
284 284 uint64_t blkno;
285 285 uint32_t bcount; /* buffer size in byte */
286 286 struct aac_sge *sgt; /* sg table */
287 287
288 288 /* FIB construct function */
289 289 aac_cmd_fib_t aac_cmd_fib;
290 290 /* Call back function for completed command */
291 291 void (*ac_comp)(struct aac_softstate *, struct aac_cmd *);
292 292
293 293 struct aac_slot *slotp; /* slot used by this command */
294 294 struct aac_device *dvp; /* target device */
295 295
296 296 /* FIB for this IO command */
297 297 int fib_size; /* size of the FIB xferred to/from the card */
298 298 struct aac_fib *fibp;
299 299
300 300 #ifdef DEBUG
301 301 uint32_t fib_flags;
302 302 #endif
303 303 };
304 304
305 305 /* Flags for attach tracking */
306 306 #define AAC_ATTACH_SOFTSTATE_ALLOCED (1 << 0)
307 307 #define AAC_ATTACH_CARD_DETECTED (1 << 1)
308 308 #define AAC_ATTACH_PCI_MEM_MAPPED (1 << 2)
309 309 #define AAC_ATTACH_KMUTEX_INITED (1 << 3)
310 310 #define AAC_ATTACH_SCSI_TRAN_SETUP (1 << 4)
311 311 #define AAC_ATTACH_COMM_SPACE_SETUP (1 << 5)
312 312 #define AAC_ATTACH_CREATE_DEVCTL (1 << 6)
313 313 #define AAC_ATTACH_CREATE_SCSI (1 << 7)
314 314
315 315 /* Driver running states */
316 316 #define AAC_STATE_STOPPED 0
317 317 #define AAC_STATE_RUN (1 << 0)
318 318 #define AAC_STATE_RESET (1 << 1)
319 319 #define AAC_STATE_QUIESCED (1 << 2)
320 320 #define AAC_STATE_DEAD (1 << 3)
321 321 #define AAC_STATE_INTR (1 << 4)
322 322
323 323 /*
324 324 * Flags for aac firmware
325 325 * Note: Quirks are only valid for the older cards. These cards only supported
326 326 * old comm. Thus they are not valid for any cards that support new comm.
327 327 */
328 328 #define AAC_FLAGS_SG_64BIT (1 << 0) /* Use 64-bit S/G addresses */
329 329 #define AAC_FLAGS_4GB_WINDOW (1 << 1) /* Can access host mem 2-4GB range */
330 330 #define AAC_FLAGS_NO4GB (1 << 2) /* quirk: FIB addresses must reside */
331 331 /* between 0x2000 & 0x7FFFFFFF */
332 332 #define AAC_FLAGS_256FIBS (1 << 3) /* quirk: Can only do 256 commands */
333 333 #define AAC_FLAGS_NEW_COMM (1 << 4) /* New comm. interface supported */
334 334 #define AAC_FLAGS_RAW_IO (1 << 5) /* Raw I/O interface */
335 335 #define AAC_FLAGS_ARRAY_64BIT (1 << 6) /* 64-bit array size */
336 336 #define AAC_FLAGS_LBA_64BIT (1 << 7) /* 64-bit LBA supported */
337 337 #define AAC_FLAGS_17SG (1 << 8) /* quirk: 17 scatter gather maximum */
338 338 #define AAC_FLAGS_34SG (1 << 9) /* quirk: 34 scatter gather maximum */
339 339 #define AAC_FLAGS_NONDASD (1 << 10) /* non-DASD device supported */
340 340 #define AAC_FLAGS_BRKUP (1 << 11) /* pkt breakup support */
341 341 #define AAC_FLAGS_JBOD (1 << 12) /* JBOD mode support */
342 342
343 343 struct aac_softstate;
344 344 struct aac_interface {
345 345 int (*aif_get_fwstatus)(struct aac_softstate *);
346 346 int (*aif_get_mailbox)(struct aac_softstate *, int);
347 347 void (*aif_set_mailbox)(struct aac_softstate *, uint32_t,
348 348 uint32_t, uint32_t, uint32_t, uint32_t);
349 349 };
350 350
351 351 #define AAC_CTXFLAG_FILLED 0x01 /* aifq's full for this ctx */
352 352 #define AAC_CTXFLAG_RESETED 0x02
353 353
354 354 struct aac_fib_context {
355 355 uint32_t unique;
356 356 int ctx_idx;
357 357 int ctx_filled; /* aifq is full for this fib context */
358 358 int ctx_flags;
359 359 int ctx_overrun;
360 360 struct aac_fib_context *next, *prev;
361 361 };
362 362
363 363 #define AAC_VENDOR_LEN 8
364 364 #define AAC_PRODUCT_LEN 16
365 365
366 366 struct aac_softstate {
367 367 int card; /* index to aac_cards */
368 368 uint16_t hwif; /* card chip type: i960 or Rocket */
369 369 uint16_t vendid; /* vendor id */
370 370 uint16_t subvendid; /* sub vendor id */
371 371 uint16_t devid; /* device id */
372 372 uint16_t subsysid; /* sub system id */
373 373 char vendor_name[AAC_VENDOR_LEN + 1];
374 374 char product_name[AAC_PRODUCT_LEN + 1];
375 375 uint32_t support_opt; /* firmware features */
376 376 uint32_t support_opt2;
377 377 uint32_t feature_bits;
378 378 uint32_t atu_size; /* actual size of PCI mem space */
379 379 uint32_t map_size; /* mapped PCI mem space size */
380 380 uint32_t map_size_min; /* minimum size of PCI mem that must be */
381 381 /* mapped to address the card */
382 382 int flags; /* firmware features enabled */
383 383 int instance;
384 384 dev_info_t *devinfo_p;
385 385 scsi_hba_tran_t *hba_tran;
386 386 int slen;
387 387 int legacy; /* legacy device naming */
388 388 uint32_t dma_max; /* for buf breakup */
389 389
390 390 /* DMA attributes */
391 391 ddi_dma_attr_t buf_dma_attr;
392 392 ddi_dma_attr_t addr_dma_attr;
393 393
394 394 /* PCI spaces */
395 395 ddi_device_acc_attr_t acc_attr;
396 396 ddi_device_acc_attr_t reg_attr;
397 397 ddi_acc_handle_t pci_mem_handle;
398 398 uint8_t *pci_mem_base_vaddr;
399 399 uint32_t pci_mem_base_paddr;
400 400
401 401 struct aac_interface aac_if; /* adapter hardware interface */
402 402
403 403 struct aac_cmd sync_ac; /* sync FIB */
404 404
405 405 /* Communication space */
406 406 struct aac_comm_space *comm_space;
407 407 ddi_acc_handle_t comm_space_acc_handle;
408 408 ddi_dma_handle_t comm_space_dma_handle;
409 409 uint32_t comm_space_phyaddr;
410 410
411 411 /* Old Comm. interface: message queues */
412 412 struct aac_queue_table *qtablep;
413 413 struct aac_queue_entry *qentries[AAC_QUEUE_COUNT];
414 414
415 415 /* New Comm. interface */
416 416 uint32_t aac_max_fibs; /* max. FIB count */
417 417 uint32_t aac_max_fib_size; /* max. FIB size */
418 418 uint32_t aac_sg_tablesize; /* max. sg count from host */
419 419 uint32_t aac_max_sectors; /* max. I/O size from host (blocks) */
420 420
421 421 aac_cmd_fib_t aac_cmd_fib; /* IO cmd FIB construct function */
422 422 aac_cmd_fib_t aac_cmd_fib_scsi; /* SRB construct function */
423 423
424 424 ddi_softintr_t softint_id; /* soft intr */
425 425
426 426 kmutex_t io_lock;
427 427 int state; /* driver state */
428 428
429 429 struct aac_container containers[AAC_MAX_LD];
430 430 int container_count; /* max container id + 1 */
431 431 struct aac_nondasd *nondasds;
432 432 uint32_t bus_max; /* max FW buses exposed */
433 433 uint32_t tgt_max; /* max FW target per bus */
434 434
435 435 /*
436 436 * Command queues
437 437 * Each aac command flows through wait(or wait_sync) queue,
438 438 * busy queue, and complete queue sequentially.
439 439 */
440 440 struct aac_cmd_queue q_wait[AAC_CMDQ_NUM];
441 441 struct aac_cmd_queue q_busy; /* outstanding cmd queue */
442 442 kmutex_t q_comp_mutex;
443 443 struct aac_cmd_queue q_comp; /* completed io requests */
444 444
445 445 /* I/O slots and FIBs */
446 446 int total_slots; /* total slots allocated */
447 447 int total_fibs; /* total FIBs allocated */
448 448 struct aac_slot *io_slot; /* static list for allocated slots */
449 449 struct aac_slot *free_io_slot_head;
450 450
451 451 kcondvar_t event; /* for ioctl_send_fib() and sync IO */
452 452 kcondvar_t sync_fib_cv; /* for sync_fib_slot_bind/release */
453 453
454 454 int bus_ncmds[AAC_CMDQ_NUM]; /* total outstanding async cmds */
455 455 int bus_throttle[AAC_CMDQ_NUM]; /* hold IO cmds for the bus */
456 456 int ndrains; /* number of draining threads */
457 457 timeout_id_t drain_timeid; /* for outstanding cmd drain */
458 458 kcondvar_t drain_cv; /* for quiesce drain */
459 459
460 460 /* Internal timer */
461 461 kmutex_t time_mutex;
462 462 timeout_id_t timeout_id; /* for timeout daemon */
463 463 uint32_t timebase; /* internal timer in seconds */
464 464 uint32_t time_sync; /* next time to sync with firmware */
465 465 uint32_t time_out; /* next time to check timeout */
466 466 uint32_t time_throttle; /* next time to restore throttle */
467 467
468 468 /* Internal events handling */
469 469 kmutex_t ev_lock;
470 470 int events;
471 471 kthread_t *event_thread; /* for AIF & timeout */
472 472 kcondvar_t event_wait_cv;
473 473 kcondvar_t event_disp_cv;
474 474
475 475 /* AIF */
476 476 kmutex_t aifq_mutex; /* for AIF queue aifq */
477 477 kcondvar_t aifq_cv;
478 478 union aac_fib_align aifq[AAC_AIFQ_LENGTH];
479 479 int aifq_idx; /* slot for next new AIF */
480 480 int aifq_wrap; /* AIF queue has ever been wrapped */
481 481 struct aac_fib_context aifctx; /* sys aif ctx */
482 482 struct aac_fib_context *fibctx_p;
483 483 int devcfg_wait_on; /* AIF event waited for rescan */
484 484
485 485 int fm_capabilities;
486 486
487 487 /* MSI specific fields */
488 488 ddi_intr_handle_t *htable; /* For array of interrupts */
489 489 int intr_type; /* What type of interrupt */
490 490 int intr_cnt; /* # of intrs count returned */
491 491 int intr_size;
492 492 uint_t intr_pri; /* Interrupt priority */
493 493 int intr_cap; /* Interrupt capabilities */
494 494
495 495 #ifdef DEBUG
↓ open down ↓ |
495 lines elided |
↑ open up ↑ |
496 496 /* UART trace printf variables */
497 497 uint32_t debug_flags; /* debug print flags bitmap */
498 498 uint32_t debug_fib_flags; /* debug FIB print flags bitmap */
499 499 uint32_t debug_fw_flags; /* FW debug flags */
500 500 uint32_t debug_buf_offset; /* offset from DPMEM start */
501 501 uint32_t debug_buf_size; /* FW debug buffer size in bytes */
502 502 uint32_t debug_header_size; /* size of debug header */
503 503 #endif
504 504 };
505 505
506 -/*
507 - * The following data are kept stable because they are only written at driver
508 - * initialization, and we do not allow them changed otherwise even at driver
509 - * re-initialization.
510 - */
511 -_NOTE(SCHEME_PROTECTS_DATA("stable data", aac_softstate::{flags slen \
512 - buf_dma_attr pci_mem_handle pci_mem_base_vaddr \
513 - comm_space_acc_handle comm_space_dma_handle aac_max_fib_size \
514 - aac_sg_tablesize aac_cmd_fib aac_cmd_fib_scsi debug_flags bus_max tgt_max}))
515 -
516 506 #ifdef DEBUG
517 507
518 508 #define AACDB_FLAGS_MASK 0x0000ffff
519 509 #define AACDB_FLAGS_KERNEL_PRINT 0x00000001
520 510 #define AACDB_FLAGS_FW_PRINT 0x00000002
521 511 #define AACDB_FLAGS_NO_HEADERS 0x00000004
522 512
523 513 #define AACDB_FLAGS_MISC 0x00000010
524 514 #define AACDB_FLAGS_FUNC1 0x00000020
525 515 #define AACDB_FLAGS_FUNC2 0x00000040
526 516 #define AACDB_FLAGS_SCMD 0x00000080
527 517 #define AACDB_FLAGS_AIF 0x00000100
528 518 #define AACDB_FLAGS_FIB 0x00000200
529 519 #define AACDB_FLAGS_IOCTL 0x00000400
530 520
531 521 /*
532 522 * Flags for FIB print
533 523 */
534 524 /* FIB sources */
535 525 #define AACDB_FLAGS_FIB_SCMD 0x00000001
536 526 #define AACDB_FLAGS_FIB_IOCTL 0x00000002
537 527 #define AACDB_FLAGS_FIB_SRB 0x00000004
538 528 #define AACDB_FLAGS_FIB_SYNC 0x00000008
539 529 /* FIB components */
540 530 #define AACDB_FLAGS_FIB_HEADER 0x00000010
541 531 /* FIB states */
542 532 #define AACDB_FLAGS_FIB_TIMEOUT 0x00000100
543 533
544 534 extern uint32_t aac_debug_flags;
545 535 extern int aac_dbflag_on(struct aac_softstate *, int);
546 536 extern void aac_printf(struct aac_softstate *, uint_t, const char *, ...);
547 537 extern void aac_print_fib(struct aac_softstate *, struct aac_slot *);
548 538
549 539 #define AACDB_PRINT(s, lev, ...) { \
550 540 if (aac_dbflag_on((s), AACDB_FLAGS_MISC)) \
551 541 aac_printf((s), (lev), __VA_ARGS__); }
552 542
553 543 #define AACDB_PRINT_IOCTL(s, ...) { \
554 544 if (aac_dbflag_on((s), AACDB_FLAGS_IOCTL)) \
555 545 aac_printf((s), CE_NOTE, __VA_ARGS__); }
556 546
557 547 #define AACDB_PRINT_TRAN(s, ...) { \
558 548 if (aac_dbflag_on((s), AACDB_FLAGS_SCMD)) \
559 549 aac_printf((s), CE_NOTE, __VA_ARGS__); }
560 550
561 551 #define DBCALLED(s, n) { \
562 552 if (aac_dbflag_on((s), AACDB_FLAGS_FUNC ## n)) \
563 553 aac_printf((s), CE_NOTE, "--- %s() called ---", __func__); }
564 554
565 555 #define AACDB_PRINT_SCMD(s, x) { \
566 556 if (aac_dbflag_on((s), AACDB_FLAGS_SCMD)) aac_print_scmd((s), (x)); }
567 557
568 558 #define AACDB_PRINT_AIF(s, x) { \
569 559 if (aac_dbflag_on((s), AACDB_FLAGS_AIF)) aac_print_aif((s), (x)); }
570 560
571 561 #define AACDB_PRINT_FIB(s, x) { \
572 562 if (aac_dbflag_on((s), AACDB_FLAGS_FIB)) aac_print_fib((s), (x)); }
573 563
574 564 #else /* DEBUG */
575 565
576 566 #define AACDB_PRINT(s, lev, ...)
577 567 #define AACDB_PRINT_IOCTL(s, ...)
578 568 #define AACDB_PRINT_TRAN(s, ...)
579 569 #define AACDB_PRINT_FIB(s, x)
580 570 #define AACDB_PRINT_SCMD(s, x)
581 571 #define AACDB_PRINT_AIF(s, x)
582 572 #define DBCALLED(s, n)
583 573
584 574 #endif /* DEBUG */
585 575
586 576 #ifdef __cplusplus
587 577 }
588 578 #endif
589 579
590 580 #endif /* _AAC_H_ */
↓ open down ↓ |
65 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX