aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl4965-base.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-05-15 06:55:29 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-05-21 21:48:11 -0400
commite039fa4a4195ac4ee895e6f3d1334beed63256fe (patch)
treecfd0762d73df96b73052378be7b157c4ac6e7035 /drivers/net/wireless/iwlwifi/iwl4965-base.c
parente24549485f859be6518929bb1c9c0257d79f033d (diff)
mac80211: move TX info into skb->cb
This patch converts mac80211 and all drivers to have transmit information and status in skb->cb rather than allocating extra memory for it and copying all the data around. To make it fit, a union is used where only data that is necessary for all steps is kept outside of the union. A number of fixes were done by Ivo, as well as the rt2x00 part of this patch. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl4965-base.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl4965-base.c52
1 files changed, 21 insertions, 31 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index 1fad6227aa51..07c52b69d1e2 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -1606,17 +1606,7 @@ static int iwl4965_get_measurement(struct iwl_priv *priv,
1606static void iwl4965_txstatus_to_ieee(struct iwl_priv *priv, 1606static void iwl4965_txstatus_to_ieee(struct iwl_priv *priv,
1607 struct iwl_tx_info *tx_sta) 1607 struct iwl_tx_info *tx_sta)
1608{ 1608{
1609 1609 ieee80211_tx_status_irqsafe(priv->hw, tx_sta->skb[0]);
1610 tx_sta->status.ack_signal = 0;
1611 tx_sta->status.excessive_retries = 0;
1612
1613 if (in_interrupt())
1614 ieee80211_tx_status_irqsafe(priv->hw,
1615 tx_sta->skb[0], &(tx_sta->status));
1616 else
1617 ieee80211_tx_status(priv->hw,
1618 tx_sta->skb[0], &(tx_sta->status));
1619
1620 tx_sta->skb[0] = NULL; 1610 tx_sta->skb[0] = NULL;
1621} 1611}
1622 1612
@@ -1710,7 +1700,7 @@ static int iwl4965_tx_status_reply_tx(struct iwl_priv *priv,
1710{ 1700{
1711 u16 status; 1701 u16 status;
1712 struct agg_tx_status *frame_status = &tx_resp->status; 1702 struct agg_tx_status *frame_status = &tx_resp->status;
1713 struct ieee80211_tx_status *tx_status = NULL; 1703 struct ieee80211_tx_info *info = NULL;
1714 struct ieee80211_hdr *hdr = NULL; 1704 struct ieee80211_hdr *hdr = NULL;
1715 int i, sh; 1705 int i, sh;
1716 int txq_id, idx; 1706 int txq_id, idx;
@@ -1736,14 +1726,14 @@ static int iwl4965_tx_status_reply_tx(struct iwl_priv *priv,
1736 IWL_DEBUG_TX_REPLY("FrameCnt = %d, StartIdx=%d idx=%d\n", 1726 IWL_DEBUG_TX_REPLY("FrameCnt = %d, StartIdx=%d idx=%d\n",
1737 agg->frame_count, agg->start_idx, idx); 1727 agg->frame_count, agg->start_idx, idx);
1738 1728
1739 tx_status = &(priv->txq[txq_id].txb[idx].status); 1729 info = IEEE80211_SKB_CB(priv->txq[txq_id].txb[idx].skb[0]);
1740 tx_status->retry_count = tx_resp->failure_frame; 1730 info->status.retry_count = tx_resp->failure_frame;
1741 tx_status->control.flags &= ~IEEE80211_TXCTL_AMPDU; 1731 info->flags &= ~IEEE80211_TX_CTL_AMPDU;
1742 tx_status->flags = iwl4965_is_tx_success(status)? 1732 info->flags |= iwl4965_is_tx_success(status)?
1743 IEEE80211_TX_STATUS_ACK : 0; 1733 IEEE80211_TX_STAT_ACK : 0;
1744 iwl4965_hwrate_to_tx_control(priv, 1734 iwl4965_hwrate_to_tx_control(priv,
1745 le32_to_cpu(tx_resp->rate_n_flags), 1735 le32_to_cpu(tx_resp->rate_n_flags),
1746 &tx_status->control); 1736 info);
1747 /* FIXME: code repetition end */ 1737 /* FIXME: code repetition end */
1748 1738
1749 IWL_DEBUG_TX_REPLY("1 Frame 0x%x failure :%d\n", 1739 IWL_DEBUG_TX_REPLY("1 Frame 0x%x failure :%d\n",
@@ -1830,7 +1820,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
1830 int txq_id = SEQ_TO_QUEUE(sequence); 1820 int txq_id = SEQ_TO_QUEUE(sequence);
1831 int index = SEQ_TO_INDEX(sequence); 1821 int index = SEQ_TO_INDEX(sequence);
1832 struct iwl_tx_queue *txq = &priv->txq[txq_id]; 1822 struct iwl_tx_queue *txq = &priv->txq[txq_id];
1833 struct ieee80211_tx_status *tx_status; 1823 struct ieee80211_tx_info *info;
1834 struct iwl4965_tx_resp *tx_resp = (void *)&pkt->u.raw[0]; 1824 struct iwl4965_tx_resp *tx_resp = (void *)&pkt->u.raw[0];
1835 u32 status = le32_to_cpu(tx_resp->status); 1825 u32 status = le32_to_cpu(tx_resp->status);
1836#ifdef CONFIG_IWL4965_HT 1826#ifdef CONFIG_IWL4965_HT
@@ -1848,6 +1838,9 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
1848 return; 1838 return;
1849 } 1839 }
1850 1840
1841 info = IEEE80211_SKB_CB(txq->txb[txq->q.read_ptr].skb[0]);
1842 memset(&info->status, 0, sizeof(info->status));
1843
1851#ifdef CONFIG_IWL4965_HT 1844#ifdef CONFIG_IWL4965_HT
1852 hdr = iwl4965_tx_queue_get_hdr(priv, txq_id, index); 1845 hdr = iwl4965_tx_queue_get_hdr(priv, txq_id, index);
1853 fc = le16_to_cpu(hdr->frame_control); 1846 fc = le16_to_cpu(hdr->frame_control);
@@ -1902,13 +1895,12 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
1902 } 1895 }
1903 } else { 1896 } else {
1904#endif /* CONFIG_IWL4965_HT */ 1897#endif /* CONFIG_IWL4965_HT */
1905 tx_status = &(txq->txb[txq->q.read_ptr].status);
1906 1898
1907 tx_status->retry_count = tx_resp->failure_frame; 1899 info->status.retry_count = tx_resp->failure_frame;
1908 tx_status->flags = 1900 info->flags |=
1909 iwl4965_is_tx_success(status) ? IEEE80211_TX_STATUS_ACK : 0; 1901 iwl4965_is_tx_success(status) ? IEEE80211_TX_STAT_ACK : 0;
1910 iwl4965_hwrate_to_tx_control(priv, le32_to_cpu(tx_resp->rate_n_flags), 1902 iwl4965_hwrate_to_tx_control(priv, le32_to_cpu(tx_resp->rate_n_flags),
1911 &tx_status->control); 1903 info);
1912 1904
1913 IWL_DEBUG_TX("Tx queue %d Status %s (0x%08x) rate_n_flags 0x%x " 1905 IWL_DEBUG_TX("Tx queue %d Status %s (0x%08x) rate_n_flags 0x%x "
1914 "retries %d\n", txq_id, iwl4965_get_tx_fail_reason(status), 1906 "retries %d\n", txq_id, iwl4965_get_tx_fail_reason(status),
@@ -2053,7 +2045,7 @@ static void iwl4965_bg_beacon_update(struct work_struct *work)
2053 struct sk_buff *beacon; 2045 struct sk_buff *beacon;
2054 2046
2055 /* Pull updated AP beacon from mac80211. will fail if not in AP mode */ 2047 /* Pull updated AP beacon from mac80211. will fail if not in AP mode */
2056 beacon = ieee80211_beacon_get(priv->hw, priv->vif, NULL); 2048 beacon = ieee80211_beacon_get(priv->hw, priv->vif);
2057 2049
2058 if (!beacon) { 2050 if (!beacon) {
2059 IWL_ERROR("update beacon failed\n"); 2051 IWL_ERROR("update beacon failed\n");
@@ -4268,8 +4260,7 @@ static void iwl4965_mac_stop(struct ieee80211_hw *hw)
4268 IWL_DEBUG_MAC80211("leave\n"); 4260 IWL_DEBUG_MAC80211("leave\n");
4269} 4261}
4270 4262
4271static int iwl4965_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb, 4263static int iwl4965_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
4272 struct ieee80211_tx_control *ctl)
4273{ 4264{
4274 struct iwl_priv *priv = hw->priv; 4265 struct iwl_priv *priv = hw->priv;
4275 4266
@@ -4281,9 +4272,9 @@ static int iwl4965_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb,
4281 } 4272 }
4282 4273
4283 IWL_DEBUG_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len, 4274 IWL_DEBUG_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len,
4284 ieee80211_get_tx_rate(hw, ctl)->bitrate); 4275 ieee80211_get_tx_rate(hw, IEEE80211_SKB_CB(skb))->bitrate);
4285 4276
4286 if (iwl_tx_skb(priv, skb, ctl)) 4277 if (iwl_tx_skb(priv, skb))
4287 dev_kfree_skb_any(skb); 4278 dev_kfree_skb_any(skb);
4288 4279
4289 IWL_DEBUG_MAC80211("leave\n"); 4280 IWL_DEBUG_MAC80211("leave\n");
@@ -5065,8 +5056,7 @@ static void iwl4965_mac_reset_tsf(struct ieee80211_hw *hw)
5065 IWL_DEBUG_MAC80211("leave\n"); 5056 IWL_DEBUG_MAC80211("leave\n");
5066} 5057}
5067 5058
5068static int iwl4965_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb, 5059static int iwl4965_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb)
5069 struct ieee80211_tx_control *control)
5070{ 5060{
5071 struct iwl_priv *priv = hw->priv; 5061 struct iwl_priv *priv = hw->priv;
5072 unsigned long flags; 5062 unsigned long flags;