rtl8188eu: Fix a number of sparse warnings

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2018-11-01 20:34:15 -05:00
parent 96ff2341a9
commit bf88fed9a4
33 changed files with 340 additions and 318 deletions

View file

@ -48,8 +48,10 @@ int rtw_mp_write_reg(struct net_device *dev,
u32 addr, data;
int ret;
PADAPTER padapter = rtw_netdev_priv(dev);
char input[wrqu->length];
char input[128];
if (wrqu->length > 128)
return -EFAULT;
if (copy_from_user(input, wrqu->pointer, wrqu->length))
return -EFAULT;
@ -130,7 +132,7 @@ int rtw_mp_read_reg(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *wrqu, char *extra)
{
char input[wrqu->length];
char input[128];
char *pch, *pnext, *ptmp;
char *width_str;
char width;
@ -262,9 +264,10 @@ int rtw_mp_write_rf(struct net_device *dev,
u32 path, addr, data;
int ret;
PADAPTER padapter = rtw_netdev_priv(dev);
char input[wrqu->length];
char input[128];
if (wrqu->length > 128)
return -EFAULT;
_rtw_memset(input, 0, wrqu->length);
if (copy_from_user(input, wrqu->pointer, wrqu->length))
return -EFAULT;
@ -304,7 +307,7 @@ int rtw_mp_read_rf(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *wrqu, char *extra)
{
char input[wrqu->length];
char input[128];
char *pch, *pnext, *ptmp;
char data[20], tmp[20], buf[3];
u32 path, addr, strtou;
@ -412,10 +415,12 @@ int rtw_mp_rate(struct net_device *dev,
struct iw_point *wrqu, char *extra)
{
u32 rate = MPT_RATE_1M;
u8 input[wrqu->length];
u8 input[128];
PADAPTER padapter = rtw_netdev_priv(dev);
PMPT_CONTEXT pMptCtx = &(padapter->mppriv.mpt_ctx);
if (wrqu->length > 128)
return -EFAULT;
if (copy_from_user(input, wrqu->pointer, wrqu->length))
return -EFAULT;
@ -460,10 +465,12 @@ int rtw_mp_channel(struct net_device *dev,
PADAPTER padapter = rtw_netdev_priv(dev);
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
u8 input[wrqu->length];
u8 input[128];
u32 channel = 1;
int cur_ch_offset;
if (wrqu->length > 128)
return -EFAULT;
if (copy_from_user(input, wrqu->pointer, wrqu->length))
return -EFAULT;
@ -488,8 +495,10 @@ int rtw_mp_bandwidth(struct net_device *dev,
int cur_ch_offset;
PADAPTER padapter = rtw_netdev_priv(dev);
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
u8 input[wrqu->length];
u8 input[128];
if (wrqu->length > 128)
return -EFAULT;
if (copy_from_user(input, wrqu->pointer, wrqu->length))
return -EFAULT;
@ -521,7 +530,7 @@ int rtw_mp_txpower_index(struct net_device *dev,
struct iw_point *wrqu, char *extra)
{
PADAPTER padapter = rtw_netdev_priv(dev);
char input[wrqu->length];
char input[128];
u32 rfpath;
u32 txpower_inx;
@ -546,11 +555,13 @@ int rtw_mp_txpower(struct net_device *dev,
{
u32 idx_a = 0, idx_b = 0, idx_c = 0, idx_d = 0, status = 0;
int MsetPower = 1;
u8 input[wrqu->length];
u8 input[128];
PADAPTER padapter = rtw_netdev_priv(dev);
PMPT_CONTEXT pMptCtx = &(padapter->mppriv.mpt_ctx);
if (wrqu->length > 128)
return -EFAULT;
if (copy_from_user(input, wrqu->pointer, wrqu->length))
return -EFAULT;
@ -584,11 +595,13 @@ int rtw_mp_ant_tx(struct net_device *dev,
struct iw_point *wrqu, char *extra)
{
u8 i;
u8 input[wrqu->length];
u8 input[128];
u16 antenna = 0;
PADAPTER padapter = rtw_netdev_priv(dev);
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
if (wrqu->length > 128)
return -EFAULT;
if (copy_from_user(input, wrqu->pointer, wrqu->length))
return -EFAULT;
@ -630,10 +643,12 @@ int rtw_mp_ant_rx(struct net_device *dev,
{
u8 i;
u16 antenna = 0;
u8 input[wrqu->length];
u8 input[128];
PADAPTER padapter = rtw_netdev_priv(dev);
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
if (wrqu->length > 128)
return -EFAULT;
if (copy_from_user(input, wrqu->pointer, wrqu->length))
return -EFAULT;
/*RTW_INFO("%s: input=%s\n", __func__, input);*/
@ -806,9 +821,11 @@ int rtw_mp_disable_bt_coexist(struct net_device *dev,
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
struct hal_ops *pHalFunc = &padapter->hal_func;
u8 input[wrqu->data.length];
u8 input[128];
u32 bt_coexist;
if (wrqu->data.length > 128)
return -EFAULT;
if (copy_from_user(input, wrqu->data.pointer, wrqu->data.length))
return -EFAULT;
@ -840,13 +857,15 @@ int rtw_mp_arx(struct net_device *dev,
{
int bStartRx = 0, bStopRx = 0, bQueryPhy = 0, bQueryMac = 0, bSetBssid = 0;
int bmac_filter = 0, bfilter_init = 0, bmon = 0, bSmpCfg = 0, bloopbk = 0;
u8 input[wrqu->length];
char *pch, *ptmp, *token, *tmp[2] = {0x00, 0x00};
u8 input[128];
char *pch, *ptmp, *token, *tmp[2] = {NULL, NULL};
u32 i = 0, ii = 0, jj = 0, kk = 0, cnts = 0, ret;
PADAPTER padapter = rtw_netdev_priv(dev);
struct mp_priv *pmppriv = &padapter->mppriv;
struct dbg_rx_counter rx_counter;
if (wrqu->length > 128)
return -EFAULT;
if (copy_from_user(input, wrqu->pointer, wrqu->length))
return -EFAULT;
@ -1019,8 +1038,10 @@ int rtw_mp_pwrtrk(struct net_device *dev,
s32 ret;
PADAPTER padapter = rtw_netdev_priv(dev);
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
u8 input[wrqu->length];
u8 input[128];
if (wrqu->length > 128)
return -EFAULT;
if (copy_from_user(input, wrqu->pointer, wrqu->length))
return -EFAULT;
@ -1057,8 +1078,10 @@ int rtw_mp_psd(struct net_device *dev,
struct iw_point *wrqu, char *extra)
{
PADAPTER padapter = rtw_netdev_priv(dev);
u8 input[wrqu->length];
u8 input[128];
if (wrqu->length > 128)
return -EFAULT;
if (copy_from_user(input, wrqu->pointer, wrqu->length))
return -EFAULT;
@ -1170,13 +1193,15 @@ int rtw_mp_dump(struct net_device *dev,
struct mp_priv *pmp_priv;
struct pkt_attrib *pattrib;
u32 value;
u8 input[wrqu->length];
u8 input[128];
u8 rf_type, path_nums = 0;
u32 i, j = 1, path;
PADAPTER padapter = rtw_netdev_priv(dev);
pmp_priv = &padapter->mppriv;
if (wrqu->length > 128)
return -EFAULT;
if (copy_from_user(input, wrqu->pointer, wrqu->length))
return -EFAULT;
@ -1196,9 +1221,11 @@ int rtw_mp_phypara(struct net_device *dev,
PADAPTER padapter = rtw_netdev_priv(dev);
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
char input[wrqu->length];
char input[128];
u32 valxcap, ret;
if (wrqu->length > 128)
return -EFAULT;
if (copy_from_user(input, wrqu->pointer, wrqu->length))
return -EFAULT;
@ -1222,9 +1249,11 @@ int rtw_mp_SetRFPath(struct net_device *dev,
struct iw_point *wrqu, char *extra)
{
PADAPTER padapter = rtw_netdev_priv(dev);
char input[wrqu->length];
char input[128];
int bMain = 1, bTurnoff = 1;
if (wrqu->length > 128)
return -EFAULT;
RTW_INFO("%s:iwpriv in=%s\n", __func__, input);
if (copy_from_user(input, wrqu->pointer, wrqu->length))
@ -1261,11 +1290,12 @@ int rtw_mp_QueryDrv(struct net_device *dev,
union iwreq_data *wrqu, char *extra)
{
PADAPTER padapter = rtw_netdev_priv(dev);
char input[wrqu->data.length];
char input[128];
int qAutoLoad = 1;
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(padapter);
if (wrqu->data.length > 128)
return -EFAULT;
if (copy_from_user(input, wrqu->data.pointer, wrqu->data.length))
return -EFAULT;
RTW_INFO("%s:iwpriv in=%s\n", __func__, input);
@ -1290,9 +1320,11 @@ int rtw_mp_PwrCtlDM(struct net_device *dev,
struct iw_point *wrqu, char *extra)
{
PADAPTER padapter = rtw_netdev_priv(dev);
u8 input[wrqu->length];
u8 input[128];
int bstart = 1;
if (wrqu->length > 128)
return -EFAULT;
if (copy_from_user(input, wrqu->pointer, wrqu->length))
return -EFAULT;
@ -1932,8 +1964,10 @@ int rtw_mp_hwtx(struct net_device *dev,
PMPT_CONTEXT pMptCtx = &(padapter->mppriv.mpt_ctx);
#if defined(CONFIG_RTL8814A) || defined(CONFIG_RTL8821B) || defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8821C)
u8 input[wrqu->data.length];
u8 input[128];
if (wrqu->data.length > 128)
return -EFAULT;
if (copy_from_user(input, wrqu->data.pointer, wrqu->data.length))
return -EFAULT;
@ -2092,6 +2126,8 @@ int rtw_mp_SetBT(struct net_device *dev,
u32 i = 0, ii = 0, jj = 0, kk = 0, cnts = 0, status = 0;
PRT_MP_FIRMWARE pBTFirmware = NULL;
if (wrqu->data.length > 128)
return -EFAULT;
if (copy_from_user(extra, wrqu->data.pointer, wrqu->data.length))
return -EFAULT;
if (strlen(extra) < 1)

View file

@ -21,6 +21,7 @@
#include <drv_types.h>
#include <hal_data.h>
#include <rtw_debug.h>
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Realtek Wireless Lan Driver");
@ -28,45 +29,45 @@ MODULE_AUTHOR("Realtek Semiconductor Corp.");
MODULE_VERSION(DRIVERVERSION);
/* module param defaults */
int rtw_chip_version = 0x00;
int rtw_rfintfs = HWPI;
int rtw_lbkmode = 0;/* RTL8712_AIR_TRX; */
int rtw_network_mode = Ndis802_11IBSS;/* Ndis802_11Infrastructure; */ /* infra, ad-hoc, auto */
static int rtw_chip_version = 0x00;
static int rtw_rfintfs = HWPI;
static int rtw_lbkmode = 0;/* RTL8712_AIR_TRX; */
static int rtw_network_mode = Ndis802_11IBSS;/* Ndis802_11Infrastructure; */ /* infra, ad-hoc, auto */
/* NDIS_802_11_SSID ssid; */
int rtw_channel = 1;/* ad-hoc support requirement */
int rtw_wireless_mode = WIRELESS_MODE_MAX;
int rtw_vrtl_carrier_sense = AUTO_VCS;
int rtw_vcs_type = RTS_CTS;
int rtw_rts_thresh = 2347;
int rtw_frag_thresh = 2346;
int rtw_preamble = PREAMBLE_LONG;/* long, short, auto */
int rtw_scan_mode = 1;/* active, passive */
int rtw_adhoc_tx_pwr = 1;
int rtw_soft_ap = 0;
static int rtw_channel = 1;/* ad-hoc support requirement */
static int rtw_wireless_mode = WIRELESS_MODE_MAX;
static int rtw_vrtl_carrier_sense = AUTO_VCS;
static int rtw_vcs_type = RTS_CTS;
static int rtw_rts_thresh = 2347;
static int rtw_frag_thresh = 2346;
static int rtw_preamble = PREAMBLE_LONG;/* long, short, auto */
static int rtw_scan_mode = 1;/* active, passive */
static int rtw_adhoc_tx_pwr = 1;
static int rtw_soft_ap = 0;
/* int smart_ps = 1; */
#ifdef CONFIG_POWER_SAVING
int rtw_power_mgnt = PS_MODE_MAX;
static int rtw_power_mgnt = PS_MODE_MAX;
#ifdef CONFIG_IPS_LEVEL_2
int rtw_ips_mode = IPS_LEVEL_2;
static int rtw_ips_mode = IPS_LEVEL_2;
#else
int rtw_ips_mode = IPS_NORMAL;
static int rtw_ips_mode = IPS_NORMAL;
#endif
#else
int rtw_power_mgnt = PS_MODE_ACTIVE;
int rtw_ips_mode = IPS_NONE;
static int rtw_power_mgnt = PS_MODE_ACTIVE;
static int rtw_ips_mode = IPS_NONE;
#endif
module_param(rtw_ips_mode, int, 0644);
MODULE_PARM_DESC(rtw_ips_mode, "The default IPS mode");
int rtw_smart_ps = 2;
static int rtw_smart_ps = 2;
int rtw_check_fw_ps = 1;
static int rtw_check_fw_ps = 1;
#ifdef CONFIG_TX_EARLY_MODE
int rtw_early_mode = 1;
static int rtw_early_mode = 1;
#endif
int rtw_usb_rxagg_mode = 2;/* RX_AGG_DMA=1, RX_AGG_USB=2 */
static int rtw_usb_rxagg_mode = 2;/* RX_AGG_DMA=1, RX_AGG_USB=2 */
module_param(rtw_usb_rxagg_mode, int, 0644);
/* set log level when inserting driver module, default log level is _DRV_INFO_ = 4,
@ -80,33 +81,33 @@ module_param(rtw_usb_rxagg_mode, int, 0644);
module_param(rtw_drv_log_level, uint, 0644);
MODULE_PARM_DESC(rtw_drv_log_level, "set log level when insert driver module, default log level is _DRV_INFO_ = 4");
int rtw_radio_enable = 1;
int rtw_long_retry_lmt = 7;
int rtw_short_retry_lmt = 7;
int rtw_busy_thresh = 40;
static int rtw_radio_enable = 1;
static int rtw_long_retry_lmt = 7;
static int rtw_short_retry_lmt = 7;
static int rtw_busy_thresh = 40;
/* int qos_enable = 0; */ /* * */
int rtw_ack_policy = NORMAL_ACK;
static int rtw_ack_policy = NORMAL_ACK;
int rtw_mp_mode = 0;
static int rtw_mp_mode = 0;
#if defined(CONFIG_MP_INCLUDED) && defined(CONFIG_RTW_CUSTOMER_STR)
uint rtw_mp_customer_str = 0;
static uint rtw_mp_customer_str = 0;
module_param(rtw_mp_customer_str, uint, 0644);
MODULE_PARM_DESC(rtw_mp_customer_str, "Whether or not to enable customer str support on MP mode");
#endif
int rtw_software_encrypt = 0;
int rtw_software_decrypt = 0;
static int rtw_software_encrypt = 0;
static int rtw_software_decrypt = 0;
int rtw_acm_method = 0;/* 0:By SW 1:By HW. */
static int rtw_acm_method = 0;/* 0:By SW 1:By HW. */
int rtw_wmm_enable = 1;/* default is set to enable the wmm. */
int rtw_uapsd_enable = 0;
int rtw_uapsd_max_sp = NO_LIMIT;
int rtw_uapsd_acbk_en = 0;
int rtw_uapsd_acbe_en = 0;
int rtw_uapsd_acvi_en = 0;
int rtw_uapsd_acvo_en = 0;
static int rtw_wmm_enable = 1;/* default is set to enable the wmm. */
static int rtw_uapsd_enable = 0;
static int rtw_uapsd_max_sp = NO_LIMIT;
static int rtw_uapsd_acbk_en = 0;
static int rtw_uapsd_acbe_en = 0;
static int rtw_uapsd_acvi_en = 0;
static int rtw_uapsd_acvo_en = 0;
#if defined(CONFIG_RTL8814A) || defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8821C)
static int rtw_pwrtrim_enable = 2; /* disable kfree , rename to power trim disable */
#else
@ -3035,9 +3036,6 @@ int pm_netdev_open(struct net_device *pnetdev, u8 bnormal)
if (_TRUE == bnormal) {
_enter_critical_mutex(&(adapter_to_dvobj(padapter)->hw_init_mutex), NULL);
status = _netdev_open(pnetdev);
#if 0
rtw_restore_mac_addr(padapter);
#endif
_exit_critical_mutex(&(adapter_to_dvobj(padapter)->hw_init_mutex), NULL);
}
#ifdef CONFIG_IPS

View file

@ -79,7 +79,7 @@ int rtw_os_alloc_recvframe(_adapter *padapter, union recv_frame *precvframe, u8
/* For 8 bytes IP header alignment. */
shift_sz = pattrib->qos ? 6 : 0; /* Qos data, wireless lan header length is 26 */
skb_len = pattrib->pkt_len;
skb_len = le16_to_cpu(pattrib->pkt_len);
/* for first fragment packet, driver need allocate 1536+drvinfo_sz+RXDESC_SIZE to defrag packet. */
/* modify alloc_sz for recvive crc error packet by thomas 2011-06-02 */
@ -315,7 +315,7 @@ _pkt *rtw_os_alloc_msdu_pkt(union recv_frame *prframe, u16 nSubframe_Length, u8
_rtw_memcpy(skb_push(sub_skb, ETH_ALEN), pattrib->src, ETH_ALEN);
_rtw_memcpy(skb_push(sub_skb, ETH_ALEN), pattrib->dst, ETH_ALEN);
} else {
u16 len;
__be16 len;
/* Leave Ethernet header part of hdr and full payload */
len = htons(sub_skb->len);
_rtw_memcpy(skb_push(sub_skb, 2), &len, 2);
@ -733,7 +733,7 @@ int rtw_recv_indicatepkt(_adapter *padapter, union recv_frame *precv_frame)
skb->len = precv_frame->u.hdr.len;
if (pattrib->eth_type == 0x888e)
if (pattrib->eth_type == cpu_to_le16(0x888e))
RTW_INFO("recv eapol packet\n");
#ifdef CONFIG_AUTO_AP_MODE
@ -848,9 +848,9 @@ void rtw_os_read_port(_adapter *padapter, struct recv_buf *precvbuf)
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
void _rtw_reordering_ctrl_timeout_handler(void *FunctionContext)
static void _rtw_reordering_ctrl_timeout_handler(void *FunctionContext)
#else
void _rtw_reordering_ctrl_timeout_handler(struct timer_list *t)
static void _rtw_reordering_ctrl_timeout_handler(struct timer_list *t)
#endif
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)

View file

@ -46,7 +46,7 @@
extern void macstr2num(u8 *dst, u8 *src);
const char *android_wifi_cmd_str[ANDROID_WIFI_CMD_MAX] = {
static const char *android_wifi_cmd_str[ANDROID_WIFI_CMD_MAX] = {
"START",
"STOP",
"SCAN-ACTIVE",
@ -169,8 +169,8 @@ typedef struct compat_android_wifi_priv_cmd {
*/
static int g_wifi_on = _TRUE;
unsigned int oob_irq = 0;
unsigned int oob_gpio = 0;
static unsigned int oob_irq = 0;
static unsigned int oob_gpio = 0;
#ifdef CONFIG_PNO_SUPPORT
/*
@ -363,7 +363,7 @@ int rtw_android_cmdstr_to_num(char *cmdstr)
return cmd_num;
}
int rtw_android_get_rssi(struct net_device *net, char *command, int total_len)
static int rtw_android_get_rssi(struct net_device *net, char *command, int total_len)
{
_adapter *padapter = (_adapter *)rtw_netdev_priv(net);
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
@ -378,7 +378,7 @@ int rtw_android_get_rssi(struct net_device *net, char *command, int total_len)
return bytes_written;
}
int rtw_android_get_link_speed(struct net_device *net, char *command, int total_len)
static int rtw_android_get_link_speed(struct net_device *net, char *command, int total_len)
{
_adapter *padapter = (_adapter *)rtw_netdev_priv(net);
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
@ -392,7 +392,7 @@ int rtw_android_get_link_speed(struct net_device *net, char *command, int total_
return bytes_written;
}
int rtw_android_get_macaddr(struct net_device *net, char *command, int total_len)
static int rtw_android_get_macaddr(struct net_device *net, char *command, int total_len)
{
_adapter *adapter = (_adapter *)rtw_netdev_priv(net);
int bytes_written = 0;
@ -401,7 +401,7 @@ int rtw_android_get_macaddr(struct net_device *net, char *command, int total_len
return bytes_written;
}
int rtw_android_set_country(struct net_device *net, char *command, int total_len)
static int rtw_android_set_country(struct net_device *net, char *command, int total_len)
{
_adapter *adapter = (_adapter *)rtw_netdev_priv(net);
char *country_code = command + strlen(android_wifi_cmd_str[ANDROID_WIFI_CMD_COUNTRY]) + 1;
@ -412,7 +412,7 @@ int rtw_android_set_country(struct net_device *net, char *command, int total_len
return (ret == _SUCCESS) ? 0 : -1;
}
int rtw_android_get_p2p_dev_addr(struct net_device *net, char *command, int total_len)
static int rtw_android_get_p2p_dev_addr(struct net_device *net, char *command, int total_len)
{
int bytes_written = 0;
@ -423,7 +423,7 @@ int rtw_android_get_p2p_dev_addr(struct net_device *net, char *command, int tota
return bytes_written;
}
int rtw_android_set_block_scan(struct net_device *net, char *command, int total_len)
static int rtw_android_set_block_scan(struct net_device *net, char *command, int total_len)
{
_adapter *adapter = (_adapter *)rtw_netdev_priv(net);
char *block_value = command + strlen(android_wifi_cmd_str[ANDROID_WIFI_CMD_BLOCK_SCAN]) + 1;
@ -435,7 +435,7 @@ int rtw_android_set_block_scan(struct net_device *net, char *command, int total_
return 0;
}
int rtw_android_set_block(struct net_device *net, char *command, int total_len)
static int rtw_android_set_block(struct net_device *net, char *command, int total_len)
{
_adapter *adapter = (_adapter *)rtw_netdev_priv(net);
char *block_value = command + strlen(android_wifi_cmd_str[ANDROID_WIFI_CMD_BLOCK]) + 1;
@ -447,7 +447,7 @@ int rtw_android_set_block(struct net_device *net, char *command, int total_len)
return 0;
}
int rtw_android_setband(struct net_device *net, char *command, int total_len)
static int rtw_android_setband(struct net_device *net, char *command, int total_len)
{
_adapter *adapter = (_adapter *)rtw_netdev_priv(net);
char *arg = command + strlen(android_wifi_cmd_str[ANDROID_WIFI_CMD_SETBAND]) + 1;
@ -460,7 +460,7 @@ int rtw_android_setband(struct net_device *net, char *command, int total_len)
return (ret == _SUCCESS) ? 0 : -1;
}
int rtw_android_getband(struct net_device *net, char *command, int total_len)
static int rtw_android_getband(struct net_device *net, char *command, int total_len)
{
_adapter *adapter = (_adapter *)rtw_netdev_priv(net);
int bytes_written = 0;
@ -471,7 +471,7 @@ int rtw_android_getband(struct net_device *net, char *command, int total_len)
}
#ifdef CONFIG_WFD
int rtw_android_set_miracast_mode(struct net_device *net, char *command, int total_len)
static int rtw_android_set_miracast_mode(struct net_device *net, char *command, int total_len)
{
_adapter *adapter = (_adapter *)rtw_netdev_priv(net);
struct wifi_display_info *wfd_info = &adapter->wfd_info;
@ -507,7 +507,7 @@ exit:
}
#endif /* CONFIG_WFD */
int get_int_from_command(char *pcmd)
static int get_int_from_command(char *pcmd)
{
int i = 0;
@ -631,7 +631,7 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
ret = -EFAULT;
goto exit;
}
if (copy_from_user(command, (void *)priv_cmd.buf, priv_cmd.total_len)) {
if (copy_from_user(command, (void __user *)priv_cmd.buf, priv_cmd.total_len)) {
ret = -EFAULT;
goto exit;
}
@ -910,7 +910,7 @@ response:
} else
bytes_written++;
priv_cmd.used_len = bytes_written;
if (copy_to_user((void *)priv_cmd.buf, command, bytes_written)) {
if (copy_to_user((void __user *)priv_cmd.buf, command, bytes_written)) {
RTW_INFO("%s: failed to copy data to user buffer\n", __FUNCTION__);
ret = -EFAULT;
}

View file

@ -144,7 +144,7 @@ int dbg_rtw_cfg80211_vendor_cmd_reply(struct sk_buff *skb
dbg_rtw_cfg80211_vendor_cmd_reply(skb, MSTAT_FUNC_CFG_VENDOR | MSTAT_TYPE_SKB, __FUNCTION__, __LINE__)
#else
struct sk_buff *rtw_cfg80211_vendor_event_alloc(
static struct sk_buff *rtw_cfg80211_vendor_event_alloc(
struct wiphy *wiphy, struct wireless_dev *wdev, int len, int event_id, gfp_t gfp)
{
struct sk_buff *skb;
@ -176,7 +176,7 @@ struct sk_buff *rtw_cfg80211_vendor_event_alloc(
int rtw_cfgvendor_send_async_event(struct wiphy *wiphy,
struct net_device *dev, int event_id, const void *data, int len)
{
u16 kflags;
gfp_t kflags;
struct sk_buff *skb;
kflags = in_atomic() ? GFP_ATOMIC : GFP_KERNEL;
@ -234,7 +234,7 @@ static int rtw_cfgvendor_send_cmd_reply(struct wiphy *wiphy,
#define MAX_FEATURE_SET_CONCURRRENT_GROUPS 3
#include <hal_data.h>
int rtw_dev_get_feature_set(struct net_device *dev)
static int rtw_dev_get_feature_set(struct net_device *dev)
{
_adapter *adapter = (_adapter *)rtw_netdev_priv(dev);
HAL_DATA_TYPE *HalData = GET_HAL_DATA(adapter);
@ -256,7 +256,7 @@ int rtw_dev_get_feature_set(struct net_device *dev)
return feature_set;
}
int *rtw_dev_get_feature_set_matrix(struct net_device *dev, int *num)
static int *rtw_dev_get_feature_set_matrix(struct net_device *dev, int *num)
{
int feature_set_full, mem_needed;
int *ret;

View file

@ -170,7 +170,7 @@ static int proc_get_chplan_test(struct seq_file *m, void *v)
* rtw_drv_proc:
* init/deinit when register/unregister driver
*/
const struct rtw_proc_hdl drv_proc_hdls[] = {
static const struct rtw_proc_hdl drv_proc_hdls[] = {
RTW_PROC_HDL_SSEQ("ver_info", proc_get_drv_version, NULL),
RTW_PROC_HDL_SSEQ("log_level", proc_get_log_level, proc_set_log_level),
RTW_PROC_HDL_SSEQ("drv_cfg", proc_get_drv_cfg, NULL),
@ -182,7 +182,7 @@ const struct rtw_proc_hdl drv_proc_hdls[] = {
RTW_PROC_HDL_SSEQ("chplan_test", proc_get_chplan_test, NULL),
};
const int drv_proc_hdls_num = sizeof(drv_proc_hdls) / sizeof(struct rtw_proc_hdl);
static const int drv_proc_hdls_num = sizeof(drv_proc_hdls) / sizeof(struct rtw_proc_hdl);
static int rtw_drv_proc_open(struct inode *inode, struct file *file)
{
@ -846,7 +846,7 @@ static int proc_get_macaddr_acl(struct seq_file *m, void *v)
return 0;
}
ssize_t proc_set_macaddr_acl(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data)
static ssize_t proc_set_macaddr_acl(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data)
{
struct net_device *dev = data;
_adapter *adapter = (_adapter *)rtw_netdev_priv(dev);
@ -2056,7 +2056,7 @@ int proc_get_mbid_cam_cache(struct seq_file *m, void *v)
}
#endif /* CONFIG_MBSSID_CAM */
int proc_get_mac_addr(struct seq_file *m, void *v)
static int proc_get_mac_addr(struct seq_file *m, void *v)
{
struct net_device *dev = m->private;
_adapter *adapter = (_adapter *)rtw_netdev_priv(dev);
@ -2314,7 +2314,7 @@ static int proc_get_napi_info(struct seq_file *m, void *v)
* rtw_adapter_proc:
* init/deinit when register/unregister net_device
*/
const struct rtw_proc_hdl adapter_proc_hdls[] = {
static const struct rtw_proc_hdl adapter_proc_hdls[] = {
#if RTW_SEQ_FILE_TEST
RTW_PROC_HDL_SEQ("seq_file_test", &seq_file_test, NULL),
#endif
@ -2546,7 +2546,7 @@ const struct rtw_proc_hdl adapter_proc_hdls[] = {
RTW_PROC_HDL_SSEQ("ack_timeout", proc_get_ack_timeout, proc_set_ack_timeout),
};
const int adapter_proc_hdls_num = sizeof(adapter_proc_hdls) / sizeof(struct rtw_proc_hdl);
static const int adapter_proc_hdls_num = sizeof(adapter_proc_hdls) / sizeof(struct rtw_proc_hdl);
static int rtw_adapter_proc_open(struct inode *inode, struct file *file)
{
@ -2601,7 +2601,7 @@ static const struct file_operations rtw_adapter_proc_sseq_fops = {
};
int proc_get_odm_force_igi_lb(struct seq_file *m, void *v)
static int proc_get_odm_force_igi_lb(struct seq_file *m, void *v)
{
struct net_device *dev = m->private;
_adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
@ -2611,7 +2611,7 @@ int proc_get_odm_force_igi_lb(struct seq_file *m, void *v)
return 0;
}
ssize_t proc_set_odm_force_igi_lb(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data)
static ssize_t proc_set_odm_force_igi_lb(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data)
{
struct net_device *dev = data;
_adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
@ -2684,7 +2684,7 @@ ssize_t proc_set_odm_adaptivity(struct file *file, const char __user *buffer, si
static char *phydm_msg = NULL;
#define PHYDM_MSG_LEN 80*24
int proc_get_phydm_cmd(struct seq_file *m, void *v)
static int proc_get_phydm_cmd(struct seq_file *m, void *v)
{
struct net_device *netdev;
PADAPTER padapter;
@ -2713,7 +2713,7 @@ int proc_get_phydm_cmd(struct seq_file *m, void *v)
return 0;
}
ssize_t proc_set_phydm_cmd(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data)
static ssize_t proc_set_phydm_cmd(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data)
{
struct net_device *netdev;
PADAPTER padapter;
@ -2836,7 +2836,7 @@ static struct seq_operations seq_ops_lamode = {
* rtw_odm_proc:
* init/deinit when register/unregister net_device, along with rtw_adapter_proc
*/
const struct rtw_proc_hdl odm_proc_hdls[] = {
static const struct rtw_proc_hdl odm_proc_hdls[] = {
RTW_PROC_HDL_SSEQ("adaptivity", proc_get_odm_adaptivity, proc_set_odm_adaptivity),
RTW_PROC_HDL_SSEQ("force_igi_lb", proc_get_odm_force_igi_lb, proc_set_odm_force_igi_lb),
RTW_PROC_HDL_SSEQ("cmd", proc_get_phydm_cmd, proc_set_phydm_cmd),
@ -2845,7 +2845,7 @@ const struct rtw_proc_hdl odm_proc_hdls[] = {
#endif /* CONFIG_LAMODE */
};
const int odm_proc_hdls_num = sizeof(odm_proc_hdls) / sizeof(struct rtw_proc_hdl);
static const int odm_proc_hdls_num = sizeof(odm_proc_hdls) / sizeof(struct rtw_proc_hdl);
static int rtw_odm_proc_open(struct inode *inode, struct file *file)
{
@ -2899,7 +2899,7 @@ static const struct file_operations rtw_odm_proc_sseq_fops = {
.write = rtw_odm_proc_write,
};
struct proc_dir_entry *rtw_odm_proc_init(struct net_device *dev)
static struct proc_dir_entry *rtw_odm_proc_init(struct net_device *dev)
{
struct proc_dir_entry *dir_odm = NULL;
struct proc_dir_entry *entry = NULL;
@ -2942,7 +2942,7 @@ exit:
return dir_odm;
}
void rtw_odm_proc_deinit(_adapter *adapter)
static void rtw_odm_proc_deinit(_adapter *adapter)
{
struct proc_dir_entry *dir_odm = NULL;
int i;

View file

@ -32,18 +32,11 @@
#error "Shall be Linux or Windows, but not both!\n"
#endif
#ifdef CONFIG_80211N_HT
extern int rtw_ht_enable;
extern int rtw_bw_mode;
extern int rtw_ampdu_enable;/* for enable tx_ampdu */
#endif
#ifdef CONFIG_GLOBAL_UI_PID
int ui_pid[3] = {0, 0, 0};
#endif
extern int pm_netdev_open(struct net_device *pnetdev, u8 bnormal);
static int rtw_suspend(struct usb_interface *intf, pm_message_t message);
static int rtw_resume(struct usb_interface *intf);

View file

@ -457,7 +457,7 @@ static const struct ieee80211_regdomain *_rtw_regdomain_select(struct
#endif
}
void _rtw_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request)
static void _rtw_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request)
{
struct rtw_regulatory *reg = NULL;
@ -467,9 +467,9 @@ void _rtw_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request)
}
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 9, 0))
int rtw_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request)
static int rtw_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request)
#else
void rtw_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request)
static void rtw_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request)
#endif
{
_rtw_reg_notifier(wiphy, request);

View file

@ -20,6 +20,7 @@
#define _XMIT_OSDEP_C_
#include <drv_types.h>
#include <hal_data.h>
#define DBG_DUMP_OS_QUEUE_CTL 0
@ -445,7 +446,6 @@ int _rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev)
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
#ifdef CONFIG_TX_MCAST2UNI
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
extern int rtw_mc2u_disable;
#endif /* CONFIG_TX_MCAST2UNI */
s32 res = 0;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35))