Commit 475b922e authored by Larry Finger's avatar Larry Finger Committed by Greg Kroah-Hartman
Browse files

staging: r8188eu: Add files for new driver - part 26



This commit adds files include/rtw_android.h, include/rtw_ap.h,
include/rtw_br_ext.h, include/rtw_cmd.h, include/rtw_debug.h,
include/rtw_eeprom.h, include/rtw_efuse.h, and include/rtw_event.h.

Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 58c43401
Loading
Loading
Loading
Loading
+64 −0
Original line number Diff line number Diff line
/******************************************************************************
 *
 * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of version 2 of the GNU General Public License as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
 *
 *
 ******************************************************************************/

#ifndef __RTW_ANDROID_H__
#define __RTW_ANDROID_H__

#include <linux/module.h>
#include <linux/netdevice.h>

enum ANDROID_WIFI_CMD {
	ANDROID_WIFI_CMD_START,
	ANDROID_WIFI_CMD_STOP,
	ANDROID_WIFI_CMD_SCAN_ACTIVE,
	ANDROID_WIFI_CMD_SCAN_PASSIVE,
	ANDROID_WIFI_CMD_RSSI,
	ANDROID_WIFI_CMD_LINKSPEED,
	ANDROID_WIFI_CMD_RXFILTER_START,
	ANDROID_WIFI_CMD_RXFILTER_STOP,
	ANDROID_WIFI_CMD_RXFILTER_ADD,
	ANDROID_WIFI_CMD_RXFILTER_REMOVE,
	ANDROID_WIFI_CMD_BTCOEXSCAN_START,
	ANDROID_WIFI_CMD_BTCOEXSCAN_STOP,
	ANDROID_WIFI_CMD_BTCOEXMODE,
	ANDROID_WIFI_CMD_SETSUSPENDOPT,
	ANDROID_WIFI_CMD_P2P_DEV_ADDR,
	ANDROID_WIFI_CMD_SETFWPATH,
	ANDROID_WIFI_CMD_SETBAND,
	ANDROID_WIFI_CMD_GETBAND,
	ANDROID_WIFI_CMD_COUNTRY,
	ANDROID_WIFI_CMD_P2P_SET_NOA,
	ANDROID_WIFI_CMD_P2P_GET_NOA,
	ANDROID_WIFI_CMD_P2P_SET_PS,
	ANDROID_WIFI_CMD_SET_AP_WPS_P2P_IE,
	ANDROID_WIFI_CMD_MACADDR,
	ANDROID_WIFI_CMD_BLOCK,
	ANDROID_WIFI_CMD_WFD_ENABLE,
	ANDROID_WIFI_CMD_WFD_DISABLE,
	ANDROID_WIFI_CMD_WFD_SET_TCPPORT,
	ANDROID_WIFI_CMD_WFD_SET_MAX_TPUT,
	ANDROID_WIFI_CMD_WFD_SET_DEVTYPE,
	ANDROID_WIFI_CMD_MAX
};

int rtw_android_cmdstr_to_num(char *cmdstr);
int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd);

#endif /* __RTW_ANDROID_H__ */
+65 −0
Original line number Diff line number Diff line
/******************************************************************************
 *
 * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of version 2 of the GNU General Public License as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
 *
 *
 ******************************************************************************/
#ifndef __RTW_AP_H_
#define __RTW_AP_H_

#include <osdep_service.h>
#include <drv_types.h>

#ifdef CONFIG_88EU_AP_MODE

/* external function */
void rtw_indicate_sta_assoc_event(struct adapter *padapter,
				  struct sta_info *psta);
void rtw_indicate_sta_disassoc_event(struct adapter *padapter,
				     struct sta_info *psta);
void init_mlme_ap_info(struct adapter *padapter);
void free_mlme_ap_info(struct adapter *padapter);
void rtw_add_bcn_ie(struct adapter *padapter, struct wlan_bssid_ex *pnetwork,
		    u8 index, u8 *data, u8 len);
void rtw_remove_bcn_ie(struct adapter *padapter,
		       struct wlan_bssid_ex *pnetwork, u8 index);
void update_beacon(struct adapter *padapter, u8 ie_id,
		   u8 *oui, u8 tx);
void add_RATid(struct adapter *padapter, struct sta_info *psta,
	       u8 rssi_level);
