40 static u8 b43legacy_plcp_get_bitrate_idx_cck(
struct b43legacy_plcp_hdr6 *plcp)
42 switch (plcp->raw[0]) {
57 static u8 b43legacy_plcp_get_bitrate_idx_ofdm(
struct b43legacy_plcp_hdr6 *plcp,
60 int base = aphy ? 0 : 4;
62 switch (plcp->raw[0] & 0xF) {
130 if (b43legacy_is_ofdm_rate(bitrate)) {
141 if ((octets * 16 % bitrate) > 0) {
144 && ((octets * 8 % 11) < 4))
189 const unsigned char *fragment_data,
190 unsigned int fragment_len,
195 int use_encryption = !!info->
control.hw_key;
200 unsigned int plcp_fragment_len;
208 memset(txhdr, 0,
sizeof(*txhdr));
210 tx_rate = ieee80211_get_tx_rate(dev->
wl->hw, info);
213 rate_ofdm = b43legacy_is_ofdm_rate(rate);
214 rate_fb = ieee80211_get_alt_retry_rate(dev->
wl->hw, info, 0) ? : tx_rate;
215 rate_fb_ofdm = b43legacy_is_ofdm_rate(rate_fb->
hw_value);
236 plcp_fragment_len = fragment_len +
FCS_LEN;
237 if (use_encryption) {
238 u8 key_idx = info->
control.hw_key->hw_key_idx;
244 key = &(dev->
key[key_idx]);
248 plcp_fragment_len += info->
control.hw_key->icv_len;
250 key_idx = b43legacy_kidx_to_fw(dev, key_idx);
257 iv_len =
min((
size_t)info->
control.hw_key->iv_len,
259 memcpy(txhdr->
iv, ((
u8 *)wlhdr) + wlhdr_len, iv_len);
270 (&txhdr->
plcp), plcp_fragment_len,
298 (rates[0].count <= dev->wl->hw->conf.long_frame_max_tx_count)) {
299 rates[0].
count = dev->
wl->hw->conf.long_frame_max_tx_count;
302 rates[0].
count = dev->
wl->hw->conf.short_frame_max_tx_count;
306 if ((rates[0].
flags & IEEE80211_TX_RC_USE_RTS_CTS) ||
312 int rts_rate_fb_ofdm;
314 rts_rate = ieee80211_get_rts_cts_rate(dev->
wl->hw, info)->hw_value;
315 rts_rate_fb = b43legacy_calc_fallback_rate(rts_rate);
316 rts_rate_fb_ofdm = b43legacy_is_ofdm_rate(rts_rate_fb);
317 if (rts_rate_fb_ofdm)
320 if (rates[0].
flags & IEEE80211_TX_RC_USE_CTS_PROTECT) {
332 fragment_data, fragment_len, info,
360 const unsigned char *fragment_data,
361 unsigned int fragment_len,
366 fragment_data, fragment_len,
372 int adjust_2053,
int adjust_2050)
390 if (dev->
dev->bus->sprom.boardflags_lo
436 struct b43legacy_plcp_hdr6 *plcp;
449 memset(&status, 0,
sizeof(status));
460 dev->
wl->ieee_stats.dot11FCSErrorCount++;
464 if (
unlikely(skb->
len < (
sizeof(
struct b43legacy_plcp_hdr6) +
469 plcp = (
struct b43legacy_plcp_hdr6 *)(skb->
data + padding);
470 skb_pull(skb,
sizeof(
struct b43legacy_plcp_hdr6) + padding);
491 keyidx = b43legacy_kidx_to_raw(dev, keyidx);
506 if (skb->
data[wlhdr_len + 3] & (1 << 5)) {
532 status.
signal = b43legacy_rssi_postprocess(dev, jssi,
537 if (phystat0 & B43legacy_RX_PHYST0_OFDM)
538 status.
rate_idx = b43legacy_plcp_get_bitrate_idx_ofdm(plcp,
false);
540 status.
rate_idx = b43legacy_plcp_get_bitrate_idx_cck(plcp);
551 if (ieee80211_is_beacon(fctl) || dev->
wl->radiotap_enabled) {
555 low_mactime_now = status.
mactime;
558 if (low_mactime_now <= mactime)
569 status.
freq = chanid + 2400;
576 memcpy(IEEE80211_SKB_RXCB(skb), &status,
sizeof(status));
595 dev->
wl->ieee_stats.dot11ACKFailureCount++;
598 dev->
wl->ieee_stats.dot11RTSFailureCount++;
600 dev->
wl->ieee_stats.dot11RTSSuccessCount++;
603 if (b43legacy_using_pio(dev))
622 tmp = hw->
flags << 1;
627 status.
acked = !!(tmp & 0x02);
635 if (b43legacy_using_pio(dev))
644 if (b43legacy_using_pio(dev))
659 b43legacy_write16(dev, 0x688,
660 b43legacy_read16(dev, 0x688) | 0x4);