Lines Matching refs:scb_data

2976 	for (i = 0; i < ahd->scb_data.maxhscbs; i++) {  in ahd_update_pending_scbs()
5176 for (i = 0; i < ahd->scb_data.maxhscbs; i++) { in ahd_initialize_hscbs()
5190 struct scb_data *scb_data; in ahd_init_scbdata() local
5193 scb_data = &ahd->scb_data; in ahd_init_scbdata()
5194 TAILQ_INIT(&scb_data->free_scbs); in ahd_init_scbdata()
5196 LIST_INIT(&scb_data->free_scb_lists[i]); in ahd_init_scbdata()
5197 LIST_INIT(&scb_data->any_dev_free_scb_list); in ahd_init_scbdata()
5198 SLIST_INIT(&scb_data->hscb_maps); in ahd_init_scbdata()
5199 SLIST_INIT(&scb_data->sg_maps); in ahd_init_scbdata()
5200 SLIST_INIT(&scb_data->sense_maps); in ahd_init_scbdata()
5203 scb_data->maxhscbs = ahd_probe_scbs(ahd); in ahd_init_scbdata()
5204 if (scb_data->maxhscbs == 0) { in ahd_init_scbdata()
5229 /*flags*/0, &scb_data->hscb_dmat) != 0) { in ahd_init_scbdata()
5233 scb_data->init_level++; in ahd_init_scbdata()
5243 /*flags*/0, &scb_data->sg_dmat) != 0) { in ahd_init_scbdata()
5252 scb_data->init_level++; in ahd_init_scbdata()
5262 /*flags*/0, &scb_data->sense_dmat) != 0) { in ahd_init_scbdata()
5266 scb_data->init_level++; in ahd_init_scbdata()
5271 if (scb_data->numscbs == 0) { in ahd_init_scbdata()
5304 TAILQ_FOREACH(scb, &ahd->scb_data.free_scbs, links.tqe) { in ahd_find_scb_by_tag()
5318 LIST_FOREACH(scb, &ahd->scb_data.any_dev_free_scb_list, links.le) { in ahd_find_scb_by_tag()
5329 struct scb_data *scb_data; in ahd_fini_scbdata() local
5331 scb_data = &ahd->scb_data; in ahd_fini_scbdata()
5332 if (scb_data == NULL) in ahd_fini_scbdata()
5335 switch (scb_data->init_level) { in ahd_fini_scbdata()
5341 while ((sns_map = SLIST_FIRST(&scb_data->sense_maps)) != NULL) { in ahd_fini_scbdata()
5342 SLIST_REMOVE_HEAD(&scb_data->sense_maps, links); in ahd_fini_scbdata()
5343 ahd_dmamap_unload(ahd, scb_data->sense_dmat, in ahd_fini_scbdata()
5345 ahd_dmamem_free(ahd, scb_data->sense_dmat, in ahd_fini_scbdata()
5349 ahd_dma_tag_destroy(ahd, scb_data->sense_dmat); in ahd_fini_scbdata()
5356 while ((sg_map = SLIST_FIRST(&scb_data->sg_maps)) != NULL) { in ahd_fini_scbdata()
5357 SLIST_REMOVE_HEAD(&scb_data->sg_maps, links); in ahd_fini_scbdata()
5358 ahd_dmamap_unload(ahd, scb_data->sg_dmat, in ahd_fini_scbdata()
5360 ahd_dmamem_free(ahd, scb_data->sg_dmat, in ahd_fini_scbdata()
5364 ahd_dma_tag_destroy(ahd, scb_data->sg_dmat); in ahd_fini_scbdata()
5371 while ((hscb_map = SLIST_FIRST(&scb_data->hscb_maps)) != NULL) { in ahd_fini_scbdata()
5372 SLIST_REMOVE_HEAD(&scb_data->hscb_maps, links); in ahd_fini_scbdata()
5373 ahd_dmamap_unload(ahd, scb_data->hscb_dmat, in ahd_fini_scbdata()
5375 ahd_dmamem_free(ahd, scb_data->hscb_dmat, in ahd_fini_scbdata()
5379 ahd_dma_tag_destroy(ahd, scb_data->hscb_dmat); in ahd_fini_scbdata()
5449 free_list = &ahd->scb_data.free_scb_lists[col_idx]; in ahd_add_col_list()
5450 free_tailq = &ahd->scb_data.free_scbs; in ahd_add_col_list()
5470 free_list = &ahd->scb_data.free_scb_lists[col_idx]; in ahd_rem_col_list()
5471 free_tailq = &ahd->scb_data.free_scbs; in ahd_rem_col_list()
5502 TAILQ_FOREACH(scb, &ahd->scb_data.free_scbs, links.tqe) { in ahd_get_scb()
5508 if ((scb = LIST_FIRST(&ahd->scb_data.any_dev_free_scb_list)) == NULL) { in ahd_get_scb()
5537 ahd->scb_data.scbindex[SCB_GET_TAG(scb)] = NULL; in ahd_free_scb()
5544 LIST_INSERT_HEAD(&ahd->scb_data.any_dev_free_scb_list, in ahd_free_scb()
5554 LIST_INSERT_HEAD(&ahd->scb_data.any_dev_free_scb_list, in ahd_free_scb()
5556 LIST_INSERT_HEAD(&ahd->scb_data.any_dev_free_scb_list, in ahd_free_scb()
5576 LIST_INSERT_HEAD(&ahd->scb_data.any_dev_free_scb_list, in ahd_free_scb()
5586 struct scb_data *scb_data; in ahd_alloc_scbs() local
5600 scb_data = &ahd->scb_data; in ahd_alloc_scbs()
5601 if (scb_data->numscbs >= AHD_SCB_MAX_ALLOC) in ahd_alloc_scbs()
5605 if (scb_data->scbs_left != 0) { in ahd_alloc_scbs()
5608 offset = (PAGE_SIZE / sizeof(*hscb)) - scb_data->scbs_left; in ahd_alloc_scbs()
5609 hscb_map = SLIST_FIRST(&scb_data->hscb_maps); in ahd_alloc_scbs()
5619 if (ahd_dmamem_alloc(ahd, scb_data->hscb_dmat, in ahd_alloc_scbs()
5626 SLIST_INSERT_HEAD(&scb_data->hscb_maps, hscb_map, links); in ahd_alloc_scbs()
5628 ahd_dmamap_load(ahd, scb_data->hscb_dmat, hscb_map->dmamap, in ahd_alloc_scbs()
5634 scb_data->scbs_left = PAGE_SIZE / sizeof(*hscb); in ahd_alloc_scbs()
5637 if (scb_data->sgs_left != 0) { in ahd_alloc_scbs()
5641 - scb_data->sgs_left) * ahd_sglist_size(ahd); in ahd_alloc_scbs()
5642 sg_map = SLIST_FIRST(&scb_data->sg_maps); in ahd_alloc_scbs()
5652 if (ahd_dmamem_alloc(ahd, scb_data->sg_dmat, in ahd_alloc_scbs()
5659 SLIST_INSERT_HEAD(&scb_data->sg_maps, sg_map, links); in ahd_alloc_scbs()
5661 ahd_dmamap_load(ahd, scb_data->sg_dmat, sg_map->dmamap, in ahd_alloc_scbs()
5667 scb_data->sgs_left = in ahd_alloc_scbs()
5675 if (scb_data->sense_left != 0) { in ahd_alloc_scbs()
5678 offset = PAGE_SIZE - (AHD_SENSE_BUFSIZE * scb_data->sense_left); in ahd_alloc_scbs()
5679 sense_map = SLIST_FIRST(&scb_data->sense_maps); in ahd_alloc_scbs()
5689 if (ahd_dmamem_alloc(ahd, scb_data->sense_dmat, in ahd_alloc_scbs()
5696 SLIST_INSERT_HEAD(&scb_data->sense_maps, sense_map, links); in ahd_alloc_scbs()
5698 ahd_dmamap_load(ahd, scb_data->sense_dmat, sense_map->dmamap, in ahd_alloc_scbs()
5704 scb_data->sense_left = PAGE_SIZE / AHD_SENSE_BUFSIZE; in ahd_alloc_scbs()
5711 newcount = MIN(scb_data->sense_left, scb_data->scbs_left); in ahd_alloc_scbs()
5712 newcount = MIN(newcount, scb_data->sgs_left); in ahd_alloc_scbs()
5713 newcount = MIN(newcount, (AHD_SCB_MAX_ALLOC - scb_data->numscbs)); in ahd_alloc_scbs()
5714 scb_data->sense_left -= newcount; in ahd_alloc_scbs()
5715 scb_data->scbs_left -= newcount; in ahd_alloc_scbs()
5716 scb_data->sgs_left -= newcount; in ahd_alloc_scbs()
5767 next_scb->hscb->tag = ahd_htole16(scb_data->numscbs); in ahd_alloc_scbs()
5768 col_tag = scb_data->numscbs ^ 0x100; in ahd_alloc_scbs()
5779 scb_data->numscbs++; in ahd_alloc_scbs()
5804 ahd->scb_data.maxhscbs); in ahd_controller_info()
7082 if (scbid >= ahd->scb_data.numscbs) { in ahd_search_qinfifo()
7085 ahd_name(ahd), scbid, ahd->scb_data.numscbs); in ahd_search_qinfifo()
7141 if (scbid >= ahd->scb_data.numscbs) { in ahd_search_scb_list()
7144 ahd_name(ahd), scbid, ahd->scb_data.numscbs); in ahd_search_scb_list()
8530 ahd->scb_data.numscbs, ahd_inw(ahd, CMDS_PENDING), in ahd_dump_card_state()
8554 TAILQ_FOREACH(scb, &ahd->scb_data.free_scbs, links.tqe) { in ahd_dump_card_state()
8564 LIST_FOREACH(scb, &ahd->scb_data.any_dev_free_scb_list, links.le) { in ahd_dump_card_state()