linux/drivers/net/wireless/ti/wlcore/rx.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * This file is part of wl1271
 *
 * Copyright (C) 1998-2009 Texas Instruments. All rights reserved.
 * Copyright (C) 2008-2009 Nokia Corporation
 *
 * Contact: Luciano Coelho <[email protected]>
 */

#ifndef __RX_H__
#define __RX_H__

#include <linux/bitops.h>

#define WL1271_RX_MAX_RSSI
#define WL1271_RX_MIN_RSSI

#define RSSI_LEVEL_BITMASK
#define ANT_DIVERSITY_BITMASK

#define SHORT_PREAMBLE_BIT
#define OFDM_RATE_BIT
#define PBCC_RATE_BIT

#define PLCP_HEADER_LENGTH
#define RX_DESC_PACKETID_SHIFT
#define RX_MAX_PACKET_ID

#define RX_DESC_VALID_FCS
#define RX_DESC_MATCH_RXADDR1
#define RX_DESC_MCAST
#define RX_DESC_STAINTIM
#define RX_DESC_VIRTUAL_BM
#define RX_DESC_BCAST
#define RX_DESC_MATCH_SSID
#define RX_DESC_MATCH_BSSID
#define RX_DESC_ENCRYPTION_MASK
#define RX_DESC_MEASURMENT
#define RX_DESC_SEQNUM_MASK
#define RX_DESC_MIC_FAIL
#define RX_DESC_DECRYPT_FAIL

/*
 * RX Descriptor flags:
 *
 * Bits 0-1 - band
 * Bit  2   - STBC
 * Bit  3   - A-MPDU
 * Bit  4   - HT
 * Bits 5-7 - encryption
 */
#define WL1271_RX_DESC_BAND_MASK
#define WL1271_RX_DESC_ENCRYPT_MASK

#define WL1271_RX_DESC_BAND_BG
#define WL1271_RX_DESC_BAND_J
#define WL1271_RX_DESC_BAND_A

#define WL1271_RX_DESC_STBC
#define WL1271_RX_DESC_A_MPDU
#define WL1271_RX_DESC_HT

#define WL1271_RX_DESC_ENCRYPT_WEP
#define WL1271_RX_DESC_ENCRYPT_TKIP
#define WL1271_RX_DESC_ENCRYPT_AES
#define WL1271_RX_DESC_ENCRYPT_GEM

/*
 * RX Descriptor status
 *
 * Bits 0-2 - error code
 * Bits 3-5 - process_id tag (AP mode FW)
 * Bits 6-7 - reserved
 */
#define WL1271_RX_DESC_STATUS_MASK

#define WL1271_RX_DESC_SUCCESS
#define WL1271_RX_DESC_DECRYPT_FAIL
#define WL1271_RX_DESC_MIC_FAIL

#define RX_MEM_BLOCK_MASK
#define RX_BUF_SIZE_MASK
#define RX_BUF_SIZE_SHIFT_DIV
#define ALIGNED_RX_BUF_SIZE_MASK
#define ALIGNED_RX_BUF_SIZE_SHIFT

/* If set, the start of IP payload is not 4 bytes aligned */
#define RX_BUF_UNALIGNED_PAYLOAD

/* If set, the buffer was padded by the FW to be 4 bytes aligned */
#define RX_BUF_PADDED_PAYLOAD

/*
 * Account for the padding inserted by the FW in case of RX_ALIGNMENT
 * or for fixing alignment in case the packet wasn't aligned.
 */
#define RX_BUF_ALIGN

/* Describes the alignment state of a Rx buffer */
enum wl_rx_buf_align {};

enum {};

struct wl1271_rx_descriptor {} __packed;

int wlcore_rx(struct wl1271 *wl, struct wl_fw_status *status);
u8 wl1271_rate_to_idx(int rate, enum nl80211_band band);
int wl1271_rx_filter_enable(struct wl1271 *wl,
			    int index, bool enable,
			    struct wl12xx_rx_filter *filter);
int wl1271_rx_filter_clear_all(struct wl1271 *wl);

#endif