Remove buffer capacity, offset and resize in UAPI

The UAPI no longer supports the buffer capacity, offset and resize
functionality. Instead, the UAPI now only accepts a fixed size given at
the creation of the buffer. This change was made because the features
were not used and made the buffer handling more complicated. The user
knows how big buffers they need for their networks so they don't need
resize support or partial buffer usage support by having separate size
and capacity with an offset.

Without these features, the buffer instance no longer needs any IOCTL
call support so it has been removed. However, to still be able to check
the size of a buffer from its file descriptor, seek support has been
implemented so lseek and similar functions can be used to get the size.

The driver library's clear function that previously only reset the size
and offset values of the buffer will now clear the buffer content
instead.

These are breaking changes so the Linux kernel NPU driver version and
the driver library version have been given major version bumps. All the
tests and other applications affected by these changes have been updated
accordingly.

Change-Id: Ifc34cf04724a95853ad23fd7398dd286f73bcdab
Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
diff --git a/kernel/ethosu_buffer.h b/kernel/ethosu_buffer.h
index bc5958c..1829fbe 100644
--- a/kernel/ethosu_buffer.h
+++ b/kernel/ethosu_buffer.h
@@ -1,5 +1,6 @@
 /*
- * Copyright 2020,2022-2023 Arm Limited and/or its affiliates
+ * SPDX-FileCopyrightText: Copyright 2020,2022-2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
+ * SPDX-License-Identifier: GPL-2.0-only
  *
  * This program is free software and is provided to you under the terms of the
  * GNU General Public License version 2 as published by the Free Software
@@ -14,8 +15,6 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, you can access it online at
  * http://www.gnu.org/licenses/gpl-2.0.html.
- *
- * SPDX-License-Identifier: GPL-2.0-only
  */
 
 #ifndef ETHOSU_BUFFER_H
@@ -40,21 +39,14 @@
  * @dev:		Device
  * @file:		File
  * @kref:		Reference counting
- * @capacity:		Maximum capacity of the buffer
- * @offset:		Offset to first byte of buffer
- * @size:		Size of the data in the buffer
+ * @size:		Size of the buffer
  * @cpu_addr:		Kernel mapped address
  * @dma_addr:		DMA address
- * @dma_addr_orig:	Original DMA address before range mapping
- *
- * 'offset + size' must not be larger than 'capacity'.
  */
 struct ethosu_buffer {
 	struct device *dev;
 	struct file   *file;
 	struct kref   kref;
-	size_t        capacity;
-	size_t        offset;
 	size_t        size;
 	void          *cpu_addr;
 	dma_addr_t    dma_addr;
@@ -72,7 +64,7 @@
  * Return: fd on success, else error code.
  */
 int ethosu_buffer_create(struct device *dev,
-			 size_t capacity);
+			 size_t size);
 
 /**
  * ethosu_buffer_get_from_fd() - Get buffer handle from fd
@@ -93,13 +85,4 @@
  */
 void ethosu_buffer_put(struct ethosu_buffer *buf);
 
-/**
- * ethosu_buffer_resize() - Resize and validate buffer
- *
- * Return: 0 on success, else error code.
- */
-int ethosu_buffer_resize(struct ethosu_buffer *buf,
-			 size_t size,
-			 size_t offset);
-
 #endif /* ETHOSU_BUFFER_H */