ispvar.h (196008) | ispvar.h (203444) |
---|---|
1/* $FreeBSD: head/sys/dev/isp/ispvar.h 196008 2009-08-01 01:04:26Z mjacob $ */ | 1/* $FreeBSD: head/sys/dev/isp/ispvar.h 203444 2010-02-03 21:09:32Z mjacob $ */ |
2/*- 3 * Copyright (c) 1997-2009 by Matthew Jacob 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * --- 35 unchanged lines hidden (view full) --- 45#include "isp_stds.h" 46#include "ispmbox.h" 47#endif 48#ifdef __svr4__ 49#include "isp_stds.h" 50#include "ispmbox.h" 51#endif 52 | 2/*- 3 * Copyright (c) 1997-2009 by Matthew Jacob 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * --- 35 unchanged lines hidden (view full) --- 45#include "isp_stds.h" 46#include "ispmbox.h" 47#endif 48#ifdef __svr4__ 49#include "isp_stds.h" 50#include "ispmbox.h" 51#endif 52 |
53#define ISP_CORE_VERSION_MAJOR 6 | 53#define ISP_CORE_VERSION_MAJOR 7 |
54#define ISP_CORE_VERSION_MINOR 0 55 56/* 57 * Vector for bus specific code to provide specific services. 58 */ 59typedef struct ispsoftc ispsoftc_t; 60struct ispmdvec { 61 int (*dv_rd_isr) (ispsoftc_t *, uint32_t *, uint16_t *, uint16_t *); --- 221 unchanged lines hidden (view full) --- 283#define MANAGEMENT_PORT_ID 0xFFFFFA 284#define SNS_PORT_ID 0xFFFFFC 285#define FABRIC_PORT_ID 0xFFFFFE 286#define PORT_ANY 0xFFFFFF 287#define PORT_NONE 0 288#define DOMAIN_CONTROLLER_BASE 0xFFFC00 289#define DOMAIN_CONTROLLER_END 0xFFFCFF 290 | 54#define ISP_CORE_VERSION_MINOR 0 55 56/* 57 * Vector for bus specific code to provide specific services. 58 */ 59typedef struct ispsoftc ispsoftc_t; 60struct ispmdvec { 61 int (*dv_rd_isr) (ispsoftc_t *, uint32_t *, uint16_t *, uint16_t *); --- 221 unchanged lines hidden (view full) --- 283#define MANAGEMENT_PORT_ID 0xFFFFFA 284#define SNS_PORT_ID 0xFFFFFC 285#define FABRIC_PORT_ID 0xFFFFFE 286#define PORT_ANY 0xFFFFFF 287#define PORT_NONE 0 288#define DOMAIN_CONTROLLER_BASE 0xFFFC00 289#define DOMAIN_CONTROLLER_END 0xFFFCFF 290 |
291/* 292 * Command Handles 293 * 294 * Most QLogic initiator or target have 32 bit handles associated with them. 295 * We want to have a quick way to index back and forth between a local SCSI 296 * command context and what the firmware is passing back to us. We also 297 * want to avoid working on stale information. This structure handles both 298 * at the expense of some local memory. 299 * 300 * The handle is architected thusly: 301 * 302 * 0 means "free handle" 303 * bits 0..12 index commands 304 * bits 13..15 bits index usage 305 * bits 16..31 contain a rolling sequence 306 * 307 * 308 */ 309typedef struct { 310 void * cmd; /* associated command context */ 311 uint32_t handle; /* handle associated with this command */ 312} isp_hdl_t; 313#define ISP_HANDLE_FREE 0x00000000 314#define ISP_HANDLE_CMD_MASK 0x00001fff 315#define ISP_HANDLE_USAGE_MASK 0x0000e000 316#define ISP_HANDLE_USAGE_SHIFT 13 317#define ISP_H2HT(hdl) ((hdl & ISP_HANDLE_USAGE_MASK) >> ISP_HANDLE_USAGE_SHIFT) 318# define ISP_HANDLE_NONE 0 319# define ISP_HANDLE_INITIATOR 1 320# define ISP_HANDLE_TARGET 2 321#define ISP_HANDLE_SEQ_MASK 0xffff0000 322#define ISP_HANDLE_SEQ_SHIFT 16 323#define ISP_H2SEQ(hdl) ((hdl & ISP_HANDLE_SEQ_MASK) >> ISP_HANDLE_SEQ_SHIFT) 324#define ISP_VALID_INI_HANDLE(c, hdl) \ 325 (ISP_H2HT(hdl) == ISP_HANDLE_INITIATOR && (hdl & ISP_HANDLE_CMD_MASK) < (c)->isp_maxcmds && \ 326 ISP_H2SEQ(hdl) == ISP_H2SEQ((c)->isp_xflist[hdl & ISP_HANDLE_CMD_MASK].handle)) 327#ifdef ISP_TARGET_MODE 328#define ISP_VALID_TGT_HANDLE(c, hdl) \ 329 (ISP_H2HT(hdl) == ISP_HANDLE_TARGET && (hdl & ISP_HANDLE_CMD_MASK) < (c)->isp_maxcmds && \ 330 ISP_H2SEQ(hdl) == ISP_H2SEQ((c)->isp_tgtlist[hdl & ISP_HANDLE_CMD_MASK].handle)) 331#define ISP_VALID_HANDLE(c, hdl) \ 332 (ISP_VALID_INI_HANDLE((c), hdl) || ISP_VALID_TGT_HANDLE((c), hdl)) 333#else 334#define ISP_VALID_HANDLE ISP_VALID_INI_HANDLE 335#endif 336#define ISP_BAD_HANDLE_INDEX 0xffffffff |
|
291 | 337 |
338 |
|
292/* 293 * FC Port Database entry. 294 * 295 * It has a handle that the f/w uses to address commands to a device. 296 * This handle's value may be assigned by the firmware (e.g., for local loop 297 * devices) or by the driver (e.g., for fabric devices). 298 * 299 * It has a state. If the state if VALID, that means that we've logged into --- 257 unchanged lines hidden (view full) --- 557 558 volatile uint32_t : 8, 559 : 2, 560 isp_dead : 1, 561 : 1, 562 isp_mboxbsy : 1, /* mailbox command active */ 563 isp_state : 3, 564 isp_nactive : 16; /* how many commands active */ | 339/* 340 * FC Port Database entry. 341 * 342 * It has a handle that the f/w uses to address commands to a device. 343 * This handle's value may be assigned by the firmware (e.g., for local loop 344 * devices) or by the driver (e.g., for fabric devices). 345 * 346 * It has a state. If the state if VALID, that means that we've logged into --- 257 unchanged lines hidden (view full) --- 604 605 volatile uint32_t : 8, 606 : 2, 607 isp_dead : 1, 608 : 1, 609 isp_mboxbsy : 1, /* mailbox command active */ 610 isp_state : 3, 611 isp_nactive : 16; /* how many commands active */ |
612 volatile mbreg_t isp_curmbx; /* currently active mailbox command */ |
|
565 volatile uint32_t isp_reqodx; /* index of last ISP pickup */ 566 volatile uint32_t isp_reqidx; /* index of next request */ 567 volatile uint32_t isp_residx; /* index of next result */ 568 volatile uint32_t isp_resodx; /* index of next result */ | 613 volatile uint32_t isp_reqodx; /* index of last ISP pickup */ 614 volatile uint32_t isp_reqidx; /* index of next request */ 615 volatile uint32_t isp_residx; /* index of next result */ 616 volatile uint32_t isp_resodx; /* index of next result */ |
569 volatile uint32_t isp_lasthdls; /* last handle seed */ | |
570 volatile uint32_t isp_obits; /* mailbox command output */ 571 volatile uint32_t isp_serno; /* rolling serial number */ 572 volatile uint16_t isp_mboxtmp[MAILBOX_STORAGE]; 573 volatile uint16_t isp_lastmbxcmd; /* last mbox command sent */ 574 volatile uint16_t isp_mbxwrk0; 575 volatile uint16_t isp_mbxwrk1; 576 volatile uint16_t isp_mbxwrk2; 577 volatile uint16_t isp_mbxwrk8; | 617 volatile uint32_t isp_obits; /* mailbox command output */ 618 volatile uint32_t isp_serno; /* rolling serial number */ 619 volatile uint16_t isp_mboxtmp[MAILBOX_STORAGE]; 620 volatile uint16_t isp_lastmbxcmd; /* last mbox command sent */ 621 volatile uint16_t isp_mbxwrk0; 622 volatile uint16_t isp_mbxwrk1; 623 volatile uint16_t isp_mbxwrk2; 624 volatile uint16_t isp_mbxwrk8; |
625 volatile uint16_t isp_seqno; /* running sequence number */ |
|
578 void * isp_mbxworkp; 579 580 /* 581 * Active commands are stored here, indexed by handle functions. 582 */ | 626 void * isp_mbxworkp; 627 628 /* 629 * Active commands are stored here, indexed by handle functions. 630 */ |
583 XS_T **isp_xflist; | 631 isp_hdl_t *isp_xflist; 632 isp_hdl_t *isp_xffree; |
584 585#ifdef ISP_TARGET_MODE 586 /* 587 * Active target commands are stored here, indexed by handle functions. 588 */ | 633 634#ifdef ISP_TARGET_MODE 635 /* 636 * Active target commands are stored here, indexed by handle functions. 637 */ |
589 void **isp_tgtlist; | 638 isp_hdl_t *isp_tgtlist; 639 isp_hdl_t *isp_tgtfree; |
590#endif 591 592 /* 593 * request/result queue pointers and DMA handles for them. 594 */ 595 void * isp_rquest; 596 void * isp_result; 597 XS_DMA_ADDR_T isp_rquest_dma; --- 518 unchanged lines hidden --- | 640#endif 641 642 /* 643 * request/result queue pointers and DMA handles for them. 644 */ 645 void * isp_rquest; 646 void * isp_result; 647 XS_DMA_ADDR_T isp_rquest_dma; --- 518 unchanged lines hidden --- |