wil6210: add ioctl interface

Wireless drivers should not be using ioctl interface,
hence it was removed in upstream code.
Add ioctl support as internal patch.
Add snapshot for wil6210_uapi.h from msm-4.19 commit 143aa4925e1a.

Change-Id: Idd374f80540c0f17cff10d3c8cc85bcdd66253c4
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Lior David <liord@codeaurora.org>
Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
This commit is contained in:
Maya Erez 2019-12-11 16:19:55 +02:00 • committed by Alexei Avshalom Lazar
commit 387306359a
6 changed files with 339 additions and 1 deletions

View file

@ -0,0 +1,72 @@
/* SPDX-License-Identifier: ISC */
/*
* Copyright (c) 2014 Qualcomm Atheros, Inc.
* Copyright (c) 2019-2020, The Linux Foundation. All rights reserved.
*/
#ifndef __WIL6210_UAPI_H__
#define __WIL6210_UAPI_H__
#if !defined(__KERNEL__)
#define __user
#endif
#include <linux/sockios.h>
/* Numbers SIOCDEVPRIVATE and SIOCDEVPRIVATE + 1
* are used by Android devices to implement PNO (preferred network offload).
* Albeit it is temporary solution, use different numbers to avoid conflicts
*/
/**
* Perform 32-bit I/O operation to the card memory
*
* User code should arrange data in memory like this:
*
* struct wil_memio io;
* struct ifreq ifr = {
* .ifr_data = &io,
* };
*/
#define WIL_IOCTL_MEMIO (SIOCDEVPRIVATE + 2)
/**
* Perform block I/O operation to the card memory
*
* User code should arrange data in memory like this:
*
* void *buf;
* struct wil_memio_block io = {
* .block = buf,
* };
* struct ifreq ifr = {
* .ifr_data = &io,
* };
*/
#define WIL_IOCTL_MEMIO_BLOCK (SIOCDEVPRIVATE + 3)
/** operation to perform */
#define WIL_MMIO_READ 0
#define WIL_MMIO_WRITE 1
#define WIL_MMIO_OP_MASK 0xff
/** addressing mode to use */
#define WIL_MMIO_ADDR_LINKER (0 << 8)
#define WIL_MMIO_ADDR_AHB (1 << 8)
#define WIL_MMIO_ADDR_BAR (2 << 8)
#define WIL_MMIO_ADDR_MASK 0xff00
struct wil_memio {
uint32_t op; /* enum wil_memio_op */
uint32_t addr; /* should be 32-bit aligned */
uint32_t val;
};
struct wil_memio_block {
uint32_t op; /* enum wil_memio_op */
uint32_t addr; /* should be 32-bit aligned */
uint32_t size; /* should be multiple of 4 */
uint64_t __user block; /* block address */
};
#endif /* __WIL6210_UAPI_H__ */