aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aic7xxx/aic79xx_core.c
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2006-01-12 06:05:46 -0500
committerJames Bottomley <jejb@mulgrave.(none)>2006-01-12 13:00:34 -0500
commit66a0683e4620f087e41e79d4d2be6c5a06bb206b (patch)
tree09f5b125da1bda61a582212f6ca1b2265f5b34f5 /drivers/scsi/aic7xxx/aic79xx_core.c
parent5e46631b04382ef14255467288052f29cb77daeb (diff)
[SCSI] aic79xx: Use struct map_node
Use struct map_node instead of separate variables. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/aic7xxx/aic79xx_core.c')
-rw-r--r--drivers/scsi/aic7xxx/aic79xx_core.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/drivers/scsi/aic7xxx/aic79xx_core.c b/drivers/scsi/aic7xxx/aic79xx_core.c
index 4e8f00df978d..55c44bf54050 100644
--- a/drivers/scsi/aic7xxx/aic79xx_core.c
+++ b/drivers/scsi/aic7xxx/aic79xx_core.c
@@ -5203,13 +5203,13 @@ ahd_free(struct ahd_softc *ahd)
5203 /* FALLTHROUGH */ 5203 /* FALLTHROUGH */
5204 case 4: 5204 case 4:
5205 ahd_dmamap_unload(ahd, ahd->shared_data_dmat, 5205 ahd_dmamap_unload(ahd, ahd->shared_data_dmat,
5206 ahd->shared_data_dmamap); 5206 ahd->shared_data_map.dmamap);
5207 /* FALLTHROUGH */ 5207 /* FALLTHROUGH */
5208 case 3: 5208 case 3:
5209 ahd_dmamem_free(ahd, ahd->shared_data_dmat, ahd->qoutfifo, 5209 ahd_dmamem_free(ahd, ahd->shared_data_dmat, ahd->qoutfifo,
5210 ahd->shared_data_dmamap); 5210 ahd->shared_data_map.dmamap);
5211 ahd_dmamap_destroy(ahd, ahd->shared_data_dmat, 5211 ahd_dmamap_destroy(ahd, ahd->shared_data_dmat,
5212 ahd->shared_data_dmamap); 5212 ahd->shared_data_map.dmamap);
5213 /* FALLTHROUGH */ 5213 /* FALLTHROUGH */
5214 case 2: 5214 case 2:
5215 ahd_dma_tag_destroy(ahd, ahd->shared_data_dmat); 5215 ahd_dma_tag_destroy(ahd, ahd->shared_data_dmat);
@@ -6088,7 +6088,6 @@ static const char *termstat_strings[] = {
6088int 6088int
6089ahd_init(struct ahd_softc *ahd) 6089ahd_init(struct ahd_softc *ahd)
6090{ 6090{
6091 uint8_t *base_vaddr;
6092 uint8_t *next_vaddr; 6091 uint8_t *next_vaddr;
6093 dma_addr_t next_baddr; 6092 dma_addr_t next_baddr;
6094 size_t driver_data_size; 6093 size_t driver_data_size;
@@ -6178,20 +6177,23 @@ ahd_init(struct ahd_softc *ahd)
6178 6177
6179 /* Allocation of driver data */ 6178 /* Allocation of driver data */
6180 if (ahd_dmamem_alloc(ahd, ahd->shared_data_dmat, 6179 if (ahd_dmamem_alloc(ahd, ahd->shared_data_dmat,
6181 (void **)&base_vaddr, 6180 (void **)&ahd->shared_data_map.vaddr,
6182 BUS_DMA_NOWAIT, &ahd->shared_data_dmamap) != 0) { 6181 BUS_DMA_NOWAIT,
6182 &ahd->shared_data_map.dmamap) != 0) {
6183 return (ENOMEM); 6183 return (ENOMEM);
6184 } 6184 }
6185 6185
6186 ahd->init_level++; 6186 ahd->init_level++;
6187 6187
6188 /* And permanently map it in */ 6188 /* And permanently map it in */
6189 ahd_dmamap_load(ahd, ahd->shared_data_dmat, ahd->shared_data_dmamap, 6189 ahd_dmamap_load(ahd, ahd->shared_data_dmat, ahd->shared_data_map.dmamap,
6190 base_vaddr, driver_data_size, ahd_dmamap_cb, 6190 ahd->shared_data_map.vaddr, driver_data_size,
6191 &ahd->shared_data_busaddr, /*flags*/0); 6191 ahd_dmamap_cb, &ahd->shared_data_map.physaddr,
6192 ahd->qoutfifo = (uint16_t *)base_vaddr; 6192 /*flags*/0);
6193 ahd->qoutfifo = (uint16_t *)ahd->shared_data_map.vaddr;
6193 next_vaddr = (uint8_t *)&ahd->qoutfifo[AHD_QOUT_SIZE]; 6194 next_vaddr = (uint8_t *)&ahd->qoutfifo[AHD_QOUT_SIZE];
6194 next_baddr = ahd->shared_data_busaddr + AHD_QOUT_SIZE*sizeof(uint16_t); 6195 next_baddr = ahd->shared_data_map.physaddr
6196 + AHD_QOUT_SIZE*sizeof(uint16_t);
6195 if ((ahd->features & AHD_TARGETMODE) != 0) { 6197 if ((ahd->features & AHD_TARGETMODE) != 0) {
6196 ahd->targetcmds = (struct target_cmd *)next_vaddr; 6198 ahd->targetcmds = (struct target_cmd *)next_vaddr;
6197 next_vaddr += AHD_TMODE_CMDS * sizeof(struct target_cmd); 6199 next_vaddr += AHD_TMODE_CMDS * sizeof(struct target_cmd);
@@ -6212,6 +6214,7 @@ ahd_init(struct ahd_softc *ahd)
6212 * specially from the DMA safe memory chunk used for the QOUTFIFO. 6214 * specially from the DMA safe memory chunk used for the QOUTFIFO.
6213 */ 6215 */
6214 ahd->next_queued_hscb = (struct hardware_scb *)next_vaddr; 6216 ahd->next_queued_hscb = (struct hardware_scb *)next_vaddr;
6217 ahd->next_queued_hscb_map = &ahd->shared_data_map;
6215 ahd->next_queued_hscb->hscb_busaddr = ahd_htole32(next_baddr); 6218 ahd->next_queued_hscb->hscb_busaddr = ahd_htole32(next_baddr);
6216 6219
6217 ahd->init_level++; 6220 ahd->init_level++;
@@ -6557,12 +6560,13 @@ ahd_chip_init(struct ahd_softc *ahd)
6557 /* 6560 /*
6558 * The Freeze Count is 0. 6561 * The Freeze Count is 0.
6559 */ 6562 */
6563 ahd->qfreeze_cnt = 0;
6560 ahd_outw(ahd, QFREEZE_COUNT, 0); 6564 ahd_outw(ahd, QFREEZE_COUNT, 0);
6561 6565
6562 /* 6566 /*
6563 * Tell the sequencer where it can find our arrays in memory. 6567 * Tell the sequencer where it can find our arrays in memory.
6564 */ 6568 */
6565 busaddr = ahd->shared_data_busaddr; 6569 busaddr = ahd->shared_data_map.physaddr;
6566 ahd_outb(ahd, SHARED_DATA_ADDR, busaddr & 0xFF); 6570 ahd_outb(ahd, SHARED_DATA_ADDR, busaddr & 0xFF);
6567 ahd_outb(ahd, SHARED_DATA_ADDR + 1, (busaddr >> 8) & 0xFF); 6571 ahd_outb(ahd, SHARED_DATA_ADDR + 1, (busaddr >> 8) & 0xFF);
6568 ahd_outb(ahd, SHARED_DATA_ADDR + 2, (busaddr >> 16) & 0xFF); 6572 ahd_outb(ahd, SHARED_DATA_ADDR + 2, (busaddr >> 16) & 0xFF);
@@ -9651,7 +9655,7 @@ ahd_run_tqinfifo(struct ahd_softc *ahd, int paused)
9651 9655
9652 cmd->cmd_valid = 0; 9656 cmd->cmd_valid = 0;
9653 ahd_dmamap_sync(ahd, ahd->shared_data_dmat, 9657 ahd_dmamap_sync(ahd, ahd->shared_data_dmat,
9654 ahd->shared_data_dmamap, 9658 ahd->shared_data_map.dmamap,
9655 ahd_targetcmd_offset(ahd, ahd->tqinfifonext), 9659 ahd_targetcmd_offset(ahd, ahd->tqinfifonext),
9656 sizeof(struct target_cmd), 9660 sizeof(struct target_cmd),
9657 BUS_DMASYNC_PREREAD); 9661 BUS_DMASYNC_PREREAD);