isp_freebsd.h (237537) | isp_freebsd.h (238869) |
---|---|
1/* $FreeBSD: head/sys/dev/isp/isp_freebsd.h 237537 2012-06-24 17:30:54Z mjacob $ */ | 1/* $FreeBSD: head/sys/dev/isp/isp_freebsd.h 238869 2012-07-28 20:06:29Z mjacob $ */ |
2/*- 3 * Qlogic ISP SCSI Host Adapter FreeBSD Wrapper Definitions 4 * 5 * Copyright (c) 1997-2008 by Matthew Jacob 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 60 unchanged lines hidden (view full) --- 70#ifdef __sparc64__ 71#define ISP_SBUS_SUPPORTED 1 72#else 73#define ISP_SBUS_SUPPORTED 0 74#endif 75 76#define ISP_IFLAGS INTR_TYPE_CAM | INTR_ENTROPY | INTR_MPSAFE 77 | 2/*- 3 * Qlogic ISP SCSI Host Adapter FreeBSD Wrapper Definitions 4 * 5 * Copyright (c) 1997-2008 by Matthew Jacob 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 60 unchanged lines hidden (view full) --- 70#ifdef __sparc64__ 71#define ISP_SBUS_SUPPORTED 1 72#else 73#define ISP_SBUS_SUPPORTED 0 74#endif 75 76#define ISP_IFLAGS INTR_TYPE_CAM | INTR_ENTROPY | INTR_MPSAFE 77 |
78#define N_XCMDS 64 79#define XCMD_SIZE 512 80struct ispsoftc; 81typedef union isp_ecmd { 82 union isp_ecmd * next; 83 uint8_t data[XCMD_SIZE]; 84} isp_ecmd_t; 85isp_ecmd_t * isp_get_ecmd(struct ispsoftc *); 86void isp_put_ecmd(struct ispsoftc *, isp_ecmd_t *); 87 |
|
78#ifdef ISP_TARGET_MODE 79/* Not quite right, but there was no bump for this change */ 80#if __FreeBSD_version < 225469 81#define SDFIXED(x) (&x) 82#else 83#define SDFIXED(x) ((struct scsi_sense_data_fixed *)(&x)) 84#endif 85 --- 9 unchanged lines hidden (view full) --- 95 uint32_t last_xframt; 96 uint32_t tag; /* typically f/w RX_ID */ 97 uint32_t lun; 98 uint32_t nphdl; 99 uint32_t sid; 100 uint32_t portid; 101 uint16_t rxid; /* wire rxid */ 102 uint16_t oxid; /* wire oxid */ | 88#ifdef ISP_TARGET_MODE 89/* Not quite right, but there was no bump for this change */ 90#if __FreeBSD_version < 225469 91#define SDFIXED(x) (&x) 92#else 93#define SDFIXED(x) ((struct scsi_sense_data_fixed *)(&x)) 94#endif 95 --- 9 unchanged lines hidden (view full) --- 105 uint32_t last_xframt; 106 uint32_t tag; /* typically f/w RX_ID */ 107 uint32_t lun; 108 uint32_t nphdl; 109 uint32_t sid; 110 uint32_t portid; 111 uint16_t rxid; /* wire rxid */ 112 uint16_t oxid; /* wire oxid */ |
113 uint16_t word3; /* PRLI word3 params */ 114 uint16_t ctcnt; /* number of CTIOs currently active */ |
|
103 uint32_t | 115 uint32_t |
104 cdb0 : 8, 105 : 1, 106 dead : 1, 107 tattr : 3, 108 state : 3; | 116 srr_notify_rcvd : 1, 117 cdb0 : 8, 118 sendst : 1, 119 dead : 1, 120 tattr : 3, 121 state : 3; 122 void * ests; 123 /* 124 * The current SRR notify copy 125 */ 126 uint8_t srr[64]; /* sb QENTRY_LEN, but order of definitions is wrong */ 127 void * srr_ccb; 128 uint32_t nsrr; |
109} atio_private_data_t; 110#define ATPD_STATE_FREE 0 111#define ATPD_STATE_ATIO 1 112#define ATPD_STATE_CAM 2 113#define ATPD_STATE_CTIO 3 114#define ATPD_STATE_LAST_CTIO 4 115#define ATPD_STATE_PDON 5 116 117typedef union inot_private_data inot_private_data_t; 118union inot_private_data { 119 inot_private_data_t *next; 120 struct { 121 isp_notify_t nt; /* must be first! */ 122 uint8_t data[64]; /* sb QENTRY_LEN, but order of definitions is wrong */ 123 uint32_t tag_id, seq_id; 124 } rd; 125}; | 129} atio_private_data_t; 130#define ATPD_STATE_FREE 0 131#define ATPD_STATE_ATIO 1 132#define ATPD_STATE_CAM 2 133#define ATPD_STATE_CTIO 3 134#define ATPD_STATE_LAST_CTIO 4 135#define ATPD_STATE_PDON 5 136 137typedef union inot_private_data inot_private_data_t; 138union inot_private_data { 139 inot_private_data_t *next; 140 struct { 141 isp_notify_t nt; /* must be first! */ 142 uint8_t data[64]; /* sb QENTRY_LEN, but order of definitions is wrong */ 143 uint32_t tag_id, seq_id; 144 } rd; 145}; |
146typedef struct isp_timed_notify_ack { 147 void *isp; 148 void *not; 149 uint8_t data[64]; /* sb QENTRY_LEN, but order of definitions is wrong */ 150} isp_tna_t; |
|
126 127typedef struct tstate { 128 SLIST_ENTRY(tstate) next; 129 struct cam_path *owner; 130 struct ccb_hdr_slist atios; 131 struct ccb_hdr_slist inots; 132 uint32_t hold; 133 uint32_t --- 12 unchanged lines hidden (view full) --- 146 147#endif 148 149/* 150 * Per command info. 151 */ 152struct isp_pcmd { 153 struct isp_pcmd * next; | 151 152typedef struct tstate { 153 SLIST_ENTRY(tstate) next; 154 struct cam_path *owner; 155 struct ccb_hdr_slist atios; 156 struct ccb_hdr_slist inots; 157 uint32_t hold; 158 uint32_t --- 12 unchanged lines hidden (view full) --- 171 172#endif 173 174/* 175 * Per command info. 176 */ 177struct isp_pcmd { 178 struct isp_pcmd * next; |
154 bus_dmamap_t dmap; /* dma map for this command */ 155 struct ispsoftc * isp; /* containing isp */ 156 struct callout wdog; /* watchdog timer */ 157 uint8_t crn; /* command reference number */ | 179 bus_dmamap_t dmap; /* dma map for this command */ 180 struct ispsoftc * isp; /* containing isp */ 181 struct callout wdog; /* watchdog timer */ 182 uint8_t totslen; /* sense length on status response */ 183 uint8_t cumslen; /* sense length on status response */ 184 uint8_t crn; /* command reference number */ |
158}; 159#define ISP_PCMD(ccb) (ccb)->ccb_h.spriv_ptr1 160#define PISP_PCMD(ccb) ((struct isp_pcmd *)ISP_PCMD(ccb)) 161 162/* | 185}; 186#define ISP_PCMD(ccb) (ccb)->ccb_h.spriv_ptr1 187#define PISP_PCMD(ccb) ((struct isp_pcmd *)ISP_PCMD(ccb)) 188 189/* |
190 * Per nexus info. 191 */ 192struct isp_nexus { 193 struct isp_nexus * next; 194 uint32_t 195 crnseed : 8; /* next command reference number */ 196 uint32_t 197 tgt : 16, /* TGT for target */ 198 lun : 16; /* LUN for target */ 199}; 200#define NEXUS_HASH_WIDTH 32 201#define INITIAL_NEXUS_COUNT MAX_FC_TARG 202#define NEXUS_HASH(tgt, lun) ((tgt + lun) % NEXUS_HASH_WIDTH) 203 204/* |
|
163 * Per channel information 164 */ 165SLIST_HEAD(tslist, tstate); 166 167struct isp_fc { 168 struct cam_sim *sim; 169 struct cam_path *path; 170 struct ispsoftc *isp; 171 struct proc *kproc; 172 bus_dma_tag_t tdmat; 173 bus_dmamap_t tdmap; 174 uint64_t def_wwpn; 175 uint64_t def_wwnn; 176 uint32_t loop_down_time; 177 uint32_t loop_down_limit; 178 uint32_t gone_device_time; | 205 * Per channel information 206 */ 207SLIST_HEAD(tslist, tstate); 208 209struct isp_fc { 210 struct cam_sim *sim; 211 struct cam_path *path; 212 struct ispsoftc *isp; 213 struct proc *kproc; 214 bus_dma_tag_t tdmat; 215 bus_dmamap_t tdmap; 216 uint64_t def_wwpn; 217 uint64_t def_wwnn; 218 uint32_t loop_down_time; 219 uint32_t loop_down_limit; 220 uint32_t gone_device_time; |
221 /* 222 * Per target/lun info- just to keep a per-ITL nexus crn count 223 */ 224 struct isp_nexus *nexus_hash[NEXUS_HASH_WIDTH]; 225 struct isp_nexus *nexus_free_list; |
|
179 uint32_t 180#ifdef ISP_TARGET_MODE 181#ifdef ISP_INTERNAL_TARGET 182 proc_active : 1, 183#endif 184 tm_luns_enabled : 1, 185 tm_enable_defer : 1, 186 tm_enabled : 1, --- 10 unchanged lines hidden (view full) --- 197 struct callout gdt; /* gone device timer */ 198 struct task ltask; 199 struct task gtask; 200#ifdef ISP_TARGET_MODE 201 struct tslist lun_hash[LUN_HASH_SIZE]; 202#ifdef ISP_INTERNAL_TARGET 203 struct proc * target_proc; 204#endif | 226 uint32_t 227#ifdef ISP_TARGET_MODE 228#ifdef ISP_INTERNAL_TARGET 229 proc_active : 1, 230#endif 231 tm_luns_enabled : 1, 232 tm_enable_defer : 1, 233 tm_enabled : 1, --- 10 unchanged lines hidden (view full) --- 244 struct callout gdt; /* gone device timer */ 245 struct task ltask; 246 struct task gtask; 247#ifdef ISP_TARGET_MODE 248 struct tslist lun_hash[LUN_HASH_SIZE]; 249#ifdef ISP_INTERNAL_TARGET 250 struct proc * target_proc; 251#endif |
252#if defined(DEBUG) 253 unsigned int inject_lost_data_frame; |
|
205#endif | 254#endif |
206 uint8_t crnseed; /* next command reference number */ | 255#endif |
207}; 208 209struct isp_spi { 210 struct cam_sim *sim; 211 struct cam_path *path; 212 uint32_t 213#ifdef ISP_TARGET_MODE 214#ifdef ISP_INTERNAL_TARGET --- 46 unchanged lines hidden (view full) --- 261 262 uint32_t 263#ifdef ISP_TARGET_MODE 264 tmwanted : 1, 265 tmbusy : 1, 266#else 267 : 2, 268#endif | 256}; 257 258struct isp_spi { 259 struct cam_sim *sim; 260 struct cam_path *path; 261 uint32_t 262#ifdef ISP_TARGET_MODE 263#ifdef ISP_INTERNAL_TARGET --- 46 unchanged lines hidden (view full) --- 310 311 uint32_t 312#ifdef ISP_TARGET_MODE 313 tmwanted : 1, 314 tmbusy : 1, 315#else 316 : 2, 317#endif |
318 sixtyfourbit : 1, /* sixtyfour bit platform */ |
|
269 timer_active : 1, 270 autoconf : 1, 271 ehook_active : 1, 272 disabled : 1, 273 mbox_sleeping : 1, 274 mbox_sleep_ok : 1, 275 mboxcmd_done : 1, 276 mboxbsy : 1; --- 6 unchanged lines hidden (view full) --- 283 int framesize; 284 int exec_throttle; 285 int cont_max; 286 287#ifdef ISP_TARGET_MODE 288 cam_status * rptr; 289#endif 290 | 319 timer_active : 1, 320 autoconf : 1, 321 ehook_active : 1, 322 disabled : 1, 323 mbox_sleeping : 1, 324 mbox_sleep_ok : 1, 325 mboxcmd_done : 1, 326 mboxbsy : 1; --- 6 unchanged lines hidden (view full) --- 333 int framesize; 334 int exec_throttle; 335 int cont_max; 336 337#ifdef ISP_TARGET_MODE 338 cam_status * rptr; 339#endif 340 |
341 bus_addr_t ecmd_dma; 342 isp_ecmd_t * ecmd_base; 343 isp_ecmd_t * ecmd_free; 344 |
|
291 /* 292 * Per-type private storage... 293 */ 294 union { 295 struct isp_fc *fc; 296 struct isp_spi *spi; 297 void *ptr; 298 } pc; --- 14 unchanged lines hidden (view full) --- 313 } 314#define ISP_SET_PC(isp, chan, tag, val) \ 315 if (IS_SCSI(isp)) { \ 316 ISP_SPI_PC(isp, chan)-> tag = val; \ 317 } else { \ 318 ISP_FC_PC(isp, chan)-> tag = val; \ 319 } 320 | 345 /* 346 * Per-type private storage... 347 */ 348 union { 349 struct isp_fc *fc; 350 struct isp_spi *spi; 351 void *ptr; 352 } pc; --- 14 unchanged lines hidden (view full) --- 367 } 368#define ISP_SET_PC(isp, chan, tag, val) \ 369 if (IS_SCSI(isp)) { \ 370 ISP_SPI_PC(isp, chan)-> tag = val; \ 371 } else { \ 372 ISP_FC_PC(isp, chan)-> tag = val; \ 373 } 374 |
321#define FCP_NEXT_CRN(isp, cmd, rslt, chan, tgt, lun) \ 322 if ((isp)->isp_osinfo.pc.fc[(chan)].crnseed == 0) { \ 323 (isp)->isp_osinfo.pc.fc[(chan)].crnseed = 1; \ 324 } \ 325 if (cmd) { \ 326 PISP_PCMD(cmd)->crn = (isp)->isp_osinfo.pc.fc[(chan)].crnseed; \ 327 } \ 328 (rslt) = (isp)->isp_osinfo.pc.fc[(chan)].crnseed++ 329 330 | 375#define FCP_NEXT_CRN isp_fcp_next_crn |
331#define isp_lock isp_osinfo.lock 332#define isp_bus_tag isp_osinfo.bus_tag 333#define isp_bus_handle isp_osinfo.bus_handle 334 335/* 336 * Locking macros... 337 */ 338#define ISP_LOCK(isp) mtx_lock(&isp->isp_osinfo.lock) 339#define ISP_UNLOCK(isp) mtx_unlock(&isp->isp_osinfo.lock) 340 341/* 342 * Required Macros/Defines 343 */ | 376#define isp_lock isp_osinfo.lock 377#define isp_bus_tag isp_osinfo.bus_tag 378#define isp_bus_handle isp_osinfo.bus_handle 379 380/* 381 * Locking macros... 382 */ 383#define ISP_LOCK(isp) mtx_lock(&isp->isp_osinfo.lock) 384#define ISP_UNLOCK(isp) mtx_unlock(&isp->isp_osinfo.lock) 385 386/* 387 * Required Macros/Defines 388 */ |
344 | |
345#define ISP_FC_SCRLEN 0x1000 346 347#define ISP_MEMZERO(a, b) memset(a, 0, b) 348#define ISP_MEMCPY memcpy 349#define ISP_SNPRINTF snprintf 350#define ISP_DELAY DELAY 351#define ISP_SLEEP(isp, x) DELAY(x) 352 --- 101 unchanged lines hidden (view full) --- 454#define XS_CDBLEN(ccb) (ccb)->cdb_len 455#define XS_XFRLEN(ccb) (ccb)->dxfer_len 456#define XS_TIME(ccb) (ccb)->ccb_h.timeout 457#define XS_GET_RESID(ccb) (ccb)->resid 458#define XS_SET_RESID(ccb, r) (ccb)->resid = r 459#define XS_STSP(ccb) (&(ccb)->scsi_status) 460#define XS_SNSP(ccb) (&(ccb)->sense_data) 461 | 389#define ISP_FC_SCRLEN 0x1000 390 391#define ISP_MEMZERO(a, b) memset(a, 0, b) 392#define ISP_MEMCPY memcpy 393#define ISP_SNPRINTF snprintf 394#define ISP_DELAY DELAY 395#define ISP_SLEEP(isp, x) DELAY(x) 396 --- 101 unchanged lines hidden (view full) --- 498#define XS_CDBLEN(ccb) (ccb)->cdb_len 499#define XS_XFRLEN(ccb) (ccb)->dxfer_len 500#define XS_TIME(ccb) (ccb)->ccb_h.timeout 501#define XS_GET_RESID(ccb) (ccb)->resid 502#define XS_SET_RESID(ccb, r) (ccb)->resid = r 503#define XS_STSP(ccb) (&(ccb)->scsi_status) 504#define XS_SNSP(ccb) (&(ccb)->sense_data) 505 |
462#define XS_SNSLEN(ccb) \ 463 imin((sizeof((ccb)->sense_data)), ccb->sense_len - ccb->sense_resid) | 506#define XS_TOT_SNSLEN(ccb) ccb->sense_len 507#define XS_CUR_SNSLEN(ccb) (ccb->sense_len - ccb->sense_resid) |
464 465#define XS_SNSKEY(ccb) (scsi_get_sense_key(&(ccb)->sense_data, \ | 508 509#define XS_SNSKEY(ccb) (scsi_get_sense_key(&(ccb)->sense_data, \ |
466 ccb->sense_len - ccb->sense_resid, \ 467 /*show_errors*/ 1)) | 510 ccb->sense_len - ccb->sense_resid, 1)) |
468 469#define XS_SNSASC(ccb) (scsi_get_asc(&(ccb)->sense_data, \ | 511 512#define XS_SNSASC(ccb) (scsi_get_asc(&(ccb)->sense_data, \ |
470 ccb->sense_len - ccb->sense_resid, \ 471 /*show_errors*/ 1)) | 513 ccb->sense_len - ccb->sense_resid, 1)) |
472 473#define XS_SNSASCQ(ccb) (scsi_get_ascq(&(ccb)->sense_data, \ | 514 515#define XS_SNSASCQ(ccb) (scsi_get_ascq(&(ccb)->sense_data, \ |
474 ccb->sense_len - ccb->sense_resid, \ 475 /*show_errors*/ 1)) | 516 ccb->sense_len - ccb->sense_resid, 1)) |
476#define XS_TAG_P(ccb) \ 477 (((ccb)->ccb_h.flags & CAM_TAG_ACTION_VALID) && \ 478 (ccb)->tag_action != CAM_TAG_ACTION_NONE) 479 480#define XS_TAG_TYPE(ccb) \ 481 ((ccb->tag_action == MSG_SIMPLE_Q_TAG)? REQFLAG_STAG : \ 482 ((ccb->tag_action == MSG_HEAD_OF_Q_TAG)? REQFLAG_HTAG : REQFLAG_OTAG)) 483 484 485#define XS_SETERR(ccb, v) (ccb)->ccb_h.status &= ~CAM_STATUS_MASK, \ | 517#define XS_TAG_P(ccb) \ 518 (((ccb)->ccb_h.flags & CAM_TAG_ACTION_VALID) && \ 519 (ccb)->tag_action != CAM_TAG_ACTION_NONE) 520 521#define XS_TAG_TYPE(ccb) \ 522 ((ccb->tag_action == MSG_SIMPLE_Q_TAG)? REQFLAG_STAG : \ 523 ((ccb->tag_action == MSG_HEAD_OF_Q_TAG)? REQFLAG_HTAG : REQFLAG_OTAG)) 524 525 526#define XS_SETERR(ccb, v) (ccb)->ccb_h.status &= ~CAM_STATUS_MASK, \ |
486 (ccb)->ccb_h.status |= v, \ 487 (ccb)->ccb_h.spriv_field0 |= ISP_SPRIV_ERRSET | 527 (ccb)->ccb_h.status |= v |
488 489# define HBA_NOERROR CAM_REQ_INPROG 490# define HBA_BOTCH CAM_UNREC_HBA_ERROR 491# define HBA_CMDTIMEOUT CAM_CMD_TIMEOUT 492# define HBA_SELTIMEOUT CAM_SEL_TIMEOUT 493# define HBA_TGTBSY CAM_SCSI_STATUS_ERROR 494# define HBA_BUSRESET CAM_SCSI_BUS_RESET 495# define HBA_ABORTED CAM_REQ_ABORTED 496# define HBA_DATAOVR CAM_DATA_RUN_ERR 497# define HBA_ARQFAIL CAM_AUTOSENSE_FAIL 498 499 500#define XS_ERR(ccb) ((ccb)->ccb_h.status & CAM_STATUS_MASK) 501 | 528 529# define HBA_NOERROR CAM_REQ_INPROG 530# define HBA_BOTCH CAM_UNREC_HBA_ERROR 531# define HBA_CMDTIMEOUT CAM_CMD_TIMEOUT 532# define HBA_SELTIMEOUT CAM_SEL_TIMEOUT 533# define HBA_TGTBSY CAM_SCSI_STATUS_ERROR 534# define HBA_BUSRESET CAM_SCSI_BUS_RESET 535# define HBA_ABORTED CAM_REQ_ABORTED 536# define HBA_DATAOVR CAM_DATA_RUN_ERR 537# define HBA_ARQFAIL CAM_AUTOSENSE_FAIL 538 539 540#define XS_ERR(ccb) ((ccb)->ccb_h.status & CAM_STATUS_MASK) 541 |
502#define XS_NOERR(ccb) \ 503 (((ccb)->ccb_h.spriv_field0 & ISP_SPRIV_ERRSET) == 0 || \ 504 ((ccb)->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_INPROG) | 542#define XS_NOERR(ccb) (((ccb)->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_INPROG) |
505 | 543 |
506#define XS_INITERR(ccb) \ 507 XS_SETERR(ccb, CAM_REQ_INPROG), (ccb)->ccb_h.spriv_field0 = 0 | 544#define XS_INITERR(ccb) XS_SETERR(ccb, CAM_REQ_INPROG), ccb->sense_resid = ccb->sense_len |
508 | 545 |
509#define XS_SAVE_SENSE(xs, sense_ptr, slen) do { \ 510 (xs)->ccb_h.status |= CAM_AUTOSNS_VALID; \ 511 memset(&(xs)->sense_data, 0, sizeof((xs)->sense_data)); \ 512 memcpy(&(xs)->sense_data, sense_ptr, imin(XS_SNSLEN(xs),\ 513 slen)); \ 514 if (slen < (xs)->sense_len) \ 515 (xs)->sense_resid = (xs)->sense_len - slen; \ 516 } while (0); | 546#define XS_SAVE_SENSE(xs, sense_ptr, totslen, slen) do { \ 547 uint32_t tlen = slen; \ 548 if (tlen > (xs)->sense_len) \ 549 tlen = (xs)->sense_len; \ 550 PISP_PCMD(xs)->totslen = imin((xs)->sense_len, totslen); \ 551 PISP_PCMD(xs)->cumslen = tlen; \ 552 memcpy(&(xs)->sense_data, sense_ptr, tlen); \ 553 (xs)->sense_resid = (xs)->sense_len - tlen; \ 554 (xs)->ccb_h.status |= CAM_AUTOSNS_VALID; \ 555 } while (0) |
517 | 556 |
557#define XS_SENSE_APPEND(xs, xsnsp, xsnsl) do { \ 558 uint32_t off = PISP_PCMD(xs)->cumslen; \ 559 uint8_t *ptr = &((uint8_t *)(&(xs)->sense_data))[off]; \ 560 uint32_t amt = imin(xsnsl, PISP_PCMD(xs)->totslen - off); \ 561 if (amt) { \ 562 memcpy(ptr, xsnsp, amt); \ 563 (xs)->sense_resid -= amt; \ 564 PISP_PCMD(xs)->cumslen += amt; \ 565 } \ 566 } while (0) 567 |
|
518#define XS_SENSE_VALID(xs) (((xs)->ccb_h.status & CAM_AUTOSNS_VALID) != 0) 519 520#define DEFAULT_FRAMESIZE(isp) isp->isp_osinfo.framesize 521#define DEFAULT_EXEC_THROTTLE(isp) isp->isp_osinfo.exec_throttle 522 523#define GET_DEFAULT_ROLE(isp, chan) \ 524 (IS_FC(isp)? ISP_FC_PC(isp, chan)->def_role : ISP_SPI_PC(isp, chan)->def_role) 525#define SET_DEFAULT_ROLE(isp, chan, val) \ --- 103 unchanged lines hidden (view full) --- 629extern int isp_loop_down_limit; 630extern int isp_gone_device_time; 631extern int isp_quickboot_time; 632extern int isp_autoconfig; 633 634/* 635 * Platform private flags 636 */ | 568#define XS_SENSE_VALID(xs) (((xs)->ccb_h.status & CAM_AUTOSNS_VALID) != 0) 569 570#define DEFAULT_FRAMESIZE(isp) isp->isp_osinfo.framesize 571#define DEFAULT_EXEC_THROTTLE(isp) isp->isp_osinfo.exec_throttle 572 573#define GET_DEFAULT_ROLE(isp, chan) \ 574 (IS_FC(isp)? ISP_FC_PC(isp, chan)->def_role : ISP_SPI_PC(isp, chan)->def_role) 575#define SET_DEFAULT_ROLE(isp, chan, val) \ --- 103 unchanged lines hidden (view full) --- 679extern int isp_loop_down_limit; 680extern int isp_gone_device_time; 681extern int isp_quickboot_time; 682extern int isp_autoconfig; 683 684/* 685 * Platform private flags 686 */ |
637#define ISP_SPRIV_ERRSET 0x1 638#define ISP_SPRIV_TACTIVE 0x2 639#define ISP_SPRIV_DONE 0x8 640#define ISP_SPRIV_WPEND 0x10 | |
641 | 687 |
642#define XS_S_TACTIVE(sccb) (sccb)->ccb_h.spriv_field0 |= ISP_SPRIV_TACTIVE 643#define XS_C_TACTIVE(sccb) (sccb)->ccb_h.spriv_field0 &= ~ISP_SPRIV_TACTIVE 644#define XS_TACTIVE_P(sccb) ((sccb)->ccb_h.spriv_field0 & ISP_SPRIV_TACTIVE) 645 646#define XS_CMD_S_DONE(sccb) (sccb)->ccb_h.spriv_field0 |= ISP_SPRIV_DONE 647#define XS_CMD_C_DONE(sccb) (sccb)->ccb_h.spriv_field0 &= ~ISP_SPRIV_DONE 648#define XS_CMD_DONE_P(sccb) ((sccb)->ccb_h.spriv_field0 & ISP_SPRIV_DONE) 649 650#define XS_CMD_S_WPEND(sccb) (sccb)->ccb_h.spriv_field0 |= ISP_SPRIV_WPEND 651#define XS_CMD_C_WPEND(sccb) (sccb)->ccb_h.spriv_field0 &= ~ISP_SPRIV_WPEND 652#define XS_CMD_WPEND_P(sccb) ((sccb)->ccb_h.spriv_field0 & ISP_SPRIV_WPEND) 653 654#define XS_CMD_S_CLEAR(sccb) (sccb)->ccb_h.spriv_field0 = 0 655 | |
656/* 657 * Platform Library Functions 658 */ 659void isp_prt(ispsoftc_t *, int level, const char *, ...) __printflike(3, 4); 660void isp_xs_prt(ispsoftc_t *, XS_T *, int level, const char *, ...) __printflike(4, 5); 661uint64_t isp_nanotime_sub(struct timespec *, struct timespec *); 662int isp_mbox_acquire(ispsoftc_t *); 663void isp_mbox_wait_complete(ispsoftc_t *, mbreg_t *); 664void isp_mbox_notify_done(ispsoftc_t *); 665void isp_mbox_release(ispsoftc_t *); 666int isp_fc_scratch_acquire(ispsoftc_t *, int); 667int isp_mstohz(int); 668void isp_platform_intr(void *); 669void isp_common_dmateardown(ispsoftc_t *, struct ccb_scsiio *, uint32_t); | 688/* 689 * Platform Library Functions 690 */ 691void isp_prt(ispsoftc_t *, int level, const char *, ...) __printflike(3, 4); 692void isp_xs_prt(ispsoftc_t *, XS_T *, int level, const char *, ...) __printflike(4, 5); 693uint64_t isp_nanotime_sub(struct timespec *, struct timespec *); 694int isp_mbox_acquire(ispsoftc_t *); 695void isp_mbox_wait_complete(ispsoftc_t *, mbreg_t *); 696void isp_mbox_notify_done(ispsoftc_t *); 697void isp_mbox_release(ispsoftc_t *); 698int isp_fc_scratch_acquire(ispsoftc_t *, int); 699int isp_mstohz(int); 700void isp_platform_intr(void *); 701void isp_common_dmateardown(ispsoftc_t *, struct ccb_scsiio *, uint32_t); |
702int isp_fcp_next_crn(ispsoftc_t *, uint8_t *, XS_T *); |
|
670 671/* 672 * Platform Version specific defines 673 */ 674#define BUS_DMA_ROOTARG(x) bus_get_dma_tag(x) 675#define isp_dma_tag_create(a, b, c, d, e, f, g, h, i, j, k, z) \ 676 bus_dma_tag_create(a, b, c, d, e, f, g, h, i, j, k, \ 677 busdma_lock_mutex, &isp->isp_osinfo.lock, z) --- 25 unchanged lines hidden --- | 703 704/* 705 * Platform Version specific defines 706 */ 707#define BUS_DMA_ROOTARG(x) bus_get_dma_tag(x) 708#define isp_dma_tag_create(a, b, c, d, e, f, g, h, i, j, k, z) \ 709 bus_dma_tag_create(a, b, c, d, e, f, g, h, i, j, k, \ 710 busdma_lock_mutex, &isp->isp_osinfo.lock, z) --- 25 unchanged lines hidden --- |