Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 291237
b: refs/heads/master
c: e199188
h: refs/heads/master
i:
  291235: 6a4ac24
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Mar 7, 2012
1 parent 3f62af8 commit 5158f89
Show file tree
Hide file tree
Showing 14 changed files with 151 additions and 161 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3d4f96997263d97cd4d60373f1ed8184ee6df31b
refs/heads/master: e19918855dc4822a24787a6d0048205b011e5ecb
26 changes: 17 additions & 9 deletions trunk/drivers/net/wireless/iwlwifi/iwl-agn-calib.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@
* INIT calibrations framework
*****************************************************************************/

/* Opaque calibration results */
struct iwl_calib_result {
struct list_head list;
size_t cmd_len;
struct iwl_calib_hdr hdr;
/* data follows */
};

struct statistics_general_data {
u32 beacon_silence_rssi_a;
u32 beacon_silence_rssi_b;
Expand All @@ -84,23 +92,23 @@ struct statistics_general_data {
u32 beacon_energy_c;
};

int iwl_send_calib_results(struct iwl_trans *trans)
int iwl_send_calib_results(struct iwl_priv *priv)
{
struct iwl_host_cmd hcmd = {
.id = REPLY_PHY_CALIBRATION_CMD,
.flags = CMD_SYNC,
};
struct iwl_calib_result *res;

list_for_each_entry(res, &trans->calib_results, list) {
list_for_each_entry(res, &priv->calib_results, list) {
int ret;

hcmd.len[0] = res->cmd_len;
hcmd.data[0] = &res->hdr;
hcmd.dataflags[0] = IWL_HCMD_DFL_NOCOPY;
ret = iwl_trans_send_cmd(trans, &hcmd);
ret = iwl_trans_send_cmd(trans(priv), &hcmd);
if (ret) {
IWL_ERR(trans, "Error %d on calib cmd %d\n",
IWL_ERR(priv, "Error %d on calib cmd %d\n",
ret, res->hdr.op_code);
return ret;
}
Expand All @@ -109,7 +117,7 @@ int iwl_send_calib_results(struct iwl_trans *trans)
return 0;
}

int iwl_calib_set(struct iwl_trans *trans,
int iwl_calib_set(struct iwl_priv *priv,
const struct iwl_calib_hdr *cmd, int len)
{
struct iwl_calib_result *res, *tmp;
Expand All @@ -121,7 +129,7 @@ int iwl_calib_set(struct iwl_trans *trans,
memcpy(&res->hdr, cmd, len);
res->cmd_len = len;

list_for_each_entry(tmp, &trans->calib_results, list) {
list_for_each_entry(tmp, &priv->calib_results, list) {
if (tmp->hdr.op_code == res->hdr.op_code) {
list_replace(&tmp->list, &res->list);
kfree(tmp);
Expand All @@ -130,16 +138,16 @@ int iwl_calib_set(struct iwl_trans *trans,
}

/* wasn't in list already */
list_add_tail(&res->list, &trans->calib_results);
list_add_tail(&res->list, &priv->calib_results);

return 0;
}

void iwl_calib_free_results(struct iwl_trans *trans)
void iwl_calib_free_results(struct iwl_priv *priv)
{
struct iwl_calib_result *res, *tmp;

list_for_each_entry_safe(res, tmp, &trans->calib_results, list) {
list_for_each_entry_safe(res, tmp, &priv->calib_results, list) {
list_del(&res->list);
kfree(res);
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1195,7 +1195,7 @@ int iwlagn_suspend(struct iwl_priv *priv,

priv->wowlan = true;

ret = iwl_load_ucode_wait_alive(trans(priv), IWL_UCODE_WOWLAN);
ret = iwl_load_ucode_wait_alive(priv, IWL_UCODE_WOWLAN);
if (ret)
goto out;

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/wireless/iwlwifi/iwl-agn-rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1177,7 +1177,7 @@ int iwl_rx_dispatch(struct iwl_op_mode *op_mode, struct iwl_rx_cmd_buffer *rxb,
pkt->hdr.cmd);
w->triggered = true;
if (w->fn)
w->fn(trans(priv), pkt, w->fn_data);
w->fn(priv, pkt, w->fn_data);
}
spin_unlock(&priv->shrd->notif_wait_lock);

Expand Down
9 changes: 5 additions & 4 deletions trunk/drivers/net/wireless/iwlwifi/iwl-agn.c
Original file line number Diff line number Diff line change
Expand Up @@ -671,14 +671,14 @@ int iwl_alive_start(struct iwl_priv *priv)
priv->bt_valid = IWLAGN_BT_VALID_ENABLE_FLAGS;
priv->cur_rssi_ctx = NULL;

iwl_send_prio_tbl(trans(priv));
iwl_send_prio_tbl(priv);

/* FIXME: w/a to force change uCode BT state machine */
ret = iwl_send_bt_env(trans(priv), IWL_BT_COEX_ENV_OPEN,
ret = iwl_send_bt_env(priv, IWL_BT_COEX_ENV_OPEN,
BT_COEX_PRIO_TBL_EVT_INIT_CALIB2);
if (ret)
return ret;
ret = iwl_send_bt_env(trans(priv), IWL_BT_COEX_ENV_CLOSE,
ret = iwl_send_bt_env(priv, IWL_BT_COEX_ENV_CLOSE,
BT_COEX_PRIO_TBL_EVT_INIT_CALIB2);
if (ret)
return ret;
Expand Down Expand Up @@ -1040,7 +1040,7 @@ static int iwl_init_drv(struct iwl_priv *priv)

mutex_init(&priv->shrd->mutex);

INIT_LIST_HEAD(&trans(priv)->calib_results);
INIT_LIST_HEAD(&priv->calib_results);

priv->ieee_channels = NULL;
priv->ieee_rates = NULL;
Expand Down Expand Up @@ -1105,6 +1105,7 @@ static void iwl_uninit_drv(struct iwl_priv *priv)
kfree(priv->scan_cmd);
kfree(priv->beacon_cmd);
kfree(rcu_dereference_raw(priv->noa_data));
iwl_calib_free_results(priv);
#ifdef CONFIG_IWLWIFI_DEBUGFS
kfree(priv->wowlan_sram);
#endif
Expand Down
10 changes: 10 additions & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-agn.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,16 @@ int iwlagn_rx_calib_result(struct iwl_priv *priv,
struct iwl_rx_cmd_buffer *rxb,
struct iwl_device_cmd *cmd);
void iwl_init_context(struct iwl_priv *priv, u32 ucode_flags);
int iwl_send_bt_env(struct iwl_priv *priv, u8 action, u8 type);
void iwl_send_prio_tbl(struct iwl_priv *priv);
int iwl_init_alive_start(struct iwl_priv *priv);
int iwl_run_init_ucode(struct iwl_priv *priv);
int iwl_load_ucode_wait_alive(struct iwl_priv *priv,
enum iwl_ucode_type ucode_type);
int iwl_send_calib_results(struct iwl_priv *priv);
int iwl_calib_set(struct iwl_priv *priv,
const struct iwl_calib_hdr *cmd, int len);
void iwl_calib_free_results(struct iwl_priv *priv);

/* lib */
int iwlagn_send_tx_power(struct iwl_priv *priv);
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,8 @@ struct iwl_priv {
struct ieee80211_rate *ieee_rates;
struct kmem_cache *tx_cmd_pool;

struct list_head calib_results;

struct workqueue_struct *workqueue;

enum ieee80211_band band;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/wireless/iwlwifi/iwl-mac80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,13 +278,13 @@ static int __iwl_up(struct iwl_priv *priv)
}
}

ret = iwl_run_init_ucode(trans(priv));
ret = iwl_run_init_ucode(priv);
if (ret) {
IWL_ERR(priv, "Failed to run INIT ucode: %d\n", ret);
goto error;
}

ret = iwl_load_ucode_wait_alive(trans(priv), IWL_UCODE_REGULAR);
ret = iwl_load_ucode_wait_alive(priv, IWL_UCODE_REGULAR);
if (ret) {
IWL_ERR(priv, "Failed to start RT ucode: %d\n", ret);
goto error;
Expand Down
14 changes: 7 additions & 7 deletions trunk/drivers/net/wireless/iwlwifi/iwl-shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ enum iwl_ucode_type {
struct iwl_notification_wait {
struct list_head list;

void (*fn)(struct iwl_trans *trans, struct iwl_rx_packet *pkt,
void (*fn)(struct iwl_priv *priv, struct iwl_rx_packet *pkt,
void *data);
void *fn_data;

Expand Down Expand Up @@ -472,12 +472,12 @@ bool iwl_check_for_ct_kill(struct iwl_priv *priv);
void iwl_abort_notification_waits(struct iwl_shared *shrd);
void __acquires(wait_entry)
iwl_init_notification_wait(struct iwl_shared *shrd,
struct iwl_notification_wait *wait_entry,
u8 cmd,
void (*fn)(struct iwl_trans *trans,
struct iwl_rx_packet *pkt,
void *data),
void *fn_data);
struct iwl_notification_wait *wait_entry,
u8 cmd,
void (*fn)(struct iwl_priv *priv,
struct iwl_rx_packet *pkt,
void *data),
void *fn_data);
int __must_check __releases(wait_entry)
iwl_wait_notification(struct iwl_shared *shrd,
struct iwl_notification_wait *wait_entry,
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/net/wireless/iwlwifi/iwl-testmode.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ static int iwl_testmode_cfg_init_calib(struct iwl_priv *priv)
iwl_init_notification_wait(priv->shrd, &calib_wait,
CALIBRATION_COMPLETE_NOTIFICATION,
NULL, NULL);
ret = iwl_init_alive_start(trans(priv));
ret = iwl_init_alive_start(priv);
if (ret) {
IWL_ERR(priv, "Fail init calibration: %d\n", ret);
goto cfg_init_calib_error;
Expand Down Expand Up @@ -484,7 +484,7 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb)
break;

case IWL_TM_CMD_APP2DEV_LOAD_INIT_FW:
status = iwl_load_ucode_wait_alive(trans, IWL_UCODE_INIT);
status = iwl_load_ucode_wait_alive(priv, IWL_UCODE_INIT);
if (status)
IWL_ERR(priv, "Error loading init ucode: %d\n", status);
break;
Expand All @@ -495,7 +495,7 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb)
break;

case IWL_TM_CMD_APP2DEV_LOAD_RUNTIME_FW:
status = iwl_load_ucode_wait_alive(trans, IWL_UCODE_REGULAR);
status = iwl_load_ucode_wait_alive(priv, IWL_UCODE_REGULAR);
if (status) {
IWL_ERR(priv,
"Error loading runtime ucode: %d\n", status);
Expand All @@ -510,7 +510,7 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb)
case IWL_TM_CMD_APP2DEV_LOAD_WOWLAN_FW:
iwl_scan_cancel_timeout(priv, 200);
iwl_trans_stop_device(trans);
status = iwl_load_ucode_wait_alive(trans, IWL_UCODE_WOWLAN);
status = iwl_load_ucode_wait_alive(priv, IWL_UCODE_WOWLAN);
if (status) {
IWL_ERR(priv,
"Error loading WOWLAN ucode: %d\n", status);
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
Original file line number Diff line number Diff line change
Expand Up @@ -1632,7 +1632,6 @@ static void iwl_trans_pcie_free(struct iwl_trans *trans)
struct iwl_trans_pcie *trans_pcie =
IWL_TRANS_GET_PCIE_TRANS(trans);

iwl_calib_free_results(trans);
iwl_trans_pcie_tx_free(trans);
#ifndef CONFIG_IWLWIFI_IDI
iwl_trans_pcie_rx_free(trans);
Expand Down
19 changes: 0 additions & 19 deletions trunk/drivers/net/wireless/iwlwifi/iwl-trans.h
Original file line number Diff line number Diff line change
Expand Up @@ -315,14 +315,6 @@ struct iwl_trans_ops {
u32 (*read32)(struct iwl_trans *trans, u32 ofs);
};

/* Opaque calibration results */
struct iwl_calib_result {
struct list_head list;
size_t cmd_len;
struct iwl_calib_hdr hdr;
/* data follows */
};

/**
* enum iwl_trans_state - state of the transport layer
*
Expand All @@ -349,7 +341,6 @@ enum iwl_trans_state {
* @ucode_write_complete: indicates that the ucode has been copied.
* @nvm_device_type: indicates OTP or eeprom
* @pm_support: set to true in start_hw if link pm is supported
* @calib_results: list head for init calibration results
*/
struct iwl_trans {
const struct iwl_trans_ops *ops;
Expand All @@ -369,8 +360,6 @@ struct iwl_trans {
int nvm_device_type;
bool pm_support;

struct list_head calib_results;

/* pointer to trans specific struct */
/*Ensure that this pointer will always be aligned to sizeof pointer */
char trans_specific[0] __aligned(sizeof(void *));
Expand Down Expand Up @@ -573,14 +562,6 @@ static inline u32 iwl_trans_read32(struct iwl_trans *trans, u32 ofs)
return trans->ops->read32(trans, ofs);
}

/*****************************************************
* Utils functions
******************************************************/
int iwl_send_calib_results(struct iwl_trans *trans);
int iwl_calib_set(struct iwl_trans *trans,
const struct iwl_calib_hdr *cmd, int len);
void iwl_calib_free_results(struct iwl_trans *trans);

/*****************************************************
* Transport layers implementations + their allocation function
******************************************************/
Expand Down
Loading

0 comments on commit 5158f89

Please sign in to comment.