/* limit status ring size in range [ring size..max ring size] */ #define WIL_SRING_SIZE_ORDER_MIN (WIL_RING_SIZE_ORDER_MIN) #define WIL_SRING_SIZE_ORDER_MAX (WIL_RING_SIZE_ORDER_MAX) /* RX sring order should be bigger than RX ring order */ #define WIL_RX_SRING_SIZE_ORDER_DEFAULT (12) #define WIL_TX_SRING_SIZE_ORDER_DEFAULT (14) #define WIL_RX_BUFF_ARR_SIZE_DEFAULT (2600)
/* Enhanced TX status message * [dword 0] * bit 0.. 7 : Number of Descriptor:8 - The number of descriptors that * are used to form the packets. It is needed for WB when * releasing the packet * bit 8..15 : tx_ring_id:8 The transmission ring ID that is related to * the message * bit 16..23 : Status:8 - The TX status Code * 0x0 - A successful transmission * 0x1 - Retry expired * 0x2 - Lifetime Expired * 0x3 - Released * 0x4-0xFF - Reserved * bit 24..30 : Reserved:7 * bit 31 : Descriptor Ready bit:1 - It is initiated to * zero by the driver when the ring is created. It is set by the HW * to one for each completed status message. Each wrap around, * the DR bit value is flipped. * [dword 1] * bit 0..31 : timestamp:32 - Set when MPDU is transmitted. * [dword 2] * bit 0.. 4 : MCS:5 - The transmitted MCS value * bit 5 : Reserved:1 * bit 6.. 7 : CB mode:2 - 0-DMG 1-EDMG 2-Wide * bit 8..12 : QID:5 - The QID that was used for the transmission * bit 13..15 : Reserved:3 * bit 16..20 : Num of MSDUs:5 - Number of MSDUs in the aggregation * bit 21..22 : Reserved:2 * bit 23 : Retry:1 - An indication that the transmission was retried * bit 24..31 : TX-Sector:8 - the antenna sector that was used for * transmission * [dword 3] * bit 0..11 : Sequence number:12 - The Sequence Number that was used * for the MPDU transmission * bit 12..31 : Reserved:20
*/ struct wil_ring_tx_status {
u8 num_descriptors;
u8 ring_id;
u8 status;
u8 desc_ready; /* Only the last bit should be set */
u32 timestamp;
u32 d2;
u16 seq_number; /* Only the first 12 bits */
u16 w7;
} __packed;
/* Enhanced Rx status message - compressed part * [dword 0] * bit 0.. 2 : L2 Rx Status:3 - The L2 packet reception Status * 0-Success, 1-MIC Error, 2-Key Error, 3-Replay Error, * 4-A-MSDU Error, 5-Reserved, 6-Reserved, 7-FCS Error * bit 3.. 4 : L3 Rx Status:2 - Bit0 - L3I - L3 identified and checksum * calculated, Bit1- L3Err - IPv4 Checksum Error * bit 5.. 6 : L4 Rx Status:2 - Bit0 - L4I - L4 identified and checksum * calculated, Bit1- L4Err - TCP/UDP Checksum Error * bit 7 : Reserved:1 * bit 8..19 : Flow ID:12 - MSDU flow ID * bit 20 : MID_V:1 - The MAC ID field is valid * bit 21..22 : MID:2 - The MAC ID * bit 23 : L3T:1 - IP types: 0-IPv6, 1-IPv4 * bit 24 : L4T:1 - Layer 4 Type: 0-UDP, 1-TCP * bit 25 : BC:1 - The received MPDU is broadcast * bit 26 : MC:1 - The received MPDU is multicast * bit 27 : Raw:1 - The MPDU received with no translation * bit 28 : Sec:1 - The FC control (b14) - Frame Protected * bit 29 : Error:1 - An error is set when (L2 status != 0) || * (L3 status == 3) || (L4 status == 3) * bit 30 : EOP:1 - End of MSDU signaling. It is set to mark the end * of the transfer, otherwise the status indicates buffer * only completion. * bit 31 : Descriptor Ready bit:1 - It is initiated to * zero by the driver when the ring is created. It is set * by the HW to one for each completed status message. * Each wrap around, the DR bit value is flipped. * [dword 1] * bit 0.. 5 : MAC Len:6 - The number of bytes that are used for L2 header * bit 6..11 : IPLEN:6 - The number of DW that are used for L3 header * bit 12..15 : I4Len:4 - The number of DW that are used for L4 header * bit 16..21 : MCS:6 - The received MCS field from the PLCP Header * bit 22..23 : CB mode:2 - The CB Mode: 0-DMG, 1-EDMG, 2-Wide * bit 24..27 : Data Offset:4 - The data offset, a code that describe the * payload shift from the beginning of the buffer: * 0 - 0 Bytes, 3 - 2 Bytes * bit 28 : A-MSDU Present:1 - The QoS (b7) A-MSDU present field * bit 29 : A-MSDU Type:1 The QoS (b8) A-MSDU Type field * bit 30 : A-MPDU:1 - Packet is part of aggregated MPDU * bit 31 : Key ID:1 - The extracted Key ID from the encryption header * [dword 2] * bit 0..15 : Buffer ID:16 - The Buffer Identifier * bit 16..31 : Length:16 - It indicates the valid bytes that are stored * in the current descriptor buffer. For multiple buffer * descriptor, SW need to sum the total descriptor length * in all buffers to produce the packet length * [dword 3] * bit 0..31 : timestamp:32 - The MPDU Timestamp.
*/ struct wil_rx_status_compressed {
u32 d0;
u32 d1;
__le16 buff_id;
__le16 length;
u32 timestamp;
} __packed;
/* Enhanced Rx status message - extension part * [dword 0] * bit 0.. 4 : QID:5 - The Queue Identifier that the packet is received * from * bit 5.. 7 : Reserved:3 * bit 8..11 : TID:4 - The QoS (b3-0) TID Field * bit 12..15 Source index:4 - The Source index that was found during Parsing the TA. This field is used to define the source of the packet * bit 16..18 : Destination index:3 - The Destination index that was found during Parsing the RA. * bit 19..20 : DS Type:2 - The FC Control (b9-8) - From / To DS * bit 21..22 : MIC ICR:2 - this signal tells the DMA to assert an interrupt after it writes the packet * bit 23 : ESOP:1 - The QoS (b4) ESOP field * bit 24 : RDG:1 * bit 25..31 : Reserved:7 * [dword 1] * bit 0.. 1 : Frame Type:2 - The FC Control (b3-2) - MPDU Type (management, data, control and extension) * bit 2.. 5 : Syb type:4 - The FC Control (b7-4) - Frame Subtype * bit 6..11 : Ext sub type:6 - The FC Control (b11-8) - Frame Extended * Subtype * bit 12..13 : ACK Policy:2 - The QoS (b6-5) ACK Policy fields * bit 14 : DECRYPT_BYP:1 - The MPDU is bypass by the decryption unit * bit 15..23 : Reserved:9 * bit 24..31 : RSSI/SNR:8 - The RSSI / SNR measurement for the received * MPDU * [dword 2] * bit 0..11 : SN:12 - The received Sequence number field * bit 12..15 : Reserved:4 * bit 16..31 : PN bits [15:0]:16 * [dword 3] * bit 0..31 : PN bits [47:16]:32
*/ struct wil_rx_status_extension {
u32 d0;
u32 d1;
__le16 seq_num; /* only lower 12 bits */
struct_group_attr(pn, __packed,
u16 pn_15_0;
u32 pn_47_16;
);
} __packed;
/** * In case of DLPF miss the parsing of flow Id should be as follows: * dest_id:2 * src_id :3 - cid * tid:3 * Otherwise: * tid:4 * cid:4
*/
staticinline u8 wil_rx_status_get_cid(void *msg)
{
u16 val = wil_rx_status_get_flow_id(msg);
if (val & WIL_RX_EDMA_DLPF_LU_MISS_BIT) /* CID is in bits 2..4 */ return (val >> WIL_RX_EDMA_DLPF_LU_MISS_CID_POS) &
WIL_RX_EDMA_DLPF_LU_MISS_CID_TID_MASK; else /* CID is in bits 4..7 */ return (val >> WIL_RX_EDMA_DLPF_LU_HIT_CID_POS) &
WIL_RX_EDMA_DLPF_LU_HIT_CID_TID_MASK;
}
staticinline u8 wil_rx_status_get_tid(void *msg)
{
u16 val = wil_rx_status_get_flow_id(msg);
if (val & WIL_RX_EDMA_DLPF_LU_MISS_BIT) /* TID is in bits 5..7 */ return (val >> WIL_RX_EDMA_DLPF_LU_MISS_TID_POS) &
WIL_RX_EDMA_DLPF_LU_MISS_CID_TID_MASK; else /* TID is in bits 0..3 */ return val & WIL_RX_EDMA_DLPF_LU_MISS_CID_TID_MASK;
}
staticinlineint wil_rx_status_get_eop(void *msg) /* EoP = End of Packet */
{ return WIL_GET_BITS(((struct wil_rx_status_compressed *)msg)->d0,
30, 30);
}
/* L4 L3 Expected result * 0 0 Ok. No L3 and no L4 known protocols found. * Treated as L2 packet. (no offloads on this packet) * 0 1 Ok. It means that L3 was found, and checksum check passed. * No known L4 protocol was found. * 0 2 It means that L3 protocol was found, and checksum check failed. * No L4 known protocol was found. * 1 any Ok. It means that L4 was found, and checksum check passed. * 3 0 Not a possible scenario. * 3 1 Recalculate. It means that L3 protocol was found, and checksum * passed. But L4 checksum failed. Need to see if really failed, * or due to fragmentation. * 3 2 Both L3 and L4 checksum check failed.
*/ staticinlineint wil_rx_status_get_checksum(void *msg, struct wil_net_stats *stats)
{ int l3_rx_status = wil_rx_status_get_l3_rx_status(msg); int l4_rx_status = wil_rx_status_get_l4_rx_status(msg);
if (l4_rx_status == 1) return CHECKSUM_UNNECESSARY;
if (l4_rx_status == 0 && l3_rx_status == 1) return CHECKSUM_UNNECESSARY;
/* If HW reports bad checksum, let IP stack re-check it * For example, HW doesn't understand Microsoft IP stack that * mis-calculates TCP checksum - if it should be 0x0, * it writes 0xffff in violation of RFC 1624
*/
stats->rx_csum_err++; return CHECKSUM_NONE;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.