Files
kernel_xiaomi_sm8250/include/uapi/linux/wil6210_uapi.h
Maya Erez 143aa4925e 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.

Change-Id: Idd374f80540c0f17cff10d3c8cc85bcdd66253c4
Signed-off-by: Maya Erez <merez@codeaurora.org>
CRs-Fixed: 2143032
Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
[liord@codeaurora.org: SPDX license, checkpatch errors]
Signed-off-by: Lior David <liord@codeaurora.org>
2019-02-22 13:00:38 +02:00

73 lines
1.6 KiB
C

/* SPDX-License-Identifier: ISC */
/*
* Copyright (c) 2014 Qualcomm Atheros, Inc.
* Copyright (c) 2019, 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__ */