Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e58b2196 authored by Ahmed Harhash's avatar Ahmed Harhash
Browse files

Add 'drivers/staging/wlan-qc/fw-api/' from branch 'kernel/13/fp4'

git-subtree-dir: drivers/staging/fw-api
git-subtree-mainline: a67d2f29
git-subtree-split: 3c6e03d7
parents a67d2f29 3c6e03d7
Loading
Loading
Loading
Loading
+71 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013-2014 The Linux Foundation. All rights reserved.
 *
 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
 *
 *
 * Permission to use, copy, modify, and/or distribute this software for
 * any purpose with or without fee is hereby granted, provided that the
 * above copyright notice and this permission notice appear in all
 * copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 * PERFORMANCE OF THIS SOFTWARE.
 */

/*
 * This file was originally distributed by Qualcomm Atheros, Inc.
 * under proprietary terms before Copyright ownership was assigned
 * to the Linux Foundation.
 */

/* ============================================================================== */
/* This file contains the definitions of the basic atheros data types. */
/* It is used to map the data types in atheros files to a platform specific */
/* type. */
/* */
/* Author(s): ="Atheros" */
/* ============================================================================== */
#ifndef _A_OSAPI_H_
#define _A_OSAPI_H_

#if defined(__linux__) && !defined(LINUX_EMULATION)
#include "osapi_linux.h"
#endif

/*=== the following primitives have the same definition for all platforms ===*/

#define A_COMPILE_TIME_ASSERT(assertion_name, predicate) \
	typedef char assertion_name[(predicate) ? 1 : -1]

/*
 * If N is a power of 2, then N and N-1 are orthogonal
 * (N-1 has all the least-significant bits set which are zero in N)
 * so  N ^ (N-1) = (N << 1) - 1
 */
#define A_COMPILE_TIME_ASSERT_IS_PWR2(assertion_name, value) \
	A_COMPILE_TIME_ASSERT (assertion_name,			  \
			       (((value) ^ ((value)-1)) == ((value) << 1) - 1))

#ifndef __ubicom32__
#define HIF_MALLOC_DIAGMEM(osdev, size, pa, context, retry) \
	os_malloc_CONSISTENT(osdev, size, pa, context, retry)
#define HIF_FREE_DIAGMEM(osdev, size, vaddr, pa, context) \
	OS_FREE_CONSISTENT(osdev, size, vaddr, pa, context)
#define HIF_DIAGMEM_SYNC(osdev, pa, size, dir, context)
#else
#define HIF_MALLOC_DIAGMEM(osdev, size, pa, context, retry) \
	os_malloc_NONCONSISTENT(osdev, size, pa, context, retry)
#define HIF_FREE_DIAGMEM(osdev, size, vaddr, pa, context) \
	OS_FREE_NONCONSISTENT(osdev, size, vaddr, pa, context)
#define HIF_DIAGMEM_SYNC(osdev, pa, size, dir, context)	\
	OS_SYNC_SINGLE(osdev, pa, size, dir, context)
#endif /* ubicom32 */

#endif /* _OSAPI_H_ */
+108 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2012, 2018 The Linux Foundation. All rights reserved.
 *
 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
 *
 *
 * Permission to use, copy, modify, and/or distribute this software for
 * any purpose with or without fee is hereby granted, provided that the
 * above copyright notice and this permission notice appear in all
 * copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 * PERFORMANCE OF THIS SOFTWARE.
 */

/*
 * This file was originally distributed by Qualcomm Atheros, Inc.
 * under proprietary terms before Copyright ownership was assigned
 * to the Linux Foundation.
 */

/* USB definitions shared between host and target */

#ifndef __A_USB_DEFS_H__
#define __A_USB_DEFS_H__

#ifndef ATH_TARGET
#include "athstartpack.h"
#endif

/* USB endpoint definitions */
#ifdef PLATFORM_GENOA

#define USB_EP_ADDR_APP_CTRL_IN          0x88
#define USB_EP_ADDR_APP_DATA_IN          0x89
#define USB_EP_ADDR_APP_QMI_IN           0x8A
#define USB_EP_ADDR_APP_DIAG_IN          0x8B

#define USB_EP_ADDR_APP_CTRL_OUT         0x08
#define USB_EP_ADDR_APP_DATA_OUT         0x09
#define USB_EP_ADDR_APP_QMI_OUT          0x0A
#define USB_EP_ADDR_APP_DIAG_OUT         0x0B

#else /* PLATFORM_GENOA */

