Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

p54: redo rx_status into skb->cb

This patch slightly optimizes p54_rx_data's stack and code size.

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Christian Lamparter and committed by
John W. Linville
1795378e 92179986

+13 -15
+13 -15
drivers/net/wireless/p54/p54common.c
··· 743 743 { 744 744 struct p54_common *priv = dev->priv; 745 745 struct p54_rx_data *hdr = (struct p54_rx_data *) skb->data; 746 - struct ieee80211_rx_status rx_status = {0}; 746 + struct ieee80211_rx_status *rx_status = IEEE80211_SKB_RXCB(skb); 747 747 u16 freq = le16_to_cpu(hdr->freq); 748 748 size_t header_len = sizeof(*hdr); 749 749 u32 tsf32; ··· 762 762 } 763 763 764 764 if (hdr->decrypt_status == P54_DECRYPT_OK) 765 - rx_status.flag |= RX_FLAG_DECRYPTED; 765 + rx_status->flag |= RX_FLAG_DECRYPTED; 766 766 if ((hdr->decrypt_status == P54_DECRYPT_FAIL_MICHAEL) || 767 767 (hdr->decrypt_status == P54_DECRYPT_FAIL_TKIP)) 768 - rx_status.flag |= RX_FLAG_MMIC_ERROR; 768 + rx_status->flag |= RX_FLAG_MMIC_ERROR; 769 769 770 - rx_status.signal = p54_rssi_to_dbm(dev, hdr->rssi); 771 - rx_status.noise = priv->noise; 770 + rx_status->signal = p54_rssi_to_dbm(dev, hdr->rssi); 771 + rx_status->noise = priv->noise; 772 772 if (hdr->rate & 0x10) 773 - rx_status.flag |= RX_FLAG_SHORTPRE; 773 + rx_status->flag |= RX_FLAG_SHORTPRE; 774 774 if (dev->conf.channel->band == IEEE80211_BAND_5GHZ) 775 - rx_status.rate_idx = (rate < 4) ? 0 : rate - 4; 775 + rx_status->rate_idx = (rate < 4) ? 0 : rate - 4; 776 776 else 777 - rx_status.rate_idx = rate; 777 + rx_status->rate_idx = rate; 778 778 779 - rx_status.freq = freq; 780 - rx_status.band = dev->conf.channel->band; 781 - rx_status.antenna = hdr->antenna; 779 + rx_status->freq = freq; 780 + rx_status->band = dev->conf.channel->band; 781 + rx_status->antenna = hdr->antenna; 782 782 783 783 tsf32 = le32_to_cpu(hdr->tsf32); 784 784 if (tsf32 < priv->tsf_low32) 785 785 priv->tsf_high32++; 786 - rx_status.mactime = ((u64)priv->tsf_high32) << 32 | tsf32; 786 + rx_status->mactime = ((u64)priv->tsf_high32) << 32 | tsf32; 787 787 priv->tsf_low32 = tsf32; 788 788 789 - rx_status.flag |= RX_FLAG_TSFT; 789 + rx_status->flag |= RX_FLAG_TSFT; 790 790 791 791 if (hdr->flags & cpu_to_le16(P54_HDR_FLAG_DATA_ALIGN)) 792 792 header_len += hdr->align[0]; 793 793 794 794 skb_pull(skb, header_len); 795 795 skb_trim(skb, le16_to_cpu(hdr->len)); 796 - 797 - memcpy(IEEE80211_SKB_RXCB(skb), &rx_status, sizeof(rx_status)); 798 796 ieee80211_rx_irqsafe(dev, skb); 799 797 800 798 queue_delayed_work(dev->workqueue, &priv->work,