Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 90825
b: refs/heads/master
c: 49ea859
h: refs/heads/master
i:
  90823: 6b01b1c
v: v3
  • Loading branch information
Emmanuel Grumbach authored and John W. Linville committed Apr 16, 2008
1 parent a33b800 commit 60f30a9
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 34 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: ba380013b681e91e059f95b51002f8d43024b371
refs/heads/master: 49ea85961cf8b60b5387cc1c1bc06fe4b6a31ee4
29 changes: 6 additions & 23 deletions trunk/drivers/net/wireless/iwlwifi/iwl-4965.c
Original file line number Diff line number Diff line change
Expand Up @@ -976,40 +976,21 @@ int iwl4965_hw_nic_reset(struct iwl_priv *priv)
/**
* iwl4965_bg_statistics_periodic - Timer callback to queue statistics
*
* This callback is provided in order to queue the statistics_work
* in work_queue context (v. softirq)
* This callback is provided in order to send a statistics request.
*
* This timer function is continually reset to execute within
* REG_RECALIB_PERIOD seconds since the last STATISTICS_NOTIFICATION
* was received. We need to ensure we receive the statistics in order
* to update the temperature used for calibrating the TXPOWER. However,
* we can't send the statistics command from softirq context (which
* is the context which timers run at) so we have to queue off the
* statistics_work to actually send the command to the hardware.
* to update the temperature used for calibrating the TXPOWER.
*/
static void iwl4965_bg_statistics_periodic(unsigned long data)
{
struct iwl_priv *priv = (struct iwl_priv *)data;

queue_work(priv->workqueue, &priv->statistics_work);
}

/**
* iwl4965_bg_statistics_work - Send the statistics request to the hardware.
*
* This is queued by iwl4965_bg_statistics_periodic.
*/
static void iwl4965_bg_statistics_work(struct work_struct *work)
{
struct iwl_priv *priv = container_of(work, struct iwl_priv,
statistics_work);

if (test_bit(STATUS_EXIT_PENDING, &priv->status))
return;

mutex_lock(&priv->mutex);
iwl4965_send_statistics_request(priv);
mutex_unlock(&priv->mutex);
iwl_send_statistics_request(priv, CMD_ASYNC);
}

#define CT_LIMIT_CONST 259
Expand Down Expand Up @@ -2026,6 +2007,9 @@ int iwl4965_alive_notify(struct iwl_priv *priv)
iwl_release_nic_access(priv);
spin_unlock_irqrestore(&priv->lock, flags);

/* Ask for statistics now, the uCode will send statistics notification
* periodically after association */
iwl_send_statistics_request(priv, CMD_ASYNC);
return ret;
}

Expand Down Expand Up @@ -4903,7 +4887,6 @@ void iwl4965_hw_rx_handler_setup(struct iwl_priv *priv)
void iwl4965_hw_setup_deferred_work(struct iwl_priv *priv)
{
INIT_WORK(&priv->txpower_work, iwl4965_bg_txpower_work);
INIT_WORK(&priv->statistics_work, iwl4965_bg_statistics_work);
#ifdef CONFIG_IWL4965_SENSITIVITY
INIT_WORK(&priv->sensitivity_work, iwl4965_bg_sensitivity_work);
#endif
Expand Down
2 changes: 0 additions & 2 deletions trunk/drivers/net/wireless/iwlwifi/iwl-4965.h
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,6 @@ extern unsigned int iwl4965_fill_beacon_frame(struct iwl_priv *priv,
const u8 *dest, int left);
extern int iwl4965_rx_queue_update_write_ptr(struct iwl_priv *priv,
struct iwl4965_rx_queue *q);
extern int iwl4965_send_statistics_request(struct iwl_priv *priv);
extern void iwl4965_set_decrypted_flag(struct iwl_priv *priv, struct sk_buff *skb,
u32 decrypt_res,
struct ieee80211_rx_status *stats);
Expand Down Expand Up @@ -1206,7 +1205,6 @@ struct iwl_priv {
#ifdef CONFIG_IWL4965_SENSITIVITY
struct work_struct sensitivity_work;
#endif
struct work_struct statistics_work;
struct timer_list statistics_periodic;
}; /*iwl_priv */

Expand Down
12 changes: 12 additions & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,3 +277,15 @@ int iwlcore_low_level_notify(struct iwl_priv *priv,
}
EXPORT_SYMBOL(iwlcore_low_level_notify);

int iwl_send_statistics_request(struct iwl_priv *priv, u8 flags)
{
u32 stat_flags = 0;
struct iwl_host_cmd cmd = {
.id = REPLY_STATISTICS_CMD,
.meta.flags = flags,
.len = sizeof(stat_flags),
.data = (u8 *) &stat_flags,
};
return iwl_send_cmd(priv, &cmd);
}
EXPORT_SYMBOL(iwl_send_statistics_request);
2 changes: 2 additions & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-core.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,6 @@ enum iwlcore_card_notify {

int iwlcore_low_level_notify(struct iwl_priv *priv,
enum iwlcore_card_notify notify);
extern int iwl_send_statistics_request(struct iwl_priv *priv, u8 flags);

#endif /* __iwl_core_h__ */
9 changes: 1 addition & 8 deletions trunk/drivers/net/wireless/iwlwifi/iwl4965-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -596,13 +596,6 @@ static void iwl4965_set_rxon_hwcrypto(struct iwl_priv *priv, int hw_decrypt)

}

int iwl4965_send_statistics_request(struct iwl_priv *priv)
{
u32 flags = 0;
return iwl_send_cmd_pdu(priv, REPLY_STATISTICS_CMD,
sizeof(flags), &flags);
}

/**
* iwl4965_rxon_add_station - add station into station table.
*
Expand Down Expand Up @@ -7530,7 +7523,7 @@ static ssize_t show_statistics(struct device *d,
return -EAGAIN;

mutex_lock(&priv->mutex);
rc = iwl4965_send_statistics_request(priv);
rc = iwl_send_statistics_request(priv, 0);
mutex_unlock(&priv->mutex);

if (rc) {
Expand Down

0 comments on commit 60f30a9

Please sign in to comment.