Skip to content

Commit

Permalink
Merge branch 'wireless-next-2.6' of git://git.kernel.org/pub/scm/linu…
Browse files Browse the repository at this point in the history
…x/kernel/git/iwlwifi/iwlwifi-2.6
  • Loading branch information
John W. Linville committed Apr 12, 2010
2 parents 68dd5b7 + 470058e commit b1f9086
Show file tree
Hide file tree
Showing 18 changed files with 274 additions and 144 deletions.
2 changes: 2 additions & 0 deletions drivers/net/wireless/iwlwifi/iwl-1000.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ struct iwl_cfg iwl1000_bgn_cfg = {
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_EXT_LONG_THRESHOLD_DEF,
.chain_noise_scale = 1000,
.monitor_recover_period = IWL_MONITORING_PERIOD,
.max_event_log_size = 128,
};

struct iwl_cfg iwl1000_bg_cfg = {
Expand Down Expand Up @@ -282,6 +283,7 @@ struct iwl_cfg iwl1000_bg_cfg = {
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_EXT_LONG_THRESHOLD_DEF,
.chain_noise_scale = 1000,
.monitor_recover_period = IWL_MONITORING_PERIOD,
.max_event_log_size = 128,
};

MODULE_FIRMWARE(IWL1000_MODULE_FIRMWARE(IWL1000_UCODE_API_MAX));
2 changes: 1 addition & 1 deletion drivers/net/wireless/iwlwifi/iwl-3945-rs.c
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta,
unsigned long flags;
u16 rate_mask = sta ? sta->supp_rates[sband->band] : 0;
s8 max_rate_idx = -1;
struct iwl_priv *priv = (struct iwl_priv *)priv_r;
struct iwl_priv *priv __maybe_unused = (struct iwl_priv *)priv_r;
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);

IWL_DEBUG_RATE(priv, "enter\n");
Expand Down
10 changes: 6 additions & 4 deletions drivers/net/wireless/iwlwifi/iwl-3945.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,12 @@ static int iwl3945_hwrate_to_plcp_idx(u8 plcp)
}

#ifdef CONFIG_IWLWIFI_DEBUG
#define TX_STATUS_ENTRY(x) case TX_STATUS_FAIL_ ## x: return #x
#define TX_STATUS_ENTRY(x) case TX_3945_STATUS_FAIL_ ## x: return #x

