/* Copyright Statement: * * (C) 2005-2016 MediaTek Inc. All rights reserved. * * This software/firmware and related documentation ("MediaTek Software") are * protected under relevant copyright laws. The information contained herein * is confidential and proprietary to MediaTek Inc. ("MediaTek") and/or its licensors. * Without the prior written permission of MediaTek and/or its licensors, * any reproduction, modification, use or disclosure of MediaTek Software, * and information contained herein, in whole or in part, shall be strictly prohibited. * You may only use, reproduce, modify, or distribute (as applicable) MediaTek Software * if you have agreed to and been bound by the applicable license agreement with * MediaTek ("License Agreement") and been granted explicit permission to do so within * the License Agreement ("Permitted User"). If you are not a Permitted User, * please cease any access or use of MediaTek Software immediately. * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES * THAT MEDIATEK SOFTWARE RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES * ARE PROVIDED TO RECEIVER ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR * SUPPLIED WITH MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND * CUMULATIVE LIABILITY WITH RESPECT TO MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE MEDIATEK SOFTWARE AT ISSUE, * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. */ #ifndef __CONNSYS_DRIVER_H__ #define __CONNSYS_DRIVER_H__ #include #include #include "connsys_profile.h" /* CONNSYS_MAX_RX_PKT_SIZE is set by PBUF_POOL_BUFSIZE. */ #define CONNSYS_MAX_RX_PKT_SIZE 1664 //(0x640) // The max RX pkt size by upper layer (lwip) #define MY_CONNSYS_BLOCK_SIZE 128 #ifdef MTK_HIF_GDMA_ENABLE #define CFG_WIFI_HIF_GDMA_EN 1 #else #define CFG_WIFI_HIF_GDMA_EN 0 #endif #define CFG_CONNSYS_POLLING_IRQ_EN 0 #define CFG_CONNSYS_DVT_RX_ENHANCE_MODE_EN 0 #define CFG_CONNSYS_IOT_RX_ZERO_COPY_EN 1 #define CFG_CONNSYS_IOT_TX_ZERO_COPY_EN 1 #define CFG_CONNSYS_TRX_BALANCE_EN 0 #define CFG_CONNSYS_MEASURE_INT_TIME_EN 0 #define CFG_CONNSYS_MEASURE_TIME_NUM 4 #define CFG_CONNSYS_CONTINOUS_ALLOCATE_FAIL_PRINT_CNT_VAL (16) #define CFG_CONNSYS_BALANCE_DEFAULT_TX_NUM 10 #define CFG_CONNSYS_BALANCE_DEFAULT_RX_NUM 10 #define CFG_CONNSYS_BALANCE_DEFAULT_EN_VAL 1 #define CONNSYS_POLLING_DELAY_TIME 10 #define CFG_MAX_HIF_RX_LEN_NUM 0 #define CFG_RPT_OWN_RX_PACKET_LEN_EN 0 #define CFG_RX0_RPT_PKT_LEN 4 /* 0:16, 1~15 */ #define CFG_RX1_RPT_PKT_LEN 10 #define DEFAULT_N9_PSE_PAGE_SIZE 128 #define DEFAULT_N9_PSE_PAGE_QUOTA 910 #define NUM_OF_WIFI_HIF_RX_PORT 2 #define NUM_OF_WIFI_HIF_TX_PORT 2 #define WIFI_HIF_RX_PORT0_IDX 0 /* in-band command port */ #define WIFI_HIF_RX_PORT1_IDX 1 /* data port */ #define WIFI_HIF_TX_PORT_IDX 0 #define WIFI_HIF_RX_CS_OFFLOAD_STATUS_LEN 4 #define WIFI_HIF_HEADER_LEN 12 #define NUM_OF_WIFI_TXQ 16 #define WIFI_HIF_RX_FIFO_MAX_LEN 16 #define CONNSYS_STATUS_SUCCESS (0) #define CONNSYS_STATUS_FAIL (-1) #define CONNSYS_DEBUG_MODE_EN 1 /* TXCFFA: the real amount of free pages that HIF source port can use for this time. * Other TXQ_CNT: the amount of finished packet for a certain queue. */ #define WIFI_TXQ_CNT_IDX_0_TXCAC0 0 #define WIFI_TXQ_CNT_IDX_1_TXCAC1 1 #define WIFI_TXQ_CNT_IDX_2_TXCAC2 2 #define WIFI_TXQ_CNT_IDX_3_TXCAC3 3 #define WIFI_TXQ_CNT_IDX_4_TXCAC4 4 #define WIFI_TXQ_CNT_IDX_5_TXCAC5 5 #define WIFI_TXQ_CNT_IDX_6_TXCAC6 6 #define WIFI_TXQ_CNT_IDX_7_TXCBMC 7 #define WIFI_TXQ_CNT_IDX_8_TXCBCN 8 #define WIFI_TXQ_CNT_IDX_9_TXCAC10 9 #define WIFI_TXQ_CNT_IDX_10_TXCAC11 10 #define WIFI_TXQ_CNT_IDX_11_TXCAC12 11 #define WIFI_TXQ_CNT_IDX_12_TXCAC13 12 #define WIFI_TXQ_CNT_IDX_13_TXCAC14 13 #define WIFI_TXQ_CNT_IDX_14_TXCFFA 14 #define WIFI_TXQ_CNT_IDX_15_TXCCPU 15 #define LEN_INT_ENHANCE_MODE (sizeof(enhance_mode_data_struct_t)) #define LEN_RX_ENHANCE_MODE (4 + sizeof(enhance_mode_data_struct_t)) // HW design spec #define WF_PSE_TOP_BASE 0xA0000000 #define PSE_BC (WF_PSE_TOP_BASE + 0x14) #define PSE_BC_TOTAL_PAGE_NUM_OFFSET (0) #define PSE_BC_TOTAL_PAGE_NUM_MASK ((0xFFF)<