rtl8188eu: Remove all trailing spaces from code

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2014-12-19 00:59:46 -06:00
parent 8db176767f
commit bb33327257
190 changed files with 53569 additions and 53764 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,7 +1,7 @@
/******************************************************************************
*
* 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.
@ -94,20 +94,20 @@ static void _dynamic_check_timer_handlder (void *FunctionContext)
{
struct adapter *adapter = (struct adapter *)FunctionContext;
/* remove for MP power tracking DM.
#if (MP_DRIVER == 1)
#if (MP_DRIVER == 1)
if (adapter->registrypriv.mp_mode == 1)
return;
#endif
*/
rtw_dynamic_check_timer_handlder(adapter);
_set_timer(&adapter->mlmepriv.dynamic_chk_timer, 2000);
}
#ifdef CONFIG_SET_SCAN_DENY_TIMER
void _rtw_set_scan_deny_timer_hdl(void *FunctionContext)
{
struct adapter *adapter = (struct adapter *)FunctionContext;
struct adapter *adapter = (struct adapter *)FunctionContext;
rtw_set_scan_deny_timer_hdl(adapter);
}
#endif
@ -118,7 +118,7 @@ void _rtw_event_polling_timer_hdl(void *FunctionContext)
struct adapter *adapter = (struct adapter *)FunctionContext;
rtw_event_polling_timer_hdl(adapter);
_set_timer(&adapter->mlmepriv.event_polling_timer, 200);
}
#endif
@ -148,7 +148,7 @@ void rtw_init_mlme_timer(struct adapter *padapter)
#if defined(CONFIG_CHECK_BT_HANG) && defined(CONFIG_BT_COEXIST)
if (padapter->HalFunc.hal_init_checkbthang_workqueue)
padapter->HalFunc.hal_init_checkbthang_workqueue(padapter);
#endif
#endif
}
extern void rtw_indicate_wx_assoc_event(struct adapter *padapter);
@ -157,10 +157,10 @@ extern void rtw_indicate_wx_disassoc_event(struct adapter *padapter);
void rtw_os_indicate_connect(struct adapter *adapter)
{
struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);
_func_enter_;
_func_enter_;
#ifdef CONFIG_IOCTL_CFG80211
if ( (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)==_TRUE ) ||
if ( (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)==_TRUE ) ||
(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)==_TRUE ) )
{
rtw_cfg80211_ibss_indicate_connect(adapter);
@ -179,7 +179,7 @@ _func_enter_;
_set_workitem(&adapter->mlmepriv.Linkup_workitem);
#endif
_func_exit_;
_func_exit_;
}
@ -201,11 +201,11 @@ void rtw_reset_securitypriv( struct adapter *adapter )
// add for CONFIG_IEEE80211W, none 11w also can use
_irqL irqL;
struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv;
_enter_critical_bh(&adapter->security_key_mutex, &irqL);
if(adapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X)//802.1x
{
{
// Added by Albert 2009/02/18
// We have to backup the PMK information for WiFi PMK Caching test item.
//
@ -217,7 +217,7 @@ void rtw_reset_securitypriv( struct adapter *adapter )
_rtw_memcpy( &backupPMKIDList[ 0 ], &adapter->securitypriv.PMKIDList[ 0 ], sizeof( RT_PMKID_LIST ) * NUM_PMKID_CACHE );
backupPMKIDIndex = adapter->securitypriv.PMKIDIndex;
backupTKIPCountermeasure = adapter->securitypriv.btkip_countermeasure;
backupTKIPcountermeasure_time = adapter->securitypriv.btkip_countermeasure_time;
backupTKIPcountermeasure_time = adapter->securitypriv.btkip_countermeasure_time;
#ifdef CONFIG_IEEE80211W
//reset RX BIP packet number
pmlmeext->mgnt_80211w_IPN_rx = 0;
@ -230,13 +230,13 @@ void rtw_reset_securitypriv( struct adapter *adapter )
_rtw_memcpy( &adapter->securitypriv.PMKIDList[ 0 ], &backupPMKIDList[ 0 ], sizeof( RT_PMKID_LIST ) * NUM_PMKID_CACHE );
adapter->securitypriv.PMKIDIndex = backupPMKIDIndex;
adapter->securitypriv.btkip_countermeasure = backupTKIPCountermeasure;
adapter->securitypriv.btkip_countermeasure_time = backupTKIPcountermeasure_time;
adapter->securitypriv.btkip_countermeasure_time = backupTKIPcountermeasure_time;
adapter->securitypriv.ndisauthtype = Ndis802_11AuthModeOpen;
adapter->securitypriv.ndisencryptstatus = Ndis802_11WEPDisabled;
}
else //reset values in securitypriv
else //reset values in securitypriv
{
//if(adapter->mlmepriv.fw_state & WIFI_STATION_STATE)
//{
@ -295,37 +295,37 @@ _func_enter_;
if(authmode==_WPA_IE_ID_)
{
RT_TRACE(_module_mlme_osdep_c_,_drv_info_,("rtw_report_sec_ie, authmode=%d\n", authmode));
buff = rtw_malloc(IW_CUSTOM_MAX);
_rtw_memset(buff,0,IW_CUSTOM_MAX);
p=buff;
p+=sprintf(p,"ASSOCINFO(ReqIEs=");
len = sec_ie[1]+2;
len = (len < IW_CUSTOM_MAX) ? len:IW_CUSTOM_MAX;
for(i=0;i<len;i++){
p+=sprintf(p,"%02x",sec_ie[i]);
}
p+=sprintf(p,")");
_rtw_memset(&wrqu,0,sizeof(wrqu));
wrqu.data.length=p-buff;
wrqu.data.length = (wrqu.data.length<IW_CUSTOM_MAX) ? wrqu.data.length:IW_CUSTOM_MAX;
#ifndef CONFIG_IOCTL_CFG80211
wireless_send_event(adapter->pnetdev,IWEVCUSTOM,&wrqu,buff);
#endif
if(buff)
rtw_mfree(buff, IW_CUSTOM_MAX);
}
_func_exit_;
@ -335,7 +335,7 @@ _func_exit_;
static void _survey_timer_hdl (void *FunctionContext)
{
struct adapter *padapter = (struct adapter *)FunctionContext;
survey_timer_hdl(padapter);
}
@ -380,7 +380,7 @@ void _reassoc_timer_hdl(void *FunctionContext)
*/
void init_mlme_ext_timer(struct adapter *padapter)
{
{
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
_init_timer(&pmlmeext->survey_timer, padapter->pnetdev, _survey_timer_hdl, padapter);
@ -409,14 +409,14 @@ void rtw_indicate_sta_assoc_event(struct adapter *padapter, struct sta_info *pst
if(pstapriv->sta_aid[psta->aid - 1] != psta)
return;
wrqu.addr.sa_family = ARPHRD_ETHER;
wrqu.addr.sa_family = ARPHRD_ETHER;
_rtw_memcpy(wrqu.addr.sa_data, psta->hwaddr, ETH_ALEN);
DBG_871X("+rtw_indicate_sta_assoc_event\n");
#ifndef CONFIG_IOCTL_CFG80211
wireless_send_event(padapter->pnetdev, IWEVREGISTERED, &wrqu, NULL);
#endif
@ -436,18 +436,18 @@ void rtw_indicate_sta_disassoc_event(struct adapter *padapter, struct sta_info *
if(pstapriv->sta_aid[psta->aid - 1] != psta)
return;
wrqu.addr.sa_family = ARPHRD_ETHER;
wrqu.addr.sa_family = ARPHRD_ETHER;
_rtw_memcpy(wrqu.addr.sa_data, psta->hwaddr, ETH_ALEN);
DBG_871X("+rtw_indicate_sta_disassoc_event\n");
#ifndef CONFIG_IOCTL_CFG80211
wireless_send_event(padapter->pnetdev, IWEVEXPIRED, &wrqu, NULL);
#endif
}
@ -471,7 +471,7 @@ static int mgnt_netdev_open(struct net_device *pnetdev)
init_usb_anchor(&phostapdpriv->anchored);
if(!rtw_netif_queue_stopped(pnetdev))
rtw_netif_start_queue(pnetdev);
else
@ -479,10 +479,10 @@ static int mgnt_netdev_open(struct net_device *pnetdev)
netif_carrier_on(pnetdev);
//rtw_write16(phostapdpriv->padapter, 0x0116, 0x0100);//only excluding beacon
return 0;
//rtw_write16(phostapdpriv->padapter, 0x0116, 0x0100);//only excluding beacon
return 0;
}
static int mgnt_netdev_close(struct net_device *pnetdev)
{
@ -496,10 +496,10 @@ static int mgnt_netdev_close(struct net_device *pnetdev)
if (!rtw_netif_queue_stopped(pnetdev))
rtw_netif_stop_queue(pnetdev);
//rtw_write16(phostapdpriv->padapter, 0x0116, 0x3f3f);
return 0;
return 0;
}
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,29))
@ -518,8 +518,8 @@ int hostapd_mode_init(struct adapter *padapter)
unsigned char mac[ETH_ALEN];
struct hostapd_priv *phostapdpriv;
struct net_device *pnetdev;
pnetdev = rtw_alloc_etherdev(sizeof(struct hostapd_priv));
pnetdev = rtw_alloc_etherdev(sizeof(struct hostapd_priv));
if (!pnetdev)
return -ENOMEM;
@ -527,49 +527,49 @@ int hostapd_mode_init(struct adapter *padapter)
ether_setup(pnetdev);
//pnetdev->type = ARPHRD_IEEE80211;
phostapdpriv = rtw_netdev_priv(pnetdev);
phostapdpriv->pmgnt_netdev = pnetdev;
phostapdpriv->padapter= padapter;
padapter->phostapdpriv = phostapdpriv;
//pnetdev->init = NULL;
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,29))
DBG_871X("register rtl871x_mgnt_netdev_ops to netdev_ops\n");
pnetdev->netdev_ops = &rtl871x_mgnt_netdev_ops;
#else
pnetdev->open = mgnt_netdev_open;
pnetdev->stop = mgnt_netdev_close;
pnetdev->stop = mgnt_netdev_close;
pnetdev->hard_start_xmit = mgnt_xmit_entry;
//pnetdev->set_mac_address = r871x_net_set_mac_address;
//pnetdev->get_stats = r871x_net_get_stats;
//pnetdev->do_ioctl = r871x_mp_ioctl;
#endif
pnetdev->watchdog_timeo = HZ; /* 1 second timeout */
pnetdev->watchdog_timeo = HZ; /* 1 second timeout */
//pnetdev->wireless_handlers = NULL;
#ifdef CONFIG_TCP_CSUM_OFFLOAD_TX
pnetdev->features |= NETIF_F_IP_CSUM;
#endif
#endif
if(dev_alloc_name(pnetdev,"mgnt.wlan%d") < 0)
{
DBG_871X("hostapd_mode_init(): dev_alloc_name, fail! \n");
DBG_871X("hostapd_mode_init(): dev_alloc_name, fail! \n");
}
@ -582,9 +582,9 @@ int hostapd_mode_init(struct adapter *padapter)
mac[3]=0x87;
mac[4]=0x11;
mac[5]=0x12;
_rtw_memcpy(pnetdev->dev_addr, mac, ETH_ALEN);
netif_carrier_off(pnetdev);
@ -593,15 +593,15 @@ int hostapd_mode_init(struct adapter *padapter)
if (register_netdev(pnetdev) != 0)
{
DBG_871X("hostapd_mode_init(): register_netdev fail!\n");
if(pnetdev)
{
{
rtw_free_netdev(pnetdev);
}
}
}
return 0;
}
void hostapd_mode_unload(struct adapter *padapter)
@ -611,9 +611,8 @@ void hostapd_mode_unload(struct adapter *padapter)
unregister_netdev(pnetdev);
rtw_free_netdev(pnetdev);
}
#endif
#endif

