提交 6eb031d2 编写于 作者: S Sara Sharon 提交者: Emmanuel Grumbach

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: NSara Sharon <sara.sharon@intel.com>
Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
上级 48ed7040
...@@ -444,7 +444,7 @@ static int iwlagn_mac_resume(struct ieee80211_hw *hw) ...@@ -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 = {};
......
/****************************************************************************** /******************************************************************************
* *
* 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, ...@@ -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,6 +3,7 @@ ...@@ -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, ...@@ -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, ...@@ -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
}; };
......
...@@ -6,6 +6,7 @@ ...@@ -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, ...@@ -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); ...@@ -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, ...@@ -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;
......
...@@ -6,6 +6,7 @@ ...@@ -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 { ...@@ -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); ...@@ -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);
......
...@@ -148,6 +148,9 @@ static inline u32 iwl_cmd_id(u8 opcode, u8 groupid, u8 version) ...@@ -148,6 +148,9 @@ static inline u32 iwl_cmd_id(u8 opcode, u8 groupid, u8 version)
return opcode + (groupid << 8) + (version << 16); return opcode + (groupid << 8) + (version << 16);
} }
/* make u16 wide id out of u8 group and opcode */
#define WIDE_ID(grp, opcode) ((grp << 8) | opcode)
/* due to the conversion, this group is special; new groups /* due to the conversion, this group is special; new groups
* should be defined in the appropriate fw-api header files * should be defined in the appropriate fw-api header files
*/ */
......
...@@ -1145,7 +1145,7 @@ static int __iwl_mvm_suspend(struct ieee80211_hw *hw, ...@@ -1145,7 +1145,7 @@ static int __iwl_mvm_suspend(struct ieee80211_hw *hw,
static int iwl_mvm_enter_d0i3_sync(struct iwl_mvm *mvm) static int iwl_mvm_enter_d0i3_sync(struct iwl_mvm *mvm)
{ {
struct iwl_notification_wait wait_d3; struct iwl_notification_wait wait_d3;
static const u8 d3_notif[] = { D3_CONFIG_CMD }; static const u16 d3_notif[] = { D3_CONFIG_CMD };
int ret; int ret;
iwl_init_notification_wait(&mvm->notif_wait, &wait_d3, iwl_init_notification_wait(&mvm->notif_wait, &wait_d3,
......
...@@ -213,7 +213,7 @@ static int iwl_mvm_load_ucode_wait_alive(struct iwl_mvm *mvm, ...@@ -213,7 +213,7 @@ static int iwl_mvm_load_ucode_wait_alive(struct iwl_mvm *mvm,
const struct fw_img *fw; const struct fw_img *fw;
int ret, i; int ret, i;
enum iwl_ucode_type old_type = mvm->cur_ucode; enum iwl_ucode_type old_type = mvm->cur_ucode;
static const u8 alive_cmd[] = { MVM_ALIVE }; static const u16 alive_cmd[] = { MVM_ALIVE };
struct iwl_sf_region st_fwrd_space; struct iwl_sf_region st_fwrd_space;
if (ucode_type == IWL_UCODE_REGULAR && if (ucode_type == IWL_UCODE_REGULAR &&
...@@ -314,7 +314,7 @@ static int iwl_send_phy_cfg_cmd(struct iwl_mvm *mvm) ...@@ -314,7 +314,7 @@ static int iwl_send_phy_cfg_cmd(struct iwl_mvm *mvm)
int iwl_run_init_mvm_ucode(struct iwl_mvm *mvm, bool read_nvm) int iwl_run_init_mvm_ucode(struct iwl_mvm *mvm, bool read_nvm)
{ {
struct iwl_notification_wait calib_wait; struct iwl_notification_wait calib_wait;
static const u8 init_complete[] = { static const u16 init_complete[] = {
INIT_COMPLETE_NOTIF, INIT_COMPLETE_NOTIF,
CALIB_RES_NOTIF_PHY_DB CALIB_RES_NOTIF_PHY_DB
}; };
......
...@@ -3019,7 +3019,7 @@ static int iwl_mvm_send_aux_roc_cmd(struct iwl_mvm *mvm, ...@@ -3019,7 +3019,7 @@ static int iwl_mvm_send_aux_roc_cmd(struct iwl_mvm *mvm,
int res, time_reg = DEVICE_SYSTEM_TIME_REG; int res, time_reg = DEVICE_SYSTEM_TIME_REG;
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
struct iwl_mvm_time_event_data *te_data = &mvmvif->hs_time_event_data; struct iwl_mvm_time_event_data *te_data = &mvmvif->hs_time_event_data;
static const u8 time_event_response[] = { HOT_SPOT_CMD }; static const u16 time_event_response[] = { HOT_SPOT_CMD };
struct iwl_notification_wait wait_time_event; struct iwl_notification_wait wait_time_event;
struct iwl_hs20_roc_req aux_roc_req = { struct iwl_hs20_roc_req aux_roc_req = {
.action = cpu_to_le32(FW_CTXT_ACTION_ADD), .action = cpu_to_le32(FW_CTXT_ACTION_ADD),
......
...@@ -1395,7 +1395,7 @@ static int iwl_mvm_umac_scan_abort(struct iwl_mvm *mvm, int type) ...@@ -1395,7 +1395,7 @@ static int iwl_mvm_umac_scan_abort(struct iwl_mvm *mvm, int type)
static int iwl_mvm_scan_stop_wait(struct iwl_mvm *mvm, int type) static int iwl_mvm_scan_stop_wait(struct iwl_mvm *mvm, int type)
{ {
struct iwl_notification_wait wait_scan_done; struct iwl_notification_wait wait_scan_done;
static const u8 scan_done_notif[] = { SCAN_COMPLETE_UMAC, static const u16 scan_done_notif[] = { SCAN_COMPLETE_UMAC,
SCAN_OFFLOAD_COMPLETE, }; SCAN_OFFLOAD_COMPLETE, };
int ret; int ret;
......
...@@ -500,7 +500,7 @@ static int iwl_mvm_time_event_send_add(struct iwl_mvm *mvm, ...@@ -500,7 +500,7 @@ static int iwl_mvm_time_event_send_add(struct iwl_mvm *mvm,
struct iwl_mvm_time_event_data *te_data, struct iwl_mvm_time_event_data *te_data,
struct iwl_time_event_cmd *te_cmd) struct iwl_time_event_cmd *te_cmd)
{ {
static const u8 time_event_response[] = { TIME_EVENT_CMD }; static const u16 time_event_response[] = { TIME_EVENT_CMD };
struct iwl_notification_wait wait_time_event; struct iwl_notification_wait wait_time_event;
int ret; int ret;
...@@ -563,7 +563,7 @@ void iwl_mvm_protect_session(struct iwl_mvm *mvm, ...@@ -563,7 +563,7 @@ void iwl_mvm_protect_session(struct iwl_mvm *mvm,
{ {
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
struct iwl_mvm_time_event_data *te_data = &mvmvif->time_event_data; struct iwl_mvm_time_event_data *te_data = &mvmvif->time_event_data;
const u8 te_notif_response[] = { TIME_EVENT_NOTIFICATION }; const u16 te_notif_response[] = { TIME_EVENT_NOTIFICATION };
struct iwl_notification_wait wait_te_notif; struct iwl_notification_wait wait_te_notif;
struct iwl_time_event_cmd time_cmd = {}; struct iwl_time_event_cmd time_cmd = {};
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
* *
* Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
* Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
* Copyright(c) 2015 Intel Deutschland GmbH
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
...@@ -183,7 +184,7 @@ static int iwl_mvm_get_temp_cmd(struct iwl_mvm *mvm) ...@@ -183,7 +184,7 @@ static int iwl_mvm_get_temp_cmd(struct iwl_mvm *mvm)
int iwl_mvm_get_temp(struct iwl_mvm *mvm) int iwl_mvm_get_temp(struct iwl_mvm *mvm)
{ {
struct iwl_notification_wait wait_temp_notif; struct iwl_notification_wait wait_temp_notif;
static const u8 temp_notif[] = { DTS_MEASUREMENT_NOTIFICATION }; static const u16 temp_notif[] = { DTS_MEASUREMENT_NOTIFICATION };
int ret, temp; int ret, temp;
lockdep_assert_held(&mvm->mutex); lockdep_assert_held(&mvm->mutex);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册