#define USB_EP_ADDR_APP_CTRL_IN          0x81
#define USB_EP_ADDR_APP_DATA_IN          0x82
#define USB_EP_ADDR_APP_DATA2_IN         0x83
#define USB_EP_ADDR_APP_INT_IN           0x84

#define USB_EP_ADDR_APP_CTRL_OUT         0x01
#define USB_EP_ADDR_APP_DATA_LP_OUT      0x02
#define USB_EP_ADDR_APP_DATA_MP_OUT      0x03
#define USB_EP_ADDR_APP_DATA_HP_OUT      0x04

#endif /* PLATFORM_GENOA */

#define USB_CONTROL_REQ_SEND_BMI_CMD        1
#define USB_CONTROL_REQ_RECV_BMI_RESP       2
#define USB_CONTROL_REQ_DIAG_CMD            3
#define USB_CONTROL_REQ_DIAG_RESP           4


//#define USB_CONTROL_MAX_BMI_TRANSFER_SIZE   64
#define USB_CONTROL_MAX_BMI_TRANSFER_SIZE   252

#define HIF_BMI_MAX_TRANSFER_SIZE           USB_CONTROL_MAX_BMI_TRANSFER_SIZE

#define USB_HS_BULK_MAXP_SIZE   0x200  //512 Bytes Maxp for High Speed for BULK EP
#define USB_FS_BULK_MAXP_SIZE   0x40   //64 Bytes Maxp for Full Speed for BULK EP



/* diagnostic command defnitions */
#define USB_CTRL_DIAG_CC_READ       0
#define USB_CTRL_DIAG_CC_WRITE      1
#define USB_CTRL_DIAG_CC_WARM_RESET 2

typedef PREPACK struct {
    A_UINT32    Cmd;
    A_UINT32    Address;
    A_UINT32    Value;
    A_UINT32    _pad[1];
} POSTPACK USB_CTRL_DIAG_CMD_WRITE;

typedef PREPACK struct {
    A_UINT32    Cmd;
    A_UINT32    Address;
} POSTPACK USB_CTRL_DIAG_CMD_READ;

typedef PREPACK struct {
    A_UINT32    ReadValue;
} POSTPACK USB_CTRL_DIAG_RESP_READ;

#define USB_CTRL_MAX_DIAG_CMD_SIZE  (sizeof(USB_CTRL_DIAG_CMD_WRITE))
#define USB_CTRL_MAX_DIAG_RESP_SIZE (sizeof(USB_CTRL_DIAG_RESP_READ))

#ifndef ATH_TARGET
#include "athendpack.h"
#endif

#endif
+59 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013-2014 The Linux Foundation. All rights reserved.
 *
 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
 *
 *
 * Permission to use, copy, modify, and/or distribute this software for
 * any purpose with or without fee is hereby granted, provided that the
 * above copyright notice and this permission notice appear in all
 * copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 * PERFORMANCE OF THIS SOFTWARE.
 */

/*
 * This file was originally distributed by Qualcomm Atheros, Inc.
 * under proprietary terms before Copyright ownership was assigned
 * to the Linux Foundation.
 */

#ifndef _APB_ATHR_WLAN_MAP_H_
#define _APB_ATHR_WLAN_MAP_H_

#define RTC_SOC_BASE_ADDRESS                     0x00004000
#define RTC_WMAC_BASE_ADDRESS                    0x00005000
#define MAC_COEX_BASE_ADDRESS                    0x00006000
#define BT_COEX_BASE_ADDRESS                     0x00007000
#define SOC_PCIE_BASE_ADDRESS                    0x00008000
#define SOC_CORE_BASE_ADDRESS                    0x00009000
#define WLAN_UART_BASE_ADDRESS                   0x0000c000
#define WLAN_SI_BASE_ADDRESS                     0x00010000
#define WLAN_GPIO_BASE_ADDRESS                   0x00014000
#define WLAN_ANALOG_INTF_BASE_ADDRESS            0x0001c000
#define WLAN_MAC_BASE_ADDRESS                    0x00020000
#define EFUSE_BASE_ADDRESS                       0x00030000
#define FPGA_REG_BASE_ADDRESS                    0x00039000
#define WLAN_UART2_BASE_ADDRESS                  0x00054c00
#define CE_WRAPPER_BASE_ADDRESS                  0x00057000
#define CE0_BASE_ADDRESS                         0x00057400
#define CE1_BASE_ADDRESS                         0x00057800
#define CE2_BASE_ADDRESS                         0x00057c00
#define CE3_BASE_ADDRESS                         0x00058000
#define CE4_BASE_ADDRESS                         0x00058400
#define CE5_BASE_ADDRESS                         0x00058800
#define CE6_BASE_ADDRESS                         0x00058c00
#define CE7_BASE_ADDRESS                         0x00059000
#define DBI_BASE_ADDRESS                         0x00060000
#define WLAN_MBOX_BASE_ADDRESS                   0x00068000
#define WLAN_DBG_UART_BASE_ADDRESS               0x00069000
#define USB_DMA_BASE_ADDRESS                     0x0006a000

