Lines Matching refs:chunk

174 /* allocate and align a chunk of memory intended to hold the data behing exchanged
178 fore200e_chunk_alloc(struct fore200e* fore200e, struct chunk* chunk, int size, int alignment, int direction)
185 chunk->alloc_size = size + alignment;
186 chunk->align_size = size;
187 chunk->direction = direction;
189 chunk->alloc_addr = kzalloc(chunk->alloc_size, GFP_KERNEL | GFP_DMA);
190 if (chunk->alloc_addr == NULL)
194 offset = FORE200E_ALIGN(chunk->alloc_addr, alignment);
196 chunk->align_addr = chunk->alloc_addr + offset;
198 chunk->dma_addr = fore200e->bus->dma_map(fore200e, chunk->align_addr, chunk->align_size, direction);
204 /* free a chunk of memory */
207 fore200e_chunk_free(struct fore200e* fore200e, struct chunk* chunk)
209 fore200e->bus->dma_unmap(fore200e, chunk->dma_addr, chunk->dma_size, chunk->direction);
211 kfree(chunk->alloc_addr);
283 struct chunk* data = &buffer[ nbr ].data;
302 struct chunk* status = &fore200e->host_bsq[ scheme ][ magn ].status;
303 struct chunk* rbd_block = &fore200e->host_bsq[ scheme ][ magn ].rbd_block;
464 /* allocate a DMA consistent chunk of memory intended to act as a communication mechanism
468 fore200e_pca_dma_chunk_alloc(struct fore200e* fore200e, struct chunk* chunk,
472 chunk->alloc_size = size * nbr;
473 chunk->alloc_addr = pci_alloc_consistent((struct pci_dev*)fore200e->bus_dev,
474 chunk->alloc_size,
475 &chunk->dma_addr);
477 if ((chunk->alloc_addr == NULL) || (chunk->dma_addr == 0))
480 chunk->align_addr = chunk->alloc_addr;
486 /* free a DMA consistent chunk of memory */
489 fore200e_pca_dma_chunk_free(struct fore200e* fore200e, struct chunk* chunk)
492 chunk->alloc_size,
493 chunk->alloc_addr,
494 chunk->dma_addr);
716 /* Allocate a DVMA consistent chunk of memory intended to act as a communication mechanism
719 static int fore200e_sba_dma_chunk_alloc(struct fore200e *fore200e, struct chunk *chunk,
724 chunk->alloc_size = chunk->align_size = size * nbr;
727 chunk->alloc_addr = dma_alloc_coherent(&op->dev, chunk->alloc_size,
728 &chunk->dma_addr, GFP_ATOMIC);
730 if ((chunk->alloc_addr == NULL) || (chunk->dma_addr == 0))
733 chunk->align_addr = chunk->alloc_addr;
738 /* free a DVMA consistent chunk of memory */
739 static void fore200e_sba_dma_chunk_free(struct fore200e *fore200e, struct chunk *chunk)
743 dma_free_coherent(&op->dev, chunk->alloc_size,
744 chunk->alloc_addr, chunk->dma_addr);