static const char *iwl3945_get_tx_fail_reason(u32 status)
{
switch (status & TX_STATUS_MSK) {
case TX_STATUS_SUCCESS:
case TX_3945_STATUS_SUCCESS:
return "SUCCESS";
TX_STATUS_ENTRY(SHORT_LIMIT);
TX_STATUS_ENTRY(LONG_LIMIT);
Expand Down Expand Up @@ -597,8 +597,8 @@ static void iwl3945_rx_reply_rx(struct iwl_priv *priv,
struct iwl3945_rx_frame_stats *rx_stats = IWL_RX_STATS(pkt);
struct iwl3945_rx_frame_hdr *rx_hdr = IWL_RX_HDR(pkt);
struct iwl3945_rx_frame_end *rx_end = IWL_RX_END(pkt);
u16 rx_stats_sig_avg = le16_to_cpu(rx_stats->sig_avg);
u16 rx_stats_noise_diff = le16_to_cpu(rx_stats->noise_diff);
u16 rx_stats_sig_avg __maybe_unused = le16_to_cpu(rx_stats->sig_avg);
u16 rx_stats_noise_diff __maybe_unused = le16_to_cpu(rx_stats->noise_diff);
u8 network_packet;

rx_status.flag = 0;
Expand Down Expand Up @@ -2770,6 +2770,7 @@ static struct iwl_cfg iwl3945_bg_cfg = {
.broken_powersave = true,
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
.monitor_recover_period = IWL_MONITORING_PERIOD,
.max_event_log_size = 512,
};

static struct iwl_cfg iwl3945_abg_cfg = {
Expand All @@ -2789,6 +2790,7 @@ static struct iwl_cfg iwl3945_abg_cfg = {
.broken_powersave = true,
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
.monitor_recover_period = IWL_MONITORING_PERIOD,
.max_event_log_size = 512,
};

DEFINE_PCI_DEVICE_TABLE(iwl3945_hw_card_ids) = {
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/iwlwifi/iwl-4965.c
Original file line number Diff line number Diff line change
Expand Up @@ -2054,8 +2054,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
if (qc && likely(sta_id != IWL_INVALID_STATION))
iwlagn_txq_check_empty(priv, sta_id, tid, txq_id);

if (iwl_check_bits(status, TX_ABORT_REQUIRED_MSK))
IWL_ERR(priv, "TODO: Implement Tx ABORT REQUIRED!!!\n");
iwl_check_abort_status(priv, tx_resp->frame_count, status);
}

static int iwl4965_calc_rssi(struct iwl_priv *priv,
Expand Down Expand Up @@ -2255,6 +2254,7 @@ struct iwl_cfg iwl4965_agn_cfg = {
.monitor_recover_period = IWL_MONITORING_PERIOD,
.temperature_kelvin = true,
.off_channel_workaround = true,
.max_event_log_size = 512,
};

/* Module firmware */
Expand Down
7 changes: 7 additions & 0 deletions drivers/net/wireless/iwlwifi/iwl-5000.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ struct iwl_cfg iwl5300_agn_cfg = {
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
.chain_noise_scale = 1000,
.monitor_recover_period = IWL_MONITORING_PERIOD,
.max_event_log_size = 512,
};

struct iwl_cfg iwl5100_bgn_cfg = {
Expand Down Expand Up @@ -450,6 +451,7 @@ struct iwl_cfg iwl5100_bgn_cfg = {
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
.chain_noise_scale = 1000,
.monitor_recover_period = IWL_MONITORING_PERIOD,
.max_event_log_size = 512,
};

struct iwl_cfg iwl5100_abg_cfg = {
Expand All @@ -475,6 +477,7 @@ struct iwl_cfg iwl5100_abg_cfg = {
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
.chain_noise_scale = 1000,
.monitor_recover_period = IWL_MONITORING_PERIOD,
.max_event_log_size = 512,
};

struct iwl_cfg iwl5100_agn_cfg = {
Expand Down Expand Up @@ -502,6 +505,7 @@ struct iwl_cfg iwl5100_agn_cfg = {
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
.chain_noise_scale = 1000,
.monitor_recover_period = IWL_MONITORING_PERIOD,
.max_event_log_size = 512,
};

struct iwl_cfg iwl5350_agn_cfg = {
Expand Down Expand Up @@ -529,6 +533,7 @@ struct iwl_cfg iwl5350_agn_cfg = {
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
.chain_noise_scale = 1000,
.monitor_recover_period = IWL_MONITORING_PERIOD,
.max_event_log_size = 512,
};

struct iwl_cfg iwl5150_agn_cfg = {
Expand Down Expand Up @@ -556,6 +561,7 @@ struct iwl_cfg iwl5150_agn_cfg = {
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
.chain_noise_scale = 1000,
.monitor_recover_period = IWL_MONITORING_PERIOD,
.max_event_log_size = 512,
};

struct iwl_cfg iwl5150_abg_cfg = {
Expand All @@ -581,6 +587,7 @@ struct iwl_cfg iwl5150_abg_cfg = {
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
.chain_noise_scale = 1000,
.monitor_recover_period = IWL_MONITORING_PERIOD,
.max_event_log_size = 512,
};

MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_MAX));
Expand Down
7 changes: 7 additions & 0 deletions drivers/net/wireless/iwlwifi/iwl-6000.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ struct iwl_cfg iwl6000i_g2_2agn_cfg = {
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
.chain_noise_scale = 1000,
.monitor_recover_period = IWL_MONITORING_PERIOD,
.max_event_log_size = 1024,
};

struct iwl_cfg iwl6000i_2agn_cfg = {
Expand Down Expand Up @@ -427,6 +428,7 @@ struct iwl_cfg iwl6000i_2agn_cfg = {
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
.chain_noise_scale = 1000,
.monitor_recover_period = IWL_MONITORING_PERIOD,
.max_event_log_size = 1024,
};

struct iwl_cfg iwl6000i_2abg_cfg = {
Expand Down Expand Up @@ -459,6 +461,7 @@ struct iwl_cfg iwl6000i_2abg_cfg = {
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
.chain_noise_scale = 1000,
.monitor_recover_period = IWL_MONITORING_PERIOD,
.max_event_log_size = 1024,
};

struct iwl_cfg iwl6000i_2bg_cfg = {
Expand Down Expand Up @@ -491,6 +494,7 @@ struct iwl_cfg iwl6000i_2bg_cfg = {
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
.chain_noise_scale = 1000,
.monitor_recover_period = IWL_MONITORING_PERIOD,
.max_event_log_size = 1024,
};

struct iwl_cfg iwl6050_2agn_cfg = {
Expand Down Expand Up @@ -524,6 +528,7 @@ struct iwl_cfg iwl6050_2agn_cfg = {
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
.chain_noise_scale = 1500,
.monitor_recover_period = IWL_MONITORING_PERIOD,
.max_event_log_size = 1024,
};

struct iwl_cfg iwl6050_2abg_cfg = {
Expand Down Expand Up @@ -556,6 +561,7 @@ struct iwl_cfg iwl6050_2abg_cfg = {
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
.chain_noise_scale = 1500,
.monitor_recover_period = IWL_MONITORING_PERIOD,
.max_event_log_size = 1024,
};

struct iwl_cfg iwl6000_3agn_cfg = {
Expand Down Expand Up @@ -589,6 +595,7 @@ struct iwl_cfg iwl6000_3agn_cfg = {
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
.chain_noise_scale = 1000,
.monitor_recover_period = IWL_MONITORING_PERIOD,
.max_event_log_size = 1024,
};

MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX));
Expand Down
32 changes: 21 additions & 11 deletions drivers/net/wireless/iwlwifi/iwl-agn-lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,14 @@ static int iwlagn_tx_status_reply_tx(struct iwl_priv *priv,
return 0;
}

void iwl_check_abort_status(struct iwl_priv *priv,
u8 frame_count, u32 status)
{
if (frame_count == 1 && status == TX_STATUS_FAIL_RFKILL_FLUSH) {
IWL_ERR(priv, "TODO: Implement Tx flush command!!!\n");
}
}

static void iwlagn_rx_reply_tx(struct iwl_priv *priv,
struct iwl_rx_mem_buffer *rxb)
{
Expand Down Expand Up @@ -246,8 +254,7 @@ static void iwlagn_rx_reply_tx(struct iwl_priv *priv,

iwlagn_txq_check_empty(priv, sta_id, tid, txq_id);

if (iwl_check_bits(status, TX_ABORT_REQUIRED_MSK))
IWL_ERR(priv, "TODO: Implement Tx ABORT REQUIRED!!!\n");
iwl_check_abort_status(priv, tx_resp->frame_count, status);
}

void iwlagn_rx_handler_setup(struct iwl_priv *priv)
Expand Down Expand Up @@ -505,10 +512,13 @@ int iwlagn_hw_nic_init(struct iwl_priv *priv)

spin_unlock_irqrestore(&priv->lock, flags);

/* Allocate and init all Tx and Command queues */
ret = iwlagn_txq_ctx_reset(priv);
if (ret)
return ret;
/* Allocate or reset and init all Tx and Command queues */
if (!priv->txq) {
ret = iwlagn_txq_ctx_alloc(priv);
if (ret)
return ret;
} else
iwlagn_txq_ctx_reset(priv);

set_bit(STATUS_INIT, &priv->status);

Expand Down Expand Up @@ -1001,11 +1011,11 @@ void iwlagn_rx_reply_rx(struct iwl_priv *priv,
phy_res->cfg_phy_cnt + len);
ampdu_status = le32_to_cpu(rx_pkt_status);
} else {
if (!priv->last_phy_res[0]) {
if (!priv->_agn.last_phy_res_valid) {
IWL_ERR(priv, "MPDU frame without cached PHY data\n");
return;
}
phy_res = (struct iwl_rx_phy_res *)&priv->last_phy_res[1];
phy_res = &priv->_agn.last_phy_res;
amsdu = (struct iwl4965_rx_mpdu_res_start *)pkt->u.raw;
header = (struct ieee80211_hdr *)(pkt->u.raw + sizeof(*amsdu));
len = le16_to_cpu(amsdu->byte_count);
Expand Down Expand Up @@ -1094,10 +1104,10 @@ void iwlagn_rx_reply_rx(struct iwl_priv *priv,
/* Cache phy data (Rx signal strength, etc) for HT frame (REPLY_RX_PHY_CMD).
* This will be used later in iwl_rx_reply_rx() for REPLY_RX_MPDU_CMD. */
void iwlagn_rx_reply_rx_phy(struct iwl_priv *priv,
struct iwl_rx_mem_buffer *rxb)
struct iwl_rx_mem_buffer *rxb)
{
struct iwl_rx_packet *pkt = rxb_addr(rxb);
priv->last_phy_res[0] = 1;
memcpy(&priv->last_phy_res[1], &(pkt->u.raw[0]),
priv->_agn.last_phy_res_valid = true;
memcpy(&priv->_agn.last_phy_res, pkt->u.raw,
sizeof(struct iwl_rx_phy_res));
}
2 changes: 1 addition & 1 deletion drivers/net/wireless/iwlwifi/iwl-agn-rs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2409,7 +2409,7 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta, void *priv_sta,

struct sk_buff *skb = txrc->skb;
struct ieee80211_supported_band *sband = txrc->sband;
struct iwl_priv *priv = (struct iwl_priv *)priv_r;
struct iwl_priv *priv __maybe_unused = (struct iwl_priv *)priv_r;
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
struct iwl_lq_sta *lq_sta = priv_sta;
int rate_idx;
Expand Down
39 changes: 29 additions & 10 deletions drivers/net/wireless/iwlwifi/iwl-agn-tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -809,8 +809,7 @@ void iwlagn_hw_txq_ctx_free(struct iwl_priv *priv)

/* Tx queues */
if (priv->txq) {
for (txq_id = 0; txq_id < priv->hw_params.max_txq_num;
txq_id++)
for (txq_id = 0; txq_id < priv->hw_params.max_txq_num; txq_id++)
if (txq_id == IWL_CMD_QUEUE_NUM)
iwl_cmd_queue_free(priv);
else
Expand All @@ -825,15 +824,15 @@ void iwlagn_hw_txq_ctx_free(struct iwl_priv *priv)
}

/**
* iwlagn_txq_ctx_reset - Reset TX queue context
* Destroys all DMA structures and initialize them again
* iwlagn_txq_ctx_alloc - allocate TX queue context
* Allocate all Tx DMA structures and initialize them
*
* @param priv
* @return error code
*/
int iwlagn_txq_ctx_reset(struct iwl_priv *priv)
int iwlagn_txq_ctx_alloc(struct iwl_priv *priv)
{
int ret = 0;
int ret;
int txq_id, slots_num;
unsigned long flags;

Expand Down Expand Up @@ -891,8 +890,31 @@ int iwlagn_txq_ctx_reset(struct iwl_priv *priv)
return ret;
}

void iwlagn_txq_ctx_reset(struct iwl_priv *priv)
{
int txq_id, slots_num;
unsigned long flags;

spin_lock_irqsave(&priv->lock, flags);

/* Turn off all Tx DMA fifos */
priv->cfg->ops->lib->txq_set_sched(priv, 0);

/* Tell NIC where to find the "keep warm" buffer */
iwl_write_direct32(priv, FH_KW_MEM_ADDR_REG, priv->kw.dma >> 4);

spin_unlock_irqrestore(&priv->lock, flags);

/* Alloc and init all Tx queues, including the command queue (#4) */
for (txq_id = 0; txq_id < priv->hw_params.max_txq_num; txq_id++) {
slots_num = txq_id == IWL_CMD_QUEUE_NUM ?
TFD_CMD_SLOTS : TFD_TX_CMD_SLOTS;
iwl_tx_queue_reset(priv, &priv->txq[txq_id], slots_num, txq_id);
}
}

/**
* iwlagn_txq_ctx_stop - Stop all Tx DMA channels, free Tx queue memory
* iwlagn_txq_ctx_stop - Stop all Tx DMA channels
*/
void iwlagn_txq_ctx_stop(struct iwl_priv *priv)
{
Expand All @@ -912,9 +934,6 @@ void iwlagn_txq_ctx_stop(struct iwl_priv *priv)
1000);
}
spin_unlock_irqrestore(&priv->lock, flags);

/* Deallocate memory for all Tx queues */
iwlagn_hw_txq_ctx_free(priv);
}

/*
Expand Down
Loading

0 comments on commit b1f9086

Please sign in to comment.