// SPDX-License-Identifier: GPL-2.0-only /* * ISHTP DMA I/F functions * * Copyright (c) 2003-2016, Intel Corporation. */ #include <linux/slab.h> #include <linux/sched.h> #include <linux/wait.h> #include <linux/delay.h> #include <linux/dma-mapping.h> #include "ishtp-dev.h" #include "client.h" /** * ishtp_cl_alloc_dma_buf() - Allocate DMA RX and TX buffer * @dev: ishtp device * * Allocate RX and TX DMA buffer once during bus setup. * It allocates 1MB, RX and TX DMA buffer, which are divided * into slots. */ void ishtp_cl_alloc_dma_buf(struct ishtp_device *dev) { … } /** * ishtp_cl_free_dma_buf() - Free DMA RX and TX buffer * @dev: ishtp device * * Free DMA buffer when all clients are released. This is * only happens during error path in ISH built in driver * model */ void ishtp_cl_free_dma_buf(struct ishtp_device *dev) { … } /* * ishtp_cl_get_dma_send_buf() - Get a DMA memory slot * @dev: ishtp device * @size: Size of memory to get * * Find and return free address of "size" bytes in dma tx buffer. * the function will mark this address as "in-used" memory. * * Return: NULL when no free buffer else a buffer to copy */ void *ishtp_cl_get_dma_send_buf(struct ishtp_device *dev, uint32_t size) { … } /* * ishtp_cl_release_dma_acked_mem() - Release DMA memory slot * @dev: ishtp device * @msg_addr: message address of slot * @size: Size of memory to get * * Release_dma_acked_mem - returnes the acked memory to free list. * (from msg_addr, size bytes long) */ void ishtp_cl_release_dma_acked_mem(struct ishtp_device *dev, void *msg_addr, uint8_t size) { … }