void expire_timeout_chk(struct adapter *padapter);
void update_sta_info_apmode(struct adapter *padapter, struct sta_info *psta);
int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf,  int len);
void rtw_set_macaddr_acl(struct adapter *padapter, int mode);
int rtw_acl_add_sta(struct adapter *padapter, u8 *addr);
int rtw_acl_remove_sta(struct adapter *padapter, u8 *addr);

#ifdef CONFIG_88EU_AP_MODE
void associated_clients_update(struct adapter *padapter, u8 updated);
void bss_cap_update_on_sta_join(struct adapter *padapter, struct sta_info *psta);
u8 bss_cap_update_on_sta_leave(struct adapter *padapter, struct sta_info *psta);
void sta_info_update(struct adapter *padapter, struct sta_info *psta);
void ap_sta_info_defer_update(struct adapter *padapter, struct sta_info *psta);
u8 ap_free_sta(struct adapter *padapter, struct sta_info *psta,
	       bool active, u16 reason);
int rtw_sta_flush(struct adapter *padapter);
int rtw_ap_inform_ch_switch(struct adapter *padapter, u8 new_ch, u8 ch_offset);
void start_ap_mode(struct adapter *padapter);
void stop_ap_mode(struct adapter *padapter);
#endif
#endif /* end of CONFIG_88EU_AP_MODE */

#endif
+66 −0
Original line number Diff line number Diff line
/******************************************************************************
 *
 * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of version 2 of the GNU General Public License as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
 *
 *
 ******************************************************************************/
#ifndef _RTW_BR_EXT_H_
#define _RTW_BR_EXT_H_

#define MACADDRLEN		6
#define _DEBUG_ERR		DBG_88E
#define _DEBUG_INFO		DBG_88E
#define DEBUG_WARN		DBG_88E
#define DEBUG_INFO		DBG_88E
#define DEBUG_ERR		DBG_88E
#define GET_MY_HWADDR(padapter)		((padapter)->eeprompriv.mac_addr)

#define NAT25_HASH_BITS		4
#define NAT25_HASH_SIZE		(1 << NAT25_HASH_BITS)
#define NAT25_AGEING_TIME	300

#define MAX_NETWORK_ADDR_LEN	17

struct nat25_network_db_entry {
	struct nat25_network_db_entry	*next_hash;
	struct nat25_network_db_entry	**pprev_hash;
	atomic_t	use_count;
	unsigned char	macAddr[6];
	unsigned long	ageing_timer;
	unsigned char	networkAddr[MAX_NETWORK_ADDR_LEN];
};

enum NAT25_METHOD {
	NAT25_MIN,
	NAT25_CHECK,
	NAT25_INSERT,
	NAT25_LOOKUP,
	NAT25_PARSE,
	NAT25_MAX
};

struct br_ext_info {
	unsigned int	nat25_disable;
	unsigned int	macclone_enable;
	unsigned int	dhcp_bcst_disable;
	int	addPPPoETag;		/* 1: Add PPPoE relay-SID, 0: disable */
	unsigned char	nat25_dmzMac[MACADDRLEN];
	unsigned int	nat25sc_disable;
};

void nat25_db_cleanup(struct adapter *priv);

#endif /*  _RTW_BR_EXT_H_ */
+991 −0

File added.

Preview size limit exceeded, changes collapsed.

+290 −0
Original line number Diff line number Diff line
/******************************************************************************
 *
 * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of version 2 of the GNU General Public License as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
 *
 *
 ******************************************************************************/
#ifndef __RTW_DEBUG_H__
#define __RTW_DEBUG_H__

#include <osdep_service.h>
#include <drv_types.h>


#define _drv_always_			1
#define _drv_emerg_			2
#define _drv_alert_			3
#define _drv_crit_			4
#define _drv_err_			5
#define	_drv_warning_			6
#define _drv_notice_			7
#define _drv_info_			8
#define	_drv_debug_			9


