History

dma-buf: Update [un]map documentation to match the other functions

Other function have inline documentation, a couple still have theirs at the top of the structure, update the docs and move them inline.

Andrew F. Davis committed 7 years ago

Commit d5ae7711 parent 67b886d1 file · +25 −4Browse files

Showing the changes to include/linux (1 of 1 file). Show all

Unified · Split

include/linux/dma-buf.h+25−4
@@ -39,8 +39,6 @@ struct dma_buf_attachment; · 38 unmodified lines
3939
4040 /**
4141 * struct dma_buf_ops - operations possible on struct dma_buf
42− * @map: [optional] maps a page from the buffer into kernel address space.
43− * @unmap: [optional] unmaps a page from the buffer.
4442 * @vmap: [optional] creates a virtual mapping for the buffer into kernel
4543 * address space. Same restrictions as for vmap and friends apply.
4644 * @vunmap: [optional] unmaps a vmap from the buffer
@@ -200,8 +198,6 @@ struct dma_buf_ops { · 153 unmodified lines
200198 * to be restarted.
201199 */
202200 int (*end_cpu_access)(struct dma_buf *, enum dma_data_direction);
203− void *(*map)(struct dma_buf *, unsigned long);
204− void (*unmap)(struct dma_buf *, unsigned long, void *);
205201
206202 /**
207203 * @mmap:
@@ -240,6 +236,31 @@ struct dma_buf_ops { · 32 unmodified lines
240236 */
241237 int (*mmap)(struct dma_buf *, struct vm_area_struct *vma);
242238
239+ /**
240+ * @map:
241+ *
242+ * Maps a page from the buffer into kernel address space. The page is
243+ * specified by offset into the buffer in PAGE_SIZE units.
244+ *
245+ * This callback is optional.
246+ *
247+ * Returns:
248+ *
249+ * Virtual address pointer where requested page can be accessed. NULL
250+ * on error or when this function is unimplemented by the exporter.
251+ */
252+ void *(*map)(struct dma_buf *, unsigned long);
253+
254+ /**
255+ * @unmap:
256+ *
257+ * Unmaps a page from the buffer. Page offset and address pointer should
258+ * be the same as the one passed to and returned by matching call to map.
259+ *
260+ * This callback is optional.
261+ */
262+ void (*unmap)(struct dma_buf *, unsigned long, void *);
263+
243264 void *(*vmap)(struct dma_buf *);
244265 void (*vunmap)(struct dma_buf *, void *vaddr);
245266 };

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t