#endif /* _APB_ATHR_WLAN_MAP_REG_H_ */
+90 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2012 The Linux Foundation. All rights reserved.
 *
 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
 *
 *
 * Permission to use, copy, modify, and/or distribute this software for
 * any purpose with or without fee is hereby granted, provided that the
 * above copyright notice and this permission notice appear in all
 * copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 * PERFORMANCE OF THIS SOFTWARE.
 */

/*
 * This file was originally distributed by Qualcomm Atheros, Inc.
 * under proprietary terms before Copyright ownership was assigned
 * to the Linux Foundation.
 */

#ifndef __ATHDEFS_H__
#define __ATHDEFS_H__

/*
 * This file contains definitions that may be used across both
 * Host and Target software.  Nothing here is module-dependent
 * or platform-dependent.
 */

/*
 * Generic error codes that can be used by hw, sta, ap, sim, dk
 * and any other environments. Since these are enums, feel free to
 * add any more codes that you need.
 */

typedef enum {
    A_ERROR = -1,               /* Generic error return */
    A_OK = 0,                   /* success */
                                /* Following values start at 1 */
    A_DEVICE_NOT_FOUND,         /* not able to find PCI device */
    A_NO_MEMORY,                /* not able to allocate memory, not available */
    A_MEMORY_NOT_AVAIL,         /* memory region is not free for mapping */
    A_NO_FREE_DESC,             /* no free descriptors available */
    A_BAD_ADDRESS,              /* address does not match descriptor */
    A_WIN_DRIVER_ERROR,         /* used in NT_HW version, if problem at init */
    A_REGS_NOT_MAPPED,          /* registers not correctly mapped */
    A_EPERM,                    /* Not superuser */
    A_EACCES,                   /* Access denied */
    A_ENOENT,                   /* No such entry, search failed, etc. */
    A_EEXIST,                   /* The object already exists (can't create) */
    A_EFAULT,                   /* Bad address fault */
    A_EBUSY,                    /* Object is busy */
    A_EINVAL,                   /* Invalid parameter */
    A_EMSGSIZE,                 /* Inappropriate message buffer length */
    A_ECANCELED,                /* Operation canceled */
    A_ENOTSUP,                  /* Operation not supported */
    A_ECOMM,                    /* Communication error on send */
    A_EPROTO,                   /* Protocol error */
    A_ENODEV,                   /* No such device */
    A_EDEVNOTUP,                /* device is not UP */
    A_NO_RESOURCE,              /* No resources for requested operation */
    A_HARDWARE,                 /* Hardware failure */
    A_PENDING,                  /* Asynchronous routine; will send up results la
ter (typically in callback) */
    A_EBADCHANNEL,              /* The channel cannot be used */
    A_DECRYPT_ERROR,            /* Decryption error */
    A_PHY_ERROR,                /* RX PHY error */
    A_CONSUMED,                 /* Object was consumed */
    A_CLONE,                    /* The buffer is cloned */
} A_STATUS;

#define A_SUCCESS(x)        (x == A_OK)
#define A_FAILED(x)         (!A_SUCCESS(x))

#ifndef TRUE
#define TRUE 1
#endif

#ifndef FALSE
#define FALSE 0
#endif

#endif /* __ATHDEFS_H__ */
+35 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013-2014 The Linux Foundation. All rights reserved.
 *
 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
 *
 *
 * Permission to use, copy, modify, and/or distribute this software for
 * any purpose with or without fee is hereby granted, provided that the
 * above copyright notice and this permission notice appear in all
 * copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 * PERFORMANCE OF THIS SOFTWARE.
 */

/*
 * This file was originally distributed by Qualcomm Atheros, Inc.
 * under proprietary terms before Copyright ownership was assigned
 * to the Linux Foundation.
 */

#ifdef VXWORKS
#endif /* VXWORKS */

#if defined(LINUX) || defined(__linux__)
#endif /* LINUX */

#ifdef QNX
#endif /* QNX */
Loading