Lines Matching defs:ring

337 		device_printf(dev, "could not allocate Cmd ring\n");
346 device_printf(dev, "could not allocate Tx ring %d\n",
353 device_printf(dev, "could not allocate Rx ring\n");
548 iwi_alloc_cmd_ring(struct iwi_softc *sc, struct iwi_cmd_ring *ring, int count)
552 ring->count = count;
553 ring->queued = 0;
554 ring->cur = ring->next = 0;
559 NULL, NULL, &ring->desc_dmat);
565 error = bus_dmamem_alloc(ring->desc_dmat, (void **)&ring->desc,
566 BUS_DMA_NOWAIT | BUS_DMA_ZERO, &ring->desc_map);
572 error = bus_dmamap_load(ring->desc_dmat, ring->desc_map, ring->desc,
573 count * IWI_CMD_DESC_SIZE, iwi_dma_map_addr, &ring->physaddr, 0);
581 fail: iwi_free_cmd_ring(sc, ring);
586 iwi_reset_cmd_ring(struct iwi_softc *sc, struct iwi_cmd_ring *ring)
588 ring->queued = 0;
589 ring->cur = ring->next = 0;
593 iwi_free_cmd_ring(struct iwi_softc *sc, struct iwi_cmd_ring *ring)
595 if (ring->desc != NULL) {
596 bus_dmamap_sync(ring->desc_dmat, ring->desc_map,
598 bus_dmamap_unload(ring->desc_dmat, ring->desc_map);
599 bus_dmamem_free(ring->desc_dmat, ring->desc, ring->desc_map);
602 if (ring->desc_dmat != NULL)
603 bus_dma_tag_destroy(ring->desc_dmat);
607 iwi_alloc_tx_ring(struct iwi_softc *sc, struct iwi_tx_ring *ring, int count,
612 ring->count = count;
613 ring->queued = 0;
614 ring->cur = ring->next = 0;
615 ring->csr_ridx = csr_ridx;
616 ring->csr_widx = csr_widx;
621 NULL, &ring->desc_dmat);
627 error = bus_dmamem_alloc(ring->desc_dmat, (void **)&ring->desc,
628 BUS_DMA_NOWAIT | BUS_DMA_ZERO, &ring->desc_map);
634 error = bus_dmamap_load(ring->desc_dmat, ring->desc_map, ring->desc,
635 count * IWI_TX_DESC_SIZE, iwi_dma_map_addr, &ring->physaddr, 0);
641 ring->data = malloc(count * sizeof (struct iwi_tx_data), M_DEVBUF,
643 if (ring->data == NULL) {
651 IWI_MAX_NSEG, MCLBYTES, 0, NULL, NULL, &ring->data_dmat);
658 error = bus_dmamap_create(ring->data_dmat, 0,
659 &ring->data[i].map);
668 fail: iwi_free_tx_ring(sc, ring);
673 iwi_reset_tx_ring(struct iwi_softc *sc, struct iwi_tx_ring *ring)
678 for (i = 0; i < ring->count; i++) {
679 data = &ring->data[i];
682 bus_dmamap_sync(ring->data_dmat, data->map,
684 bus_dmamap_unload(ring->data_dmat, data->map);
695 ring->queued = 0;
696 ring->cur = ring->next = 0;
700 iwi_free_tx_ring(struct iwi_softc *sc, struct iwi_tx_ring *ring)
705 if (ring->desc != NULL) {
706 bus_dmamap_sync(ring->desc_dmat, ring->desc_map,
708 bus_dmamap_unload(ring->desc_dmat, ring->desc_map);
709 bus_dmamem_free(ring->desc_dmat, ring->desc, ring->desc_map);
712 if (ring->desc_dmat != NULL)
713 bus_dma_tag_destroy(ring->desc_dmat);
715 if (ring->data != NULL) {
716 for (i = 0; i < ring->count; i++) {
717 data = &ring->data[i];
720 bus_dmamap_sync(ring->data_dmat, data->map,
722 bus_dmamap_unload(ring->data_dmat, data->map);
730 bus_dmamap_destroy(ring->data_dmat, data->map);
733 free(ring->data, M_DEVBUF);
736 if (ring->data_dmat != NULL)
737 bus_dma_tag_destroy(ring->data_dmat);
741 iwi_alloc_rx_ring(struct iwi_softc *sc, struct iwi_rx_ring *ring, int count)
746 ring->count = count;
747 ring->cur = 0;
749 ring->data = malloc(count * sizeof (struct iwi_rx_data), M_DEVBUF,
751 if (ring->data == NULL) {
759 1, MCLBYTES, 0, NULL, NULL, &ring->data_dmat);
766 data = &ring->data[i];
768 error = bus_dmamap_create(ring->data_dmat, 0, &data->map);
782 error = bus_dmamap_load(ring->data_dmat, data->map,
796 fail: iwi_free_rx_ring(sc, ring);
801 iwi_reset_rx_ring(struct iwi_softc *sc, struct iwi_rx_ring *ring)
803 ring->cur = 0;
807 iwi_free_rx_ring(struct iwi_softc *sc, struct iwi_rx_ring *ring)
812 if (ring->data != NULL) {
813 for (i = 0; i < ring->count; i++) {
814 data = &ring->data[i];
817 bus_dmamap_sync(ring->data_dmat, data->map,
819 bus_dmamap_unload(ring->data_dmat, data->map);
824 bus_dmamap_destroy(ring->data_dmat, data->map);
827 free(ring->data, M_DEVBUF);
830 if (ring->data_dmat != NULL)
831 bus_dma_tag_destroy(ring->data_dmat);
1213 * Try to allocate a new mbuf for this ring element and load it before
1214 * processing the current mbuf. If the ring element cannot be loaded,
1246 * New mbuf successfully loaded, update Rx ring and continue
1976 /* there is no place left in this ring; tail drop */