Skip to content

Commit ce9347a

Browse files
authored
Merge pull request #1488 from fran6co/rtl
[8192cu] Fixes
2 parents 627f91a + 57336b0 commit ce9347a

File tree

14 files changed

+67
-33
lines changed

14 files changed

+67
-33
lines changed

drivers/net/wireless/realtek/rtl8192cu/Makefile

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,37 @@
11
EXTRA_CFLAGS += $(USER_EXTRA_CFLAGS)
22
EXTRA_CFLAGS += -O1
33
#EXTRA_CFLAGS += -O3
4-
#EXTRA_CFLAGS += -Wall
5-
#EXTRA_CFLAGS += -Wextra
4+
EXTRA_CFLAGS += -Wall
5+
EXTRA_CFLAGS += -Wextra
66
#EXTRA_CFLAGS += -Werror
77
#EXTRA_CFLAGS += -pedantic
88
#EXTRA_CFLAGS += -Wshadow -Wpointer-arith -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes
99

10+
# The "$(call cc-option,-Wxxx)" macro only includes that option when it's
11+
# supported by the compiler used. It may only work on Debian systems.
12+
13+
# Wdate-time was added in gcc-4.9
14+
EXTRA_CFLAGS += $(call cc-option,-Werror=date-time)
15+
# Wincompatible-pointer-types was added in gcc-5.0
16+
EXTRA_CFLAGS += $(call cc-option,-Werror=incompatible-pointer-types)
17+
1018
EXTRA_CFLAGS += -Wno-unused-variable
1119
EXTRA_CFLAGS += -Wno-unused-value
1220
EXTRA_CFLAGS += -Wno-unused-label
1321
EXTRA_CFLAGS += -Wno-unused-parameter
1422
EXTRA_CFLAGS += -Wno-unused-function
1523
EXTRA_CFLAGS += -Wno-unused
1624

17-
EXTRA_CFLAGS += -Wno-uninitialized
25+
# Relax some warnings from '-Wextra' so we won't get flooded with warnings
26+
EXTRA_CFLAGS += -Wno-sign-compare
27+
EXTRA_CFLAGS += -Wno-missing-field-initializers
28+
29+
#EXTRA_CFLAGS += -Wno-uninitialized
1830

1931
EXTRA_CFLAGS += -I$(src)/include
2032

33+
EXTRA_LDFLAGS += --strip-debug
34+
2135
CONFIG_AUTOCFG_CP = n
2236

2337
CONFIG_RTL8192C = y

drivers/net/wireless/realtek/rtl8192cu/core/rtw_ap.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ void rtw_add_bcn_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 index, u8 *d
210210
PNDIS_802_11_VARIABLE_IEs pIE;
211211
u8 bmatch = _FALSE;
212212
u8 *pie = pnetwork->IEs;
213-
u8 *p, *dst_ie, *premainder_ie=NULL, *pbackup_remainder_ie=NULL;
213+
u8 *p=NULL, *dst_ie=NULL, *premainder_ie=NULL, *pbackup_remainder_ie=NULL;
214214
u32 i, offset, ielen, ie_offset, remainder_ielen = 0;
215215

216216
for (i = sizeof(NDIS_802_11_FIXED_IEs); i < pnetwork->IELength;)
@@ -250,6 +250,9 @@ void rtw_add_bcn_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 index, u8 *d
250250
dst_ie = (p+ielen);
251251
}
252252