File diff suppressed because it is too large Load diff

View file

@ -1,7 +1,7 @@
/******************************************************************************
*
* 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.
@ -65,22 +65,22 @@ u32 rtw_atoi(u8* s)
{
if(s[i] >= '0' && s[i] <= '9')
num = num * 10 + s[i] -'0';
else if(s[0] == '-' && i==0)
else if(s[0] == '-' && i==0)
flag =1;
else
else
break;
}
if(flag == 1)
num = num * -1;
return(num);
return(num);
}
inline u8* _rtw_vmalloc(u32 sz)
{
u8 *pbuf;
u8 *pbuf;
pbuf = vmalloc(sz);
#ifdef DBG_MEMORY_LEAK
if ( pbuf != NULL) {
@ -89,16 +89,16 @@ inline u8* _rtw_vmalloc(u32 sz)
}
#endif /* DBG_MEMORY_LEAK */
return pbuf;
return pbuf;
}
inline u8* _rtw_zvmalloc(u32 sz)
{
u8 *pbuf;
u8 *pbuf;
pbuf = _rtw_vmalloc(sz);
if (pbuf != NULL)
memset(pbuf, 0, sz);
return pbuf;
return pbuf;
}
inline void _rtw_vmfree(u8 *pbuf, u32 sz)
@ -113,14 +113,14 @@ inline void _rtw_vmfree(u8 *pbuf, u32 sz)
u8* _rtw_malloc(u32 sz)
{
u8 *pbuf=NULL;
u8 *pbuf=NULL;
#ifdef RTK_DMP_PLATFORM
if(sz > 0x4000)
pbuf = (u8 *)dvr_malloc(sz);
else
#endif
pbuf = kmalloc(sz,in_interrupt() ? GFP_ATOMIC : GFP_KERNEL);
#endif
pbuf = kmalloc(sz,in_interrupt() ? GFP_ATOMIC : GFP_KERNEL);
#ifdef DBG_MEMORY_LEAK
if ( pbuf != NULL) {
@ -129,21 +129,21 @@ u8* _rtw_malloc(u32 sz)
}
#endif /* DBG_MEMORY_LEAK */
return pbuf;
return pbuf;
}
u8* _rtw_zmalloc(u32 sz)
{
u8 *pbuf = _rtw_malloc(sz);
u8 *pbuf = _rtw_malloc(sz);
if (pbuf != NULL) {
memset(pbuf, 0, sz);
}
return pbuf;
return pbuf;
}
void _rtw_mfree(u8 *pbuf, u32 sz)
@ -159,7 +159,7 @@ void _rtw_mfree(u8 *pbuf, u32 sz)
atomic_dec(&_malloc_cnt);
atomic_sub(sz, &_malloc_size);
#endif /* DBG_MEMORY_LEAK */
}
inline struct sk_buff *_rtw_skb_alloc(u32 sz)
@ -209,7 +209,7 @@ inline void *_rtw_usb_buffer_alloc(struct usb_device *dev, size_t size, dma_addr
inline void _rtw_usb_buffer_free(struct usb_device *dev, size_t size, void *addr, dma_addr_t dma)
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
usb_free_coherent(dev, size, addr, dma);
usb_free_coherent(dev, size, addr, dma);
#else
usb_buffer_free(dev, size, addr, dma);
#endif
@ -220,7 +220,7 @@ inline void _rtw_usb_buffer_free(struct usb_device *dev, size_t size, void *addr
struct rtw_mem_stat {
ATOMIC_T alloc; // the memory bytes we allocate currently
ATOMIC_T peak; // the peak memory bytes we allocate
ATOMIC_T peak; // the peak memory bytes we allocate
ATOMIC_T alloc_cnt; // the alloc count for alloc currently
ATOMIC_T alloc_err_cnt; // the error times we fail to allocate memory
};
@ -250,7 +250,7 @@ int _rtw_mstat_dump(char *buf, int len)
int i;
int value_t[4][mstat_tf_idx(MSTAT_TYPE_MAX)];
int value_f[4][mstat_ff_idx(MSTAT_FUNC_MAX)];
int vir_alloc, vir_peak, vir_alloc_err, phy_alloc, phy_peak, phy_alloc_err;
int tx_alloc, tx_peak, tx_alloc_err, rx_alloc, rx_peak, rx_alloc_err;
@ -358,7 +358,7 @@ inline u8* dbg_rtw_vmalloc(u32 sz, const enum mstat_f flags, const char *func, c
{
u8 *p;
//DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz));
p=_rtw_vmalloc((sz));
rtw_mstat_update(
@ -366,16 +366,16 @@ inline u8* dbg_rtw_vmalloc(u32 sz, const enum mstat_f flags, const char *func, c
, p ? MSTAT_ALLOC_SUCCESS : MSTAT_ALLOC_FAIL
, sz
);
return p;
}
inline u8* dbg_rtw_zvmalloc(u32 sz, const enum mstat_f flags, const char *func, const int line)
{
u8 *p;
//DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz));
p=_rtw_zvmalloc((sz));
//DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz));
p=_rtw_zvmalloc((sz));
rtw_mstat_update(
flags
@ -389,8 +389,8 @@ inline u8* dbg_rtw_zvmalloc(u32 sz, const enum mstat_f flags, const char *func,
inline void dbg_rtw_vmfree(u8 *pbuf, u32 sz, const enum mstat_f flags, const char *func, const int line)
{
//DBG_871X("DBG_MEM_ALLOC %s:%d %s(%p,%d)\n", func, line, __FUNCTION__, (pbuf), (sz));
_rtw_vmfree((pbuf), (sz));
_rtw_vmfree((pbuf), (sz));
rtw_mstat_update(
flags
@ -399,18 +399,18 @@ inline void dbg_rtw_vmfree(u8 *pbuf, u32 sz, const enum mstat_f flags, const cha
);
}
inline u8* dbg_rtw_malloc(u32 sz, const enum mstat_f flags, const char *func, const int line)
inline u8* dbg_rtw_malloc(u32 sz, const enum mstat_f flags, const char *func, const int line)
{
u8 *p;
//if(sz>=153 && sz<=306)
//if(sz>=153 && sz<=306)
// DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz));
//if((sz)>4096)
// DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz));
//if((sz)>4096)
// DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz));
p=_rtw_malloc((sz));
rtw_mstat_update(
flags
, p ? MSTAT_ALLOC_SUCCESS : MSTAT_ALLOC_FAIL
@ -424,7 +424,7 @@ inline u8* dbg_rtw_zmalloc(u32 sz, const enum mstat_f flags, const char *func, c
{
u8 *p;
//if(sz>=153 && sz<=306)
//if(sz>=153 && sz<=306)
// DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz));
//if((sz)>4096)
@ -443,12 +443,12 @@ inline u8* dbg_rtw_zmalloc(u32 sz, const enum mstat_f flags, const char *func, c
inline void dbg_rtw_mfree(u8 *pbuf, u32 sz, const enum mstat_f flags, const char *func, const int line)
{
//if(sz>=153 && sz<=306)
//if(sz>=153 && sz<=306)
// DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz));
//if((sz)>4096)
// DBG_871X("DBG_MEM_ALLOC %s:%d %s(%p,%d)\n", func, line, __FUNCTION__, (pbuf), (sz));
_rtw_mfree((pbuf), (sz));
rtw_mstat_update(
@ -488,7 +488,7 @@ inline void dbg_rtw_skb_free(struct sk_buff *skb, const enum mstat_f flags, cons
// DBG_871X("DBG_MEM_ALLOC %s:%d %s, truesize=%u\n", func, line, __FUNCTION__, truesize);
_rtw_skb_free(skb);
rtw_mstat_update(
flags
, MSTAT_FREE
@ -501,7 +501,7 @@ inline struct sk_buff *dbg_rtw_skb_copy(const struct sk_buff *skb, const enum ms
struct sk_buff *skb_cp;
unsigned int truesize = skb->truesize;
unsigned int cp_truesize = 0;
skb_cp = _rtw_skb_copy(skb);
if(skb_cp)
cp_truesize = skb_cp->truesize;
@ -549,7 +549,7 @@ inline int dbg_rtw_netif_rx(_nic_hdl ndev, struct sk_buff *skb, const enum mstat
// DBG_871X("DBG_MEM_ALLOC %s:%d %s, truesize=%u\n", func, line, __FUNCTION__, truesize);
ret = _rtw_netif_rx(ndev, skb);
rtw_mstat_update(
flags
, MSTAT_FREE
@ -572,9 +572,9 @@ inline void *dbg_rtw_usb_buffer_alloc(struct usb_device *dev, size_t size, dma_a
{
void *p;
//DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, size);
p = _rtw_usb_buffer_alloc(dev, size, dma);
rtw_mstat_update(
flags
, p ? MSTAT_ALLOC_SUCCESS : MSTAT_ALLOC_FAIL
@ -647,7 +647,7 @@ void _rtw_init_listhead(_list *list)
/*
For the following list_xxx operations,
For the following list_xxx operations,
caller must guarantee the atomic context.
Otherwise, there will be racing condition.
*/
@ -796,12 +796,12 @@ inline s32 rtw_get_time_interval_ms(u32 start, u32 end)
{
return rtw_systime_to_ms(end-start);
}
void rtw_sleep_schedulable(int ms)
void rtw_sleep_schedulable(int ms)
{
u32 delta;
delta = (ms * HZ)/1000;//(ms)
if (delta == 0) {
delta = 1;// 1 ms
@ -815,7 +815,7 @@ void rtw_sleep_schedulable(int ms)
void rtw_msleep_os(int ms)
{
msleep((unsigned int)ms);
msleep((unsigned int)ms);
}
void rtw_usleep_os(int us)
@ -831,22 +831,22 @@ void rtw_usleep_os(int us)
void _rtw_mdelay_os(int ms, const char *func, const int line)
{
DBG_871X("%s:%d %s(%d)\n", func, line, __FUNCTION__, ms);
mdelay((unsigned long)ms);
mdelay((unsigned long)ms);
}
void _rtw_udelay_os(int us, const char *func, const int line)
{
DBG_871X("%s:%d %s(%d)\n", func, line, __FUNCTION__, us);
udelay((unsigned long)us);
udelay((unsigned long)us);
}
#else
void rtw_mdelay_os(int ms)
{
mdelay((unsigned long)ms);
mdelay((unsigned long)ms);
}
void rtw_udelay_os(int us)
{
udelay((unsigned long)us);
udelay((unsigned long)us);
}
#endif
@ -995,19 +995,19 @@ inline int ATOMIC_DEC_RETURN(ATOMIC_T *v)
* @param mode please refer to linux document
* @return Linux specific error code
*/
static int openFile(struct file **fpp, char *path, int flag, int mode)
{
struct file *fp;
fp=filp_open(path, flag, mode);
static int openFile(struct file **fpp, char *path, int flag, int mode)
{
struct file *fp;
fp=filp_open(path, flag, mode);
if(IS_ERR(fp)) {
*fpp=NULL;
return PTR_ERR(fp);
}
else {
*fpp=fp;
*fpp=fp;
return 0;
}
}
}
/*
@ -1015,17 +1015,17 @@ static int openFile(struct file **fpp, char *path, int flag, int mode)
* @param fp the pointer of struct file to close
* @return always 0
*/
static int closeFile(struct file *fp)
{
static int closeFile(struct file *fp)
{
filp_close(fp,NULL);
return 0;
return 0;
}
static int readFile(struct file *fp,char *buf,int len)
{
static int readFile(struct file *fp,char *buf,int len)
{
int rlen=0, sum=0;
if (!fp->f_op || !fp->f_op->read)
if (!fp->f_op || !fp->f_op->read)
return -EPERM;
while(sum<len) {
@ -1037,17 +1037,17 @@ static int readFile(struct file *fp,char *buf,int len)
else
break;
}
return sum;
}
static int writeFile(struct file *fp,char *buf,int len)
{
static int writeFile(struct file *fp,char *buf,int len)
{
int wlen=0, sum=0;
if (!fp->f_op || !fp->f_op->write)
return -EPERM;
if (!fp->f_op || !fp->f_op->write)
return -EPERM;
while(sum<len) {
wlen=fp->f_op->write(fp,buf+sum,len-sum, &fp->f_pos);
@ -1069,25 +1069,25 @@ static int writeFile(struct file *fp,char *buf,int len)
* @return Linux specific error code
*/
static int isFileReadable(char *path)
{
{
struct file *fp;
int ret = 0;
mm_segment_t oldfs;
char buf;
fp=filp_open(path, O_RDONLY, 0);
fp=filp_open(path, O_RDONLY, 0);
if(IS_ERR(fp)) {
ret = PTR_ERR(fp);
}
else {
oldfs = get_fs(); set_fs(get_ds());
if(1!=readFile(fp, &buf, 1))
ret = PTR_ERR(fp);
set_fs(oldfs);
filp_close(fp,NULL);
}
}
return ret;
}
@ -1112,9 +1112,9 @@ static int retriveFromFile(char *path, u8* buf, u32 sz)
ret=readFile(fp, buf, sz);
set_fs(oldfs);
closeFile(fp);
DBG_871X("%s readFile, ret:%d\n",__FUNCTION__, ret);
} else {
DBG_871X("%s openFile path:%s Fail, ret:%d\n",__FUNCTION__, path, ret);
}
@ -1137,7 +1137,7 @@ static int storeToFile(char *path, u8* buf, u32 sz)
int ret =0;
mm_segment_t oldfs;
struct file *fp;
if(path && buf) {
if( 0 == (ret=openFile(&fp, path, O_CREAT|O_WRONLY, 0666)) ) {
DBG_871X("%s openFile path:%s fp=%p\n",__FUNCTION__, path ,fp);
@ -1148,10 +1148,10 @@ static int storeToFile(char *path, u8* buf, u32 sz)
closeFile(fp);
DBG_871X("%s writeFile, ret:%d\n",__FUNCTION__, ret);
} else {
DBG_871X("%s openFile path:%s Fail, ret:%d\n",__FUNCTION__, path, ret);
}
}
} else {
DBG_871X("%s NULL pointer\n",__FUNCTION__);
ret = -EINVAL;
@ -1211,7 +1211,7 @@ struct net_device *rtw_alloc_etherdev_with_old_priv(int sizeof_priv, void *old_p
#endif
if (!pnetdev)
goto RETURN;
pnpi = netdev_priv(pnetdev);
pnpi->priv=old_priv;
pnpi->sizeof_priv=sizeof_priv;
@ -1232,16 +1232,16 @@ struct net_device *rtw_alloc_etherdev(int sizeof_priv)
#endif
if (!pnetdev)
goto RETURN;
pnpi = netdev_priv(pnetdev);
pnpi->priv = rtw_zvmalloc(sizeof_priv);
if (!pnpi->priv) {
free_netdev(pnetdev);
pnetdev = NULL;
goto RETURN;
}
pnpi->sizeof_priv=sizeof_priv;
RETURN:
return pnetdev;
@ -1250,10 +1250,10 @@ RETURN:
void rtw_free_netdev(struct net_device * netdev)
{
struct rtw_netdev_priv_indicator *pnpi;
if(!netdev)
goto RETURN;
pnpi = netdev_priv(netdev);
if(!pnpi->priv)
@ -1267,7 +1267,7 @@ RETURN:
}
/*
* Jeff: this function should be called under ioctl (rtnl_lock is accquired) while
* Jeff: this function should be called under ioctl (rtnl_lock is accquired) while
* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
*/
int rtw_change_ifname(struct adapter *padapter, const char *ifname)
@ -1281,7 +1281,7 @@ int rtw_change_ifname(struct adapter *padapter, const char *ifname)
goto error;
rereg_priv = &padapter->rereg_nd_name_priv;
//free the old_pnetdev
if(rereg_priv->old_pnetdev) {
free_netdev(rereg_priv->old_pnetdev);
@ -1328,9 +1328,9 @@ int rtw_change_ifname(struct adapter *padapter, const char *ifname)
return 0;
error:
return -1;
}
#endif //MEM_ALLOC_REFINE_ADAPTOR
@ -1495,4 +1495,3 @@ void rtw_cbuf_free(struct rtw_cbuf *cbuf)
{
rtw_mfree((u8*)cbuf, sizeof(*cbuf) + sizeof(void*)*cbuf->size);
}

View file

@ -45,7 +45,7 @@ int rtw_os_recv_resource_init(struct recv_priv *precvpriv, struct adapter *padap
int rtw_os_recv_resource_alloc(struct adapter *padapter, union recv_frame *precvframe)
{
int res=_SUCCESS;
precvframe->u.hdr.pkt_newalloc = precvframe->u.hdr.pkt = NULL;
return res;
@ -105,7 +105,7 @@ int rtw_os_recvbuf_resource_alloc(struct adapter *padapter, struct recv_buf *pre
if(precvbuf->pallocated_buf == NULL)
return _FAIL;
#endif //CONFIG_USE_USB_BUFFER_ALLOC_RX
#endif //CONFIG_USB_HCI
return res;
@ -154,7 +154,7 @@ void rtw_handle_tkip_mic_err(struct adapter *padapter,u8 bgroup)
union iwreq_data wrqu;
struct iw_michaelmicfailure ev;
struct mlme_priv* pmlmepriv = &padapter->mlmepriv;
struct security_priv *psecuritypriv = &padapter->securitypriv;
struct security_priv *psecuritypriv = &padapter->securitypriv;
u32 cur_time = 0;
if( psecuritypriv->last_mic_err_time == 0 )
@ -294,7 +294,7 @@ _func_enter_;
goto _recv_indicatepkt_drop;
}
RT_TRACE(_module_recv_osdep_c_,_drv_info_,("rtw_recv_indicatepkt():skb != NULL !!!\n"));
RT_TRACE(_module_recv_osdep_c_,_drv_info_,("rtw_recv_indicatepkt():skb != NULL !!!\n"));
RT_TRACE(_module_recv_osdep_c_,_drv_info_,("rtw_recv_indicatepkt():precv_frame->u.hdr.rx_head=%p precv_frame->hdr.rx_data=%p\n", precv_frame->u.hdr.rx_head, precv_frame->u.hdr.rx_data));
RT_TRACE(_module_recv_osdep_c_,_drv_info_,("precv_frame->hdr.rx_tail=%p precv_frame->u.hdr.rx_end=%p precv_frame->hdr.len=%d \n", precv_frame->u.hdr.rx_tail, precv_frame->u.hdr.rx_end, precv_frame->u.hdr.len));
@ -308,9 +308,9 @@ _func_enter_;
if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE)
{
_pkt *pskb2=NULL;
struct sta_info *psta = NULL;
struct sta_priv *pstapriv = &padapter->stapriv;
_pkt *pskb2=NULL;
struct sta_info *psta = NULL;
struct sta_priv *pstapriv = &padapter->stapriv;
struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib;
int bmcast = IS_MCAST(pattrib->dst);
@ -330,16 +330,16 @@ _func_enter_;
if(psta)
{
struct net_device *pnetdev= (struct net_device*)padapter->pnetdev;
struct net_device *pnetdev= (struct net_device*)padapter->pnetdev;
//DBG_871X("directly forwarding to the rtw_xmit_entry\n");
//skb->ip_summed = CHECKSUM_NONE;
skb->dev = pnetdev;
skb->dev = pnetdev;
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35))
skb_set_queue_mapping(skb, rtw_recv_select_queue(skb));
#endif //LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35)
_rtw_xmit_entry(skb, pnetdev);
if(bmcast)
@ -355,7 +355,7 @@ _func_enter_;
//DBG_871X("to APSelf\n");
}
}
#ifdef CONFIG_BR_EXT
@ -367,19 +367,19 @@ _func_enter_;
rcu_read_unlock();
#endif // (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35))
if( br_port && (check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) == _TRUE) )
if( br_port && (check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) == _TRUE) )
{
int nat25_handle_frame(struct adapter *priv, struct sk_buff *skb);
if (nat25_handle_frame(padapter, skb) == -1) {
//priv->ext_stats.rx_data_drops++;
//DEBUG_ERR("RX DROP: nat25_handle_frame fail!\n");
//return FAIL;
#if 1
#if 1
// bypass this frame to upper layer!!
#else
goto _recv_indicatepkt_drop;
#endif
}
}
}
#endif // CONFIG_BR_EXT
@ -404,16 +404,16 @@ _func_enter_;
#ifdef DBG_TRX_STA_PKTS
{
struct sta_info *psta = NULL;
struct sta_priv *pstapriv = &padapter->stapriv;
struct sta_priv *pstapriv = &padapter->stapriv;
struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib;
int bmcast = IS_MCAST(pattrib->dst);
if(bmcast)
{
psta = rtw_get_bcmc_stainfo(padapter);
} else {
psta = rtw_get_stainfo(pstapriv, pattrib->src);
}
@ -422,24 +422,24 @@ _func_enter_;
switch(pattrib->priority)
{
case 1:
case 2:
case 2:
psta->rx_bk_cnt++;
break;
case 4:
case 5:
case 5:
psta->rx_vi_cnt++;
break;
case 6:
case 7:
case 7:
psta->rx_vo_cnt++;
break;
case 0:
case 3:
default:
default:
psta->rx_be_cnt++;
break;
break;
}
}
}
}
#endif
@ -509,4 +509,3 @@ void rtw_init_recv_timer(struct recv_reorder_ctrl *preorder_ctrl)
_init_timer(&(preorder_ctrl->reordering_ctrl_timer), padapter->pnetdev, _rtw_reordering_ctrl_timeout_handler, preorder_ctrl);
}

View file

@ -1,7 +1,7 @@
/******************************************************************************
*
* 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.
@ -85,13 +85,13 @@ static const char *android_wifi_cmd_str[ANDROID_WIFI_CMD_MAX] = {
"WFD-DISABLE",
"WFD-SET-TCPPORT",
"WFD-SET-MAXTPUT",
"WFD-SET-DEVTYPE",
"WFD-SET-DEVTYPE",
};
#ifdef PNO_SUPPORT
#define PNO_TLV_PREFIX 'S'
#define PNO_TLV_VERSION '1'
#define PNO_TLV_SUBVERSION '2'
#define PNO_TLV_SUBVERSION '2'
#define PNO_TLV_RESERVED '0'
#define PNO_TLV_TYPE_SSID_IE 'S'
#define PNO_TLV_TYPE_TIME 'T'
@ -238,19 +238,19 @@ int rtw_android_cmdstr_to_num(char *cmdstr)
for(cmd_num=0 ; cmd_num<ANDROID_WIFI_CMD_MAX; cmd_num++)
if(0 == strnicmp(cmdstr , android_wifi_cmd_str[cmd_num], strlen(android_wifi_cmd_str[cmd_num])) )
break;
return cmd_num;
}
static int rtw_android_get_rssi(struct net_device *net, char *command, int total_len)
{
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(net);
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
struct wlan_network *pcur_network = &pmlmepriv->cur_network;
int bytes_written = 0;
if(check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) {
bytes_written += snprintf(&command[bytes_written], total_len, "%s rssi %d",
if(check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) {
bytes_written += snprintf(&command[bytes_written], total_len, "%s rssi %d",
pcur_network->network.Ssid.Ssid, padapter->recvpriv.rssi);
}
@ -260,7 +260,7 @@ static int rtw_android_get_rssi(struct net_device *net, char *command, int total
static int rtw_android_get_link_speed(struct net_device *net, char *command, int total_len)
{
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(net);
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
struct wlan_network *pcur_network = &pmlmepriv->cur_network;
int bytes_written = 0;
u16 link_speed = 0;
@ -275,7 +275,7 @@ static int rtw_android_get_macaddr(struct net_device *net, char *command, int to
{
struct adapter *adapter = (struct adapter *)rtw_netdev_priv(net);
int bytes_written = 0;
bytes_written = snprintf(command, total_len, "Macaddr = "MAC_FMT, MAC_ARG(net->dev_addr));
return bytes_written;
}
@ -285,7 +285,7 @@ static int rtw_android_set_country(struct net_device *net, char *command, int to
struct adapter *adapter = (struct adapter *)rtw_netdev_priv(net);
char *country_code = command + strlen(android_wifi_cmd_str[ANDROID_WIFI_CMD_COUNTRY]) + 1;
int ret = _FAIL;
ret = rtw_set_country(adapter, country_code);
return (ret==_SUCCESS)?0:-1;
@ -297,7 +297,7 @@ static int rtw_android_get_p2p_dev_addr(struct net_device *net, char *command, i
//We use the same address as our HW MAC address
_rtw_memcpy(command, net->dev_addr, ETH_ALEN);
bytes_written = ETH_ALEN;
return bytes_written;
}
@ -310,7 +310,7 @@ static int rtw_android_set_block(struct net_device *net, char *command, int tota
#ifdef CONFIG_IOCTL_CFG80211
wdev_to_priv(adapter->rtw_wdev)->block = (*block_value=='0')?_FALSE:_TRUE;
#endif
return 0;
}
@ -352,7 +352,7 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
ret = -EFAULT;
goto exit;
}
//DBG_871X("%s priv_cmd.buf=%p priv_cmd.total_len=%d priv_cmd.used_len=%d\n",__func__,priv_cmd.buf,priv_cmd.total_len,priv_cmd.used_len);
command = rtw_zmalloc(priv_cmd.total_len);
if (!command)
@ -363,7 +363,7 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
}
if (!access_ok(VERIFY_READ, priv_cmd.buf, priv_cmd.total_len)){
DBG_871X("%s: failed to access memory\n", __FUNCTION__);
DBG_871X("%s: failed to access memory\n", __FUNCTION__);
ret = -EFAULT;
goto exit;
}
@ -376,7 +376,7 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
, __FUNCTION__, command, ifr->ifr_name);
cmd_num = rtw_android_cmdstr_to_num(command);
switch(cmd_num) {
case ANDROID_WIFI_CMD_START:
//bytes_written = wl_android_wifi_on(net);
@ -397,19 +397,19 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
case ANDROID_WIFI_CMD_STOP:
//bytes_written = wl_android_wifi_off(net);
break;
case ANDROID_WIFI_CMD_SCAN_ACTIVE:
//rtw_set_scan_mode((struct adapter *)rtw_netdev_priv(net), SCAN_ACTIVE);
#ifdef CONFIG_PLATFORM_MSTAR
#ifdef CONFIG_PLATFORM_MSTAR
#ifdef CONFIG_IOCTL_CFG80211
(wdev_to_priv(net->ieee80211_ptr))->bandroid_scan = _TRUE;
(wdev_to_priv(net->ieee80211_ptr))->bandroid_scan = _TRUE;
#endif //CONFIG_IOCTL_CFG80211
#endif //CONFIG_PLATFORM_MSTAR
break;
case ANDROID_WIFI_CMD_SCAN_PASSIVE:
//rtw_set_scan_mode((struct adapter *)rtw_netdev_priv(net), SCAN_PASSIVE);
break;
case ANDROID_WIFI_CMD_RSSI:
bytes_written = rtw_android_get_rssi(net, command, priv_cmd.total_len);
break;
@ -420,11 +420,11 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
case ANDROID_WIFI_CMD_MACADDR:
bytes_written = rtw_android_get_macaddr(net, command, priv_cmd.total_len);
break;
case ANDROID_WIFI_CMD_BLOCK:
bytes_written = rtw_android_set_block(net, command, priv_cmd.total_len);
break;
case ANDROID_WIFI_CMD_RXFILTER_START:
//bytes_written = net_os_set_packet_filter(net, 1);
break;
@ -439,7 +439,7 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
//int filter_num = *(command + strlen(CMD_RXFILTER_REMOVE) + 1) - '0';
//bytes_written = net_os_rxfilter_add_remove(net, FALSE, filter_num);
break;
case ANDROID_WIFI_CMD_BTCOEXSCAN_START:
/* TBD: BTCOEXSCAN-START */
break;
@ -458,11 +458,11 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
#endif
#endif
break;
case ANDROID_WIFI_CMD_SETSUSPENDOPT:
//bytes_written = wl_android_set_suspendopt(net, command, priv_cmd.total_len);
break;
case ANDROID_WIFI_CMD_SETBAND:
{
uint band = *(command + strlen("SETBAND") + 1) - '0';
@ -476,11 +476,11 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
case ANDROID_WIFI_CMD_GETBAND:
//bytes_written = wl_android_get_band(net, command, priv_cmd.total_len);
break;
case ANDROID_WIFI_CMD_COUNTRY:
bytes_written = rtw_android_set_country(net, command, priv_cmd.total_len);
break;
#ifdef PNO_SUPPORT
case ANDROID_WIFI_CMD_PNOSSIDCLR_SET:
//bytes_written = dhd_dev_pno_reset(net);
@ -508,7 +508,7 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
//int skip = strlen(CMD_P2P_SET_PS) + 1;
//bytes_written = wl_cfg80211_set_p2p_ps(net, command + skip, priv_cmd.total_len - skip);
break;
#ifdef CONFIG_IOCTL_CFG80211
case ANDROID_WIFI_CMD_SET_AP_WPS_P2P_IE:
{
@ -552,14 +552,14 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
{
// Commented by Albert 2012/08/28
// Specify the WFD device type ( WFD source/primary sink )
struct wifi_display_info *pwfd_info;
struct adapter* padapter = ( struct adapter * ) rtw_netdev_priv(net);
pwfd_info = &padapter->wfd_info;
if (padapter->wdinfo.driver_interface == DRIVER_CFG80211) {
pwfd_info->wfd_device_type = (u8)get_int_from_command(priv_cmd.buf);
pwfd_info->wfd_device_type &= WFD_DEVINFO_DUAL;
}
break;
@ -825,4 +825,3 @@ static void wifi_del_dev(void)
platform_driver_unregister(&wifi_device_legacy);
}
#endif /* defined(RTW_ENABLE_WIFI_CONTROL_FUNC) */

View file

@ -1,7 +1,7 @@
/******************************************************************************
*
* 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.
@ -72,24 +72,24 @@ static void rtw_dev_shutdown(struct device *dev)
#if (LINUX_VERSION_CODE<=KERNEL_VERSION(2,6,23))
/* Some useful macros to use to create struct usb_device_id */
#define USB_DEVICE_ID_MATCH_VENDOR 0x0001
#define USB_DEVICE_ID_MATCH_VENDOR 0x0001
#define USB_DEVICE_ID_MATCH_PRODUCT 0x0002
#define USB_DEVICE_ID_MATCH_DEV_LO 0x0004
#define USB_DEVICE_ID_MATCH_DEV_HI 0x0008
#define USB_DEVICE_ID_MATCH_DEV_LO 0x0004
#define USB_DEVICE_ID_MATCH_DEV_HI 0x0008
#define USB_DEVICE_ID_MATCH_DEV_CLASS 0x0010
#define USB_DEVICE_ID_MATCH_DEV_SUBCLASS 0x0020
#define USB_DEVICE_ID_MATCH_DEV_PROTOCOL 0x0040
#define USB_DEVICE_ID_MATCH_INT_CLASS 0x0080
#define USB_DEVICE_ID_MATCH_INT_SUBCLASS 0x0100
#define USB_DEVICE_ID_MATCH_INT_PROTOCOL 0x0200
#define USB_DEVICE_ID_MATCH_INT_NUMBER 0x0400
#define USB_DEVICE_ID_MATCH_INT_NUMBER 0x0400
#define USB_DEVICE_ID_MATCH_INT_INFO \
(USB_DEVICE_ID_MATCH_INT_CLASS | \
USB_DEVICE_ID_MATCH_INT_SUBCLASS | \
USB_DEVICE_ID_MATCH_INT_PROTOCOL)
#define USB_DEVICE_AND_INTERFACE_INFO(vend, prod, cl, sc, pr) \
.match_flags = USB_DEVICE_ID_MATCH_INT_INFO \
@ -99,7 +99,7 @@ static void rtw_dev_shutdown(struct device *dev)
.bInterfaceClass = (cl), \
.bInterfaceSubClass = (sc), \
.bInterfaceProtocol = (pr)
/**
* USB_VENDOR_AND_INTERFACE_INFO - describe a specific usb vendor with a class of usb interfaces
* @vend: the 16 bit USB Vendor ID
@ -120,7 +120,7 @@ static void rtw_dev_shutdown(struct device *dev)
.bInterfaceClass = (cl), \
.bInterfaceSubClass = (sc), \
.bInterfaceProtocol = (pr)
/* ----------------------------------------------------------------------- */
#endif
@ -146,7 +146,7 @@ static struct specific_device_id specific_device_id_tbl[] = {
{.idVendor=USB_VENDER_ID_REALTEK, .idProduct=0x817E, .flags=SPEC_DEV_ID_DISABLE_HT},//8188CE-VAU USB minCard (b/g mode only)
{.idVendor=0x0b05, .idProduct=0x1791, .flags=SPEC_DEV_ID_DISABLE_HT},
{.idVendor=0x13D3, .idProduct=0x3311, .flags=SPEC_DEV_ID_DISABLE_HT},
{.idVendor=0x13D3, .idProduct=0x3359, .flags=SPEC_DEV_ID_DISABLE_HT},//Russian customer -Azwave (8188CE-VAU g mode)
{.idVendor=0x13D3, .idProduct=0x3359, .flags=SPEC_DEV_ID_DISABLE_HT},//Russian customer -Azwave (8188CE-VAU g mode)
#ifdef RTK_DMP_PLATFORM
{.idVendor=USB_VENDER_ID_REALTEK, .idProduct=0x8111, .flags=SPEC_DEV_ID_ASSIGN_IFNAME}, // Realtek 5G dongle for WiFi Display
{.idVendor=0x2019, .idProduct=0xAB2D, .flags=SPEC_DEV_ID_ASSIGN_IFNAME}, // PCI-Abocom 5G dongle for WiFi Display
@ -172,10 +172,10 @@ static struct rtw_usb_drv rtl8188e_usb_drv = {
.usbdrv.suspend = rtw_suspend,
.usbdrv.resume = rtw_resume,
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 22))
.usbdrv.reset_resume = rtw_resume,
.usbdrv.reset_resume = rtw_resume,
#endif
#ifdef CONFIG_AUTOSUSPEND
.usbdrv.supports_autosuspend = 1,
#ifdef CONFIG_AUTOSUSPEND
.usbdrv.supports_autosuspend = 1,
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19))
@ -204,7 +204,7 @@ static inline int RT_usb_endpoint_xfer_int(const struct usb_endpoint_descriptor
static inline int RT_usb_endpoint_xfer_bulk(const struct usb_endpoint_descriptor *epd)
{
return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_BULK);
return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_BULK);
}
static inline int RT_usb_endpoint_is_bulk_in(const struct usb_endpoint_descriptor *epd)
@ -229,8 +229,8 @@ static inline int RT_usb_endpoint_num(const struct usb_endpoint_descriptor *epd)
static u8 rtw_init_intf_priv(struct dvobj_priv *dvobj)
{
u8 rst = _SUCCESS;
u8 rst = _SUCCESS;
#ifdef CONFIG_USB_VENDOR_REQ_MUTEX
_rtw_mutex_init(&dvobj->usb_vendor_req_mutex);
#endif
@ -243,18 +243,18 @@ static u8 rtw_init_intf_priv(struct dvobj_priv *dvobj)
rst = _FAIL;
goto exit;
}
dvobj->usb_vendor_req_buf =
dvobj->usb_vendor_req_buf =
(u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(dvobj->usb_alloc_vendor_req_buf ), ALIGNMENT_UNIT);
exit:
#endif
return rst;
}
static u8 rtw_deinit_intf_priv(struct dvobj_priv *dvobj)
{
u8 rst = _SUCCESS;
u8 rst = _SUCCESS;
#ifdef CONFIG_USB_VENDOR_REQ_BUFFER_PREALLOC
if(dvobj->usb_vendor_req_buf)
@ -264,7 +264,7 @@ static u8 rtw_deinit_intf_priv(struct dvobj_priv *dvobj)
#ifdef CONFIG_USB_VENDOR_REQ_MUTEX
_rtw_mutex_free(&dvobj->usb_vendor_req_mutex);
#endif
return rst;
}
@ -274,7 +274,7 @@ static struct dvobj_priv *usb_dvobj_init(struct usb_interface *usb_intf)
u8 val8;
int status = _FAIL;
struct dvobj_priv *pdvobjpriv;
struct usb_device_descriptor *pdev_desc;
struct usb_device_descriptor *pdev_desc;
struct usb_host_config *phost_conf;
struct usb_config_descriptor *pconf_desc;
struct usb_host_interface *phost_iface;
@ -402,7 +402,7 @@ _func_enter_;
pdvobjpriv->ep_num[i] = RT_usb_endpoint_num(pendp_desc);
}
}
DBG_871X("nr_endpoint=%d, in_num=%d, out_num=%d\n\n", pdvobjpriv->nr_endpoint, pdvobjpriv->RtNumInPipes, pdvobjpriv->RtNumOutPipes);
if (pusbd->speed == USB_SPEED_HIGH) {
@ -412,14 +412,14 @@ _func_enter_;
pdvobjpriv->ishighspeed = _FALSE;
DBG_871X("NON USB_SPEED_HIGH\n");
}
if (rtw_init_intf_priv(pdvobjpriv) == _FAIL) {
RT_TRACE(_module_os_intfs_c_,_drv_err_,("\n Can't INIT rtw_init_intf_priv\n"));
goto free_dvobj;
}
//.3 misc
_rtw_init_sema(&(pdvobjpriv->usb_suspend_sema), 0);
_rtw_init_sema(&(pdvobjpriv->usb_suspend_sema), 0);
rtw_reset_continual_io_error(pdvobjpriv);
usb_get_dev(pusbd);
@ -453,7 +453,7 @@ _func_enter_;
if ((dvobj->NumInterfaces != 2 && dvobj->NumInterfaces != 3)
|| (dvobj->InterfaceNumber == 1)) {
if (interface_to_usbdev(usb_intf)->state != USB_STATE_NOTATTACHED) {
//If we didn't unplug usb dongle and remove/insert modlue, driver fails on sitesurvey for the first time when device is up .
//If we didn't unplug usb dongle and remove/insert modlue, driver fails on sitesurvey for the first time when device is up .
//Reset usb port for sitesurvey fail issue. 2009.8.13, by Thomas
DBG_871X("usb attached..., try to reset usb device\n");
usb_reset_device(interface_to_usbdev(usb_intf));
@ -466,7 +466,7 @@ _func_enter_;
_rtw_mutex_free(&dvobj->setbw_mutex);
rtw_mfree((u8*)dvobj, sizeof(*dvobj));
}
//DBG_871X("%s %d\n", __func__, ATOMIC_READ(&usb_intf->dev.kobj.kref.refcount));
usb_put_dev(interface_to_usbdev(usb_intf));
@ -482,8 +482,8 @@ static void decide_chip_type_by_usb_device_id(struct adapter *padapter, const st
static void usb_intf_start(struct adapter *padapter)
{
RT_TRACE(_module_hci_intfs_c_,_drv_err_,("+usb_intf_start\n"));
RT_TRACE(_module_hci_intfs_c_,_drv_err_,("+usb_intf_start\n"));
rtw_hal_inirp_init(padapter);
RT_TRACE(_module_hci_intfs_c_,_drv_err_,("-usb_intf_start\n"));
@ -504,7 +504,7 @@ static void usb_intf_stop(struct adapter *padapter)
}
//cancel in irp
rtw_hal_inirp_deinit(padapter);
rtw_hal_inirp_deinit(padapter);
//cancel out irp
rtw_write_port_cancel(padapter);
@ -538,7 +538,7 @@ void rtw_dev_unload(struct adapter *padapter)
}
//s4.
if(!adapter_to_pwrctl(padapter)->bInternalAutoSuspend )
if(!adapter_to_pwrctl(padapter)->bInternalAutoSuspend )
rtw_stop_drv_threads(padapter);
@ -602,7 +602,7 @@ static void process_spec_devid(const struct usb_device_id *pdid)
if((pdid->idVendor==vid) && (pdid->idProduct==pid) && (flags&SPEC_DEV_ID_ASSIGN_IFNAME))
{
extern char* ifname;
strncpy(ifname, "wlan10", 6);
strncpy(ifname, "wlan10", 6);
//DBG_871X("%s()-%d: ifname=%s, vid=%04X, pid=%04X\n", __FUNCTION__, __LINE__, ifname, vid, pid);
}
#endif /* RTK_DMP_PLATFORM */
@ -614,23 +614,23 @@ static void process_spec_devid(const struct usb_device_id *pdid)
int rtw_hw_suspend(struct adapter *padapter )
{
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
struct usb_interface *pusb_intf = adapter_to_dvobj(padapter)->pusbintf;
struct usb_interface *pusb_intf = adapter_to_dvobj(padapter)->pusbintf;
struct net_device *pnetdev = padapter->pnetdev;
_func_enter_;
if((!padapter->bup) || (padapter->bDriverStopped)||(padapter->bSurpriseRemoved))
{
DBG_871X("padapter->bup=%d bDriverStopped=%d bSurpriseRemoved = %d\n",
padapter->bup, padapter->bDriverStopped,padapter->bSurpriseRemoved);
padapter->bup, padapter->bDriverStopped,padapter->bSurpriseRemoved);
goto error_exit;
}
if(padapter)//system suspend
{
{
LeaveAllPowerSaveMode(padapter);
DBG_871X("==> rtw_hw_suspend\n");
DBG_871X("==> rtw_hw_suspend\n");
_enter_pwrlock(&pwrpriv->lock);
pwrpriv->bips_processing = _TRUE;
//padapter->net_closed = _TRUE;
@ -643,11 +643,11 @@ int rtw_hw_suspend(struct adapter *padapter )
//s2.
rtw_disassoc_cmd(padapter, 500, _FALSE);
//s2-2. indicate disconnect to os
//rtw_indicate_disconnect(padapter);
{
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
if(check_fwstate(pmlmepriv, _FW_LINKED))
{
@ -656,7 +656,7 @@ int rtw_hw_suspend(struct adapter *padapter )
rtw_led_control(padapter, LED_CTL_NO_LINK);
rtw_os_indicate_disconnect(padapter);
#ifdef CONFIG_LPS
//donnot enqueue cmd
rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_DISCONNECT, 0);
@ -670,19 +670,19 @@ int rtw_hw_suspend(struct adapter *padapter )
//s2-4.
rtw_free_network_queue(padapter,_TRUE);
#ifdef CONFIG_IPS
rtw_ips_dev_unload(padapter);
#endif
rtw_ips_dev_unload(padapter);
#endif
pwrpriv->rf_pwrstate = rf_off;
pwrpriv->bips_processing = _FALSE;
pwrpriv->bips_processing = _FALSE;
_exit_pwrlock(&pwrpriv->lock);
}
else
goto error_exit;
_func_exit_;
return 0;
error_exit:
DBG_871X("%s, failed \n",__FUNCTION__);
return (-1);
@ -698,41 +698,41 @@ int rtw_hw_resume(struct adapter *padapter)
_func_enter_;
if(padapter)//system resume
{
{
DBG_871X("==> rtw_hw_resume\n");
_enter_pwrlock(&pwrpriv->lock);
pwrpriv->bips_processing = _TRUE;
rtw_reset_drv_sw(padapter);
if(pm_netdev_open(pnetdev,_FALSE) != 0)
{
_exit_pwrlock(&pwrpriv->lock);
goto error_exit;
}
netif_device_attach(pnetdev);
netif_device_attach(pnetdev);
netif_carrier_on(pnetdev);
if(!rtw_netif_queue_stopped(pnetdev))
rtw_netif_start_queue(pnetdev);
rtw_netif_start_queue(pnetdev);
else
rtw_netif_wake_queue(pnetdev);
pwrpriv->bkeepfwalive = _FALSE;
pwrpriv->brfoffbyhw = _FALSE;
pwrpriv->rf_pwrstate = rf_on;
pwrpriv->bips_processing = _FALSE;
pwrpriv->bips_processing = _FALSE;
_exit_pwrlock(&pwrpriv->lock);
}
else
{
goto error_exit;
goto error_exit;
}
_func_exit_;
return 0;
error_exit:
DBG_871X("%s, Open net dev failed \n",__FUNCTION__);
@ -754,13 +754,13 @@ static void rtw_suspend_wow(struct adapter *padapter)
pwrpriv->wowlan_mode = _TRUE;
else
pwrpriv->wowlan_mode = _FALSE;
rtw_cancel_all_timer(padapter);
rtw_cancel_all_timer(padapter);
LeaveAllPowerSaveMode(padapter);
rtw_stop_cmd_thread(padapter);
//padapter->net_closed = _TRUE;
//s1.
if(pnetdev)
@ -790,7 +790,7 @@ static void rtw_suspend_wow(struct adapter *padapter)
MAC_ARG(pmlmepriv->cur_network.network.MacAddress),
pmlmepriv->cur_network.network.Ssid.SsidLength,
pmlmepriv->assoc_ssid.SsidLength);
rtw_set_roaming(padapter, 1);
}
#endif
@ -805,7 +805,7 @@ static void rtw_suspend_wow(struct adapter *padapter)
rtw_free_network_queue(padapter, _TRUE);
rtw_dev_unload(padapter);
if(check_fwstate(pmlmepriv, _FW_UNDER_SURVEY))
rtw_indicate_scan_done(padapter, 1);
@ -826,7 +826,7 @@ static int rtw_suspend(struct usb_interface *pusb_intf, pm_message_t message)
int ret = 0;
u32 start_time = rtw_get_current_time();
_func_enter_;
DBG_871X("==> %s (%s:%d)\n",__FUNCTION__, current->comm, current->pid);
@ -847,10 +847,10 @@ static int rtw_suspend(struct usb_interface *pusb_intf, pm_message_t message)
padapter->bup, padapter->bDriverStopped,padapter->bSurpriseRemoved);
goto exit;
}
if(pwrpriv->bInternalAutoSuspend )
{
#ifdef CONFIG_AUTOSUSPEND
#ifdef CONFIG_AUTOSUSPEND
#ifdef SUPPORT_HW_RFOFF_DETECTED
// The FW command register update must after MAC and FW init ready.
if((padapter->bFWReady) && (pwrpriv->bHWPwrPindetect ) && (padapter->registrypriv.usbss_enable ))
@ -863,22 +863,22 @@ static int rtw_suspend(struct usb_interface *pusb_intf, pm_message_t message)
#endif
}
pwrpriv->bInSuspend = _TRUE;
pwrpriv->bInSuspend = _TRUE;
_enter_pwrlock(&pwrpriv->lock);
#ifdef CONFIG_WOWLAN
rtw_suspend_wow(padapter);
#else
rtw_suspend_common(padapter);
rtw_suspend_common(padapter);
#endif
#ifdef CONFIG_AUTOSUSPEND
pwrpriv->rf_pwrstate = rf_off;
pwrpriv->bips_processing = _FALSE;
#endif
_exit_pwrlock(&pwrpriv->lock);
exit:
DBG_871X("<=== %s return %d.............. in %dms\n", __FUNCTION__
, ret, rtw_get_passing_time_ms(start_time));
@ -901,7 +901,7 @@ static int rtw_suspend(struct usb_interface *pusb_intf, pm_message_t message)
int ret = 0;
u32 start_time = rtw_get_current_time();
_func_enter_;
DBG_871X("==> %s (%s:%d)\n",__FUNCTION__, current->comm, current->pid);
@ -919,10 +919,10 @@ static int rtw_suspend(struct usb_interface *pusb_intf, pm_message_t message)
padapter->bup, padapter->bDriverStopped,padapter->bSurpriseRemoved);
goto exit;
}
if(pwrpriv->bInternalAutoSuspend )
{
#ifdef CONFIG_AUTOSUSPEND
#ifdef CONFIG_AUTOSUSPEND
#ifdef SUPPORT_HW_RFOFF_DETECTED
// The FW command register update must after MAC and FW init ready.
if((padapter->bFWReady) && (pwrpriv->bHWPwrPindetect ) && (padapter->registrypriv.usbss_enable ))
@ -934,8 +934,8 @@ static int rtw_suspend(struct usb_interface *pusb_intf, pm_message_t message)
#endif
#endif
}
pwrpriv->bInSuspend = _TRUE;
rtw_cancel_all_timer(padapter);
pwrpriv->bInSuspend = _TRUE;
rtw_cancel_all_timer(padapter);
LeaveAllPowerSaveMode(padapter);
rtw_stop_cmd_thread(padapter);
@ -972,7 +972,7 @@ static int rtw_suspend(struct usb_interface *pusb_intf, pm_message_t message)
MAC_ARG(pmlmepriv->cur_network.network.MacAddress),
pmlmepriv->cur_network.network.Ssid.SsidLength,
pmlmepriv->assoc_ssid.SsidLength);
rtw_set_roaming(padapter, 1);
}
#endif
@ -998,7 +998,7 @@ static int rtw_suspend(struct usb_interface *pusb_intf, pm_message_t message)
if(check_fwstate(pmlmepriv, _FW_UNDER_LINKING))
rtw_indicate_disconnect(padapter);
exit:
DBG_871X("<=== %s return %d.............. in %dms\n", __FUNCTION__
, ret, rtw_get_passing_time_ms(start_time));
@ -1015,9 +1015,9 @@ static int rtw_resume(struct usb_interface *pusb_intf)
struct net_device *pnetdev = padapter->pnetdev;
struct pwrctrl_priv *pwrpriv = dvobj_to_pwrctl(dvobj);
int ret = 0;
if(pwrpriv->bInternalAutoSuspend ){
ret = rtw_resume_process(padapter);
ret = rtw_resume_process(padapter);
} else {
#ifdef CONFIG_RESUME_IN_WORKQUEUE
rtw_resume_in_workqueue(pwrpriv);
@ -1034,7 +1034,7 @@ static int rtw_resume(struct usb_interface *pusb_intf)
}
#endif /* CONFIG_RESUME_IN_WORKQUEUE */
}
return ret;
}
@ -1068,7 +1068,7 @@ int rtw_resume_process(struct adapter *padapter)
#else
DBG_871X("...pm_usage_cnt(%d).....\n", adapter_to_dvobj(padapter)->pusbintf->pm_usage_cnt);
pm_cnt = adapter_to_dvobj(padapter)->pusbintf->pm_usage_cnt;
#endif
#endif
DBG_871X("pwrpriv->bAutoResume (%x)\n",pwrpriv->bAutoResume );
if( _TRUE == pwrpriv->bAutoResume ){
@ -1120,7 +1120,7 @@ int rtw_resume_process(struct adapter *padapter)
if( padapter->pid[1]!=0) {
DBG_871X("pid[1]:%d\n",padapter->pid[1]);
rtw_signal_process(padapter->pid[1], SIGUSR2);
}
}
ret = 0;
exit:
@ -1131,35 +1131,35 @@ exit:
pwrpriv->bInSuspend = _FALSE;
DBG_871X("<=== %s return %d.............. in %dms\n", __FUNCTION__
, ret, rtw_get_passing_time_ms(start_time));
_func_exit_;
return ret;
}
#ifdef CONFIG_AUTOSUSPEND
void autosuspend_enter(struct adapter* padapter)
void autosuspend_enter(struct adapter* padapter)
{
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
struct dvobj_priv *dvobj = adapter_to_dvobj(padapter);
DBG_871X("==>autosuspend_enter...........\n");
pwrpriv->bInternalAutoSuspend = _TRUE;
pwrpriv->bips_processing = _TRUE;
if(rf_off == pwrpriv->change_rfpwrstate )
{
{
#ifndef CONFIG_BT_COEXIST
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35))
usb_enable_autosuspend(dvobj->pusbdev);
#else
dvobj->pusbdev->autosuspend_disabled = 0;//autosuspend disabled by the user
dvobj->pusbdev->autosuspend_disabled = 0;//autosuspend disabled by the user
#endif
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,33))
usb_autopm_put_interface(dvobj->pusbintf);
#elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,20))
usb_autopm_put_interface(dvobj->pusbintf);
#elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,20))
usb_autopm_enable(dvobj->pusbintf);
#else
usb_autosuspend_device(dvobj->pusbdev, 1);
@ -1169,12 +1169,12 @@ void autosuspend_enter(struct adapter* padapter)
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35))
usb_enable_autosuspend(dvobj->pusbdev);
#else
dvobj->pusbdev->autosuspend_disabled = 0;//autosuspend disabled by the user
dvobj->pusbdev->autosuspend_disabled = 0;//autosuspend disabled by the user
#endif
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,33))
usb_autopm_put_interface(dvobj->pusbintf);
#elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,20))
usb_autopm_put_interface(dvobj->pusbintf);
#elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,20))
usb_autopm_enable(dvobj->pusbintf);
#else
usb_autosuspend_device(dvobj->pusbdev, 1);
@ -1191,7 +1191,7 @@ void autosuspend_enter(struct adapter* padapter)
#else
DBG_871X("...pm_usage_cnt(%d).....\n", dvobj->pusbintf->pm_usage_cnt);
#endif
}
int autoresume_enter(struct adapter* padapter)
{
@ -1201,21 +1201,21 @@ int autoresume_enter(struct adapter* padapter)
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
struct dvobj_priv *dvobj = adapter_to_dvobj(padapter);
DBG_871X("====> autoresume_enter \n");
if(rf_off == pwrpriv->rf_pwrstate )
{
pwrpriv->ps_flag = _FALSE;
#ifndef CONFIG_BT_COEXIST
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,33))
if (usb_autopm_get_interface(dvobj->pusbintf) < 0)
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,33))
if (usb_autopm_get_interface(dvobj->pusbintf) < 0)
{
DBG_871X( "can't get autopm: %d\n", result);
result = _FAIL;
goto error_exit;
}
#elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,20))
}
#elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,20))
usb_autopm_disable(dvobj->pusbintf);
#else
usb_autoresume_device(dvobj->pusbdev, 1);
@ -1225,18 +1225,18 @@ int autoresume_enter(struct adapter* padapter)
DBG_871X("...pm_usage_cnt(%d).....\n", atomic_read(&(dvobj->pusbintf->pm_usage_cnt)));
#else
DBG_871X("...pm_usage_cnt(%d).....\n", dvobj->pusbintf->pm_usage_cnt);
#endif
#endif
#else //#ifndef CONFIG_BT_COEXIST
pwrpriv->bAutoResume=_TRUE;
pwrpriv->bAutoResume=_TRUE;
if(0==pwrpriv->autopm_cnt){
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,33))
if (usb_autopm_get_interface(dvobj->pusbintf) < 0)
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,33))
if (usb_autopm_get_interface(dvobj->pusbintf) < 0)
{
DBG_871X( "can't get autopm: %d\n", result);
result = _FAIL;
goto error_exit;
}
#elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,20))
}
#elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,20))
usb_autopm_disable(dvobj->pusbintf);
#else
usb_autoresume_device(dvobj->pusbdev, 1);
@ -1245,15 +1245,15 @@ int autoresume_enter(struct adapter* padapter)
DBG_871X("...pm_usage_cnt(%d).....\n", atomic_read(&(dvobj->pusbintf->pm_usage_cnt)));
#else
DBG_871X("...pm_usage_cnt(%d).....\n", dvobj->pusbintf->pm_usage_cnt);
#endif
#endif
pwrpriv->autopm_cnt++;
}
else
DBG_871X("0!=pwrpriv->autopm_cnt[%d] didn't usb_autopm_get_interface\n",pwrpriv->autopm_cnt);
#endif //#ifndef CONFIG_BT_COEXIST
}
}
DBG_871X("<==== autoresume_enter \n");
error_exit:
error_exit:
return result;
}
@ -1299,7 +1299,7 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
}
padapter->dvobj = dvobj;
dvobj->if1 = padapter;
padapter->bDriverStopped=_TRUE;
dvobj->padapters[dvobj->iface_nums++] = padapter;
@ -1308,7 +1308,7 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
#if defined(CONFIG_CONCURRENT_MODE) || defined(CONFIG_DUALMAC_CONCURRENT)
//set adapter_type/iface type for primary padapter
padapter->isprimary = _TRUE;
padapter->adapter_type = PRIMARY_ADAPTER;
padapter->adapter_type = PRIMARY_ADAPTER;
#ifndef CONFIG_HWPORT_SWAP
padapter->iface_type = IFACE_PORT0;
#else
@ -1354,7 +1354,7 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
rtw_hal_chip_configure(padapter);
//step read efuse/eeprom data and get mac_addr
rtw_hal_read_chip_info(padapter);
rtw_hal_read_chip_info(padapter);
//step 5.
if(rtw_init_drv_sw(padapter) ==_FAIL) {
@ -1367,7 +1367,7 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
if(adapter_to_pwrctl(padapter)->bSupportRemoteWakeup)
{
dvobj->pusbdev->do_remote_wakeup=1;
pusb_intf->needs_remote_wakeup = 1;
pusb_intf->needs_remote_wakeup = 1;
device_init_wakeup(&pusb_intf->dev, 1);
DBG_871X("\n pwrctrlpriv.bSupportRemoteWakeup~~~~~~\n");
DBG_871X("\n pwrctrlpriv.bSupportRemoteWakeup~~~[%d]~~~\n",device_may_wakeup(&pusb_intf->dev));
@ -1378,11 +1378,11 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
#ifdef CONFIG_AUTOSUSPEND
if( padapter->registrypriv.power_mgnt != PS_MODE_ACTIVE )
{
if(padapter->registrypriv.usbss_enable ){ /* autosuspend (2s delay) */
if(padapter->registrypriv.usbss_enable ){ /* autosuspend (2s delay) */
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,38))
dvobj->pusbdev->dev.power.autosuspend_delay = 0 * HZ;//15 * HZ; idle-delay time
dvobj->pusbdev->dev.power.autosuspend_delay = 0 * HZ;//15 * HZ; idle-delay time
#else
dvobj->pusbdev->autosuspend_delay = 0 * HZ;//15 * HZ; idle-delay time
dvobj->pusbdev->autosuspend_delay = 0 * HZ;//15 * HZ; idle-delay time
#endif
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35))
@ -1398,13 +1398,13 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
DBG_871X("%s...pm_usage_cnt(%d).....\n",__FUNCTION__,atomic_read(&(dvobj->pusbintf ->pm_usage_cnt)));
#else
DBG_871X("%s...pm_usage_cnt(%d).....\n",__FUNCTION__,dvobj->pusbintf ->pm_usage_cnt);
#endif
#endif
}
}
}
#endif
//2012-07-11 Move here to prevent the 8723AS-VAU BT auto suspend influence
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,33))
if (usb_autopm_get_interface(pusb_intf) < 0)
//2012-07-11 Move here to prevent the 8723AS-VAU BT auto suspend influence
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,33))
if (usb_autopm_get_interface(pusb_intf) < 0)
{
DBG_871X( "can't get autopm: \n");
}
@ -1498,8 +1498,8 @@ static void rtw_usb_if1_deinit(struct adapter *if1)
#ifdef CONFIG_BT_COEXIST
if(1 == pwrctl->autopm_cnt){
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,33))
usb_autopm_put_interface(adapter_to_dvobj(if1)->pusbintf);
#elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,20))
usb_autopm_put_interface(adapter_to_dvobj(if1)->pusbintf);
#elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,20))
usb_autopm_enable(adapter_to_dvobj(if1)->pusbintf);
#else
usb_autosuspend_device(adapter_to_dvobj(if1)->pusbdev, 1);
@ -1526,11 +1526,11 @@ static void dump_usb_interface(struct usb_interface *usb_intf)
u8 val8;
struct usb_device *udev = interface_to_usbdev(usb_intf);
struct usb_device_descriptor *dev_desc = &udev->descriptor;
struct usb_device_descriptor *dev_desc = &udev->descriptor;
struct usb_host_config *act_conf = udev->actconfig;
struct usb_config_descriptor *act_conf_desc = &act_conf->desc;
struct usb_host_interface *host_iface;
struct usb_interface_descriptor *iface_desc;
struct usb_host_endpoint *host_endp;
@ -1553,7 +1553,7 @@ static void dump_usb_interface(struct usb_interface *usb_intf)
DBG_871X("iSerialNumber:0x%02x\n", dev_desc->iSerialNumber);
DBG_871X("bNumConfigurations:%u\n", dev_desc->bNumConfigurations);
#endif
#if 1 /* The acting usb_config_descriptor */
DBG_871X("\nact_conf_desc:%p\n", act_conf_desc);
@ -1626,7 +1626,7 @@ static void dump_usb_interface(struct usb_interface *usb_intf)
//pdvobjpriv->ep_num[i] = RT_usb_endpoint_num(pendp_desc);
}
}
//DBG_871X("nr_endpoint=%d, in_num=%d, out_num=%d\n\n", pdvobjpriv->nr_endpoint, pdvobjpriv->RtNumInPipes, pdvobjpriv->RtNumOutPipes);
#endif
@ -1669,10 +1669,10 @@ static int rtw_drv_init(struct usb_interface *pusb_intf, const struct usb_device
#ifdef CONFIG_CONCURRENT_MODE
if((if2 = rtw_drv_if2_init(if1, usb_set_intf_ops)) == NULL) {
goto free_if1;
}
}
#endif
#ifdef CONFIG_INTEL_PROXIM
#ifdef CONFIG_INTEL_PROXIM
rtw_sw_export=if1;
#endif
@ -1738,8 +1738,8 @@ _func_enter_;
DBG_871X("+rtw_dev_remove\n");
RT_TRACE(_module_hci_intfs_c_,_drv_err_,("+dev_remove()\n"));
dvobj->processing_dev_remove = _TRUE;
rtw_unregister_netdevs(dvobj);
rtw_unregister_netdevs(dvobj);
if(usb_drv->drv_registered == _TRUE)
{
//DBG_871X("r871xu_dev_remove():padapter->bSurpriseRemoved == _TRUE\n");
@ -1775,7 +1775,7 @@ _func_enter_;
DBG_871X("-r871xu_dev_remove, done\n");
#ifdef CONFIG_INTEL_PROXIM
#ifdef CONFIG_INTEL_PROXIM
rtw_sw_export=NULL;
#endif
@ -1784,7 +1784,7 @@ _func_exit_;
return;
}
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24))
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24))
extern int console_suspend_enabled;
#endif
@ -1799,18 +1799,18 @@ static int __init rtw_drv_entry(void)
#endif
#ifdef CONFIG_PLATFORM_ARM_SUNxI
int ret = 0;
/* ----------get usb_wifi_usbc_num------------- */
ret = script_parser_fetch("usb_wifi_para", "usb_wifi_usbc_num", (int *)&usb_wifi_host, 64);
if(ret != 0){
DBG_8192C("ERR: script_parser_fetch usb_wifi_usbc_num failed\n");
ret = -ENOMEM;
return ret;
}
DBG_8192C("sw_usb_enable_hcd: usbc_num = %d\n", usb_wifi_host);
/* ----------get usb_wifi_usbc_num------------- */
ret = script_parser_fetch("usb_wifi_para", "usb_wifi_usbc_num", (int *)&usb_wifi_host, 64);
if(ret != 0){
DBG_8192C("ERR: script_parser_fetch usb_wifi_usbc_num failed\n");
ret = -ENOMEM;
return ret;
}
DBG_8192C("sw_usb_enable_hcd: usbc_num = %d\n", usb_wifi_host);
sw_usb_enable_hcd(usb_wifi_host);
#endif //CONFIG_PLATFORM_ARM_SUNxI
#if defined CONFIG_PLATFORM_ARM_SUN6I
#if defined CONFIG_PLATFORM_ARM_SUN6I
script_item_value_type_e type;
type = script_get_item("wifi_para", "wifi_usbc_id", &item);
@ -1822,7 +1822,7 @@ static int __init rtw_drv_entry(void)
printk("sw_usb_enable_hcd: usbc_num = %d\n", item.val);
wifi_pm_power(1);
mdelay(10);
sw_usb_enable_hcd(item.val);
#endif // defined CONFIG_PLATFORM_ARM_SUN6I
@ -1830,8 +1830,8 @@ static int __init rtw_drv_entry(void)
DBG_871X(DRV_NAME " driver version=%s\n", DRIVERVERSION);
DBG_871X("build time: %s %s\n", __DATE__, __TIME__);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24))
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24))
//console_suspend_enabled=0;
#endif
@ -1844,7 +1844,7 @@ static int __init rtw_drv_entry(void)
static void __exit rtw_drv_halt(void)
{
RT_TRACE(_module_hci_intfs_c_,_drv_err_,("+rtw_drv_halt\n"));
DBG_871X("+rtw_drv_halt\n");
DBG_871X("+rtw_drv_halt\n");
usb_drv->drv_registered = _FALSE;
usb_deregister(&usb_drv->usbdrv);
@ -1869,11 +1869,10 @@ static void __exit rtw_drv_halt(void)
module_init(rtw_drv_entry);
module_exit(rtw_drv_halt);
#ifdef CONFIG_INTEL_PROXIM
#ifdef CONFIG_INTEL_PROXIM
struct adapter *rtw_usb_get_sw_pointer(void)
{
return rtw_sw_export;
}
EXPORT_SYMBOL(rtw_usb_get_sw_pointer);
#endif //CONFIG_INTEL_PROXIM

File diff suppressed because it is too large Load diff

View file

@ -1,7 +1,7 @@
/******************************************************************************
*
* 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.
@ -46,28 +46,28 @@ _func_enter_;
pfile->pkt_len = pfile->buf_len = pktptr->len;
pfile->cur_buffer = pfile->buf_start ;
_func_exit_;
}
uint _rtw_pktfile_read (struct pkt_file *pfile, u8 *rmem, uint rlen)
{
{
uint len = 0;
_func_enter_;
len = rtw_remainder_len(pfile);
len = (rlen > len)? len: rlen;
len = (rlen > len)? len: rlen;
if(rmem)
skb_copy_bits(pfile->pkt, pfile->buf_len-pfile->pkt_len, rmem, len);
pfile->cur_addr += len;
pfile->pkt_len -= len;
_func_exit_;
return len;
_func_exit_;
return len;
}
sint rtw_endofpktfile(struct pkt_file *pfile)
@ -90,10 +90,10 @@ void rtw_set_tx_chksum_offload(_pkt *pkt, struct pkt_attrib *pattrib)
#ifdef CONFIG_TCP_CSUM_OFFLOAD_TX
struct sk_buff *skb = (struct sk_buff *)pkt;
pattrib->hw_tcp_csum = 0;
if (skb->ip_summed == CHECKSUM_PARTIAL) {
if (skb_shinfo(skb)->nr_frags == 0)
{
{
const struct iphdr *ip = ip_hdr(skb);
if (ip->protocol == IPPROTO_TCP) {
// TCP checksum offload by HW
@ -102,7 +102,7 @@ void rtw_set_tx_chksum_offload(_pkt *pkt, struct pkt_attrib *pattrib)
//skb_checksum_help(skb);
} else if (ip->protocol == IPPROTO_UDP) {
//DBG_871X("CHECKSUM_PARTIAL UDP\n");
#if 1
#if 1
skb_checksum_help(skb);
#else
// Set UDP checksum = 0 to skip checksum check
@ -116,11 +116,11 @@ void rtw_set_tx_chksum_offload(_pkt *pkt, struct pkt_attrib *pattrib)
}
else { // IP fragmentation case
DBG_871X("%s-%d nr_frags != 0, using skb_checksum_help(skb);!!\n", __FUNCTION__, __LINE__);
skb_checksum_help(skb);
}
skb_checksum_help(skb);
}
}
#endif
#endif
}
int rtw_os_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *pxmitbuf,u32 alloc_sz)
@ -136,7 +136,7 @@ int rtw_os_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *pxmitb
if(pxmitbuf->pallocated_buf == NULL)
return _FAIL;
#else // CONFIG_USE_USB_BUFFER_ALLOC_TX
pxmitbuf->pallocated_buf = rtw_zmalloc(alloc_sz);
if (pxmitbuf->pallocated_buf == NULL)
{
@ -149,15 +149,15 @@ int rtw_os_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *pxmitb
#endif // CONFIG_USE_USB_BUFFER_ALLOC_TX
for(i=0; i<8; i++)
{
pxmitbuf->pxmit_urb[i] = usb_alloc_urb(0, GFP_KERNEL);
if(pxmitbuf->pxmit_urb[i] == NULL)
{
DBG_871X("pxmitbuf->pxmit_urb[i]==NULL");
return _FAIL;
}
}
{
pxmitbuf->pxmit_urb[i] = usb_alloc_urb(0, GFP_KERNEL);
if(pxmitbuf->pxmit_urb[i] == NULL)
{
DBG_871X("pxmitbuf->pxmit_urb[i]==NULL");
return _FAIL;
}
}
#endif
#if defined(CONFIG_PCI_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
pxmitbuf->pallocated_buf = rtw_zmalloc(alloc_sz);
@ -169,7 +169,7 @@ int rtw_os_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *pxmitb
pxmitbuf->pbuf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pxmitbuf->pallocated_buf), XMITBUF_ALIGN_SZ);
#endif
return _SUCCESS;
return _SUCCESS;
}
void rtw_os_xmit_resource_free(struct adapter *padapter, struct xmit_buf *pxmitbuf,u32 free_sz)
@ -268,7 +268,7 @@ void rtw_os_xmit_schedule(struct adapter *padapter)
_enter_critical_bh(&pxmitpriv->lock, &irqL);
if(rtw_txframes_pending(padapter))
if(rtw_txframes_pending(padapter))
{
tasklet_hi_schedule(&pxmitpriv->xmit_tasklet);
}
@ -325,7 +325,7 @@ static int rtw_mlcst2unicst(struct adapter *padapter, struct sk_buff *skb)
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL);
phead = &pstapriv->asoc_list;
plist = get_next(phead);
//free sta asoc_queue
while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) {
int stainfo_offset;
@ -342,9 +342,9 @@ static int rtw_mlcst2unicst(struct adapter *padapter, struct sk_buff *skb)
for (i = 0; i < chk_alive_num; i++) {
psta = rtw_get_stainfo_by_offset(pstapriv, chk_alive_list[i]);
if(!(psta->state &_FW_LINKED))
continue;
/* avoid come from STA1 and send back STA1 */
continue;
/* avoid come from STA1 and send back STA1 */
if (_rtw_memcmp(psta->hwaddr, &skb->data[6], 6) == _TRUE
|| _rtw_memcmp(psta->hwaddr, null_addr, 6) == _TRUE
|| _rtw_memcmp(psta->hwaddr, bc_addr, 6) == _TRUE
@ -382,7 +382,7 @@ 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;
#endif // CONFIG_TX_MCAST2UNI
#endif // CONFIG_TX_MCAST2UNI
s32 res = 0;
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35))
u16 queue;
@ -419,8 +419,8 @@ _func_enter_;
//DBG_871X("Stop M2U(%d, %d)! ", pxmitpriv->free_xmitframe_cnt, pxmitpriv->free_xmitbuf_cnt);
//DBG_871X("!m2u );
}
}
#endif // CONFIG_TX_MCAST2UNI
}
#endif // CONFIG_TX_MCAST2UNI
res = rtw_xmit(padapter, &pkt);
if (res < 0) {
@ -452,4 +452,3 @@ int rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev)
rtw_mstat_update(MSTAT_TYPE_SKB, MSTAT_ALLOC_SUCCESS, pkt->truesize);
return _rtw_xmit_entry(pkt, pnetdev);
}