1/* 2 * Core definitions and data structures shareable across OS platforms. 3 * 4 * Copyright (c) 1994-2001 Justin T. Gibbs. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 14 unchanged lines hidden (view full) --- 23 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 * SUCH DAMAGE. 30 * |
31 * $Id: //depot/src/aic7xxx/aic7xxx.h#29 $ |
32 * |
33 * $FreeBSD: head/sys/dev/aic7xxx/aic7xxx.h 79874 2001-07-18 21:39:48Z gibbs $ |
34 */ 35 36#ifndef _AIC7XXX_H_ 37#define _AIC7XXX_H_ 38 39/* Register Definitions */ 40#include "aic7xxx_reg.h" 41 --- 288 unchanged lines hidden (view full) --- 330 AHC_SCB_BTT = 0x40000,/* 331 * The busy targets table is 332 * stored in SCB space rather 333 * than SRAM. 334 */ 335 AHC_BIOS_ENABLED = 0x80000, 336 AHC_ALL_INTERRUPTS = 0x100000, 337 AHC_PAGESCBS = 0x400000, /* Enable SCB paging */ |
338 AHC_EDGE_INTERRUPT = 0x800000, /* Device uses edge triggered ints */ 339 AHC_39BIT_ADDRESSING = 0x1000000 /* Use 39 bit addressing scheme. */ |
340} ahc_flag; 341 |
342/************************* Hardware SCB Definition ***************************/ 343 344/* 345 * The driver keeps up to MAX_SCB scb structures per card in memory. The SCB 346 * consists of a "hardware SCB" mirroring the fields availible on the card 347 * and additional information the kernel stores for each transaction. 348 * 349 * To minimize space utilization, a portion of the hardware scb stores --- 132 unchanged lines hidden (view full) --- 482struct ahc_dma_seg { 483 uint32_t addr; 484 uint32_t len; 485#define AHC_DMA_LAST_SEG 0x80000000 486#define AHC_SG_HIGH_ADDR_MASK 0x7F000000 487#define AHC_SG_LEN_MASK 0x00FFFFFF 488}; 489 |
490struct sg_map_node { 491 bus_dmamap_t sg_dmamap; 492 bus_addr_t sg_physaddr; 493 struct ahc_dma_seg* sg_vaddr; 494 SLIST_ENTRY(sg_map_node) links; 495}; 496 |
497/* 498 * The current state of this SCB. 499 */ 500typedef enum { 501 SCB_FREE = 0x0000, 502 SCB_OTHERTCL_TIMEOUT = 0x0002,/* 503 * Another device was active 504 * during the first timeout for --- 23 unchanged lines hidden (view full) --- 528 LIST_ENTRY(scb) pending_links; 529 ahc_io_ctx_t io_ctx; 530 struct ahc_softc *ahc_softc; 531 scb_flag flags; 532#ifndef __linux__ 533 bus_dmamap_t dmamap; 534#endif 535 struct scb_platform_data *platform_data; |
536 struct sg_map_node *sg_map; 537 struct ahc_dma_seg *sg_list; |
538 bus_addr_t sg_list_phys; 539 u_int sg_count;/* How full ahc_dma_seg is */ 540}; 541 |
542struct scb_data { 543 SLIST_HEAD(, scb) free_scbs; /* 544 * Pool of SCBs ready to be assigned 545 * commands to execute. 546 */ 547 struct scb *scbindex[AHC_SCB_MAX + 1];/* Mapping from tag to SCB */ 548 struct hardware_scb *hscbs; /* Array of hardware SCBs */ 549 struct scb *scbarray; /* Array of kernel SCBs */ --- 299 unchanged lines hidden (view full) --- 849#endif 850 struct scb_data *scb_data; 851 852 struct scb *next_queued_scb; 853 854 /* 855 * SCBs that have been sent to the controller 856 */ |
857 LIST_HEAD(, scb) pending_scbs; |
858 859 /* 860 * Counting lock for deferring the release of additional 861 * untagged transactions from the untagged_queues. When 862 * the lock is decremented to 0, all queues in the 863 * untagged_queues array are run. 864 */ 865 u_int untagged_queue_lock; --- 157 unchanged lines hidden (view full) --- 1023 char channel; 1024 role_t role; /* 1025 * Only guaranteed to be correct if not 1026 * in the busfree state. 1027 */ 1028}; 1029 1030/****************************** PCI Structures ********************************/ |
1031typedef int (ahc_device_setup_t)(struct ahc_softc *); |
1032 1033struct ahc_pci_identity { 1034 uint64_t full_id; 1035 uint64_t id_mask; 1036 char *name; 1037 ahc_device_setup_t *setup; 1038}; 1039extern struct ahc_pci_identity ahc_pci_ident_table []; --- 36 unchanged lines hidden (view full) --- 1076 struct scb_tailq *queue); 1077void ahc_qinfifo_requeue_tail(struct ahc_softc *ahc, 1078 struct scb *scb); 1079int ahc_match_scb(struct ahc_softc *ahc, struct scb *scb, 1080 int target, char channel, int lun, 1081 u_int tag, role_t role); 1082 1083/****************************** Initialization ********************************/ |
1084struct ahc_softc *ahc_alloc(void *platform_arg, char *name); |
1085int ahc_softc_init(struct ahc_softc *); |
1086void ahc_controller_info(struct ahc_softc *ahc, char *buf); 1087int ahc_init(struct ahc_softc *ahc); 1088void ahc_intr_enable(struct ahc_softc *ahc, int enable); 1089void ahc_pause_and_flushwork(struct ahc_softc *ahc); 1090int ahc_suspend(struct ahc_softc *ahc); 1091int ahc_resume(struct ahc_softc *ahc); 1092void ahc_softc_insert(struct ahc_softc *); 1093void ahc_set_unit(struct ahc_softc *, int); --- 102 unchanged lines hidden --- |