253+
if(dst_ie == NULL)
254+
return;
255+
253256
if(remainder_ielen>0)
254257
{
255258
pbackup_remainder_ie = rtw_malloc(remainder_ielen);
@@ -357,7 +360,7 @@ void expire_timeout_chk(_adapter *padapter)
357360
{
358361
_irqL irqL;
359362
_list *phead, *plist;
360-
u8 updated;
363+
u8 updated = _FALSE;
361364
struct sta_info *psta=NULL;
362365
struct sta_priv *pstapriv = &padapter->stapriv;
363366
u8 chk_alive_num = 0;

drivers/net/wireless/realtek/rtl8192cu/core/rtw_ieee80211.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1859,7 +1859,8 @@ int rtw_action_frame_parse(const u8 *frame, u32 frame_len, u8* category, u8 *act
18591859
{
18601860
const u8 *frame_body = frame + sizeof(struct rtw_ieee80211_hdr_3addr);
18611861
u16 fc;
1862-
u8 c, a;
1862+
u8 c;
1863+
u8 a = ACT_PUBLIC_MAX;
18631864

18641865
fc = le16_to_cpu(((struct rtw_ieee80211_hdr_3addr *)frame)->frame_ctl);
18651866

drivers/net/wireless/realtek/rtl8192cu/core/rtw_mlme_ext.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2454,7 +2454,7 @@ unsigned int OnDeAuth(_adapter *padapter, union recv_frame *precv_frame)
24542454
psta = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe));
24552455
if(psta)
24562456
{
2457-
u8 updated;
2457+
u8 updated = _FALSE;
24582458

24592459
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL);
24602460
if(rtw_is_list_empty(&psta->asoc_list)==_FALSE)
@@ -2548,7 +2548,7 @@ unsigned int OnDisassoc(_adapter *padapter, union recv_frame *precv_frame)
25482548
psta = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe));
25492549
if(psta)
25502550
{
2551-
u8 updated;
2551+
u8 updated = _FALSE;
25522552

25532553
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL);
25542554
if(rtw_is_list_empty(&psta->asoc_list)==_FALSE)
@@ -5663,7 +5663,7 @@ unsigned int on_action_public_p2p(union recv_frame *precv_frame)
56635663

56645664
// Commented by Kurt 20120113
56655665
// Get peer_dev_addr here if peer doesn't issue prov_disc frame.
5666-
if( _rtw_memcmp(pwdinfo->rx_prov_disc_info.peerDevAddr, empty_addr, ETH_ALEN) );
5666+
if( _rtw_memcmp(pwdinfo->rx_prov_disc_info.peerDevAddr, empty_addr, ETH_ALEN) )
56675667
_rtw_memcpy(pwdinfo->rx_prov_disc_info.peerDevAddr, GetAddr2Ptr(pframe), ETH_ALEN);
56685668