#define _module_rtl871x_xmit_c_		BIT(0)
#define _module_xmit_osdep_c_		BIT(1)
#define _module_rtl871x_recv_c_		BIT(2)
#define _module_recv_osdep_c_		BIT(3)
#define _module_rtl871x_mlme_c_		BIT(4)
#define _module_mlme_osdep_c_		BIT(5)
#define _module_rtl871x_sta_mgt_c_	BIT(6)
#define _module_rtl871x_cmd_c_		BIT(7)
#define _module_cmd_osdep_c_		BIT(8)
#define _module_rtl871x_io_c_		BIT(9)
#define _module_io_osdep_c_		BIT(10)
#define _module_os_intfs_c_		BIT(11)
#define _module_rtl871x_security_c_	BIT(12)
#define _module_rtl871x_eeprom_c_	BIT(13)
#define _module_hal_init_c_		BIT(14)
#define _module_hci_hal_init_c_		BIT(15)
#define _module_rtl871x_ioctl_c_	BIT(16)
#define _module_rtl871x_ioctl_set_c_	BIT(17)
#define _module_rtl871x_ioctl_query_c_	BIT(18)
#define _module_rtl871x_pwrctrl_c_	BIT(19)
#define _module_hci_intfs_c_		BIT(20)
#define _module_hci_ops_c_		BIT(21)
#define _module_osdep_service_c_	BIT(22)
#define _module_mp_			BIT(23)
#define _module_hci_ops_os_c_		BIT(24)
#define _module_rtl871x_ioctl_os_c	BIT(25)
#define _module_rtl8712_cmd_c_		BIT(26)
#define	_module_rtl8192c_xmit_c_	BIT(27)
#define _module_hal_xmit_c_		BIT(28)
#define _module_efuse_			BIT(29)
#define _module_rtl8712_recv_c_		BIT(30)
#define _module_rtl8712_led_c_		BIT(31)

#define DRIVER_PREFIX	"R8188EU: "

extern u32 GlobalDebugLevel;

