linux/drivers/staging/rtl8192e/rtl8192e/rtl_core.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved.
 *
 * Based on the r8180 driver, which is:
 * Copyright 2004-2005 Andrea Merello <[email protected]>, et al.
 *
 * Contact Information: wlanfae <[email protected]>
 */
#ifndef _RTL_CORE_H
#define _RTL_CORE_H

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/ioport.h>
#include <linux/sched.h>
#include <linux/types.h>
#include <linux/interrupt.h>
#include <linux/slab.h>
#include <linux/netdevice.h>
#include <linux/pci.h>
#include <linux/etherdevice.h>
#include <linux/delay.h>
#include <linux/rtnetlink.h>
#include <linux/wireless.h>
#include <linux/timer.h>
#include <linux/proc_fs.h>
#include <linux/if_arp.h>
#include <linux/random.h>
#include <linux/io.h>

/* Need this defined before including local include files */
#define DRV_NAME

#include "../rtllib.h"

#include "r8192E_firmware.h"
#include "r8192E_hw.h"

#include "r8190P_def.h"
#include "r8192E_dev.h"

#include "rtl_eeprom.h"
#include "rtl_ps.h"
#include "rtl_pci.h"
#include "rtl_cam.h"

#define DRV_COPYRIGHT
#define DRV_AUTHOR
#define DRV_VERSION

#define TOTAL_CAM_ENTRY
#define CAM_CONTENT_COUNT

#define HAL_HW_PCI_REVISION_ID_8192PCIE
#define HAL_HW_PCI_REVISION_ID_8192SE

#define RTLLIB_WATCH_DOG_TIME

#define MAX_DEV_ADDR_SIZE
#define MAX_FIRMWARE_INFORMATION_SIZE
#define MAX_802_11_HEADER_LENGTH
#define ENCRYPTION_MAX_OVERHEAD
#define MAX_FRAGMENT_COUNT
#define MAX_TRANSMIT_BUFFER_SIZE

#define CMDPACKET_FRAG_SIZE

#define DEFAULT_FRAG_THRESHOLD
#define MIN_FRAG_THRESHOLD
#define DEFAULT_BEACONINTERVAL

#define DEFAULT_RETRY_RTS
#define DEFAULT_RETRY_DATA

#define PHY_RSSI_SLID_WIN_MAX

#define TX_BB_GAIN_TABLE_LEN
#define CCK_TX_BB_GAIN_TABLE_LEN

#define CHANNEL_PLAN_LEN
#define S_CRC_LEN

#define NIC_SEND_HANG_THRESHOLD_NORMAL
#define NIC_SEND_HANG_THRESHOLD_POWERSAVE

#define MAX_TX_QUEUE

#define MAX_RX_COUNT
#define MAX_TX_QUEUE_COUNT

extern int hwwep;

enum nic_t {};

enum rt_eeprom_type {};

enum dcmg_txcmd_op {};

enum rt_customer_id {};

enum reset_type {};

struct rt_stats {};

struct init_gain {};

struct tx_ring {} __packed;

struct rtl8192_tx_ring {};

struct r8192_priv {};

extern const struct ethtool_ops rtl819x_ethtool_ops;

u8 rtl92e_readb(struct net_device *dev, int x);
u32 rtl92e_readl(struct net_device *dev, int x);
u16 rtl92e_readw(struct net_device *dev, int x);
void rtl92e_writeb(struct net_device *dev, int x, u8 y);
void rtl92e_writew(struct net_device *dev, int x, u16 y);
void rtl92e_writel(struct net_device *dev, int x, u32 y);

void force_pci_posting(struct net_device *dev);

void rtl92e_rx_enable(struct net_device *dev);
void rtl92e_tx_enable(struct net_device *dev);

void rtl92e_hw_sleep_wq(void *data);
void rtl92e_commit(struct net_device *dev);

void rtl92e_check_rfctrl_gpio_timer(struct timer_list *t);

void rtl92e_hw_wakeup_wq(void *data);

void rtl92e_reset_desc_ring(struct net_device *dev);
void rtl92e_set_wireless_mode(struct net_device *dev, u8 wireless_mode);
void rtl92e_irq_enable(struct net_device *dev);
void rtl92e_config_rate(struct net_device *dev, u16 *rate_config);
void rtl92e_irq_disable(struct net_device *dev);

long rtl92e_translate_to_dbm(struct r8192_priv *priv, u8 signal_strength_index);
void rtl92e_update_rx_statistics(struct r8192_priv *priv,
				 struct rtllib_rx_stats *pprevious_stats);
u8 rtl92e_evm_db_to_percent(s8 value);
u8 rtl92e_rx_db_to_percent(s8 antpower);
void rtl92e_copy_mpdu_stats(struct rtllib_rx_stats *psrc_stats,
			    struct rtllib_rx_stats *ptarget_stats);
bool rtl92e_enable_nic(struct net_device *dev);

bool rtl92e_set_rf_state(struct net_device *dev,
			 enum rt_rf_power_state state_to_set,
			 RT_RF_CHANGE_SOURCE change_source);
#endif