diff options
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ic/aic79xx.c | 30 | ||||
-rw-r--r-- | sys/dev/ic/aic79xx.h | 75 |
2 files changed, 47 insertions, 58 deletions
diff --git a/sys/dev/ic/aic79xx.c b/sys/dev/ic/aic79xx.c index bd4b8c3c9d8..da9d1a5c160 100644 --- a/sys/dev/ic/aic79xx.c +++ b/sys/dev/ic/aic79xx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aic79xx.c,v 1.11 2004/10/24 04:28:33 krw Exp $ */ +/* $OpenBSD: aic79xx.c,v 1.12 2004/10/24 23:03:01 krw Exp $ */ /* * Copyright (c) 2004 Milos Urbanek, Kenneth R. Westerback & Marco Peereboom @@ -5925,7 +5925,7 @@ ahd_alloc_scbs(struct ahd_softc *ahd) offset = (PAGE_SIZE / sizeof(*hscb)) - scb_data->scbs_left; hscb_map = SLIST_FIRST(&scb_data->hscb_maps); hscb = &((struct hardware_scb *)hscb_map->vaddr)[offset]; - hscb_busaddr = hscb_map->physaddr + (offset * sizeof(*hscb)); + hscb_busaddr = hscb_map->busaddr + (offset * sizeof(*hscb)); } else { hscb_map = malloc(sizeof(*hscb_map), M_DEVBUF, M_NOWAIT); @@ -5938,7 +5938,7 @@ ahd_alloc_scbs(struct ahd_softc *ahd) if (ahd_createdmamem(ahd->parent_dmat, PAGE_SIZE, ahd->sc_dmaflags, &hscb_map->dmamap, (caddr_t *)&hscb_map->vaddr, - &hscb_map->physaddr, + &hscb_map->busaddr, &hscb_map->dmasegs, &hscb_map->nseg, ahd_name(ahd), "hardware SCB structures") < 0) { @@ -5949,7 +5949,7 @@ ahd_alloc_scbs(struct ahd_softc *ahd) SLIST_INSERT_HEAD(&scb_data->hscb_maps, hscb_map, links); hscb = (struct hardware_scb *)hscb_map->vaddr; - hscb_busaddr = hscb_map->physaddr; + hscb_busaddr = hscb_map->busaddr; scb_data->scbs_left = PAGE_SIZE / sizeof(*hscb); } @@ -5962,7 +5962,7 @@ ahd_alloc_scbs(struct ahd_softc *ahd) - scb_data->sgs_left) * ahd_sglist_size(ahd); sg_map = SLIST_FIRST(&scb_data->sg_maps); segs = sg_map->vaddr + offset; - sg_busaddr = sg_map->physaddr + offset; + sg_busaddr = sg_map->busaddr + offset; } else { sg_map = malloc(sizeof(*sg_map), M_DEVBUF, M_NOWAIT); @@ -5974,7 +5974,7 @@ ahd_alloc_scbs(struct ahd_softc *ahd) /* Allocate the next batch of S/G lists */ if (ahd_createdmamem(ahd->parent_dmat, ahd_sglist_allocsize(ahd), ahd->sc_dmaflags, &sg_map->dmamap, (caddr_t *)&sg_map->vaddr, - &sg_map->physaddr, &sg_map->dmasegs, + &sg_map->busaddr, &sg_map->dmasegs, &sg_map->nseg, ahd_name(ahd), "SG data structures") < 0) { free(sg_map, M_DEVBUF); @@ -5984,7 +5984,7 @@ ahd_alloc_scbs(struct ahd_softc *ahd) SLIST_INSERT_HEAD(&scb_data->sg_maps, sg_map, links); segs = sg_map->vaddr; - sg_busaddr = sg_map->physaddr; + sg_busaddr = sg_map->busaddr; scb_data->sgs_left = ahd_sglist_allocsize(ahd) / ahd_sglist_size(ahd); #ifdef AHD_DEBUG @@ -6001,7 +6001,7 @@ ahd_alloc_scbs(struct ahd_softc *ahd) offset = PAGE_SIZE - (AHD_SENSE_BUFSIZE * scb_data->sense_left); sense_map = SLIST_FIRST(&scb_data->sense_maps); sense_data = sense_map->vaddr + offset; - sense_busaddr = sense_map->physaddr + offset; + sense_busaddr = sense_map->busaddr + offset; } else { sense_map = malloc(sizeof(*sense_map), M_DEVBUF, M_NOWAIT); @@ -6013,7 +6013,7 @@ ahd_alloc_scbs(struct ahd_softc *ahd) /* Allocate the next batch of sense buffers */ if (ahd_createdmamem(ahd->parent_dmat, PAGE_SIZE, ahd->sc_dmaflags, &sense_map->dmamap, (caddr_t *)&sense_map->vaddr, - &sense_map->physaddr, &sense_map->dmasegs, + &sense_map->busaddr, &sense_map->dmasegs, &sense_map->nseg, ahd_name(ahd), "Sense Data structures") < 0) { free(sense_map, M_DEVBUF); @@ -6023,7 +6023,7 @@ ahd_alloc_scbs(struct ahd_softc *ahd) SLIST_INSERT_HEAD(&scb_data->sense_maps, sense_map, links); sense_data = sense_map->vaddr; - sense_busaddr = sense_map->physaddr; + sense_busaddr = sense_map->busaddr; scb_data->sense_left = PAGE_SIZE / AHD_SENSE_BUFSIZE; #ifdef AHD_DEBUG if (ahd_debug & AHD_SHOW_MEMORY) @@ -6204,7 +6204,7 @@ ahd_init(struct ahd_softc *ahd) if (ahd_createdmamem(ahd->parent_dmat, ahd->shared_data_size, ahd->sc_dmaflags, &ahd->shared_data_map.dmamap, (caddr_t *)&ahd->shared_data_map.vaddr, - &ahd->shared_data_map.physaddr, &ahd->shared_data_map.dmasegs, + &ahd->shared_data_map.busaddr, &ahd->shared_data_map.dmasegs, &ahd->shared_data_map.nseg, ahd_name(ahd), "shared data") < 0) return (ENOMEM); @@ -6213,7 +6213,7 @@ ahd_init(struct ahd_softc *ahd) ahd->init_level++; next_vaddr = (uint8_t *)&ahd->qoutfifo[AHD_QOUT_SIZE]; - next_baddr = ahd->shared_data_map.physaddr + next_baddr = ahd->shared_data_map.busaddr + AHD_QOUT_SIZE*sizeof(struct ahd_completion); if ((ahd->features & AHD_TARGETMODE) != 0) { ahd->targetcmds = (struct target_cmd *)next_vaddr; @@ -6593,7 +6593,7 @@ ahd_chip_init(struct ahd_softc *ahd) /* * Tell the sequencer where it can find our arrays in memory. */ - busaddr = ahd->shared_data_map.physaddr; + busaddr = ahd->shared_data_map.busaddr; ahd_outl(ahd, SHARED_DATA_ADDR, busaddr); ahd_outl(ahd, QOUTFIFO_NEXT_ADDR, busaddr); @@ -8045,7 +8045,7 @@ ahd_handle_scsi_status(struct ahd_softc *ahd, struct scb *scb) { struct ahd_devinfo devinfo; struct ahd_dma_seg *sg; - struct scsipi_sense *sc; + struct scsi_sense *sc; struct ahd_initiator_tinfo *targ_info; struct ahd_tmode_tstate *tstate; struct ahd_transinfo *tinfo; @@ -8072,7 +8072,7 @@ ahd_handle_scsi_status(struct ahd_softc *ahd, struct scb *scb) &tstate); tinfo = &targ_info->curr; sg = scb->sg_list; - sc = (struct scsipi_sense *)hscb->shared_data.idata.cdb; + sc = (struct scsi_sense *)hscb->shared_data.idata.cdb; /* * Save off the residual if there is one. */ diff --git a/sys/dev/ic/aic79xx.h b/sys/dev/ic/aic79xx.h index 2e3cba3741d..143d85d8787 100644 --- a/sys/dev/ic/aic79xx.h +++ b/sys/dev/ic/aic79xx.h @@ -1,4 +1,4 @@ -/* $OpenBSD: aic79xx.h,v 1.8 2004/10/24 22:07:38 krw Exp $ */ +/* $OpenBSD: aic79xx.h,v 1.9 2004/10/24 23:03:01 krw Exp $ */ /* * Copyright (c) 2004 Milos Urbanek, Kenneth R. Westerback & Marco Peereboom @@ -583,7 +583,7 @@ struct ahd_dma64_seg { struct map_node { bus_dmamap_t dmamap; - bus_addr_t physaddr; + bus_addr_t busaddr; uint8_t *vaddr; bus_dma_segment_t dmasegs; int nseg; @@ -665,16 +665,18 @@ struct scb { #define pending_links links2.le #define collision_links links2.le struct scb *col_scb; - struct scsipi_xfer *xs; + struct scsi_xfer *xs; struct ahd_softc *ahd_softc; scb_flag flags; +#ifndef __linux__ bus_dmamap_t dmamap; +#endif struct scb_platform_data *platform_data; struct map_node *hscb_map; struct map_node *sg_map; struct map_node *sense_map; - void *sg_list; + void *sg_list; uint8_t *sense_data; bus_addr_t sg_list_busaddr; bus_addr_t sense_busaddr; @@ -712,7 +714,6 @@ struct scb_data { SLIST_HEAD(, map_node) hscb_maps; SLIST_HEAD(, map_node) sg_maps; SLIST_HEAD(, map_node) sense_maps; - int scbs_left; /* unallocated scbs in head map_node */ int sgs_left; /* unallocated sgs in head map_node */ int sense_left; /* unallocated sense in head map_node */ @@ -1104,15 +1105,15 @@ struct ahd_completion struct ahd_softc { struct device sc_dev; - struct scsipi_channel sc_channel; + struct scsi_link sc_channel; struct device * sc_child; - struct scsipi_adapter sc_adapter; + struct scsi_adapter sc_adapter; bus_space_tag_t tags[2]; bus_space_handle_t bshs[2]; #ifndef __linux__ - bus_dma_tag_t buffer_dmat; /* dmat for buffer I/O */ + bus_dma_tag_t buffer_dmat; /* dmat for buffer I/O */ #endif void *shutdown_hook; struct scb_data scb_data; @@ -1382,25 +1383,13 @@ struct ahd_pci_identity { extern struct ahd_pci_identity ahd_pci_ident_table []; extern const u_int ahd_num_pci_devs; -/***************************** VL/EISA Declarations ***************************/ -struct aic7770_identity { - uint32_t full_id; - uint32_t id_mask; - char *name; - ahd_device_setup_t *setup; -}; -extern struct aic7770_identity aic7770_ident_table []; -extern const int ahd_num_aic7770_devs; - -#define AHD_EISA_SLOT_OFFSET 0xc00 -#define AHD_EISA_IOSIZE 0x100 - /*************************** Function Declarations ****************************/ /******************************************************************************/ -void ahd_reset_cmds_pending(struct ahd_softc *ahd); -u_int ahd_find_busy_tcl(struct ahd_softc *ahd, u_int tcl); -void ahd_busy_tcl(struct ahd_softc *ahd, u_int tcl, u_int busyid); -void ahd_unbusy_tcl(struct ahd_softc *, u_int); +void ahd_reset_cmds_pending(struct ahd_softc *ahd); +u_int ahd_find_busy_tcl(struct ahd_softc *ahd, u_int tcl); +void ahd_busy_tcl(struct ahd_softc *ahd, + u_int tcl, u_int busyid); +void ahd_unbusy_tcl(struct ahd_softc *ahd, u_int tcl); /***************************** PCI Front End *********************************/ const struct ahd_pci_identity * ahd_find_pci_device(pcireg_t, pcireg_t); @@ -1570,24 +1559,24 @@ cam_status ahd_find_tmode_devs(struct ahd_softc *ahd, #ifdef AHD_DEBUG extern uint32_t ahd_debug; #define AHD_DEBUG_OPTS 0 -#define AHD_SHOW_MISC 0x00001 -#define AHD_SHOW_SENSE 0x00002 -#define AHD_SHOW_RECOVERY 0x00004 -#define AHD_DUMP_SEEPROM 0x00008 -#define AHD_SHOW_TERMCTL 0x00010 -#define AHD_SHOW_MEMORY 0x00020 -#define AHD_SHOW_MESSAGES 0x00040 -#define AHD_SHOW_MODEPTR 0x00080 -#define AHD_SHOW_SELTO 0x00100 -#define AHD_SHOW_FIFOS 0x00200 -#define AHD_SHOW_QFULL 0x00400 -#define AHD_SHOW_DV 0x00800 -#define AHD_SHOW_MASKED_ERRORS 0x01000 -#define AHD_SHOW_QUEUE 0x02000 -#define AHD_SHOW_TQIN 0x04000 -#define AHD_SHOW_SG 0x08000 -#define AHD_SHOW_INT_COALESCING 0x10000 -#define AHD_DEBUG_SEQUENCER 0x20000 +#define AHD_SHOW_MISC 0x00001 +#define AHD_SHOW_SENSE 0x00002 +#define AHD_SHOW_RECOVERY 0x00004 +#define AHD_DUMP_SEEPROM 0x00008 +#define AHD_SHOW_TERMCTL 0x00010 +#define AHD_SHOW_MEMORY 0x00020 +#define AHD_SHOW_MESSAGES 0x00040 +#define AHD_SHOW_MODEPTR 0x00080 +#define AHD_SHOW_SELTO 0x00100 +#define AHD_SHOW_FIFOS 0x00200 +#define AHD_SHOW_QFULL 0x00400 +#define AHD_SHOW_DV 0x00800 +#define AHD_SHOW_MASKED_ERRORS 0x01000 +#define AHD_SHOW_QUEUE 0x02000 +#define AHD_SHOW_TQIN 0x04000 +#define AHD_SHOW_SG 0x08000 +#define AHD_SHOW_INT_COALESCING 0x10000 +#define AHD_DEBUG_SEQUENCER 0x20000 #endif void ahd_print_scb(struct scb *scb); void ahd_print_devinfo(struct ahd_softc *ahd, |