2011-03-22 08:00:50 +07:00
|
|
|
/*
|
|
|
|
* Marvell Wireless LAN device driver: generic data structures and APIs
|
|
|
|
*
|
2014-06-20 11:38:57 +07:00
|
|
|
* Copyright (C) 2011-2014, Marvell International Ltd.
|
2011-03-22 08:00:50 +07:00
|
|
|
*
|
|
|
|
* This software file (the "File") is distributed by Marvell International
|
|
|
|
* Ltd. under the terms of the GNU General Public License Version 2, June 1991
|
|
|
|
* (the "License"). You may use, redistribute and/or modify this File in
|
|
|
|
* accordance with the terms and conditions of the License, a copy of which
|
|
|
|
* is available by writing to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
|
|
|
|
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
|
|
|
*
|
|
|
|
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
|
|
|
|
* this warranty disclaimer.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _MWIFIEX_DECL_H_
|
|
|
|
#define _MWIFIEX_DECL_H_
|
|
|
|
|
|
|
|
#undef pr_fmt
|
|
|
|
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
|
|
|
|
|
|
|
#include <linux/wait.h>
|
|
|
|
#include <linux/timer.h>
|
|
|
|
#include <linux/ieee80211.h>
|
2013-08-24 06:48:23 +07:00
|
|
|
#include <uapi/linux/if_arp.h>
|
2013-01-03 07:56:01 +07:00
|
|
|
#include <net/mac80211.h>
|
2011-03-22 08:00:50 +07:00
|
|
|
|
|
|
|
|
2012-09-26 10:23:40 +07:00
|
|
|
#define MWIFIEX_MAX_BSS_NUM (3)
|
2011-03-22 08:00:50 +07:00
|
|
|
|
2011-07-08 07:37:09 +07:00
|
|
|
#define MWIFIEX_MIN_DATA_HEADER_LEN 36 /* sizeof(mwifiex_txpd)
|
|
|
|
* + 4 byte alignment
|
|
|
|
*/
|
2012-09-26 10:23:32 +07:00
|
|
|
#define MWIFIEX_MGMT_FRAME_HEADER_SIZE 8 /* sizeof(pkt_type)
|
|
|
|
* + sizeof(tx_control)
|
|
|
|
*/
|
2011-03-22 08:00:50 +07:00
|
|
|
|
|
|
|
#define MWIFIEX_MAX_TX_BASTREAM_SUPPORTED 2
|
|
|
|
#define MWIFIEX_MAX_RX_BASTREAM_SUPPORTED 16
|
|
|
|
|
2014-04-18 01:47:01 +07:00
|
|
|
#define MWIFIEX_STA_AMPDU_DEF_TXWINSIZE 64
|
|
|
|
#define MWIFIEX_STA_AMPDU_DEF_RXWINSIZE 64
|
2013-03-28 09:10:31 +07:00
|
|
|
#define MWIFIEX_UAP_AMPDU_DEF_TXWINSIZE 32
|
|
|
|
#define MWIFIEX_UAP_AMPDU_DEF_RXWINSIZE 16
|
2014-04-18 01:47:02 +07:00
|
|
|
#define MWIFIEX_11AC_STA_AMPDU_DEF_TXWINSIZE 64
|
|
|
|
#define MWIFIEX_11AC_STA_AMPDU_DEF_RXWINSIZE 64
|
2014-09-12 21:39:00 +07:00
|
|
|
#define MWIFIEX_11AC_UAP_AMPDU_DEF_TXWINSIZE 64
|
|
|
|
#define MWIFIEX_11AC_UAP_AMPDU_DEF_RXWINSIZE 64
|
2013-03-28 09:10:31 +07:00
|
|
|
|
2011-03-22 08:00:50 +07:00
|
|
|
#define MWIFIEX_DEFAULT_BLOCK_ACK_TIMEOUT 0xffff
|
|
|
|
|
|
|
|
#define MWIFIEX_RATE_BITMAP_MCS0 32
|
|
|
|
|
|
|
|
#define MWIFIEX_RX_DATA_BUF_SIZE (4 * 1024)
|
2012-04-19 10:08:28 +07:00
|
|
|
#define MWIFIEX_RX_CMD_BUF_SIZE (2 * 1024)
|
2011-03-22 08:00:50 +07:00
|
|
|
|
2012-05-09 08:30:24 +07:00
|
|
|
#define MAX_BEACON_PERIOD (4000)
|
|
|
|
#define MIN_BEACON_PERIOD (50)
|
|
|
|
#define MAX_DTIM_PERIOD (100)
|
|
|
|
#define MIN_DTIM_PERIOD (1)
|
|
|
|
|
2011-03-22 08:00:50 +07:00
|
|
|
#define MWIFIEX_RTS_MIN_VALUE (0)
|
|
|
|
#define MWIFIEX_RTS_MAX_VALUE (2347)
|
|
|
|
#define MWIFIEX_FRAG_MIN_VALUE (256)
|
|
|
|
#define MWIFIEX_FRAG_MAX_VALUE (2346)
|
2013-01-03 07:56:01 +07:00
|
|
|
#define MWIFIEX_WMM_VERSION 0x01
|
|
|
|
#define MWIFIEX_WMM_SUBTYPE 0x01
|
2011-03-22 08:00:50 +07:00
|
|
|
|
2012-05-09 08:30:23 +07:00
|
|
|
#define MWIFIEX_RETRY_LIMIT 14
|
2011-03-22 08:00:50 +07:00
|
|
|
#define MWIFIEX_SDIO_BLOCK_SIZE 256
|
|
|
|
|
|
|
|
#define MWIFIEX_BUF_FLAG_REQUEUED_PKT BIT(0)
|
2012-08-04 08:06:08 +07:00
|
|
|
#define MWIFIEX_BUF_FLAG_BRIDGED_PKT BIT(1)
|
2014-02-08 07:27:32 +07:00
|
|
|
#define MWIFIEX_BUF_FLAG_TDLS_PKT BIT(2)
|
2014-11-25 21:43:05 +07:00
|
|
|
#define MWIFIEX_BUF_FLAG_EAPOL_TX_STATUS BIT(3)
|
2014-11-25 21:43:06 +07:00
|
|
|
#define MWIFIEX_BUF_FLAG_ACTION_TX_STATUS BIT(4)
|
2012-08-04 08:06:08 +07:00
|
|
|
|
2013-07-23 09:17:41 +07:00
|
|
|
#define MWIFIEX_BRIDGED_PKTS_THR_HIGH 1024
|
|
|
|
#define MWIFIEX_BRIDGED_PKTS_THR_LOW 128
|
2011-03-22 08:00:50 +07:00
|
|
|
|
2014-02-08 07:27:34 +07:00
|
|
|
#define MWIFIEX_TDLS_DISABLE_LINK 0x00
|
|
|
|
#define MWIFIEX_TDLS_ENABLE_LINK 0x01
|
|
|
|
#define MWIFIEX_TDLS_CREATE_LINK 0x02
|
|
|
|
#define MWIFIEX_TDLS_CONFIG_LINK 0x03
|
|
|
|
|
2014-11-13 23:24:16 +07:00
|
|
|
#define MWIFIEX_TDLS_RSSI_HIGH 50
|
|
|
|
#define MWIFIEX_TDLS_RSSI_LOW 55
|
|
|
|
#define MWIFIEX_TDLS_MAX_FAIL_COUNT 4
|
|
|
|
#define MWIFIEX_AUTO_TDLS_IDLE_TIME 10
|
|
|
|
|
2011-03-22 08:00:50 +07:00
|
|
|
enum mwifiex_bss_type {
|
|
|
|
MWIFIEX_BSS_TYPE_STA = 0,
|
|
|
|
MWIFIEX_BSS_TYPE_UAP = 1,
|
2012-09-26 10:23:40 +07:00
|
|
|
MWIFIEX_BSS_TYPE_P2P = 2,
|
2011-03-22 08:00:50 +07:00
|
|
|
MWIFIEX_BSS_TYPE_ANY = 0xff,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum mwifiex_bss_role {
|
|
|
|
MWIFIEX_BSS_ROLE_STA = 0,
|
|
|
|
MWIFIEX_BSS_ROLE_UAP = 1,
|
|
|
|
MWIFIEX_BSS_ROLE_ANY = 0xff,
|
|
|
|
};
|
|
|
|
|
2014-02-08 07:27:33 +07:00
|
|
|
enum mwifiex_tdls_status {
|
|
|
|
TDLS_NOT_SETUP = 0,
|
|
|
|
TDLS_SETUP_INPROGRESS,
|
|
|
|
TDLS_SETUP_COMPLETE,
|
|
|
|
TDLS_SETUP_FAILURE,
|
|
|
|
TDLS_LINK_TEARDOWN,
|
|
|
|
};
|
|
|
|
|
2014-02-08 07:27:34 +07:00
|
|
|
enum mwifiex_tdls_error_code {
|
|
|
|
TDLS_ERR_NO_ERROR = 0,
|
|
|
|
TDLS_ERR_INTERNAL_ERROR,
|
|
|
|
TDLS_ERR_MAX_LINKS_EST,
|
|
|
|
TDLS_ERR_LINK_EXISTS,
|
|
|
|
TDLS_ERR_LINK_NONEXISTENT,
|
|
|
|
TDLS_ERR_PEER_STA_UNREACHABLE = 25,
|
|
|
|
};
|
|
|
|
|
2011-03-22 08:00:50 +07:00
|
|
|
#define BSS_ROLE_BIT_MASK BIT(0)
|
|
|
|
|
|
|
|
#define GET_BSS_ROLE(priv) ((priv)->bss_role & BSS_ROLE_BIT_MASK)
|
|
|
|
|
|
|
|
enum mwifiex_data_frame_type {
|
|
|
|
MWIFIEX_DATA_FRAME_TYPE_ETH_II = 0,
|
|
|
|
MWIFIEX_DATA_FRAME_TYPE_802_11,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct mwifiex_fw_image {
|
|
|
|
u8 *helper_buf;
|
|
|
|
u32 helper_len;
|
|
|
|
u8 *fw_buf;
|
|
|
|
u32 fw_len;
|
|
|
|
};
|
|
|
|
|
2012-05-09 08:30:24 +07:00
|
|
|
struct mwifiex_802_11_ssid {
|
|
|
|
u32 ssid_len;
|
|
|
|
u8 ssid[IEEE80211_MAX_SSID_LEN];
|
|
|
|
};
|
|
|
|
|
2011-03-22 08:00:50 +07:00
|
|
|
struct mwifiex_wait_queue {
|
2011-04-14 07:27:06 +07:00
|
|
|
wait_queue_head_t wait;
|
2011-03-22 08:00:50 +07:00
|
|
|
int status;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct mwifiex_rxinfo {
|
2012-01-12 11:06:11 +07:00
|
|
|
u8 bss_num;
|
|
|
|
u8 bss_type;
|
2011-03-22 08:00:50 +07:00
|
|
|
struct sk_buff *parent;
|
|
|
|
u8 use_count;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct mwifiex_txinfo {
|
|
|
|
u32 status_code;
|
|
|
|
u8 flags;
|
2012-01-12 11:06:11 +07:00
|
|
|
u8 bss_num;
|
|
|
|
u8 bss_type;
|
2013-12-03 14:17:55 +07:00
|
|
|
u32 pkt_len;
|
2014-11-25 21:43:05 +07:00
|
|
|
u8 ack_frame_id;
|
2014-11-25 21:43:06 +07:00
|
|
|
u64 cookie;
|
2011-03-22 08:00:50 +07:00
|
|
|
};
|
|
|
|
|
|
|
|
enum mwifiex_wmm_ac_e {
|
|
|
|
WMM_AC_BK,
|
|
|
|
WMM_AC_BE,
|
|
|
|
WMM_AC_VI,
|
|
|
|
WMM_AC_VO
|
|
|
|
} __packed;
|
2013-01-03 07:56:01 +07:00
|
|
|
|
|
|
|
struct ieee_types_wmm_ac_parameters {
|
|
|
|
u8 aci_aifsn_bitmap;
|
|
|
|
u8 ecw_bitmap;
|
|
|
|
__le16 tx_op_limit;
|
|
|
|
} __packed;
|
|
|
|
|
|
|
|
struct mwifiex_types_wmm_info {
|
|
|
|
u8 oui[4];
|
|
|
|
u8 subtype;
|
|
|
|
u8 version;
|
|
|
|
u8 qos_info;
|
|
|
|
u8 reserved;
|
|
|
|
struct ieee_types_wmm_ac_parameters ac_params[IEEE80211_NUM_ACS];
|
|
|
|
} __packed;
|
2013-08-24 06:48:23 +07:00
|
|
|
|
|
|
|
struct mwifiex_arp_eth_header {
|
|
|
|
struct arphdr hdr;
|
|
|
|
u8 ar_sha[ETH_ALEN];
|
|
|
|
u8 ar_sip[4];
|
|
|
|
u8 ar_tha[ETH_ALEN];
|
|
|
|
u8 ar_tip[4];
|
|
|
|
} __packed;
|
2014-10-31 17:38:26 +07:00
|
|
|
|
|
|
|
struct mwifiex_chan_stats {
|
|
|
|
u8 chan_num;
|
|
|
|
u8 bandcfg;
|
|
|
|
u8 flags;
|
|
|
|
s8 noise;
|
|
|
|
u16 total_bss;
|
|
|
|
u16 cca_scan_dur;
|
|
|
|
u16 cca_busy_dur;
|
|
|
|
} __packed;
|
2011-03-22 08:00:50 +07:00
|
|
|
#endif /* !_MWIFIEX_DECL_H_ */
|