#define DBG_88E_LEVEL(_level, fmt, arg...)				\
	do {								\
		if (_level <= GlobalDebugLevel)				\
			pr_info(DRIVER_PREFIX"ERROR " fmt, ##arg);	\
	} while (0)

#define DBG_88E(...)							\
	do {								\
		if (_drv_err_ <= GlobalDebugLevel)			\
			pr_info(DRIVER_PREFIX __VA_ARGS__);		\
	} while (0)

#define MSG_88E(...)							\
	do {								\
		if (_drv_err_ <= GlobalDebugLevel)			\
			pr_info(DRIVER_PREFIX __VA_ARGS__);			\
	} while (0)

#define RT_TRACE(_comp, _level, fmt)					\
	do {								\
		if (_level <= GlobalDebugLevel) {			\
			pr_info("%s [0x%08x,%d]", DRIVER_PREFIX,	\
				 (unsigned int)_comp, _level);		\
			pr_info fmt;					\
		}							\
	} while (0)

#define _func_enter_							\
	do {								\
		if (GlobalDebugLevel >= _drv_debug_)			\
			pr_info("%s : %s enters at %d\n",		\
				 DRIVER_PREFIX, __func__, __LINE__);	\
	} while (0)

#define _func_exit_							\
	do {								\
		if (GlobalDebugLevel >= _drv_debug_)			\
			pr_info("%s : %s exits at %d\n",		\
				 DRIVER_PREFIX, __func__, __LINE__);	\
	} while (0)

#define RT_PRINT_DATA(_comp, _level, _titlestring, _hexdata, _hexdatalen)\
	do {								\
		if (_level <= GlobalDebugLevel) {			\
			int __i;					\
			u8	*ptr = (u8 *)_hexdata;			\
			pr_info("%s", DRIVER_PREFIX);			\
			pr_info(_titlestring);				\
			for (__i = 0; __i < (int)_hexdatalen; __i++ ) {	\
				pr_info("%02X%s", ptr[__i],		\
					 (((__i + 1) % 4) == 0) ?	\
					 "  " : " ");	\
				if (((__i + 1) % 16) == 0)		\
					printk("\n");			\
			}						\
			printk("\n");					\
		}							\
	} while (0)

int proc_get_drv_version(char *page, char **start,
			 off_t offset, int count,
			 int *eof, void *data);

int proc_get_write_reg(char *page, char **start,
		       off_t offset, int count,
		       int *eof, void *data);

int proc_set_write_reg(struct file *file, const char __user *buffer,
		       unsigned long count, void *data);
int proc_get_read_reg(char *page, char **start,
		      off_t offset, int count,
		      int *eof, void *data);

int proc_set_read_reg(struct file *file, const char __user *buffer,
		      unsigned long count, void *data);

int proc_get_fwstate(char *page, char **start,
		     off_t offset, int count,
		     int *eof, void *data);
int proc_get_sec_info(char *page, char **start,
		      off_t offset, int count,
		      int *eof, void *data);
int proc_get_mlmext_state(char *page, char **start,
			  off_t offset, int count,
			  int *eof, void *data);

int proc_get_qos_option(char *page, char **start,
			off_t offset, int count,
			int *eof, void *data);
int proc_get_ht_option(char *page, char **start,
		       off_t offset, int count,
		       int *eof, void *data);
int proc_get_rf_info(char *page, char **start,
		     off_t offset, int count,
		     int *eof, void *data);
int proc_get_ap_info(char *page, char **start,
		     off_t offset, int count,
		     int *eof, void *data);

int proc_get_adapter_state(char *page, char **start,
			   off_t offset, int count,
			   int *eof, void *data);

int proc_get_trx_info(char *page, char **start,
		      off_t offset, int count,
		      int *eof, void *data);

int proc_get_mac_reg_dump1(char *page, char **start,
			   off_t offset, int count,
			   int *eof, void *data);

int proc_get_mac_reg_dump2(char *page, char **start,
			   off_t offset, int count,
			   int *eof, void *data);

int proc_get_mac_reg_dump3(char *page, char **start,
			   off_t offset, int count,
			   int *eof, void *data);

int proc_get_bb_reg_dump1(char *page, char **start,
			  off_t offset, int count,
			  int *eof, void *data);

int proc_get_bb_reg_dump2(char *page, char **start,
			  off_t offset, int count,
			  int *eof, void *data);

int proc_get_bb_reg_dump3(char *page, char **start,
			  off_t offset, int count,
			  int *eof, void *data);

int proc_get_rf_reg_dump1(char *page, char **start,
			  off_t offset, int count,
			  int *eof, void *data);

int proc_get_rf_reg_dump2(char *page, char **start,
			  off_t offset, int count,
			  int *eof, void *data);

int proc_get_rf_reg_dump3(char *page, char **start,
			  off_t offset, int count,
			  int *eof, void *data);

int proc_get_rf_reg_dump4(char *page, char **start,
			  off_t offset, int count,
			  int *eof, void *data);

#ifdef CONFIG_88EU_AP_MODE

int proc_get_all_sta_info(char *page, char **start,
			  off_t offset, int count,
			  int *eof, void *data);

#endif

int proc_get_best_channel(char *page, char **start,
			  off_t offset, int count,
			  int *eof, void *data);

int proc_get_rx_signal(char *page, char **start,
		       off_t offset, int count,
		       int *eof, void *data);

int proc_set_rx_signal(struct file *file, const char __user *buffer,
		       unsigned long count, void *data);

int proc_get_ht_enable(char *page, char **start,
		       off_t offset, int count,
		       int *eof, void *data);

int proc_set_ht_enable(struct file *file, const char __user *buffer,
		       unsigned long count, void *data);

int proc_get_cbw40_enable(char *page, char **start,
			  off_t offset, int count,
			  int *eof, void *data);

int proc_set_cbw40_enable(struct file *file, const char __user *buffer,
			  unsigned long count, void *data);

int proc_get_ampdu_enable(char *page, char **start,
			  off_t offset, int count,
			  int *eof, void *data);

int proc_set_ampdu_enable(struct file *file, const char __user *buffer,
			  unsigned long count, void *data);

int proc_get_rx_stbc(char *page, char **start,
		     off_t offset, int count,
		     int *eof, void *data);

int proc_set_rx_stbc(struct file *file, const char __user *buffer,
		     unsigned long count, void *data);

int proc_get_two_path_rssi(char *page, char **start,
			   off_t offset, int count,
			   int *eof, void *data);

int proc_get_rssi_disp(char *page, char **start,
		       off_t offset, int count,
		       int *eof, void *data);

int proc_set_rssi_disp(struct file *file, const char __user *buffer,
		       unsigned long count, void *data);

#ifdef CONFIG_BT_COEXIST
int proc_get_btcoex_dbg(char *page, char **start,
			off_t offset, int count,
			int *eof, void *data);

int proc_set_btcoex_dbg(struct file *file, const char *buffer,
			signed long count, void *data);

#endif /* CONFIG_BT_COEXIST */

#endif	/* __RTW_DEBUG_H__ */
Loading