Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6eb031d2 authored by Sara Sharon's avatar Sara Sharon Committed by Emmanuel Grumbach
Browse files

iwlwifi: add wide firmware command support for notifications



Add support for extended command id in notification system.
Extended command id header contains group id in addition to command id.

Signed-off-by: default avatarSara Sharon <sara.sharon@intel.com>
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
parent 48ed7040
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -444,7 +444,7 @@ static int iwlagn_mac_resume(struct ieee80211_hw *hw)
		u32 error_id;
		u32 error_id;
	} err_info;
	} err_info;
	struct iwl_notification_wait status_wait;
	struct iwl_notification_wait status_wait;
	static const u8 status_cmd[] = {
	static const u16 status_cmd[] = {
		REPLY_WOWLAN_GET_STATUS,
		REPLY_WOWLAN_GET_STATUS,
	};
	};
	struct iwlagn_wowlan_status status_data = {};
	struct iwlagn_wowlan_status status_data = {};
+2 −1
Original line number Original line Diff line number Diff line
/******************************************************************************
/******************************************************************************
 *
 *
 * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved.
 * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved.
 * Copyright(c) 2015 Intel Deutschland GmbH
 *
 *
 * This program is free software; you can redistribute it and/or modify it
 * 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
 * under the terms of version 2 of the GNU General Public License as
@@ -123,7 +124,7 @@ static int iwlagn_disable_pan(struct iwl_priv *priv,
	__le32 old_filter = send->filter_flags;
	__le32 old_filter = send->filter_flags;
	u8 old_dev_type = send->dev_type;
	u8 old_dev_type = send->dev_type;
	int ret;
	int ret;
	static const u8 deactivate_cmd[] = {
	static const u16 deactivate_cmd[] = {
		REPLY_WIPAN_DEACTIVATION_COMPLETE
		REPLY_WIPAN_DEACTIVATION_COMPLETE
	};
	};


+3 −2
Original line number Original line Diff line number Diff line
@@ -3,6 +3,7 @@
 * GPL LICENSE SUMMARY
 * GPL LICENSE SUMMARY
 *
 *
 * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved.
 * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved.
 * Copyright(c) 2015 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
@@ -327,7 +328,7 @@ int iwl_load_ucode_wait_alive(struct iwl_priv *priv,
	const struct fw_img *fw;
	const struct fw_img *fw;
	int ret;
	int ret;
	enum iwl_ucode_type old_type;
	enum iwl_ucode_type old_type;
	static const u8 alive_cmd[] = { REPLY_ALIVE };
	static const u16 alive_cmd[] = { REPLY_ALIVE };


	fw = iwl_get_ucode_image(priv, ucode_type);
	fw = iwl_get_ucode_image(priv, ucode_type);
	if (WARN_ON(!fw))
	if (WARN_ON(!fw))
@@ -406,7 +407,7 @@ static bool iwlagn_wait_calib(struct iwl_notif_wait_data *notif_wait,
int iwl_run_init_ucode(struct iwl_priv *priv)
int iwl_run_init_ucode(struct iwl_priv *priv)
{
{
	struct iwl_notification_wait calib_wait;
	struct iwl_notification_wait calib_wait;
	static const u8 calib_complete[] = {
	static const u16 calib_complete[] = {
		CALIBRATION_RES_NOTIFICATION,
		CALIBRATION_RES_NOTIFICATION,
		CALIBRATION_COMPLETE_NOTIFICATION
		CALIBRATION_COMPLETE_NOTIFICATION
	};
	};
+5 −3
Original line number Original line Diff line number Diff line
@@ -6,6 +6,7 @@
 * GPL LICENSE SUMMARY
 * GPL LICENSE SUMMARY
 *
 *
 * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved.
 * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved.
 * Copyright(c) 2015 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
@@ -98,7 +99,8 @@ void iwl_notification_wait_notify(struct iwl_notif_wait_data *notif_wait,
				continue;
				continue;


			for (i = 0; i < w->n_cmds; i++) {
			for (i = 0; i < w->n_cmds; i++) {
				if (w->cmds[i] == pkt->hdr.cmd) {
				if (w->cmds[i] ==
				    WIDE_ID(pkt->hdr.group_id, pkt->hdr.cmd)) {
					found = true;
					found = true;
					break;
					break;
				}
				}
@@ -136,7 +138,7 @@ IWL_EXPORT_SYMBOL(iwl_abort_notification_waits);
void
void
iwl_init_notification_wait(struct iwl_notif_wait_data *notif_wait,
iwl_init_notification_wait(struct iwl_notif_wait_data *notif_wait,
			   struct iwl_notification_wait *wait_entry,
			   struct iwl_notification_wait *wait_entry,
			   const u8 *cmds, int n_cmds,
			   const u16 *cmds, int n_cmds,
			   bool (*fn)(struct iwl_notif_wait_data *notif_wait,
			   bool (*fn)(struct iwl_notif_wait_data *notif_wait,
				      struct iwl_rx_packet *pkt, void *data),
				      struct iwl_rx_packet *pkt, void *data),
			   void *fn_data)
			   void *fn_data)
@@ -147,7 +149,7 @@ iwl_init_notification_wait(struct iwl_notif_wait_data *notif_wait,
	wait_entry->fn = fn;
	wait_entry->fn = fn;
	wait_entry->fn_data = fn_data;
	wait_entry->fn_data = fn_data;
	wait_entry->n_cmds = n_cmds;
	wait_entry->n_cmds = n_cmds;
	memcpy(wait_entry->cmds, cmds, n_cmds);
	memcpy(wait_entry->cmds, cmds, n_cmds * sizeof(u16));
	wait_entry->triggered = false;
	wait_entry->triggered = false;
	wait_entry->aborted = false;
	wait_entry->aborted = false;


+3 −2
Original line number Original line Diff line number Diff line
@@ -6,6 +6,7 @@
 * GPL LICENSE SUMMARY
 * GPL LICENSE SUMMARY
 *
 *
 * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved.
 * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved.
 * Copyright(c) 2015 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
@@ -105,7 +106,7 @@ struct iwl_notification_wait {
		   struct iwl_rx_packet *pkt, void *data);
		   struct iwl_rx_packet *pkt, void *data);
	void *fn_data;
	void *fn_data;


	u8 cmds[MAX_NOTIF_CMDS];
	u16 cmds[MAX_NOTIF_CMDS];
	u8 n_cmds;
	u8 n_cmds;
	bool triggered, aborted;
	bool triggered, aborted;
};
};
@@ -121,7 +122,7 @@ void iwl_abort_notification_waits(struct iwl_notif_wait_data *notif_data);
void __acquires(wait_entry)
void __acquires(wait_entry)
iwl_init_notification_wait(struct iwl_notif_wait_data *notif_data,
iwl_init_notification_wait(struct iwl_notif_wait_data *notif_data,
			   struct iwl_notification_wait *wait_entry,
			   struct iwl_notification_wait *wait_entry,
			   const u8 *cmds, int n_cmds,
			   const u16 *cmds, int n_cmds,
			   bool (*fn)(struct iwl_notif_wait_data *notif_data,
			   bool (*fn)(struct iwl_notif_wait_data *notif_data,
				      struct iwl_rx_packet *pkt, void *data),
				      struct iwl_rx_packet *pkt, void *data),
			   void *fn_data);
			   void *fn_data);
Loading