Lines Matching refs:scb_data
390 return (ahc->scb_data->hscb_busaddr in ahc_hscb_busaddr()
397 ahc_dmamap_sync(ahc, ahc->scb_data->hscb_dmat, in ahc_sync_scb()
398 ahc->scb_data->hscb_dmamap, in ahc_sync_scb()
409 ahc_dmamap_sync(ahc, ahc->scb_data->sg_dmat, scb->sg_map->sg_dmamap, in ahc_sync_sglist()
524 if ((scb = SLIST_FIRST(&ahc->scb_data->free_scbs)) == NULL) { in ahc_get_scb()
526 scb = SLIST_FIRST(&ahc->scb_data->free_scbs); in ahc_get_scb()
530 SLIST_REMOVE_HEAD(&ahc->scb_data->free_scbs, links.sle); in ahc_get_scb()
544 ahc->scb_data->scbindex[hscb->tag] = NULL; in ahc_free_scb()
548 SLIST_INSERT_HEAD(&ahc->scb_data->free_scbs, scb, links.sle); in ahc_free_scb()
559 scb = ahc->scb_data->scbindex[tag]; in ahc_lookup_scb()
600 ahc->scb_data->scbindex[scb->hscb->tag] = scb; in ahc_swap_with_next_hscb()
651 offset = scb - ahc->scb_data->scbarray; in ahc_get_sense_buf()
652 return (&ahc->scb_data->sense[offset]); in ahc_get_sense_buf()
660 offset = scb - ahc->scb_data->scbarray; in ahc_get_sense_bufaddr()
661 return (ahc->scb_data->sense_busaddr in ahc_get_sense_bufaddr()
1480 ahc->scb_data->hscbs[scbptr].tag); in ahc_handle_seqint()
2718 for (i = 0; i < ahc->scb_data->maxhscbs; i++) { in ahc_update_pending_scbs()
4435 if (ahc->scb_data == NULL) { in ahc_softc_init()
4436 ahc->scb_data = kzalloc(sizeof(*ahc->scb_data), GFP_ATOMIC); in ahc_softc_init()
4437 if (ahc->scb_data == NULL) in ahc_softc_init()
4690 for (i = 0; i < ahc->scb_data->maxhscbs; i++) { in ahc_build_free_scb_list()
4734 struct scb_data *scb_data; in ahc_init_scbdata() local
4736 scb_data = ahc->scb_data; in ahc_init_scbdata()
4737 SLIST_INIT(&scb_data->free_scbs); in ahc_init_scbdata()
4738 SLIST_INIT(&scb_data->sg_maps); in ahc_init_scbdata()
4741 scb_data->scbarray = kcalloc(AHC_SCB_MAX_ALLOC, sizeof(struct scb), in ahc_init_scbdata()
4743 if (scb_data->scbarray == NULL) in ahc_init_scbdata()
4748 scb_data->maxhscbs = ahc_probe_scbs(ahc); in ahc_init_scbdata()
4749 if (ahc->scb_data->maxhscbs == 0) { in ahc_init_scbdata()
4773 /*flags*/0, &scb_data->hscb_dmat) != 0) { in ahc_init_scbdata()
4777 scb_data->init_level++; in ahc_init_scbdata()
4780 if (ahc_dmamem_alloc(ahc, scb_data->hscb_dmat, in ahc_init_scbdata()
4781 (void **)&scb_data->hscbs, in ahc_init_scbdata()
4782 BUS_DMA_NOWAIT, &scb_data->hscb_dmamap) != 0) { in ahc_init_scbdata()
4786 scb_data->init_level++; in ahc_init_scbdata()
4789 ahc_dmamap_load(ahc, scb_data->hscb_dmat, scb_data->hscb_dmamap, in ahc_init_scbdata()
4790 scb_data->hscbs, in ahc_init_scbdata()
4792 ahc_dmamap_cb, &scb_data->hscb_busaddr, /*flags*/0); in ahc_init_scbdata()
4794 scb_data->init_level++; in ahc_init_scbdata()
4805 /*flags*/0, &scb_data->sense_dmat) != 0) { in ahc_init_scbdata()
4809 scb_data->init_level++; in ahc_init_scbdata()
4812 if (ahc_dmamem_alloc(ahc, scb_data->sense_dmat, in ahc_init_scbdata()
4813 (void **)&scb_data->sense, in ahc_init_scbdata()
4814 BUS_DMA_NOWAIT, &scb_data->sense_dmamap) != 0) { in ahc_init_scbdata()
4818 scb_data->init_level++; in ahc_init_scbdata()
4821 ahc_dmamap_load(ahc, scb_data->sense_dmat, scb_data->sense_dmamap, in ahc_init_scbdata()
4822 scb_data->sense, in ahc_init_scbdata()
4824 ahc_dmamap_cb, &scb_data->sense_busaddr, /*flags*/0); in ahc_init_scbdata()
4826 scb_data->init_level++; in ahc_init_scbdata()
4836 /*flags*/0, &scb_data->sg_dmat) != 0) { in ahc_init_scbdata()
4840 scb_data->init_level++; in ahc_init_scbdata()
4843 memset(scb_data->hscbs, 0, in ahc_init_scbdata()
4847 if (scb_data->numscbs == 0) { in ahc_init_scbdata()
4872 struct scb_data *scb_data; in ahc_fini_scbdata() local
4874 scb_data = ahc->scb_data; in ahc_fini_scbdata()
4875 if (scb_data == NULL) in ahc_fini_scbdata()
4878 switch (scb_data->init_level) { in ahc_fini_scbdata()
4884 while ((sg_map = SLIST_FIRST(&scb_data->sg_maps))!= NULL) { in ahc_fini_scbdata()
4885 SLIST_REMOVE_HEAD(&scb_data->sg_maps, links); in ahc_fini_scbdata()
4886 ahc_dmamap_unload(ahc, scb_data->sg_dmat, in ahc_fini_scbdata()
4888 ahc_dmamem_free(ahc, scb_data->sg_dmat, in ahc_fini_scbdata()
4893 ahc_dma_tag_destroy(ahc, scb_data->sg_dmat); in ahc_fini_scbdata()
4897 ahc_dmamap_unload(ahc, scb_data->sense_dmat, in ahc_fini_scbdata()
4898 scb_data->sense_dmamap); in ahc_fini_scbdata()
4901 ahc_dmamem_free(ahc, scb_data->sense_dmat, scb_data->sense, in ahc_fini_scbdata()
4902 scb_data->sense_dmamap); in ahc_fini_scbdata()
4903 ahc_dmamap_destroy(ahc, scb_data->sense_dmat, in ahc_fini_scbdata()
4904 scb_data->sense_dmamap); in ahc_fini_scbdata()
4907 ahc_dma_tag_destroy(ahc, scb_data->sense_dmat); in ahc_fini_scbdata()
4910 ahc_dmamap_unload(ahc, scb_data->hscb_dmat, in ahc_fini_scbdata()
4911 scb_data->hscb_dmamap); in ahc_fini_scbdata()
4914 ahc_dmamem_free(ahc, scb_data->hscb_dmat, scb_data->hscbs, in ahc_fini_scbdata()
4915 scb_data->hscb_dmamap); in ahc_fini_scbdata()
4916 ahc_dmamap_destroy(ahc, scb_data->hscb_dmat, in ahc_fini_scbdata()
4917 scb_data->hscb_dmamap); in ahc_fini_scbdata()
4920 ahc_dma_tag_destroy(ahc, scb_data->hscb_dmat); in ahc_fini_scbdata()
4925 kfree(scb_data->scbarray); in ahc_fini_scbdata()
4931 struct scb_data *scb_data; in ahc_alloc_scbs() local
4939 scb_data = ahc->scb_data; in ahc_alloc_scbs()
4940 if (scb_data->numscbs >= AHC_SCB_MAX_ALLOC) in ahc_alloc_scbs()
4944 next_scb = &scb_data->scbarray[scb_data->numscbs]; in ahc_alloc_scbs()
4952 if (ahc_dmamem_alloc(ahc, scb_data->sg_dmat, in ahc_alloc_scbs()
4959 SLIST_INSERT_HEAD(&scb_data->sg_maps, sg_map, links); in ahc_alloc_scbs()
4961 ahc_dmamap_load(ahc, scb_data->sg_dmat, sg_map->sg_dmamap, in ahc_alloc_scbs()
4969 newcount = min(newcount, (AHC_SCB_MAX_ALLOC - scb_data->numscbs)); in ahc_alloc_scbs()
4986 next_scb->hscb = &scb_data->hscbs[scb_data->numscbs]; in ahc_alloc_scbs()
4987 next_scb->hscb->tag = ahc->scb_data->numscbs; in ahc_alloc_scbs()
4988 SLIST_INSERT_HEAD(&ahc->scb_data->free_scbs, in ahc_alloc_scbs()
4993 ahc->scb_data->numscbs++; in ahc_alloc_scbs()
5033 ahc->scb_data->maxhscbs, AHC_MAX_QUEUE); in ahc_controller_info()
5035 sprintf(buf, "%d SCBs", ahc->scb_data->maxhscbs); in ahc_controller_info()
5116 physaddr = ahc->scb_data->hscb_busaddr; in ahc_chip_init()
5343 if (ahc->scb_data->maxhscbs == 0) in ahc_init()
5366 if (ahc->scb_data->maxhscbs < AHC_SCB_MAX_ALLOC) { in ahc_init()
5918 ahc->scb_data->scbindex[scb->hscb->tag] = NULL; in ahc_search_qinfifo()
5944 if (scb_index >= ahc->scb_data->numscbs) { in ahc_search_qinfifo()
5947 scb_index, ahc->scb_data->numscbs); in ahc_search_qinfifo()
6129 if (scb_index >= ahc->scb_data->numscbs) { in ahc_search_disc_list()
6132 scb_index, ahc->scb_data->numscbs); in ahc_search_disc_list()
6355 for (i = 0; i < ahc->scb_data->maxhscbs; i++) { in ahc_abort_scbs()
7162 printk("\nSCB count = %d\n", ahc->scb_data->numscbs); in ahc_dump_card_state()
7220 for (i = 0; i < ahc->scb_data->maxhscbs; i++) { in ahc_dump_card_state()
7253 SLIST_FOREACH(scb, &ahc->scb_data->free_scbs, links.sle) { in ahc_dump_card_state()