Commit e6eb8ca9 authored by Golan Ben-Ami's avatar Golan Ben-Ami Committed by Emmanuel Grumbach

iwlwifi: expose fw usniffer mode to more utilities

Today, in order to configure fw in usniffer mode, the ucode
must have the corresponding tlv, which is revealed to the driver
while parsing the ucode.

Expose the mode of the usniffer to other utilities in the driver
(other than the ucode parser) by passing back a pointer to the value.
This can be very useful for allowing configuring the fw dbg data
using an external configuration file, because this configuration
depends on the fw usniffer mode.
Signed-off-by: default avatarGolan Ben-Ami <golan.ben.ami@intel.com>
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
parent b7282643
...@@ -594,7 +594,8 @@ static int iwl_parse_v1_v2_firmware(struct iwl_drv *drv, ...@@ -594,7 +594,8 @@ static int iwl_parse_v1_v2_firmware(struct iwl_drv *drv,
static int iwl_parse_tlv_firmware(struct iwl_drv *drv, static int iwl_parse_tlv_firmware(struct iwl_drv *drv,
const struct firmware *ucode_raw, const struct firmware *ucode_raw,
struct iwl_firmware_pieces *pieces, struct iwl_firmware_pieces *pieces,
struct iwl_ucode_capabilities *capa) struct iwl_ucode_capabilities *capa,
bool *usniffer_images)
{ {
struct iwl_tlv_ucode_header *ucode = (void *)ucode_raw->data; struct iwl_tlv_ucode_header *ucode = (void *)ucode_raw->data;
struct iwl_ucode_tlv *tlv; struct iwl_ucode_tlv *tlv;
...@@ -607,7 +608,6 @@ static int iwl_parse_tlv_firmware(struct iwl_drv *drv, ...@@ -607,7 +608,6 @@ static int iwl_parse_tlv_firmware(struct iwl_drv *drv,
char buildstr[25]; char buildstr[25];
u32 build, paging_mem_size; u32 build, paging_mem_size;
int num_of_cpus; int num_of_cpus;
bool usniffer_images = false;
bool usniffer_req = false; bool usniffer_req = false;
bool gscan_capa = false; bool gscan_capa = false;
...@@ -980,7 +980,7 @@ static int iwl_parse_tlv_firmware(struct iwl_drv *drv, ...@@ -980,7 +980,7 @@ static int iwl_parse_tlv_firmware(struct iwl_drv *drv,
break; break;
} }
case IWL_UCODE_TLV_SEC_RT_USNIFFER: case IWL_UCODE_TLV_SEC_RT_USNIFFER:
usniffer_images = true; *usniffer_images = true;
iwl_store_ucode_sec(pieces, tlv_data, iwl_store_ucode_sec(pieces, tlv_data,
IWL_UCODE_REGULAR_USNIFFER, IWL_UCODE_REGULAR_USNIFFER,
tlv_len); tlv_len);
...@@ -1031,7 +1031,7 @@ static int iwl_parse_tlv_firmware(struct iwl_drv *drv, ...@@ -1031,7 +1031,7 @@ static int iwl_parse_tlv_firmware(struct iwl_drv *drv,
} }
} }
if (usniffer_req && !usniffer_images) { if (usniffer_req && !*usniffer_images) {
IWL_ERR(drv, IWL_ERR(drv,
"user selected to work with usniffer but usniffer image isn't available in ucode package\n"); "user selected to work with usniffer but usniffer image isn't available in ucode package\n");
return -EINVAL; return -EINVAL;
...@@ -1192,6 +1192,7 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context) ...@@ -1192,6 +1192,7 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context)
u32 api_ver; u32 api_ver;
int i; int i;
bool load_module = false; bool load_module = false;
bool usniffer_images = false;
fw->ucode_capa.max_probe_length = IWL_DEFAULT_MAX_PROBE_LENGTH; fw->ucode_capa.max_probe_length = IWL_DEFAULT_MAX_PROBE_LENGTH;
fw->ucode_capa.standard_phy_calibration_size = fw->ucode_capa.standard_phy_calibration_size =
...@@ -1229,7 +1230,7 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context) ...@@ -1229,7 +1230,7 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context)
err = iwl_parse_v1_v2_firmware(drv, ucode_raw, pieces); err = iwl_parse_v1_v2_firmware(drv, ucode_raw, pieces);
else else
err = iwl_parse_tlv_firmware(drv, ucode_raw, pieces, err = iwl_parse_tlv_firmware(drv, ucode_raw, pieces,
&fw->ucode_capa); &fw->ucode_capa, &usniffer_images);
if (err) if (err)
goto try_again; goto try_again;
......
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