Commit d69f0a2d authored by Johannes Berg's avatar Johannes Berg Committed by Luca Coelho

iwlwifi: mvm: create/name various enums

Some values should be in enums so documentation can refer to
them, some values should be named for the same reason.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent 4d151c2e
...@@ -197,7 +197,15 @@ enum iwl_sta_modify_flag { ...@@ -197,7 +197,15 @@ enum iwl_sta_modify_flag {
STA_MODIFY_QUEUES = BIT(7), STA_MODIFY_QUEUES = BIT(7),
}; };
#define STA_MODE_MODIFY 1 /**
* enum iwl_sta_mode - station command mode
* @STA_MODE_ADD: add new station
* @STA_MODE_MODIFY: modify the station
*/
enum iwl_sta_mode {
STA_MODE_ADD = 0,
STA_MODE_MODIFY = 1,
};
/** /**
* enum iwl_sta_sleep_flag - type of sleep of the station * enum iwl_sta_sleep_flag - type of sleep of the station
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
* Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
* Copyright(c) 2016 Intel Deutschland GmbH * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of version 2 of the GNU General Public License as
...@@ -323,12 +323,29 @@ struct iwl_notif_statistics_cdb { ...@@ -323,12 +323,29 @@ struct iwl_notif_statistics_cdb {
struct mvm_statistics_load_cdb load_stats; struct mvm_statistics_load_cdb load_stats;
} __packed; /* STATISTICS_NTFY_API_S_VER_12 */ } __packed; /* STATISTICS_NTFY_API_S_VER_12 */
#define IWL_STATISTICS_FLG_CLEAR 0x1 /**
#define IWL_STATISTICS_FLG_DISABLE_NOTIF 0x2 * enum iwl_statistics_notif_flags - flags used in statistics notification
* @IWL_STATISTICS_REPLY_FLG_CLEAR: statistics were cleared after this report
*/
enum iwl_statistics_notif_flags {
IWL_STATISTICS_REPLY_FLG_CLEAR = 0x1,
};
/**
* enum iwl_statistics_cmd_flags - flags used in statistics command
* @IWL_STATISTICS_FLG_CLEAR: request to clear statistics after the report
* that's sent after this command
* @IWL_STATISTICS_FLG_DISABLE_NOTIF: disable unilateral statistics
* notifications
*/
enum iwl_statistics_cmd_flags {
IWL_STATISTICS_FLG_CLEAR = 0x1,
IWL_STATISTICS_FLG_DISABLE_NOTIF = 0x2,
};
/** /**
* struct iwl_statistics_cmd - statistics config command * struct iwl_statistics_cmd - statistics config command
* @flags: flags from &enum iwl_statistics_flags * @flags: flags from &enum iwl_statistics_cmd_flags
*/ */
struct iwl_statistics_cmd { struct iwl_statistics_cmd {
__le32 flags; __le32 flags;
......
...@@ -472,15 +472,39 @@ struct iwl_phy_cfg_cmd { ...@@ -472,15 +472,39 @@ struct iwl_phy_cfg_cmd {
#define PHY_CFG_RX_CHAIN_C BIT(14) #define PHY_CFG_RX_CHAIN_C BIT(14)
/* Target of the NVM_ACCESS_CMD */ /**
enum { * enum iwl_nvm_access_op - NVM access opcode
* @IWL_NVM_READ: read NVM
* @IWL_NVM_WRITE: write NVM
*/
enum iwl_nvm_access_op {
IWL_NVM_READ = 0,
IWL_NVM_WRITE = 1,
};
/**
* enum iwl_nvm_access_target - target of the NVM_ACCESS_CMD
* @NVM_ACCESS_TARGET_CACHE: access the cache
* @NVM_ACCESS_TARGET_OTP: access the OTP
* @NVM_ACCESS_TARGET_EEPROM: access the EEPROM
*/
enum iwl_nvm_access_target {
NVM_ACCESS_TARGET_CACHE = 0, NVM_ACCESS_TARGET_CACHE = 0,
NVM_ACCESS_TARGET_OTP = 1, NVM_ACCESS_TARGET_OTP = 1,
NVM_ACCESS_TARGET_EEPROM = 2, NVM_ACCESS_TARGET_EEPROM = 2,
}; };
/* Section types for NVM_ACCESS_CMD */ /**
enum { * enum iwl_nvm_section_type - section types for NVM_ACCESS_CMD
* @NVM_SECTION_TYPE_SW: software section
* @NVM_SECTION_TYPE_REGULATORY: regulatory section
* @NVM_SECTION_TYPE_CALIBRATION: calibration section
* @NVM_SECTION_TYPE_PRODUCTION: production section
* @NVM_SECTION_TYPE_MAC_OVERRIDE: MAC override section
* @NVM_SECTION_TYPE_PHY_SKU: PHY SKU section
* @NVM_MAX_NUM_SECTIONS: number of sections
*/
enum iwl_nvm_section_type {
NVM_SECTION_TYPE_SW = 1, NVM_SECTION_TYPE_SW = 1,
NVM_SECTION_TYPE_REGULATORY = 3, NVM_SECTION_TYPE_REGULATORY = 3,
NVM_SECTION_TYPE_CALIBRATION = 4, NVM_SECTION_TYPE_CALIBRATION = 4,
...@@ -718,12 +742,21 @@ struct iwl_error_resp { ...@@ -718,12 +742,21 @@ struct iwl_error_resp {
#define MAX_MACS_IN_BINDING (3) #define MAX_MACS_IN_BINDING (3)
#define MAX_BINDINGS (4) #define MAX_BINDINGS (4)
/* Used to extract ID and color from the context dword */ /**
#define FW_CTXT_ID_POS (0) * enum iwl_mvm_id_and_color - ID and color fields in context dword
#define FW_CTXT_ID_MSK (0xff << FW_CTXT_ID_POS) * @FW_CTXT_ID_POS: position of the ID
#define FW_CTXT_COLOR_POS (8) * @FW_CTXT_ID_MSK: mask of the ID
#define FW_CTXT_COLOR_MSK (0xff << FW_CTXT_COLOR_POS) * @FW_CTXT_COLOR_POS: position of the color
#define FW_CTXT_INVALID (0xffffffff) * @FW_CTXT_COLOR_MSK: mask of the color
* @FW_CTXT_INVALID: value used to indicate unused/invalid
*/
enum iwl_mvm_id_and_color {
FW_CTXT_ID_POS = 0,
FW_CTXT_ID_MSK = 0xff << FW_CTXT_ID_POS,
FW_CTXT_COLOR_POS = 8,
FW_CTXT_COLOR_MSK = 0xff << FW_CTXT_COLOR_POS,
FW_CTXT_INVALID = 0xffffffff,
};
#define FW_CMD_ID_AND_COLOR(_id, _color) ((_id << FW_CTXT_ID_POS) |\ #define FW_CMD_ID_AND_COLOR(_id, _color) ((_id << FW_CTXT_ID_POS) |\
(_color << FW_CTXT_COLOR_POS)) (_color << FW_CTXT_COLOR_POS))
...@@ -871,7 +904,8 @@ enum { ...@@ -871,7 +904,8 @@ enum {
#define TE_V2_PLACEMENT_POS 12 #define TE_V2_PLACEMENT_POS 12
#define TE_V2_ABSENCE_POS 15 #define TE_V2_ABSENCE_POS 15
/* Time event policy values /**
* enum iwl_time_event_policy - Time event policy values
* A notification (both event and fragment) includes a status indicating weather * 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 * 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 * notification the status is always success. There is no start/end fragment
...@@ -886,12 +920,13 @@ enum { ...@@ -886,12 +920,13 @@ enum {
* @TE_V2_NOTIF_HOST_FRAG_END:request/receive notification on frag end * @TE_V2_NOTIF_HOST_FRAG_END:request/receive notification on frag end
* @TE_V2_NOTIF_INTERNAL_FRAG_START: internal FW use. * @TE_V2_NOTIF_INTERNAL_FRAG_START: internal FW use.
* @TE_V2_NOTIF_INTERNAL_FRAG_END: internal FW use. * @TE_V2_NOTIF_INTERNAL_FRAG_END: internal FW use.
* @T2_V2_START_IMMEDIATELY: start time event immediately
* @TE_V2_DEP_OTHER: depends on another time event * @TE_V2_DEP_OTHER: depends on another time event
* @TE_V2_DEP_TSF: depends on a specific time * @TE_V2_DEP_TSF: depends on a specific time
* @TE_V2_EVENT_SOCIOPATHIC: can't co-exist with other events of tha same MAC * @TE_V2_EVENT_SOCIOPATHIC: can't co-exist with other events of tha same MAC
* @TE_V2_ABSENCE: are we present or absent during the Time Event. * @TE_V2_ABSENCE: are we present or absent during the Time Event.
*/ */
enum { enum iwl_time_event_policy {
TE_V2_DEFAULT_POLICY = 0x0, TE_V2_DEFAULT_POLICY = 0x0,
/* notifications (event start/stop, fragment start/stop) */ /* notifications (event start/stop, fragment start/stop) */
...@@ -906,8 +941,6 @@ enum { ...@@ -906,8 +941,6 @@ enum {
TE_V2_NOTIF_INTERNAL_FRAG_END = BIT(7), TE_V2_NOTIF_INTERNAL_FRAG_END = BIT(7),
T2_V2_START_IMMEDIATELY = BIT(11), T2_V2_START_IMMEDIATELY = BIT(11),
TE_V2_NOTIF_MSK = 0xff,
/* placement characteristics */ /* placement characteristics */
TE_V2_DEP_OTHER = BIT(TE_V2_PLACEMENT_POS), TE_V2_DEP_OTHER = BIT(TE_V2_PLACEMENT_POS),
TE_V2_DEP_TSF = BIT(TE_V2_PLACEMENT_POS + 1), TE_V2_DEP_TSF = BIT(TE_V2_PLACEMENT_POS + 1),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment