Commit 8245d023 authored by John W. Linville's avatar John W. Linville
parents 9612bd1e f6b12952
...@@ -433,27 +433,19 @@ int iwlagn_tx_skb(struct iwl_priv *priv, ...@@ -433,27 +433,19 @@ int iwlagn_tx_skb(struct iwl_priv *priv,
/* Copy MAC header from skb into command buffer */ /* Copy MAC header from skb into command buffer */
memcpy(tx_cmd->hdr, hdr, hdr_len); memcpy(tx_cmd->hdr, hdr, hdr_len);
txq_id = info->hw_queue;
if (is_agg) if (is_agg)
txq_id = priv->tid_data[sta_id][tid].agg.txq_id; txq_id = priv->tid_data[sta_id][tid].agg.txq_id;
else if (info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) { else if (info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) {
/*
* Send this frame after DTIM -- there's a special queue
* reserved for this for contexts that support AP mode.
*/
txq_id = ctx->mcast_queue;
/* /*
* The microcode will clear the more data * The microcode will clear the more data
* bit in the last frame it transmits. * bit in the last frame it transmits.
*/ */
hdr->frame_control |= hdr->frame_control |=
cpu_to_le16(IEEE80211_FCTL_MOREDATA); cpu_to_le16(IEEE80211_FCTL_MOREDATA);
} else if (info->flags & IEEE80211_TX_CTL_TX_OFFCHAN) }
txq_id = IWL_AUX_QUEUE;
else
txq_id = ctx->ac_to_queue[skb_get_queue_mapping(skb)];
WARN_ON_ONCE(!is_agg && txq_id != info->hw_queue);
WARN_ON_ONCE(is_agg && WARN_ON_ONCE(is_agg &&
priv->queue_to_mac80211[txq_id] != info->hw_queue); priv->queue_to_mac80211[txq_id] != info->hw_queue);
......
...@@ -601,7 +601,7 @@ static inline int iwl_trans_send_cmd(struct iwl_trans *trans, ...@@ -601,7 +601,7 @@ static inline int iwl_trans_send_cmd(struct iwl_trans *trans,
{ {
int ret; int ret;
if (trans->state != IWL_TRANS_FW_ALIVE) { if (unlikely(trans->state != IWL_TRANS_FW_ALIVE)) {
IWL_ERR(trans, "%s bad state = %d", __func__, trans->state); IWL_ERR(trans, "%s bad state = %d", __func__, trans->state);
return -EIO; return -EIO;
} }
...@@ -640,8 +640,8 @@ static inline void iwl_trans_free_tx_cmd(struct iwl_trans *trans, ...@@ -640,8 +640,8 @@ static inline void iwl_trans_free_tx_cmd(struct iwl_trans *trans,
static inline int iwl_trans_tx(struct iwl_trans *trans, struct sk_buff *skb, static inline int iwl_trans_tx(struct iwl_trans *trans, struct sk_buff *skb,
struct iwl_device_cmd *dev_cmd, int queue) struct iwl_device_cmd *dev_cmd, int queue)
{ {
WARN_ONCE(trans->state != IWL_TRANS_FW_ALIVE, if (unlikely(trans->state != IWL_TRANS_FW_ALIVE))
"%s bad state = %d", __func__, trans->state); IWL_ERR(trans, "%s bad state = %d", __func__, trans->state);
return trans->ops->tx(trans, skb, dev_cmd, queue); return trans->ops->tx(trans, skb, dev_cmd, queue);
} }
...@@ -649,16 +649,16 @@ static inline int iwl_trans_tx(struct iwl_trans *trans, struct sk_buff *skb, ...@@ -649,16 +649,16 @@ static inline int iwl_trans_tx(struct iwl_trans *trans, struct sk_buff *skb,
static inline void iwl_trans_reclaim(struct iwl_trans *trans, int queue, static inline void iwl_trans_reclaim(struct iwl_trans *trans, int queue,
int ssn, struct sk_buff_head *skbs) int ssn, struct sk_buff_head *skbs)
{ {
WARN_ONCE(trans->state != IWL_TRANS_FW_ALIVE, if (unlikely(trans->state != IWL_TRANS_FW_ALIVE))
"%s bad state = %d", __func__, trans->state); IWL_ERR(trans, "%s bad state = %d", __func__, trans->state);
trans->ops->reclaim(trans, queue, ssn, skbs); trans->ops->reclaim(trans, queue, ssn, skbs);
} }
static inline void iwl_trans_txq_disable(struct iwl_trans *trans, int queue) static inline void iwl_trans_txq_disable(struct iwl_trans *trans, int queue)
{ {
WARN_ONCE(trans->state != IWL_TRANS_FW_ALIVE, if (unlikely(trans->state != IWL_TRANS_FW_ALIVE))
"%s bad state = %d", __func__, trans->state); IWL_ERR(trans, "%s bad state = %d", __func__, trans->state);
trans->ops->txq_disable(trans, queue); trans->ops->txq_disable(trans, queue);
} }
...@@ -669,8 +669,8 @@ static inline void iwl_trans_txq_enable(struct iwl_trans *trans, int queue, ...@@ -669,8 +669,8 @@ static inline void iwl_trans_txq_enable(struct iwl_trans *trans, int queue,
{ {
might_sleep(); might_sleep();
WARN_ONCE(trans->state != IWL_TRANS_FW_ALIVE, if (unlikely((trans->state != IWL_TRANS_FW_ALIVE)))
"%s bad state = %d", __func__, trans->state); IWL_ERR(trans, "%s bad state = %d", __func__, trans->state);
trans->ops->txq_enable(trans, queue, fifo, sta_id, tid, trans->ops->txq_enable(trans, queue, fifo, sta_id, tid,
frame_limit, ssn); frame_limit, ssn);
...@@ -685,8 +685,8 @@ static inline void iwl_trans_ac_txq_enable(struct iwl_trans *trans, int queue, ...@@ -685,8 +685,8 @@ static inline void iwl_trans_ac_txq_enable(struct iwl_trans *trans, int queue,
static inline int iwl_trans_wait_tx_queue_empty(struct iwl_trans *trans) static inline int iwl_trans_wait_tx_queue_empty(struct iwl_trans *trans)
{ {
WARN_ONCE(trans->state != IWL_TRANS_FW_ALIVE, if (unlikely(trans->state != IWL_TRANS_FW_ALIVE))
"%s bad state = %d", __func__, trans->state); IWL_ERR(trans, "%s bad state = %d", __func__, trans->state);
return trans->ops->wait_tx_queue_empty(trans); return trans->ops->wait_tx_queue_empty(trans);
} }
......
...@@ -93,10 +93,10 @@ static inline __le32 iwl_mvm_scan_max_out_time(struct ieee80211_vif *vif) ...@@ -93,10 +93,10 @@ static inline __le32 iwl_mvm_scan_max_out_time(struct ieee80211_vif *vif)
static inline __le32 iwl_mvm_scan_suspend_time(struct ieee80211_vif *vif) static inline __le32 iwl_mvm_scan_suspend_time(struct ieee80211_vif *vif)
{ {
if (vif->bss_conf.assoc) if (!vif->bss_conf.assoc)
return cpu_to_le32(vif->bss_conf.beacon_int);
else
return 0; return 0;
return cpu_to_le32(ieee80211_tu_to_usec(vif->bss_conf.beacon_int));
} }
static inline __le32 static inline __le32
......
...@@ -1465,7 +1465,8 @@ void iwl_pcie_hcmd_complete(struct iwl_trans *trans, ...@@ -1465,7 +1465,8 @@ void iwl_pcie_hcmd_complete(struct iwl_trans *trans,
spin_unlock_bh(&txq->lock); spin_unlock_bh(&txq->lock);
} }
#define HOST_COMPLETE_TIMEOUT (2 * HZ) #define HOST_COMPLETE_TIMEOUT (2 * HZ)
#define COMMAND_POKE_TIMEOUT (HZ / 10)
static int iwl_pcie_send_hcmd_async(struct iwl_trans *trans, static int iwl_pcie_send_hcmd_async(struct iwl_trans *trans,
struct iwl_host_cmd *cmd) struct iwl_host_cmd *cmd)
...@@ -1493,6 +1494,7 @@ static int iwl_pcie_send_hcmd_sync(struct iwl_trans *trans, ...@@ -1493,6 +1494,7 @@ static int iwl_pcie_send_hcmd_sync(struct iwl_trans *trans,
struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
int cmd_idx; int cmd_idx;
int ret; int ret;
int timeout = HOST_COMPLETE_TIMEOUT;
IWL_DEBUG_INFO(trans, "Attempting to send sync command %s\n", IWL_DEBUG_INFO(trans, "Attempting to send sync command %s\n",
get_cmd_string(trans_pcie, cmd->id)); get_cmd_string(trans_pcie, cmd->id));
...@@ -1517,10 +1519,29 @@ static int iwl_pcie_send_hcmd_sync(struct iwl_trans *trans, ...@@ -1517,10 +1519,29 @@ static int iwl_pcie_send_hcmd_sync(struct iwl_trans *trans,
return ret; return ret;
} }
ret = wait_event_timeout(trans_pcie->wait_command_queue, while (timeout > 0) {
!test_bit(STATUS_HCMD_ACTIVE, unsigned long flags;
&trans_pcie->status),
HOST_COMPLETE_TIMEOUT); timeout -= COMMAND_POKE_TIMEOUT;
ret = wait_event_timeout(trans_pcie->wait_command_queue,
!test_bit(STATUS_HCMD_ACTIVE,
&trans_pcie->status),
COMMAND_POKE_TIMEOUT);
if (ret)
break;
/* poke the device - it may have lost the command */
if (iwl_trans_grab_nic_access(trans, true, &flags)) {
iwl_trans_release_nic_access(trans, &flags);
IWL_DEBUG_INFO(trans,
"Tried to wake NIC for command %s\n",
get_cmd_string(trans_pcie, cmd->id));
} else {
IWL_ERR(trans, "Failed to poke NIC for command %s\n",
get_cmd_string(trans_pcie, cmd->id));
break;
}
}
if (!ret) { if (!ret) {
if (test_bit(STATUS_HCMD_ACTIVE, &trans_pcie->status)) { if (test_bit(STATUS_HCMD_ACTIVE, &trans_pcie->status)) {
struct iwl_txq *txq = struct iwl_txq *txq =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment