aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorBob Copeland <me@bobcopeland.com>2009-08-24 23:00:32 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-28 14:40:44 -0400
commit1c5256bb168faca5ce32a9c9511c8389f9fed31c (patch)
treedd9b28f17977447ef156558a098e6751f1c02792 /drivers/net/wireless
parent09c9bae26b0d3c9472cb6ae45010460a2cee8b8d (diff)
ath5k: use the skb->cb directly for RX status
Save a memcpy by just storing updates directly in the skb control block. Signed-off-by: Bob Copeland <me@bobcopeland.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c41
1 files changed, 21 insertions, 20 deletions
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index c4adf9846410..10bf01547068 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -1741,7 +1741,7 @@ ath5k_check_ibss_tsf(struct ath5k_softc *sc, struct sk_buff *skb,
1741static void 1741static void
1742ath5k_tasklet_rx(unsigned long data) 1742ath5k_tasklet_rx(unsigned long data)
1743{ 1743{
1744 struct ieee80211_rx_status rxs = {}; 1744 struct ieee80211_rx_status *rxs;
1745 struct ath5k_rx_status rs = {}; 1745 struct ath5k_rx_status rs = {};
1746 struct sk_buff *skb, *next_skb; 1746 struct sk_buff *skb, *next_skb;
1747 dma_addr_t next_skb_addr; 1747 dma_addr_t next_skb_addr;
@@ -1751,6 +1751,7 @@ ath5k_tasklet_rx(unsigned long data)
1751 int ret; 1751 int ret;
1752 int hdrlen; 1752 int hdrlen;
1753 int padsize; 1753 int padsize;
1754 int rx_flag;
1754 1755
1755 spin_lock(&sc->rxbuflock); 1756 spin_lock(&sc->rxbuflock);
1756 if (list_empty(&sc->rxbuf)) { 1757 if (list_empty(&sc->rxbuf)) {
@@ -1758,7 +1759,7 @@ ath5k_tasklet_rx(unsigned long data)
1758 goto unlock; 1759 goto unlock;
1759 } 1760 }
1760 do { 1761 do {
1761 rxs.flag = 0; 1762 rx_flag = 0;
1762 1763
1763 bf = list_first_entry(&sc->rxbuf, struct ath5k_buf, list); 1764 bf = list_first_entry(&sc->rxbuf, struct ath5k_buf, list);
1764 BUG_ON(bf->skb == NULL); 1765 BUG_ON(bf->skb == NULL);
@@ -1802,7 +1803,7 @@ ath5k_tasklet_rx(unsigned long data)
1802 goto accept; 1803 goto accept;
1803 } 1804 }
1804 if (rs.rs_status & AR5K_RXERR_MIC) { 1805 if (rs.rs_status & AR5K_RXERR_MIC) {
1805 rxs.flag |= RX_FLAG_MMIC_ERROR; 1806 rx_flag |= RX_FLAG_MMIC_ERROR;
1806 goto accept; 1807 goto accept;
1807 } 1808 }
1808 1809
@@ -1840,6 +1841,7 @@ accept:
1840 memmove(skb->data + padsize, skb->data, hdrlen); 1841 memmove(skb->data + padsize, skb->data, hdrlen);
1841 skb_pull(skb, padsize); 1842 skb_pull(skb, padsize);
1842 } 1843 }
1844 rxs = IEEE80211_SKB_RXCB(skb);
1843 1845
1844 /* 1846 /*
1845 * always extend the mac timestamp, since this information is 1847 * always extend the mac timestamp, since this information is
@@ -1861,41 +1863,40 @@ accept:
1861 * impossible to comply to that. This affects IBSS merge only 1863 * impossible to comply to that. This affects IBSS merge only
1862 * right now, so it's not too bad... 1864 * right now, so it's not too bad...
1863 */ 1865 */
1864 rxs.mactime = ath5k_extend_tsf(sc->ah, rs.rs_tstamp); 1866 rxs->mactime = ath5k_extend_tsf(sc->ah, rs.rs_tstamp);
1865 rxs.flag |= RX_FLAG_TSFT; 1867 rxs->flag = rx_flag | RX_FLAG_TSFT;
1866 1868
1867 rxs.freq = sc->curchan->center_freq; 1869 rxs->freq = sc->curchan->center_freq;
1868 rxs.band = sc->curband->band; 1870 rxs->band = sc->curband->band;
1869 1871
1870 rxs.noise = sc->ah->ah_noise_floor; 1872 rxs->noise = sc->ah->ah_noise_floor;
1871 rxs.signal = rxs.noise + rs.rs_rssi; 1873 rxs->signal = rxs->noise + rs.rs_rssi;
1872 1874
1873 /* An rssi of 35 indicates you should be able use 1875 /* An rssi of 35 indicates you should be able use
1874 * 54 Mbps reliably. A more elaborate scheme can be used 1876 * 54 Mbps reliably. A more elaborate scheme can be used
1875 * here but it requires a map of SNR/throughput for each 1877 * here but it requires a map of SNR/throughput for each
1876 * possible mode used */ 1878 * possible mode used */
1877 rxs.qual = rs.rs_rssi * 100 / 35; 1879 rxs->qual = rs.rs_rssi * 100 / 35;
1878 1880
1879 /* rssi can be more than 35 though, anything above that 1881 /* rssi can be more than 35 though, anything above that
1880 * should be considered at 100% */ 1882 * should be considered at 100% */
1881 if (rxs.qual > 100) 1883 if (rxs->qual > 100)
1882 rxs.qual = 100; 1884 rxs->qual = 100;
1883 1885
1884 rxs.antenna = rs.rs_antenna; 1886 rxs->antenna = rs.rs_antenna;
1885 rxs.rate_idx = ath5k_hw_to_driver_rix(sc, rs.rs_rate); 1887 rxs->rate_idx = ath5k_hw_to_driver_rix(sc, rs.rs_rate);
1886 rxs.flag |= ath5k_rx_decrypted(sc, ds, skb, &rs); 1888 rxs->flag |= ath5k_rx_decrypted(sc, ds, skb, &rs);
1887 1889
1888 if (rxs.rate_idx >= 0 && rs.rs_rate == 1890 if (rxs->rate_idx >= 0 && rs.rs_rate ==
1889 sc->curband->bitrates[rxs.rate_idx].hw_value_short) 1891 sc->curband->bitrates[rxs->rate_idx].hw_value_short)
1890 rxs.flag |= RX_FLAG_SHORTPRE; 1892 rxs->flag |= RX_FLAG_SHORTPRE;
1891 1893
1892 ath5k_debug_dump_skb(sc, skb, "RX ", 0); 1894 ath5k_debug_dump_skb(sc, skb, "RX ", 0);
1893 1895
1894 /* check beacons in IBSS mode */ 1896 /* check beacons in IBSS mode */
1895 if (sc->opmode == NL80211_IFTYPE_ADHOC) 1897 if (sc->opmode == NL80211_IFTYPE_ADHOC)
1896 ath5k_check_ibss_tsf(sc, skb, &rxs); 1898 ath5k_check_ibss_tsf(sc, skb, rxs);
1897 1899
1898 memcpy(IEEE80211_SKB_RXCB(skb), &rxs, sizeof(rxs));
1899 ieee80211_rx(sc->hw, skb); 1900 ieee80211_rx(sc->hw, skb);
1900 1901
1901 bf->skb = next_skb; 1902 bf->skb = next_skb;