Lines Matching +full:mac +full:- +full:only

1 /* SPDX-License-Identifier: ISC */
3 * Copyright (c) 2012-2016 Qualcomm Atheros, Inc.
4 * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
16 /* default size of MAC Tx/Rx buffers */
26 return le32_to_cpu(addr->addr_low) | in wil_desc_addr()
27 ((u64)le16_to_cpu(addr->addr_high) << 32); in wil_desc_addr()
33 addr->addr_low = cpu_to_le32(lower_32_bits(pa)); in wil_desc_addr_set()
34 addr->addr_high = cpu_to_le16((u16)upper_32_bits(pa)); in wil_desc_addr_set()
37 /* Tx descriptor - MAC part
66 * bit 18..19 : l2_translation_type:2 00 - bypass, 01 - 802.3, 10 - 802.11
78 /* TX MAC Dword 0 */
115 /* TX MAC Dword 1 */
160 /* TX MAC Dword 2 */
181 /* TX MAC Dword 3 */
229 #define DMA_CFG_DESC_TX_0_L4_TYPE_MSK 0xC0000000 /* L4 type: 0-UDP, 2-TCP */
233 #define DMA_CFG_DESC_TX_OFFLOAD_CFG_MAC_LEN_MSK 0x7F /* MAC hdr len */
237 #define DMA_CFG_DESC_TX_OFFLOAD_CFG_L3T_IPV4_MSK 0x80 /* 1-IPv4, 0-IPv6 */
241 /* Tx descriptor - DMA part
247 * bit 11..12 : SBD - Segment Buffer Details
248 * 00 - Header Segment
249 * 01 - First Data Segment
250 * 10 - Medium Data Segment
251 * 11 - Last Data Segment
252 * bit 13 : TSE - TCP Segmentation Enable
253 * bit 14 : IIC - Directs the HW to Insert IPv4 Checksum
254 * bit 15 : ITC - Directs the HW to Insert TCP/UDP Checksum
255 * bit 16..20 : QID - The target QID that the packet should be stored
256 * in the MAC.
257 * bit 21 : PO - Pseudo header Offload:
258 * 0 - Use the pseudo header value from the TCP checksum field
259 * 1- Calculate Pseudo header Checksum
260 * bit 22 : NC - No UDP Checksum
262 * bit 30..31 : L4T - Layer 4 Type: 00 - UDP , 10 - TCP , 10, 11 - Reserved
271 * bit 31 : ip_version:1 1 - IPv4, 0 - IPv6
291 /* TSO type used in dma descriptor d0 bits 11-12 */
299 /* Rx descriptor - MAC part
301 * bit 0.. 3 : tid:4 The QoS (b3-0) TID Field
304 * bit 7 : MAC_id_valid:1, 1 if MAC virtual number is valid.
305 * bit 8.. 9 : mid:2 The MAC virtual number
306 * bit 10..11 : frame_type:2 : The FC (b3-2) - MPDU Type
308 * bit 12..15 : frame_subtype:4 : The FC (b7-4) - Frame Subtype
316 * bit 8.. 9 : ds_bits:2 FC (b9-8)
331 * bit 3.. 4 : fc_protocol_ver:1 The FC (b1-0) - Protocol Version
332 * bit 5 : fc_order:1 The FC Control (b15) -Order
333 * bit 6.. 7 : qos_ack_policy:2 The QoS (b6-5) ack policy Field
336 * bit 10..14 : qos_reserved:5 The QoS (b14-10) Reserved field
350 /* Rx descriptor - DMA part
352 * bit 0.. 7 : l4_length:8 layer 4 length. The field is only valid if
359 * When the FFM bit is set bits 29-27 are used for for
363 * 00 - UDP, 01 - TCP, 10, 11 - reserved
368 * bit 16..23 : ip_length:8 The filed is valid only if the L3I bit is set
370 * bit 31 : ip_version:1 1 - IPv4, 0 - IPv6
384 * bit 3 : MI:1 MAC Interrupt is asserted (according to parser decision)
409 #define RX_DMA_STATUS_MI BIT(3) /* MAC Interrupt is asserted */
415 /* IEEE 802.11, 8.5.2 EAPOL-Key frames */
419 #define WIL_KEY_INFO_ENCR_KEY_DATA BIT(12) /* for rsn only */
466 struct vring_tx_mac mac; member
476 struct vring_rx_mac mac; member
504 return WIL_GET_BITS(d->mac.d0, 0, 3); in wil_rxdesc_tid()
509 return WIL_GET_BITS(d->mac.d0, 4, 6); in wil_rxdesc_cid()
514 return (d->mac.d0 & RX_MAC_D0_MAC_ID_VALID) ? in wil_rxdesc_mid()
515 WIL_GET_BITS(d->mac.d0, 8, 9) : 0; in wil_rxdesc_mid()
520 return WIL_GET_BITS(d->mac.d0, 10, 11); in wil_rxdesc_ftype()
525 return WIL_GET_BITS(d->mac.d0, 12, 15); in wil_rxdesc_subtype()
528 /* 1-st byte (with frame type/subtype) of FC field */
531 return (u8)(WIL_GET_BITS(d->mac.d0, 10, 15) << 2); in wil_rxdesc_fc1()
536 return WIL_GET_BITS(d->mac.d0, 16, 27); in wil_rxdesc_seq()
541 return WIL_GET_BITS(d->mac.d0, 28, 31); in wil_rxdesc_ext_subtype()
546 return WIL_GET_BITS(d->mac.d0, 31, 31); in wil_rxdesc_retry()
551 return WIL_GET_BITS(d->mac.d1, 4, 5); in wil_rxdesc_key_id()
556 return WIL_GET_BITS(d->mac.d1, 7, 7); in wil_rxdesc_security()
561 return WIL_GET_BITS(d->mac.d1, 8, 9); in wil_rxdesc_ds_bits()
566 return WIL_GET_BITS(d->mac.d1, 21, 24); in wil_rxdesc_mcs()
571 return WIL_GET_BITS(d->mac.d1, 13, 14); in wil_rxdesc_mcast()
576 return (void *)skb->cb; in wil_skb_rxdesc()
581 return ring->swhead == ring->swtail; in wil_ring_is_empty()
586 return (ring->swtail + 1) % ring->size; in wil_ring_next_tail()
591 ring->swhead = (ring->swhead + n) % ring->size; in wil_ring_advance_head()
596 return wil_ring_next_tail(ring) == ring->swhead; in wil_ring_is_full()
601 struct ethhdr *eth = (void *)skb->data; in wil_skb_get_da()
603 return eth->h_dest; in wil_skb_get_da()
608 struct ethhdr *eth = (void *)skb->data; in wil_skb_get_sa()
610 return eth->h_source; in wil_skb_get_sa()
617 return is_unicast_ether_addr(da) && skb->sk && in wil_need_txstat()
618 (skb_shinfo(skb)->tx_flags & SKBTX_WIFI_STATUS); in wil_need_txstat()
632 u32 swhead = ring->swhead; in wil_ring_used_tx()
633 u32 swtail = ring->swtail; in wil_ring_used_tx()
635 return (ring->size + swhead - swtail) % ring->size; in wil_ring_used_tx()
641 return ring->size - wil_ring_used_tx(ring) - 1; in wil_ring_avail_tx()
647 return wil->use_enhanced_dma_hw ? 1 : 0; in wil_get_min_tx_ring_id()
650 /* similar to ieee80211_ version, but FC contain only 1-st byte */
657 /* wil_val_in_range - check if value in [min,max) */
665 struct skb_rx_info *skb_rx_info = (void *)skb->cb; in wil_skb_get_cid()
667 return skb_rx_info->rx_info.cid; in wil_skb_get_cid()
672 struct skb_rx_info *skb_rx_info = (void *)skb->cb; in wil_skb_set_cid()
674 skb_rx_info->rx_info.cid = cid; in wil_skb_set_cid()