56695669
result = process_p2p_group_negotation_req( pwdinfo, frame_body, len );
@@ -11932,7 +11932,7 @@ u8 setkey_hdl(_adapter *padapter, u8 *pbuf)
1193211932
u8 set_stakey_hdl(_adapter *padapter, u8 *pbuf)
1193311933
{
1193411934
u16 ctrl=0;
11935-
u8 cam_id;//cam_entry
11935+
u8 cam_id=0;//cam_entry
1193611936
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
1193711937
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
1193811938
struct set_stakey_parm *pparm = (struct set_stakey_parm *)pbuf;

drivers/net/wireless/realtek/rtl8192cu/core/rtw_p2p.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4896,9 +4896,9 @@ void init_wifidirect_info( _adapter* padapter, enum P2P_ROLE role)
48964896
#endif
48974897
#ifdef CONFIG_CONCURRENT_MODE
48984898
_adapter *pbuddy_adapter = padapter->pbuddy_adapter;
4899-
struct wifidirect_info *pbuddy_wdinfo;
4900-
struct mlme_priv *pbuddy_mlmepriv;
4901-
struct mlme_ext_priv *pbuddy_mlmeext;
4899+
struct wifidirect_info *pbuddy_wdinfo = NULL;
4900+
struct mlme_priv *pbuddy_mlmepriv = NULL;
4901+
struct mlme_ext_priv *pbuddy_mlmeext = NULL;
49024902
#endif
49034903

49044904
pwdinfo = &padapter->wdinfo;

drivers/net/wireless/realtek/rtl8192cu/core/rtw_wlan_util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ void flush_all_cam_entry(_adapter *padapter)
853853
{
854854
struct sta_priv *pstapriv = &padapter->stapriv;
855855
struct sta_info *psta;
856-
u8 cam_id;//cam_entry
856+
u8 cam_id=0;//cam_entry
857857

858858
psta = rtw_get_stainfo(pstapriv, pmlmeinfo->network.MacAddress);
859859
if(psta) {

drivers/net/wireless/realtek/rtl8192cu/core/rtw_xmit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2590,7 +2590,7 @@ struct xmit_frame *rtw_alloc_xmitframe_once(struct xmit_priv *pxmitpriv)
25902590
s32 rtw_free_xmitframe(struct xmit_priv *pxmitpriv, struct xmit_frame *pxmitframe)
25912591
{
25922592
_irqL irqL;
2593-
_queue *queue;
2593+
_queue *queue = NULL;
25942594
_adapter *padapter = pxmitpriv->adapter;
25952595
_pkt *pndis_pkt = NULL;
25962596

drivers/net/wireless/realtek/rtl8192cu/hal/rtl8192c/rtl8192c_rf6052.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ static void getTxPowerWriteValByRegulatory(
373373
{
374374
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
375375
struct dm_priv *pdmpriv = &pHalData->dmpriv;
376-
u8 i, chnlGroup, pwr_diff_limit[4];
376+
u8 i, chnlGroup = 0, pwr_diff_limit[4];
377377
u32 writeVal, customer_limit, rf;
378378

379379
//
@@ -615,7 +615,7 @@ phy_RF6052_Config_ParaFile(
615615
IN PADAPTER Adapter
616616
)
617617
{
618-
u32 u4RegValue;
618+
u32 u4RegValue=0;
619619
u8 eRFPath;
620620
BB_REGISTER_DEFINITION_T *pPhyReg;
621621

drivers/net/wireless/realtek/rtl8192cu/include/rtw_debug.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,15 +313,15 @@ extern u32 GlobalDebugLevel;
313313
#if defined (_dbgdump)
314314
#undef DBG_871X
315315
// #define DBG_871X _dbgdump
316-
#define DBG_871X(...) LOG_LEVEL(_drv_emerg_ , __VA_ARGS__)
316+
#define DBG_871X(...) LOG_LEVEL(_drv_debug_ , __VA_ARGS__)
317317

318318
#undef MSG_8192C
319319
// #define MSG_8192C _dbgdump
320-
#define MSG_8192C(...) LOG_LEVEL(_drv_emerg_ , __VA_ARGS__)
320+
#define MSG_8192C(...) LOG_LEVEL(_drv_info_ , __VA_ARGS__)
321321

322322
#undef DBG_8192C
323323
// #define DBG_8192C _dbgdump
324-
#define DBG_8192C(...) LOG_LEVEL(_drv_emerg_ , __VA_ARGS__)
324+
#define DBG_8192C(...) LOG_LEVEL(_drv_debug_ , __VA_ARGS__)
325325

326326

327327
#undef WRN_8192C

drivers/net/wireless/realtek/rtl8192cu/os_dep/linux/ioctl_cfg80211.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ struct ieee80211_supported_band *rtw_spt_band_alloc(
221221

222222
void rtw_spt_band_free(struct ieee80211_supported_band *spt_band)
223223
{
224-
u32 size;
224+
u32 size = 0;
225225

226226
if(!spt_band)
227227
return;
@@ -3822,7 +3822,7 @@ static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev
38223822
int ret=0;
38233823
_irqL irqL;
38243824
_list *phead, *plist;
3825-
u8 updated;
3825+
u8 updated = _FALSE;
38263826
struct sta_info *psta = NULL;
38273827
_adapter *padapter = (_adapter *)rtw_netdev_priv(ndev);
38283828
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
@@ -5461,8 +5461,11 @@ int rtw_wdev_alloc(_adapter *padapter, struct device *dev)
54615461
}
54625462
wdev->wiphy = wiphy;
54635463
wdev->netdev = pnetdev;
5464-
//wdev->iftype = NL80211_IFTYPE_STATION;
5465-
wdev->iftype = NL80211_IFTYPE_MONITOR; // for rtw_setopmode_cmd() in cfg80211_rtw_change_iface()
5464+
5465+
wdev->iftype = NL80211_IFTYPE_STATION; // will be init in rtw_hal_init()
5466+
// Must sync with _rtw_init_mlme_priv()
5467+
// pmlmepriv->fw_state = WIFI_STATION_STATE
5468+
//wdev->iftype = NL80211_IFTYPE_MONITOR; // for rtw_setopmode_cmd() in cfg80211_rtw_change_iface()
54665469
padapter->rtw_wdev = wdev;
54675470
pnetdev->ieee80211_ptr = wdev;
54685471

drivers/net/wireless/realtek/rtl8192cu/os_dep/linux/ioctl_linux.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6584,7 +6584,6 @@ static int rtw_dbg_port(struct net_device *dev,
65846584
case 0x01: //dbg mode
65856585
padapter->recvpriv.is_signal_dbg = 1;
65866586
extra_arg = extra_arg>100?100:extra_arg;
6587-
extra_arg = extra_arg<0?0:extra_arg;
65886587
padapter->recvpriv.signal_strength_dbg=extra_arg;
65896588
break;
65906589
}
@@ -6956,7 +6955,7 @@ static int rtw_dbg_port(struct net_device *dev,
69566955
{
69576956
struct registry_priv *pregpriv = &padapter->registrypriv;
69586957
// 0: disable, 0x1:enable (but wifi_spec should be 0), 0x2: force enable (don't care wifi_spec)
6959-
if( pregpriv && extra_arg >= 0 && extra_arg < 3 )
6958+
if( pregpriv && extra_arg < 3 )
69606959
{
69616960
pregpriv->ampdu_enable= extra_arg;
69626961
DBG_871X("set ampdu_enable=%d\n",pregpriv->ampdu_enable);

drivers/net/wireless/realtek/rtl8192cu/os_dep/linux/os_intfs.c

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,14 @@ unsigned int rtw_classify8021d(struct sk_buff *skb)
945945
return dscp >> 5;
946946
}
947947

948-
static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb)
948+
static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb
949+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0)
950+
, void *accel_priv
951+
#endif
952+
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(3,14,0))
953+
, select_queue_fallback_t fallback
954+
#endif
955+
)
949956
{
950957
_adapter *padapter = rtw_netdev_priv(dev);
951958
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
@@ -1056,6 +1063,10 @@ int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname)
10561063
return 0;
10571064
}
10581065

1066+
static const struct device_type wlan_type = {
1067+
.name = "wlan",
1068+
};
1069+
10591070
struct net_device *rtw_init_netdev(_adapter *old_padapter)
10601071
{
10611072
_adapter *padapter;
@@ -1071,6 +1082,7 @@ struct net_device *rtw_init_netdev(_adapter *old_padapter)
10711082
if (!pnetdev)
10721083
return NULL;
10731084

1085+
pnetdev->dev.type = &wlan_type;
10741086
padapter = rtw_netdev_priv(pnetdev);
10751087
padapter->pnetdev = pnetdev;
10761088

@@ -1680,9 +1692,6 @@ int _netdev_vir_if_open(struct net_device *pnetdev)
16801692

16811693
padapter->bup = _TRUE;
16821694
padapter->hw_init_completed = _TRUE;
1683-
1684-
rtw_start_mbssid_cam(padapter);//start mbssid_cam after bup = _TRUE & hw_init_completed = _TRUE
1685-
16861695
}
16871696

16881697
padapter->net_closed = _FALSE;

drivers/net/wireless/realtek/rtl8192cu/os_dep/linux/recv_linux.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ int rtw_os_recvbuf_resource_free(_adapter *padapter, struct recv_buf *precvbuf)
136136
void rtw_handle_tkip_mic_err(_adapter *padapter,u8 bgroup)
137137
{
138138
#ifdef CONFIG_IOCTL_CFG80211
139-
enum nl80211_key_type key_type;
139+
enum nl80211_key_type key_type = 0;
140140
#endif
141141
union iwreq_data wrqu;
142142
struct iw_michaelmicfailure ev;

drivers/net/wireless/realtek/rtl8192cu/os_dep/linux/usb_intf.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ static void rtw_dev_remove(struct usb_interface *pusb_intf);
102102
{USB_DEVICE(0x103C, 0x1629)},/* HP - Lite-On ,8188CUS Slim Combo */ \
103103
{USB_DEVICE(0x2001, 0x3308)},/* D-Link - Alpha */ \
104104
{USB_DEVICE(0x050D, 0x1102)},/* Belkin - Edimax */ \
105+
{USB_DEVICE(0x050D, 0x11F2)},/* ISY - Edimax */ \
105106
{USB_DEVICE(0x2019, 0xAB2A)},/* Planex - Abocom */ \
106107
{USB_DEVICE(0x20F4, 0x648B)},/* TRENDnet - Cameo */ \
107108
{USB_DEVICE(0x4855, 0x0090)},/* - Feixun */ \
@@ -110,13 +111,16 @@ static void rtw_dev_remove(struct usb_interface *pusb_intf);
110111
{USB_DEVICE(0x0BDA, 0x5088)},/* Thinkware - CC&C */ \
111112
{USB_DEVICE(0x4856, 0x0091)},/* NetweeN - Feixun */ \
112113
{USB_DEVICE(0x0846, 0x9041)}, /* Netgear - Cameo */ \
114+
{USB_DEVICE(0x0846, 0x9042)}, /* On Networks - N150MA */ \
115+
{USB_DEVICE(0x0846, 0x9043)}, /* Netgear N150 -WNA1000M */ \
113116
{USB_DEVICE(0x2019, 0x4902)},/* Planex - Etop */ \
114117
{USB_DEVICE(0x2019, 0xAB2E)},/* SW-WF02-AD15 -Abocom */ \
115118
{USB_DEVICE(0x2001, 0x330B)}, /* D-LINK - T&W */ \
116119
{USB_DEVICE(0xCDAB, 0x8010)}, /* - - compare */ \
117120
{USB_DEVICE(0x0B05, 0x17BA)}, /* ASUS - Edimax */ \
118121
{USB_DEVICE(0x0BDA, 0x1E1E)}, /* Intel - - */ \
119122
{USB_DEVICE(0x04BB, 0x094c)}, /* I-O DATA - Edimax */ \
123+
{USB_DEVICE(0X0BDA, 0x8176)}, /* TP-Link TL-WN723N */ \
120124
/****** 8188CTV ********/ \
121125
{USB_DEVICE(0xCDAB, 0x8011)}, /* - - compare */ \
122126
{USB_DEVICE(0x0BDA, 0x0A8A)}, /* Sony - Foxconn */ \
@@ -991,7 +995,7 @@ static int rtw_resume(struct usb_interface *pusb_intf)
991995
int rtw_resume_process(_adapter *padapter)
992996
{
993997
struct net_device *pnetdev;
994-
struct pwrctrl_priv *pwrpriv;
998+
struct pwrctrl_priv *pwrpriv=NULL;
995999
int ret = -1;
9961000
u32 start_time = rtw_get_current_time();
9971001
_func_enter_;
@@ -1054,7 +1058,8 @@ int rtw_resume_process(_adapter *padapter)
10541058
rtw_unlock_suspend();
10551059
#endif //CONFIG_RESUME_IN_WORKQUEUE
10561060

1057-
pwrpriv->bInSuspend = _FALSE;
1061+
if (pwrpriv)
1062+
pwrpriv->bInSuspend = _FALSE;
10581063
DBG_871X("<=== %s return %d.............. in %dms\n", __FUNCTION__
10591064
, ret, rtw_get_passing_time_ms(start_time));
10601065

0 commit comments

Comments
 (0)