Lines Matching +full:tx +full:- +full:freq

1 // SPDX-License-Identifier: GPL-2.0-only
6 * Copyright (c) 2007-2009, Christian Lamparter <chunkeey@web.de>
10 * - the islsm (softmac prism54) driver, which is:
11 * Copyright 2004-2006 Jean-Baptiste Note <jbnote@gmail.com>, et al.
12 * - stlc45xx driver
13 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
38 spin_lock_irqsave(&priv->tx_queue.lock, flags); in p54_dump_tx_queue()
39 wiphy_debug(priv->hw->wiphy, "/ --- tx queue dump (%d entries) ---\n", in p54_dump_tx_queue()
40 skb_queue_len(&priv->tx_queue)); in p54_dump_tx_queue()
42 prev_addr = priv->rx_start; in p54_dump_tx_queue()
43 skb_queue_walk(&priv->tx_queue, skb) { in p54_dump_tx_queue()
45 range = (void *) info->rate_driver_data; in p54_dump_tx_queue()
46 hdr = (void *) skb->data; in p54_dump_tx_queue()
48 free = range->start_addr - prev_addr; in p54_dump_tx_queue()
49 wiphy_debug(priv->hw->wiphy, in p54_dump_tx_queue()
53 i++, skb, skb->len, in p54_dump_tx_queue()
54 le16_to_cpu(hdr->flags), le16_to_cpu(hdr->len), in p54_dump_tx_queue()
55 le32_to_cpu(hdr->req_id), le16_to_cpu(hdr->type), in p54_dump_tx_queue()
56 range->start_addr, range->end_addr, free); in p54_dump_tx_queue()
58 prev_addr = range->end_addr; in p54_dump_tx_queue()
61 free = priv->rx_end - prev_addr; in p54_dump_tx_queue()
63 wiphy_debug(priv->hw->wiphy, in p54_dump_tx_queue()
64 "\\ --- [free: %d], largest free block: %d ---\n", in p54_dump_tx_queue()
66 spin_unlock_irqrestore(&priv->tx_queue.lock, flags); in p54_dump_tx_queue()
74 * want the card to TX needs to stay intact until the card has told us that
84 struct p54_hdr *data = (void *) skb->data; in p54_assign_address()
86 u32 last_addr = priv->rx_start; in p54_assign_address()
87 u32 target_addr = priv->rx_start; in p54_assign_address()
88 u16 len = priv->headroom + skb->len + priv->tailroom + 3; in p54_assign_address()
91 range = (void *) info->rate_driver_data; in p54_assign_address()
92 len = (range->extra_len + len) & ~0x3; in p54_assign_address()
94 spin_lock_irqsave(&priv->tx_queue.lock, flags); in p54_assign_address()
95 if (unlikely(skb_queue_len(&priv->tx_queue) == 32)) { in p54_assign_address()
101 spin_unlock_irqrestore(&priv->tx_queue.lock, flags); in p54_assign_address()
102 return -EBUSY; in p54_assign_address()
105 skb_queue_walk(&priv->tx_queue, entry) { in p54_assign_address()
108 range = (void *) info->rate_driver_data; in p54_assign_address()
109 hole_size = range->start_addr - last_addr; in p54_assign_address()
112 target_skb = entry->prev; in p54_assign_address()
113 hole_size -= len; in p54_assign_address()
117 last_addr = range->end_addr; in p54_assign_address()
120 if (priv->rx_end - last_addr >= len) { in p54_assign_address()
121 target_skb = skb_peek_tail(&priv->tx_queue); in p54_assign_address()
124 range = (void *)info->rate_driver_data; in p54_assign_address()
125 target_addr = range->end_addr; in p54_assign_address()
128 spin_unlock_irqrestore(&priv->tx_queue.lock, flags); in p54_assign_address()
129 return -ENOSPC; in p54_assign_address()
134 range = (void *) info->rate_driver_data; in p54_assign_address()
135 range->start_addr = target_addr; in p54_assign_address()
136 range->end_addr = target_addr + len; in p54_assign_address()
137 data->req_id = cpu_to_le32(target_addr + priv->headroom); in p54_assign_address()
140 priv->beacon_req_id = data->req_id; in p54_assign_address()
143 __skb_queue_after(&priv->tx_queue, target_skb, skb); in p54_assign_address()
145 __skb_queue_head(&priv->tx_queue, skb); in p54_assign_address()
146 spin_unlock_irqrestore(&priv->tx_queue.lock, flags); in p54_assign_address()
155 skb = skb_dequeue(&priv->tx_pending); in p54_tx_pending()
161 skb_queue_head(&priv->tx_pending, skb); in p54_tx_pending()
163 priv->tx(priv->hw, skb); in p54_tx_pending()
171 if (unlikely(priv->mode == NL80211_IFTYPE_UNSPECIFIED)) in p54_wake_queues()
176 spin_lock_irqsave(&priv->tx_stats_lock, flags); in p54_wake_queues()
177 for (i = 0; i < priv->hw->queues; i++) { in p54_wake_queues()
178 if (priv->tx_stats[i + P54_QUEUE_DATA].len < in p54_wake_queues()
179 priv->tx_stats[i + P54_QUEUE_DATA].limit) in p54_wake_queues()
180 ieee80211_wake_queue(priv->hw, i); in p54_wake_queues()
182 spin_unlock_irqrestore(&priv->tx_stats_lock, flags); in p54_wake_queues()
193 return -EINVAL; in p54_tx_qos_accounting_alloc()
195 queue = &priv->tx_stats[p54_queue]; in p54_tx_qos_accounting_alloc()
197 spin_lock_irqsave(&priv->tx_stats_lock, flags); in p54_tx_qos_accounting_alloc()
198 if (unlikely(queue->len >= queue->limit && IS_QOS_QUEUE(p54_queue))) { in p54_tx_qos_accounting_alloc()
199 spin_unlock_irqrestore(&priv->tx_stats_lock, flags); in p54_tx_qos_accounting_alloc()
200 return -ENOSPC; in p54_tx_qos_accounting_alloc()
203 queue->len++; in p54_tx_qos_accounting_alloc()
204 queue->count++; in p54_tx_qos_accounting_alloc()
206 if (unlikely(queue->len == queue->limit && IS_QOS_QUEUE(p54_queue))) { in p54_tx_qos_accounting_alloc()
207 u16 ac_queue = p54_queue - P54_QUEUE_DATA; in p54_tx_qos_accounting_alloc()
208 ieee80211_stop_queue(priv->hw, ac_queue); in p54_tx_qos_accounting_alloc()
211 spin_unlock_irqrestore(&priv->tx_stats_lock, flags); in p54_tx_qos_accounting_alloc()
221 spin_lock_irqsave(&priv->tx_stats_lock, flags); in p54_tx_qos_accounting_free()
222 priv->tx_stats[GET_HW_QUEUE(skb)].len--; in p54_tx_qos_accounting_free()
223 spin_unlock_irqrestore(&priv->tx_stats_lock, flags); in p54_tx_qos_accounting_free()
226 if (priv->beacon_req_id == GET_REQ_ID(skb)) { in p54_tx_qos_accounting_free()
228 priv->beacon_req_id = 0; in p54_tx_qos_accounting_free()
230 complete(&priv->beacon_comp); in p54_tx_qos_accounting_free()
238 struct p54_common *priv = dev->priv; in p54_free_skb()
242 skb_unlink(skb, &priv->tx_queue); in p54_free_skb()
254 spin_lock_irqsave(&priv->tx_queue.lock, flags); in p54_find_and_unlink_skb()
255 skb_queue_walk(&priv->tx_queue, entry) { in p54_find_and_unlink_skb()
256 struct p54_hdr *hdr = (struct p54_hdr *) entry->data; in p54_find_and_unlink_skb()
258 if (hdr->req_id == req_id) { in p54_find_and_unlink_skb()
259 __skb_unlink(entry, &priv->tx_queue); in p54_find_and_unlink_skb()
260 spin_unlock_irqrestore(&priv->tx_queue.lock, flags); in p54_find_and_unlink_skb()
265 spin_unlock_irqrestore(&priv->tx_queue.lock, flags); in p54_find_and_unlink_skb()
271 skb_queue_tail(&priv->tx_pending, skb); in p54_tx()
277 if (priv->rxhw != 5) { in p54_rssi_to_dbm()
278 return ((rssi * priv->cur_rssi->mul) / 64 + in p54_rssi_to_dbm()
279 priv->cur_rssi->add) / 4; in p54_rssi_to_dbm()
284 return rssi / 2 - 110; in p54_rssi_to_dbm()
290 * while dozing, we have to prepared in case mac80211 uses PS-POLL
296 struct ieee80211_hdr *hdr = (void *) skb->data; in p54_pspoll_workaround()
303 if (!ieee80211_is_beacon(hdr->frame_control)) in p54_pspoll_workaround()
306 if (!priv->aid) in p54_pspoll_workaround()
310 if (!ether_addr_equal_64bits(hdr->addr3, priv->bssid)) in p54_pspoll_workaround()
320 new_psm = ieee80211_check_tim(tim_ie, tim_len, priv->aid); in p54_pspoll_workaround()
321 if (new_psm != priv->powersave_override) { in p54_pspoll_workaround()
322 priv->powersave_override = new_psm; in p54_pspoll_workaround()
329 struct p54_rx_data *hdr = (struct p54_rx_data *) skb->data; in p54_rx_data()
331 u16 freq = le16_to_cpu(hdr->freq); in p54_rx_data() local
335 u8 rate = hdr->rate & 0xf; in p54_rx_data()
342 if (unlikely(priv->mode == NL80211_IFTYPE_UNSPECIFIED)) in p54_rx_data()
345 if (!(hdr->flags & cpu_to_le16(P54_HDR_FLAG_DATA_IN_FCS_GOOD))) in p54_rx_data()
348 if (hdr->decrypt_status == P54_DECRYPT_OK) in p54_rx_data()
349 rx_status->flag |= RX_FLAG_DECRYPTED; in p54_rx_data()
350 if ((hdr->decrypt_status == P54_DECRYPT_FAIL_MICHAEL) || in p54_rx_data()
351 (hdr->decrypt_status == P54_DECRYPT_FAIL_TKIP)) in p54_rx_data()
352 rx_status->flag |= RX_FLAG_MMIC_ERROR; in p54_rx_data()
354 rx_status->signal = p54_rssi_to_dbm(priv, hdr->rssi); in p54_rx_data()
355 if (hdr->rate & 0x10) in p54_rx_data()
356 rx_status->enc_flags |= RX_ENC_FLAG_SHORTPRE; in p54_rx_data()
357 if (priv->hw->conf.chandef.chan->band == NL80211_BAND_5GHZ) in p54_rx_data()
358 rx_status->rate_idx = (rate < 4) ? 0 : rate - 4; in p54_rx_data()
360 rx_status->rate_idx = rate; in p54_rx_data()
362 rx_status->freq = freq; in p54_rx_data()
363 rx_status->band = priv->hw->conf.chandef.chan->band; in p54_rx_data()
364 rx_status->antenna = hdr->antenna; in p54_rx_data()
366 tsf32 = le32_to_cpu(hdr->tsf32); in p54_rx_data()
367 if (tsf32 < priv->tsf_low32) in p54_rx_data()
368 priv->tsf_high32++; in p54_rx_data()
369 rx_status->mactime = ((u64)priv->tsf_high32) << 32 | tsf32; in p54_rx_data()
370 priv->tsf_low32 = tsf32; in p54_rx_data()
372 /* LMAC API Page 10/29 - s_lm_data_in - clock in p54_rx_data()
376 rx_status->flag |= RX_FLAG_MACTIME_END; in p54_rx_data()
378 if (hdr->flags & cpu_to_le16(P54_HDR_FLAG_DATA_ALIGN)) in p54_rx_data()
379 header_len += hdr->align[0]; in p54_rx_data()
382 skb_trim(skb, le16_to_cpu(hdr->len)); in p54_rx_data()
384 fc = ((struct ieee80211_hdr *)skb->data)->frame_control; in p54_rx_data()
386 rx_status->boottime_ns = ktime_get_boottime_ns(); in p54_rx_data()
388 if (unlikely(priv->hw->conf.flags & IEEE80211_CONF_PS)) in p54_rx_data()
391 ieee80211_rx_irqsafe(priv->hw, skb); in p54_rx_data()
393 ieee80211_queue_delayed_work(priv->hw, &priv->work, in p54_rx_data()
396 return -1; in p54_rx_data()
401 struct p54_hdr *hdr = (struct p54_hdr *) skb->data; in p54_rx_frame_sent()
402 struct p54_frame_sent *payload = (struct p54_frame_sent *) hdr->data; in p54_rx_frame_sent()
410 entry = p54_find_and_unlink_skb(priv, hdr->req_id); in p54_rx_frame_sent()
414 frame_len = entry->len; in p54_rx_frame_sent()
416 entry_hdr = (struct p54_hdr *) entry->data; in p54_rx_frame_sent()
417 entry_data = (struct p54_tx_data *) entry_hdr->data; in p54_rx_frame_sent()
418 priv->stats.dot11ACKFailureCount += payload->tries - 1; in p54_rx_frame_sent()
425 if (unlikely(entry_data->hw_queue < P54_QUEUE_FWSCAN)) { in p54_rx_frame_sent()
434 memset_after(&info->status, 0, rates); in p54_rx_frame_sent()
436 if (entry_hdr->flags & cpu_to_le16(P54_HDR_FLAG_DATA_ALIGN)) in p54_rx_frame_sent()
437 pad = entry_data->align[0]; in p54_rx_frame_sent()
440 count = payload->tries; in p54_rx_frame_sent()
442 if (count >= info->status.rates[idx].count) { in p54_rx_frame_sent()
443 count -= info->status.rates[idx].count; in p54_rx_frame_sent()
445 info->status.rates[idx].count = count; in p54_rx_frame_sent()
448 info->status.rates[idx].idx = -1; in p54_rx_frame_sent()
449 info->status.rates[idx].count = 0; in p54_rx_frame_sent()
453 if (!(info->flags & IEEE80211_TX_CTL_NO_ACK) && in p54_rx_frame_sent()
454 !(payload->status & P54_TX_FAILED)) in p54_rx_frame_sent()
455 info->flags |= IEEE80211_TX_STAT_ACK; in p54_rx_frame_sent()
456 if (payload->status & P54_TX_PSM_CANCELLED) in p54_rx_frame_sent()
457 info->flags |= IEEE80211_TX_STAT_TX_FILTERED; in p54_rx_frame_sent()
458 info->status.ack_signal = p54_rssi_to_dbm(priv, in p54_rx_frame_sent()
459 (int)payload->ack_rssi); in p54_rx_frame_sent()
462 switch (entry_data->key_type) { in p54_rx_frame_sent()
464 u8 *iv = (u8 *)(entry_data->align + pad + in p54_rx_frame_sent()
465 entry_data->crypt_offset); in p54_rx_frame_sent()
470 iv[1] = (iv[0] | 0x20) & 0x7f; /* WEPSeed - 8.3.2.2 */ in p54_rx_frame_sent()
472 frame_len -= 12; /* remove TKIP_MMIC + TKIP_ICV */ in p54_rx_frame_sent()
476 frame_len -= 8; /* remove CCMP_MIC */ in p54_rx_frame_sent()
479 frame_len -= 4; /* remove WEP_ICV */ in p54_rx_frame_sent()
485 ieee80211_tx_status_irqsafe(priv->hw, entry); in p54_rx_frame_sent()
491 struct p54_hdr *hdr = (struct p54_hdr *) skb->data; in p54_rx_eeprom_readback()
492 struct p54_eeprom_lm86 *eeprom = (struct p54_eeprom_lm86 *) hdr->data; in p54_rx_eeprom_readback()
495 if (!priv->eeprom) in p54_rx_eeprom_readback()
498 if (priv->fw_var >= 0x509) { in p54_rx_eeprom_readback()
499 memcpy(priv->eeprom, eeprom->v2.data, in p54_rx_eeprom_readback()
500 le16_to_cpu(eeprom->v2.len)); in p54_rx_eeprom_readback()
502 memcpy(priv->eeprom, eeprom->v1.data, in p54_rx_eeprom_readback()
503 le16_to_cpu(eeprom->v1.len)); in p54_rx_eeprom_readback()
506 priv->eeprom = NULL; in p54_rx_eeprom_readback()
507 tmp = p54_find_and_unlink_skb(priv, hdr->req_id); in p54_rx_eeprom_readback()
509 complete(&priv->eeprom_comp); in p54_rx_eeprom_readback()
514 struct p54_hdr *hdr = (struct p54_hdr *) skb->data; in p54_rx_stats()
515 struct p54_statistics *stats = (struct p54_statistics *) hdr->data; in p54_rx_stats()
518 unsigned int i, rssi, tx, cca, dtime, dtotal, dcca, dtx, drssi, unit; in p54_rx_stats() local
521 if (unlikely(priv->mode == NL80211_IFTYPE_UNSPECIFIED)) in p54_rx_stats()
524 tsf32 = le32_to_cpu(stats->tsf32); in p54_rx_stats()
525 if (tsf32 < priv->tsf_low32) in p54_rx_stats()
526 priv->tsf_high32++; in p54_rx_stats()
527 priv->tsf_low32 = tsf32; in p54_rx_stats()
529 priv->stats.dot11RTSFailureCount = le32_to_cpu(stats->rts_fail); in p54_rx_stats()
530 priv->stats.dot11RTSSuccessCount = le32_to_cpu(stats->rts_success); in p54_rx_stats()
531 priv->stats.dot11FCSErrorCount = le32_to_cpu(stats->rx_bad_fcs); in p54_rx_stats()
533 priv->noise = p54_rssi_to_dbm(priv, le32_to_cpu(stats->noise)); in p54_rx_stats()
536 * STSW450X LMAC API page 26 - 3.8 Statistics in p54_rx_stats()
540 dtime = tsf32 - priv->survey_raw.timestamp; in p54_rx_stats()
543 * STSW450X LMAC API page 26 - 3.8.1 Noise histogram in p54_rx_stats()
547 cca = le32_to_cpu(stats->sample_cca); in p54_rx_stats()
548 tx = le32_to_cpu(stats->sample_tx); in p54_rx_stats()
550 for (i = 0; i < ARRAY_SIZE(stats->sample_noise); i++) in p54_rx_stats()
551 rssi += le32_to_cpu(stats->sample_noise[i]); in p54_rx_stats()
553 dcca = cca - priv->survey_raw.cached_cca; in p54_rx_stats()
554 drssi = rssi - priv->survey_raw.cached_rssi; in p54_rx_stats()
555 dtx = tx - priv->survey_raw.cached_tx; in p54_rx_stats()
562 if (dtotal && (priv->update_stats || dtime >= USEC_PER_SEC) && in p54_rx_stats()
564 priv->survey_raw.timestamp = tsf32; in p54_rx_stats()
565 priv->update_stats = false; in p54_rx_stats()
569 priv->survey_raw.cca += dcca * unit; in p54_rx_stats()
570 priv->survey_raw.cached_cca = cca; in p54_rx_stats()
573 priv->survey_raw.tx += dtx * unit; in p54_rx_stats()
574 priv->survey_raw.cached_tx = tx; in p54_rx_stats()
577 priv->survey_raw.rssi += drssi * unit; in p54_rx_stats()
578 priv->survey_raw.cached_rssi = rssi; in p54_rx_stats()
582 if (!(priv->phy_ps || priv->phy_idle)) in p54_rx_stats()
583 priv->survey_raw.active += dtotal * unit; in p54_rx_stats()
585 priv->survey_raw.active += (dcca + dtx) * unit; in p54_rx_stats()
588 chan = priv->curchan; in p54_rx_stats()
590 struct survey_info *survey = &priv->survey[chan->hw_value]; in p54_rx_stats()
591 survey->noise = clamp(priv->noise, -128, 127); in p54_rx_stats()
592 survey->time = priv->survey_raw.active; in p54_rx_stats()
593 survey->time_tx = priv->survey_raw.tx; in p54_rx_stats()
594 survey->time_busy = priv->survey_raw.tx + in p54_rx_stats()
595 priv->survey_raw.cca; in p54_rx_stats()
596 do_div(survey->time, 1024); in p54_rx_stats()
597 do_div(survey->time_tx, 1024); in p54_rx_stats()
598 do_div(survey->time_busy, 1024); in p54_rx_stats()
601 tmp = p54_find_and_unlink_skb(priv, hdr->req_id); in p54_rx_stats()
603 complete(&priv->stat_comp); in p54_rx_stats()
608 struct p54_hdr *hdr = (struct p54_hdr *) skb->data; in p54_rx_trap()
609 struct p54_trap *trap = (struct p54_trap *) hdr->data; in p54_rx_trap()
610 u16 event = le16_to_cpu(trap->event); in p54_rx_trap()
611 u16 freq = le16_to_cpu(trap->frequency); in p54_rx_trap() local
617 wiphy_info(priv->hw->wiphy, "radar (freq:%d MHz)\n", freq); in p54_rx_trap()
620 if (priv->vif) in p54_rx_trap()
621 ieee80211_beacon_loss(priv->vif); in p54_rx_trap()
630 wiphy_rfkill_set_hw_state(priv->hw->wiphy, true); in p54_rx_trap()
633 wiphy_rfkill_set_hw_state(priv->hw->wiphy, false); in p54_rx_trap()
636 wiphy_info(priv->hw->wiphy, "received event:%x freq:%d\n", in p54_rx_trap()
637 event, freq); in p54_rx_trap()
644 struct p54_hdr *hdr = (struct p54_hdr *) skb->data; in p54_rx_control()
646 switch (le16_to_cpu(hdr->type)) { in p54_rx_control()
662 wiphy_debug(priv->hw->wiphy, in p54_rx_control()
664 le16_to_cpu(hdr->type)); in p54_rx_control()
673 struct p54_common *priv = dev->priv; in p54_rx()
674 u16 type = le16_to_cpu(*((__le16 *)skb->data)); in p54_rx()
689 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; in p54_tx_80211_header()
691 if (ieee80211_is_data_qos(hdr->frame_control)) in p54_tx_80211_header()
696 if (!(info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ)) in p54_tx_80211_header()
699 if (info->flags & IEEE80211_TX_CTL_NO_PS_BUFFER) in p54_tx_80211_header()
702 if (info->flags & IEEE80211_TX_CTL_CLEAR_PS_FILT) in p54_tx_80211_header()
707 switch (priv->mode) { in p54_tx_80211_header()
712 * see STSW45x0C LMAC API - page 12. in p54_tx_80211_header()
723 if (info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) { in p54_tx_80211_header()
729 if (unlikely(ieee80211_is_mgmt(hdr->frame_control))) { in p54_tx_80211_header()
730 if (ieee80211_is_probe_resp(hdr->frame_control)) { in p54_tx_80211_header()
735 } else if (ieee80211_is_beacon(hdr->frame_control)) { in p54_tx_80211_header()
738 if (info->flags & IEEE80211_TX_CTL_INJECTED) { in p54_tx_80211_header()
756 *aid = sta->aid; in p54_tx_80211_header()
780 struct p54_common *priv = dev->priv; in p54_tx_80211()
795 p54_tx_80211_header(priv, skb, info, control->sta, &queue, &extra_len, in p54_tx_80211()
803 padding = (unsigned long)(skb->data - (sizeof(*hdr) + sizeof(*txhdr))) & 3; in p54_tx_80211()
804 len = skb->len; in p54_tx_80211()
806 if (info->control.hw_key) { in p54_tx_80211()
808 if (info->control.hw_key->cipher == WLAN_CIPHER_SUITE_TKIP) { in p54_tx_80211()
809 u8 *iv = (u8 *)(skb->data + crypt_offset); in p54_tx_80211()
825 hdr->type = cpu_to_le16(aid); in p54_tx_80211()
826 hdr->rts_tries = info->control.rates[0].count; in p54_tx_80211()
832 cts_rate = info->control.rts_cts_rate_idx; in p54_tx_80211()
834 memset(&txhdr->rateset, 0, sizeof(txhdr->rateset)); in p54_tx_80211()
837 for (i = 0; i < dev->max_rates; i++) { in p54_tx_80211()
838 if (info->control.rates[i].idx < 0) in p54_tx_80211()
851 info->control.rates[i].count); in p54_tx_80211()
852 nremaining -= calculated_tries[i]; in p54_tx_80211()
856 for (i = nrates - 1; nremaining > 0 && i >= 0; i--) { in p54_tx_80211()
857 int tmp = info->control.rates[i].count - calculated_tries[i]; in p54_tx_80211()
865 nremaining -= tmp; in p54_tx_80211()
871 rate = info->control.rates[i].idx; in p54_tx_80211()
872 if (info->band == NL80211_BAND_5GHZ) in p54_tx_80211()
875 /* store the count we actually calculated for TX status */ in p54_tx_80211()
876 info->control.rates[i].count = calculated_tries[i]; in p54_tx_80211()
878 rc_flags = info->control.rates[i].flags; in p54_tx_80211()
891 txhdr->rateset[ridx] = rate; in p54_tx_80211()
900 hdr->flags = cpu_to_le16(hdr_flags); in p54_tx_80211()
901 hdr->tries = ridx; in p54_tx_80211()
902 txhdr->rts_rate_idx = 0; in p54_tx_80211()
903 if (info->control.hw_key) { in p54_tx_80211()
904 txhdr->key_type = p54_convert_algo(info->control.hw_key->cipher); in p54_tx_80211()
905 txhdr->key_len = min((u8)16, info->control.hw_key->keylen); in p54_tx_80211()
906 memcpy(txhdr->key, info->control.hw_key->key, txhdr->key_len); in p54_tx_80211()
907 if (info->control.hw_key->cipher == WLAN_CIPHER_SUITE_TKIP) { in p54_tx_80211()
911 &(info->control.hw_key->key[NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY]), in p54_tx_80211()
915 len += info->control.hw_key->icv_len; in p54_tx_80211()
916 skb_put_zero(skb, info->control.hw_key->icv_len); in p54_tx_80211()
918 txhdr->key_type = 0; in p54_tx_80211()
919 txhdr->key_len = 0; in p54_tx_80211()
921 txhdr->crypt_offset = crypt_offset; in p54_tx_80211()
922 txhdr->hw_queue = queue; in p54_tx_80211()
923 txhdr->backlog = priv->tx_stats[queue].len - 1; in p54_tx_80211()
924 memset(txhdr->durations, 0, sizeof(txhdr->durations)); in p54_tx_80211()
925 txhdr->tx_antenna = 2 & priv->tx_diversity_mask; in p54_tx_80211()
926 if (priv->rxhw == 5) { in p54_tx_80211()
927 txhdr->longbow.cts_rate = cts_rate; in p54_tx_80211()
928 txhdr->longbow.output_power = cpu_to_le16(priv->output_power); in p54_tx_80211()
930 txhdr->normal.output_power = priv->output_power; in p54_tx_80211()
931 txhdr->normal.cts_rate = cts_rate; in p54_tx_80211()
934 txhdr->align[0] = padding; in p54_tx_80211()
936 hdr->len = cpu_to_le16(len); in p54_tx_80211()
937 /* modifies skb->cb and with it info, so must be last! */ in p54_tx_80211()
938 p54info = (void *) info->rate_driver_data; in p54_tx_80211()
939 p54info->extra_len = extra_len; in p54_tx_80211()