Lines Matching refs:scb_data

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