diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/fw-api.h')
| -rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/fw-api.h | 273 | 
1 files changed, 207 insertions, 66 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/fw-api.h b/drivers/net/wireless/iwlwifi/mvm/fw-api.h index 66264cc5a01..309a9b9a94f 100644 --- a/drivers/net/wireless/iwlwifi/mvm/fw-api.h +++ b/drivers/net/wireless/iwlwifi/mvm/fw-api.h @@ -5,7 +5,7 @@   *   * GPL LICENSE SUMMARY   * - * Copyright(c) 2012 - 2013 Intel Corporation. All rights reserved. + * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.   *   * This program is free software; you can redistribute it and/or modify   * it under the terms of version 2 of the GNU General Public License as @@ -30,7 +30,7 @@   *   * BSD LICENSE   * - * Copyright(c) 2012 - 2013 Intel Corporation. All rights reserved. + * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without @@ -70,19 +70,20 @@  #include "fw-api-mac.h"  #include "fw-api-power.h"  #include "fw-api-d3.h" -#include "fw-api-bt-coex.h" +#include "fw-api-coex.h" +#include "fw-api-scan.h" -/* queue and FIFO numbers by usage */ +/* maximal number of Tx queues in any platform */ +#define IWL_MVM_MAX_QUEUES	20 + +/* Tx queue numbers */  enum {  	IWL_MVM_OFFCHANNEL_QUEUE = 8,  	IWL_MVM_CMD_QUEUE = 9, -	IWL_MVM_AUX_QUEUE = 15, -	IWL_MVM_FIRST_AGG_QUEUE = 16, -	IWL_MVM_NUM_QUEUES = 20, -	IWL_MVM_LAST_AGG_QUEUE = IWL_MVM_NUM_QUEUES - 1, -	IWL_MVM_CMD_FIFO = 7  }; +#define IWL_MVM_CMD_FIFO	7 +  #define IWL_MVM_STATION_COUNT	16  /* commands */ @@ -95,8 +96,10 @@ enum {  	/* PHY context commands */  	PHY_CONTEXT_CMD = 0x8,  	DBG_CFG = 0x9, +	ANTENNA_COUPLING_NOTIFICATION = 0xa,  	/* station table */ +	ADD_STA_KEY = 0x17,  	ADD_STA = 0x18,  	REMOVE_STA = 0x19, @@ -114,6 +117,7 @@ enum {  	TIME_EVENT_NOTIFICATION = 0x2a,  	BINDING_CONTEXT_CMD = 0x2b,  	TIME_QUOTA_CMD = 0x2c, +	NON_QOS_TX_COUNTER_CMD = 0x2d,  	LQ_CMD = 0x4e, @@ -130,6 +134,7 @@ enum {  	SCAN_OFFLOAD_COMPLETE = 0x6D,  	SCAN_OFFLOAD_UPDATE_PROFILES_CMD = 0x6E,  	SCAN_OFFLOAD_CONFIG_CMD = 0x6f, +	MATCH_FOUND_NOTIFICATION = 0xd9,  	/* Phy */  	PHY_CONFIGURATION_CMD = 0x6a, @@ -138,6 +143,7 @@ enum {  	/* Power - legacy power table command */  	POWER_TABLE_CMD = 0x77, +	PSM_UAPSD_AP_MISBEHAVING_NOTIFICATION = 0x78,  	/* Thermal Throttling*/  	REPLY_THERMAL_MNG_BACKOFF = 0x7e, @@ -159,6 +165,7 @@ enum {  	TX_ANT_CONFIGURATION_CMD = 0x98,  	BT_CONFIG = 0x9b,  	STATISTICS_NOTIFICATION = 0x9d, +	EOSP_NOTIFICATION = 0x9e,  	REDUCE_TX_POWER_CMD = 0x9f,  	/* RF-KILL commands and notifications */ @@ -178,12 +185,15 @@ enum {  	BT_COEX_PRIO_TABLE = 0xcc,  	BT_COEX_PROT_ENV = 0xcd,  	BT_PROFILE_NOTIFICATION = 0xce, +	BT_COEX_CI = 0x5d, +	REPLY_SF_CFG_CMD = 0xd1,  	REPLY_BEACON_FILTERING_CMD = 0xd2,  	REPLY_DEBUG_CMD = 0xf0,  	DEBUG_LOG_MSG = 0xf7, +	BCAST_FILTER_CMD = 0xcf,  	MCAST_FILTER_CMD = 0xd0,  	/* D3 commands/notifications */ @@ -191,6 +201,7 @@ enum {  	PROT_OFFLOAD_CONFIG_CMD = 0xd4,  	OFFLOADS_QUERY_CMD = 0xd5,  	REMOTE_WAKE_CONFIG_CMD = 0xd6, +	D0I3_END_CMD = 0xed,  	/* for WoWLAN in particular */  	WOWLAN_PATTERNS = 0xe0, @@ -307,14 +318,12 @@ enum {  /* Section types for NVM_ACCESS_CMD */  enum { -	NVM_SECTION_TYPE_HW = 0, -	NVM_SECTION_TYPE_SW, -	NVM_SECTION_TYPE_PAPD, -	NVM_SECTION_TYPE_BT, -	NVM_SECTION_TYPE_CALIBRATION, -	NVM_SECTION_TYPE_PRODUCTION, -	NVM_SECTION_TYPE_POST_FCS_CALIB, -	NVM_NUM_OF_SECTIONS, +	NVM_SECTION_TYPE_SW = 1, +	NVM_SECTION_TYPE_REGULATORY = 3, +	NVM_SECTION_TYPE_CALIBRATION = 4, +	NVM_SECTION_TYPE_PRODUCTION = 5, +	NVM_SECTION_TYPE_MAC_OVERRIDE = 11, +	NVM_MAX_NUM_SECTIONS = 12,  };  /** @@ -406,6 +415,35 @@ struct mvm_alive_resp {  	__le32 scd_base_ptr;		/* SRAM address for SCD */  } __packed; /* ALIVE_RES_API_S_VER_1 */ +struct mvm_alive_resp_ver2 { +	__le16 status; +	__le16 flags; +	u8 ucode_minor; +	u8 ucode_major; +	__le16 id; +	u8 api_minor; +	u8 api_major; +	u8 ver_subtype; +	u8 ver_type; +	u8 mac; +	u8 opt; +	__le16 reserved2; +	__le32 timestamp; +	__le32 error_event_table_ptr;	/* SRAM address for error log */ +	__le32 log_event_table_ptr;	/* SRAM address for LMAC event log */ +	__le32 cpu_register_ptr; +	__le32 dbgm_config_ptr; +	__le32 alive_counter_ptr; +	__le32 scd_base_ptr;		/* SRAM address for SCD */ +	__le32 st_fwrd_addr;		/* pointer to Store and forward */ +	__le32 st_fwrd_size; +	u8 umac_minor;			/* UMAC version: minor */ +	u8 umac_major;			/* UMAC version: major */ +	__le16 umac_id;			/* UMAC version: id */ +	__le32 error_info_addr;		/* SRAM address for UMAC error log */ +	__le32 dbg_print_buff_addr; +} __packed; /* ALIVE_RES_API_S_VER_2 */ +  /* Error response/notification */  enum {  	FW_ERR_UNKNOWN_CMD = 0x0, @@ -567,52 +605,7 @@ enum {  	TE_V1_NOTIF_INTERNAL_FRAG_END = BIT(7),  }; /* MAC_EVENT_ACTION_API_E_VER_2 */ - -/** - * struct iwl_time_event_cmd_api_v1 - configuring Time Events - * with struct MAC_TIME_EVENT_DATA_API_S_VER_1 (see also - * with version 2. determined by IWL_UCODE_TLV_FLAGS) - * ( TIME_EVENT_CMD = 0x29 ) - * @id_and_color: ID and color of the relevant MAC - * @action: action to perform, one of FW_CTXT_ACTION_* - * @id: this field has two meanings, depending on the action: - *	If the action is ADD, then it means the type of event to add. - *	For all other actions it is the unique event ID assigned when the - *	event was added by the FW. - * @apply_time: When to start the Time Event (in GP2) - * @max_delay: maximum delay to event's start (apply time), in TU - * @depends_on: the unique ID of the event we depend on (if any) - * @interval: interval between repetitions, in TU - * @interval_reciprocal: 2^32 / interval - * @duration: duration of event in TU - * @repeat: how many repetitions to do, can be TE_REPEAT_ENDLESS - * @dep_policy: one of TE_V1_INDEPENDENT, TE_V1_DEP_OTHER, TE_V1_DEP_TSF - *	and TE_V1_EVENT_SOCIOPATHIC - * @is_present: 0 or 1, are we present or absent during the Time Event - * @max_frags: maximal number of fragments the Time Event can be divided to - * @notify: notifications using TE_V1_NOTIF_* (whom to notify when) - */ -struct iwl_time_event_cmd_v1 { -	/* COMMON_INDEX_HDR_API_S_VER_1 */ -	__le32 id_and_color; -	__le32 action; -	__le32 id; -	/* MAC_TIME_EVENT_DATA_API_S_VER_1 */ -	__le32 apply_time; -	__le32 max_delay; -	__le32 dep_policy; -	__le32 depends_on; -	__le32 is_present; -	__le32 max_frags; -	__le32 interval; -	__le32 interval_reciprocal; -	__le32 duration; -	__le32 repeat; -	__le32 notify; -} __packed; /* MAC_TIME_EVENT_CMD_API_S_VER_1 */ - - -/* Time event - defines for command API v2 */ +/* Time event - defines for command API */  /*   * @TE_V2_FRAG_NONE: fragmentation of the time event is NOT allowed. @@ -643,7 +636,7 @@ enum {  #define TE_V2_PLACEMENT_POS	12  #define TE_V2_ABSENCE_POS	15 -/* Time event policy values (for time event cmd api v2) +/* Time event policy values   * A notification (both event and fragment) includes a status indicating weather   * the FW was able to schedule the event or not. For fragment start/end   * notification the status is always success. There is no start/end fragment @@ -676,6 +669,7 @@ enum {  	TE_V2_NOTIF_HOST_FRAG_END = BIT(5),  	TE_V2_NOTIF_INTERNAL_FRAG_START = BIT(6),  	TE_V2_NOTIF_INTERNAL_FRAG_END = BIT(7), +	T2_V2_START_IMMEDIATELY = BIT(11),  	TE_V2_NOTIF_MSK = 0xff, @@ -689,7 +683,7 @@ enum {  };  /** - * struct iwl_time_event_cmd_api_v2 - configuring Time Events + * struct iwl_time_event_cmd_api - configuring Time Events   * with struct MAC_TIME_EVENT_DATA_API_S_VER_2 (see also   * with version 1. determined by IWL_UCODE_TLV_FLAGS)   * ( TIME_EVENT_CMD = 0x29 ) @@ -712,7 +706,7 @@ enum {   *	TE_EVENT_SOCIOPATHIC   *	using TE_ABSENCE and using TE_NOTIF_*   */ -struct iwl_time_event_cmd_v2 { +struct iwl_time_event_cmd {  	/* COMMON_INDEX_HDR_API_S_VER_1 */  	__le32 id_and_color;  	__le32 action; @@ -1048,6 +1042,7 @@ enum iwl_mvm_rx_status {  	RX_MPDU_RES_STATUS_SEC_WEP_ENC			= (1 << 8),  	RX_MPDU_RES_STATUS_SEC_CCM_ENC			= (2 << 8),  	RX_MPDU_RES_STATUS_SEC_TKIP_ENC			= (3 << 8), +	RX_MPDU_RES_STATUS_SEC_EXT_ENC			= (4 << 8),  	RX_MPDU_RES_STATUS_SEC_CCM_CMAC_ENC		= (6 << 8),  	RX_MPDU_RES_STATUS_SEC_ENC_ERR			= (7 << 8),  	RX_MPDU_RES_STATUS_SEC_ENC_MSK			= (7 << 8), @@ -1127,6 +1122,7 @@ struct iwl_set_calib_default_cmd {  } __packed; /* PHY_CALIB_OVERRIDE_VALUES_S */  #define MAX_PORT_ID_NUM	2 +#define MAX_MCAST_FILTERING_ADDRESSES 256  /**   * struct iwl_mcast_filter_cmd - configure multicast filter. @@ -1151,6 +1147,90 @@ struct iwl_mcast_filter_cmd {  	u8 addr_list[0];  } __packed; /* MCAST_FILTERING_CMD_API_S_VER_1 */ +#define MAX_BCAST_FILTERS 8 +#define MAX_BCAST_FILTER_ATTRS 2 + +/** + * enum iwl_mvm_bcast_filter_attr_offset - written by fw for each Rx packet + * @BCAST_FILTER_OFFSET_PAYLOAD_START: offset is from payload start. + * @BCAST_FILTER_OFFSET_IP_END: offset is from ip header end (i.e. + *	start of ip payload). + */ +enum iwl_mvm_bcast_filter_attr_offset { +	BCAST_FILTER_OFFSET_PAYLOAD_START = 0, +	BCAST_FILTER_OFFSET_IP_END = 1, +}; + +/** + * struct iwl_fw_bcast_filter_attr - broadcast filter attribute + * @offset_type:	&enum iwl_mvm_bcast_filter_attr_offset. + * @offset:	starting offset of this pattern. + * @val:		value to match - big endian (MSB is the first + *		byte to match from offset pos). + * @mask:	mask to match (big endian). + */ +struct iwl_fw_bcast_filter_attr { +	u8 offset_type; +	u8 offset; +	__le16 reserved1; +	__be32 val; +	__be32 mask; +} __packed; /* BCAST_FILTER_ATT_S_VER_1 */ + +/** + * enum iwl_mvm_bcast_filter_frame_type - filter frame type + * @BCAST_FILTER_FRAME_TYPE_ALL: consider all frames. + * @BCAST_FILTER_FRAME_TYPE_IPV4: consider only ipv4 frames + */ +enum iwl_mvm_bcast_filter_frame_type { +	BCAST_FILTER_FRAME_TYPE_ALL = 0, +	BCAST_FILTER_FRAME_TYPE_IPV4 = 1, +}; + +/** + * struct iwl_fw_bcast_filter - broadcast filter + * @discard: discard frame (1) or let it pass (0). + * @frame_type: &enum iwl_mvm_bcast_filter_frame_type. + * @num_attrs: number of valid attributes in this filter. + * @attrs: attributes of this filter. a filter is considered matched + *	only when all its attributes are matched (i.e. AND relationship) + */ +struct iwl_fw_bcast_filter { +	u8 discard; +	u8 frame_type; +	u8 num_attrs; +	u8 reserved1; +	struct iwl_fw_bcast_filter_attr attrs[MAX_BCAST_FILTER_ATTRS]; +} __packed; /* BCAST_FILTER_S_VER_1 */ + +/** + * struct iwl_fw_bcast_mac - per-mac broadcast filtering configuration. + * @default_discard: default action for this mac (discard (1) / pass (0)). + * @attached_filters: bitmap of relevant filters for this mac. + */ +struct iwl_fw_bcast_mac { +	u8 default_discard; +	u8 reserved1; +	__le16 attached_filters; +} __packed; /* BCAST_MAC_CONTEXT_S_VER_1 */ + +/** + * struct iwl_bcast_filter_cmd - broadcast filtering configuration + * @disable: enable (0) / disable (1) + * @max_bcast_filters: max number of filters (MAX_BCAST_FILTERS) + * @max_macs: max number of macs (NUM_MAC_INDEX_DRIVER) + * @filters: broadcast filters + * @macs: broadcast filtering configuration per-mac + */ +struct iwl_bcast_filter_cmd { +	u8 disable; +	u8 max_bcast_filters; +	u8 max_macs; +	u8 reserved1; +	struct iwl_fw_bcast_filter filters[MAX_BCAST_FILTERS]; +	struct iwl_fw_bcast_mac macs[NUM_MAC_INDEX_DRIVER]; +} __packed; /* BCAST_FILTERING_HCMD_API_S_VER_1 */ +  struct mvm_statistics_dbg {  	__le32 burst_check;  	__le32 burst_count; @@ -1359,4 +1439,65 @@ struct iwl_notif_statistics { /* STATISTICS_NTFY_API_S_VER_8 */  	struct mvm_statistics_general general;  } __packed; +/*********************************** + * Smart Fifo API + ***********************************/ +/* Smart Fifo state */ +enum iwl_sf_state { +	SF_LONG_DELAY_ON = 0, /* should never be called by driver */ +	SF_FULL_ON, +	SF_UNINIT, +	SF_INIT_OFF, +	SF_HW_NUM_STATES +}; + +/* Smart Fifo possible scenario */ +enum iwl_sf_scenario { +	SF_SCENARIO_SINGLE_UNICAST, +	SF_SCENARIO_AGG_UNICAST, +	SF_SCENARIO_MULTICAST, +	SF_SCENARIO_BA_RESP, +	SF_SCENARIO_TX_RESP, +	SF_NUM_SCENARIO +}; + +#define SF_TRANSIENT_STATES_NUMBER 2	/* SF_LONG_DELAY_ON and SF_FULL_ON */ +#define SF_NUM_TIMEOUT_TYPES 2		/* Aging timer and Idle timer */ + +/* smart FIFO default values */ +#define SF_W_MARK_SISO 4096 +#define SF_W_MARK_MIMO2 8192 +#define SF_W_MARK_MIMO3 6144 +#define SF_W_MARK_LEGACY 4096 +#define SF_W_MARK_SCAN 4096 + +/* SF Scenarios timers for FULL_ON state (aligned to 32 uSec) */ +#define SF_SINGLE_UNICAST_IDLE_TIMER 320	/* 300 uSec  */ +#define SF_SINGLE_UNICAST_AGING_TIMER 2016	/* 2 mSec */ +#define SF_AGG_UNICAST_IDLE_TIMER 320		/* 300 uSec */ +#define SF_AGG_UNICAST_AGING_TIMER 2016		/* 2 mSec */ +#define SF_MCAST_IDLE_TIMER 2016		/* 2 mSec */ +#define SF_MCAST_AGING_TIMER 10016		/* 10 mSec */ +#define SF_BA_IDLE_TIMER 320			/* 300 uSec */ +#define SF_BA_AGING_TIMER 2016			/* 2 mSec */ +#define SF_TX_RE_IDLE_TIMER 320			/* 300 uSec */ +#define SF_TX_RE_AGING_TIMER 2016		/* 2 mSec */ + +#define SF_LONG_DELAY_AGING_TIMER 1000000	/* 1 Sec */ + +/** + * Smart Fifo configuration command. + * @state: smart fifo state, types listed in iwl_sf_sate. + * @watermark: Minimum allowed availabe free space in RXF for transient state. + * @long_delay_timeouts: aging and idle timer values for each scenario + * in long delay state. + * @full_on_timeouts: timer values for each scenario in full on state. + */ +struct iwl_sf_cfg_cmd { +	enum iwl_sf_state state; +	__le32 watermark[SF_TRANSIENT_STATES_NUMBER]; +	__le32 long_delay_timeouts[SF_NUM_SCENARIO][SF_NUM_TIMEOUT_TYPES]; +	__le32 full_on_timeouts[SF_NUM_SCENARIO][SF_NUM_TIMEOUT_TYPES]; +} __packed; /* SF_CFG_API_S_VER_2 */ +  #endif /* __fw_api_h__ */  | 
