Removed following checkpatch.pl warning from mutiple files WARNING: Missing a blank line after declarations Signed-off-by: Pushpendra Singh <pushpendra.singh@xxxxxxxxxxxxxxx> --- drivers/staging/rtl8188eu/core/rtw_debug.c | 3 ++- drivers/staging/rtl8188eu/core/rtw_efuse.c | 12 ++++++++++++ drivers/staging/rtl8188eu/core/rtw_ieee80211.c | 4 ++++ drivers/staging/rtl8188eu/core/rtw_led.c | 1 + drivers/staging/rtl8188eu/core/rtw_mlme.c | 3 +++ drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 11 +++++++++++ drivers/staging/rtl8188eu/core/rtw_pwrctrl.c | 3 +++ drivers/staging/rtl8188eu/core/rtw_recv.c | 14 +++++++++++--- drivers/staging/rtl8188eu/core/rtw_security.c | 18 ++++++++++++++++++ drivers/staging/rtl8188eu/core/rtw_sreset.c | 1 + drivers/staging/rtl8188eu/core/rtw_sta_mgt.c | 1 + drivers/staging/rtl8188eu/core/rtw_wlan_util.c | 4 ++++ drivers/staging/rtl8188eu/core/rtw_xmit.c | 3 +++ 13 files changed, 74 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_debug.c b/drivers/staging/rtl8188eu/core/rtw_debug.c index bc3fe10..4b9045d 100644 --- a/drivers/staging/rtl8188eu/core/rtw_debug.c +++ b/drivers/staging/rtl8188eu/core/rtw_debug.c @@ -217,8 +217,8 @@ int proc_get_ht_option(char *page, char **start, struct net_device *dev = data; struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); - int len = 0; + len += snprintf(page + len, count - len, "ht_option=%d\n", pmlmepriv->htpriv.ht_option); *eof = 1; return len; @@ -588,6 +588,7 @@ int proc_set_rx_signal(struct file *file, const char __user *buffer, if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) { int num = sscanf(tmp, "%u %u", &is_signal_dbg, &signal_strength); + is_signal_dbg = is_signal_dbg == 0 ? 0 : 1; if (is_signal_dbg && num != 2) return count; diff --git a/drivers/staging/rtl8188eu/core/rtw_efuse.c b/drivers/staging/rtl8188eu/core/rtw_efuse.c index 8816d11..e15112b 100644 --- a/drivers/staging/rtl8188eu/core/rtw_efuse.c +++ b/drivers/staging/rtl8188eu/core/rtw_efuse.c @@ -260,6 +260,7 @@ static void efuse_read_phymap_from_txpktbuf( u8 lenc[2]; u16 lenbak, aaabak; u16 aaa; + lenc[0] = usb_read8(adapter, REG_PKTBUF_DBG_DATA_L); lenc[1] = usb_read8(adapter, REG_PKTBUF_DBG_DATA_L+1); @@ -331,6 +332,7 @@ void EFUSE_GetEfuseDefinition(struct adapter *pAdapter, u8 efuseType, u8 type, v case TYPE_EFUSE_MAX_SECTION: { u8 *pMax_section; + pMax_section = pOut; *pMax_section = EFUSE_MAX_SECTION_88E; } @@ -338,6 +340,7 @@ void EFUSE_GetEfuseDefinition(struct adapter *pAdapter, u8 efuseType, u8 type, v case TYPE_EFUSE_REAL_CONTENT_LEN: { u16 *pu2Tmp; + pu2Tmp = pOut; *pu2Tmp = EFUSE_REAL_CONTENT_LEN_88E; } @@ -345,6 +348,7 @@ void EFUSE_GetEfuseDefinition(struct adapter *pAdapter, u8 efuseType, u8 type, v case TYPE_EFUSE_CONTENT_LEN_BANK: { u16 *pu2Tmp; + pu2Tmp = pOut; *pu2Tmp = EFUSE_REAL_CONTENT_LEN_88E; } @@ -352,6 +356,7 @@ void EFUSE_GetEfuseDefinition(struct adapter *pAdapter, u8 efuseType, u8 type, v case TYPE_AVAILABLE_EFUSE_BYTES_BANK: { u16 *pu2Tmp; + pu2Tmp = pOut; *pu2Tmp = (u16)(EFUSE_REAL_CONTENT_LEN_88E-EFUSE_OOB_PROTECT_BYTES_88E); } @@ -359,6 +364,7 @@ void EFUSE_GetEfuseDefinition(struct adapter *pAdapter, u8 efuseType, u8 type, v case TYPE_AVAILABLE_EFUSE_BYTES_TOTAL: { u16 *pu2Tmp; + pu2Tmp = pOut; *pu2Tmp = (u16)(EFUSE_REAL_CONTENT_LEN_88E-EFUSE_OOB_PROTECT_BYTES_88E); } @@ -366,6 +372,7 @@ void EFUSE_GetEfuseDefinition(struct adapter *pAdapter, u8 efuseType, u8 type, v case TYPE_EFUSE_MAP_LEN: { u16 *pu2Tmp; + pu2Tmp = pOut; *pu2Tmp = (u16)EFUSE_MAP_LEN_88E; } @@ -373,6 +380,7 @@ void EFUSE_GetEfuseDefinition(struct adapter *pAdapter, u8 efuseType, u8 type, v case TYPE_EFUSE_PROTECT_BYTES_BANK: { u8 *pu1Tmp; + pu1Tmp = pOut; *pu1Tmp = (u8)(EFUSE_OOB_PROTECT_BYTES_88E); } @@ -380,6 +388,7 @@ void EFUSE_GetEfuseDefinition(struct adapter *pAdapter, u8 efuseType, u8 type, v default: { u8 *pu1Tmp; + pu1Tmp = pOut; *pu1Tmp = 0; } @@ -642,6 +651,7 @@ static bool hal_EfusePgPacketWrite2ByteHeader(struct adapter *pAdapter, u8 efuse continue; } else if (pg_header != tmp_header) { /* offset PG fail */ struct pgpkt fixPkt; + fixPkt.offset = ((pg_header_temp & 0xE0) >> 5) | ((tmp_header & 0xF0) >> 1); fixPkt.word_en = tmp_header & 0x0F; fixPkt.word_cnts = Efuse_CalculateWordCnts(fixPkt.word_en); @@ -684,6 +694,7 @@ static bool hal_EfusePgPacketWrite1ByteHeader(struct adapter *pAdapter, u8 efuse bRet = true; } else { struct pgpkt fixPkt; + fixPkt.offset = (tmp_header>>4) & 0x0F; fixPkt.word_en = tmp_header & 0x0F; fixPkt.word_cnts = Efuse_CalculateWordCnts(fixPkt.word_en); @@ -898,6 +909,7 @@ bool Efuse_PgPacketWrite(struct adapter *pAdapter, u8 offset, u8 word_en, u8 *pD u8 Efuse_CalculateWordCnts(u8 word_en) { u8 word_cnts = 0; + if (!(word_en & BIT(0))) word_cnts++; /* 0 : write enable */ if (!(word_en & BIT(1))) diff --git a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c index f2c3ca7..6473d60 100644 --- a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c +++ b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c @@ -77,6 +77,7 @@ int rtw_get_bit_value_from_ieee_value(u8 val) 72, 96, 108, 0}; /* last element must be zero!! */ int i = 0; + while (dot11_rate_table[i] != 0) { if (dot11_rate_table[i] == val) return BIT(i); @@ -219,6 +220,7 @@ u8 *rtw_get_ie(u8 *pbuf, int index, int *len, int limit) { int tmp, i; u8 *p; + if (limit < 1) return NULL; @@ -359,6 +361,7 @@ void rtw_set_supported_rate(u8 *SupportedRates, uint mode) uint rtw_get_rateset_len(u8 *rateset) { uint i = 0; + while (1) { if ((rateset[i]) == 0) break; @@ -1187,6 +1190,7 @@ static int rtw_get_cipher_info(struct wlan_network *pnetwork) unsigned char *pbuf; int group_cipher = 0, pairwise_cipher = 0, is8021x = 0; int ret = _FAIL; + pbuf = rtw_get_wpa_ie(&pnetwork->network.IEs[12], &wpa_ielen, pnetwork->network.IELength-12); if (pbuf && (wpa_ielen > 0)) { diff --git a/drivers/staging/rtl8188eu/core/rtw_led.c b/drivers/staging/rtl8188eu/core/rtw_led.c index 1b8264b..2b4c268 100644 --- a/drivers/staging/rtl8188eu/core/rtw_led.c +++ b/drivers/staging/rtl8188eu/core/rtw_led.c @@ -40,6 +40,7 @@ void BlinkTimerCallback(void *data) void BlinkWorkItemCallback(struct work_struct *work) { struct LED_871x *pLed = container_of(work, struct LED_871x, BlinkWorkItem); + BlinkHandler(pLed); } diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme.c b/drivers/staging/rtl8188eu/core/rtw_mlme.c index d4632da..4eb5019 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme.c @@ -688,6 +688,7 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf) } } else { int s_ret; + set_fwstate(pmlmepriv, _FW_UNDER_LINKING); pmlmepriv->to_join = false; s_ret = rtw_select_and_join_from_scanned_queue(pmlmepriv); @@ -1277,6 +1278,7 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf) if (mac_id >= 0) { u16 media_status; + media_status = (mac_id<<8)|0; /* MACID|OPMODE:0 means disconnect */ /* for STA, AP, ADHOC mode, report disconnect stauts to FW */ rtw_hal_set_hwreg(adapter, HW_VAR_H2C_MEDIA_STATUS_RPT, (u8 *)&media_status); @@ -1560,6 +1562,7 @@ int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv) rtw_hal_get_def_var(adapter, HAL_DEF_IS_SUPPORT_ANT_DIV, &(supp_ant_div)); if (supp_ant_div) { u8 cur_ant; + rtw_hal_get_def_var(adapter, HAL_DEF_CURRENT_ANTENNA, &(cur_ant)); DBG_88E("#### Opt_Ant_(%s), cur_Ant(%s)\n", (2 == candidate->network.PhyInfo.Optimum_antenna) ? "A" : "B", diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c index cd12dd7..faeeeb9 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c @@ -183,6 +183,7 @@ static struct rt_channel_plan_map RTW_CHANNEL_PLAN_MAP_REALTEK_DEFINE = {0x03}; int rtw_ch_set_search_ch(struct rt_channel_info *ch_set, const u32 ch) { int i; + for (i = 0; ch_set[i].ChannelNum != 0; i++) { if (ch == ch_set[i].ChannelNum) break; @@ -1706,6 +1707,7 @@ static unsigned int on_action_public_p2p(struct recv_frame *precv_frame) u8 *pframe = precv_frame->rx_data; u8 *frame_body; u8 dialogToken = 0; + frame_body = (unsigned char *)(pframe + sizeof(struct rtw_ieee80211_hdr_3addr)); dialogToken = frame_body[7]; @@ -2024,6 +2026,7 @@ void issue_beacon(struct adapter *padapter, int timeout_ms) u8 *wps_ie; uint wps_ielen; u8 sr = 0; + memcpy(pframe, cur_network->IEs, cur_network->IELength); len_diff = update_hidden_ssid( pframe+_BEACON_IE_OFFSET_ @@ -2480,6 +2483,7 @@ void issue_auth(struct adapter *padapter, struct sta_info *psta, unsigned short } else { __le32 le_tmp32; __le16 le_tmp16; + memcpy(pwlanhdr->addr1, pnetwork->MacAddress, ETH_ALEN); memcpy(pwlanhdr->addr2, myid(&padapter->eeprompriv), ETH_ALEN); memcpy(pwlanhdr->addr3, pnetwork->MacAddress, ETH_ALEN); @@ -3251,6 +3255,7 @@ void issue_action_spct_ch_switch(struct adapter *padapter, u8 *ra, u8 new_ch, u8 /* category, action */ { u8 category, action; + category = RTW_WLAN_CATEGORY_SPECTRUM_MGMT; action = RTW_WLAN_ACTION_SPCT_CHL_SWITCH; @@ -3647,6 +3652,7 @@ void site_survey(struct adapter *padapter) if (ScanType == SCAN_ACTIVE) { /* obey the channel plan setting... */ int i; + for (i = 0; i < RTW_SSID_SCAN_AMOUNT; i++) { if (pmlmeext->sitesurvey_res.ssid[i].SsidLength) { /* todo: to issue two probe req??? */ @@ -3834,6 +3840,7 @@ u8 collect_bss_info(struct adapter *padapter, struct recv_frame *precv_frame, st p = rtw_get_ie(bssid->IEs + ie_offset, _HT_ADD_INFO_IE_, &len, bssid->IELength - ie_offset); if (p) { struct HT_info_element *HT_info = (struct HT_info_element *)(p + 2); + bssid->Configuration.DSConfig = HT_info->primary_channel; } else { /* use current channel */ bssid->Configuration.DSConfig = rtw_get_oper_ch(padapter); @@ -3871,9 +3878,11 @@ u8 collect_bss_info(struct adapter *padapter, struct recv_frame *precv_frame, st /* 20/40 BSS Coexistence check */ if ((pregistrypriv->wifi_spec == 1) && (!pmlmeinfo->bwmode_updated)) { struct mlme_priv *pmlmepriv = &padapter->mlmepriv; + p = rtw_get_ie(bssid->IEs + ie_offset, _HT_CAPABILITY_IE_, &len, bssid->IELength - ie_offset); if (p && len > 0) { struct HT_caps_element *pHT_caps; + pHT_caps = (struct HT_caps_element *)(p + 2); if (le16_to_cpu(pHT_caps->u.HT_cap_element.HT_caps_info)&BIT(14)) @@ -3897,6 +3906,7 @@ void start_create_ibss(struct adapter *padapter) struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); struct wlan_bssid_ex *pnetwork = (struct wlan_bssid_ex *)(&(pmlmeinfo->network)); + pmlmeext->cur_channel = (u8)pnetwork->Configuration.DSConfig; pmlmeinfo->bcn_interval = get_beacon_interval(pnetwork); @@ -4695,6 +4705,7 @@ void _linked_rx_signal_strehgth_display(struct adapter *padapter) struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); u8 mac_id; int UndecoratedSmoothedPWDB; + if ((pmlmeinfo->state&0x03) == WIFI_FW_STATION_STATE) mac_id = 0; else if ((pmlmeinfo->state&0x03) == _HW_STATE_AP_) diff --git a/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c b/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c index df463a2..b29e120 100644 --- a/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c +++ b/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c @@ -284,6 +284,7 @@ exit: static void pwr_state_check_handler(void *FunctionContext) { struct adapter *padapter = FunctionContext; + rtw_ps_cmd(padapter); } @@ -550,6 +551,7 @@ void rtw_init_pwrctrl_priv(struct adapter *padapter) inline void rtw_set_ips_deny(struct adapter *padapter, u32 ms) { struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv; + pwrpriv->ips_deny_time = jiffies + msecs_to_jiffies(ms); } @@ -573,6 +575,7 @@ int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *cal { u32 start = jiffies; + if (pwrpriv->ps_processing) { DBG_88E("%s wait ps_processing...\n", __func__); while (pwrpriv->ps_processing && rtw_get_passing_time_ms(start) <= 3000) diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c index bd79e9e..a380338 100644 --- a/drivers/staging/rtl8188eu/core/rtw_recv.c +++ b/drivers/staging/rtl8188eu/core/rtw_recv.c @@ -271,6 +271,7 @@ u32 rtw_free_uc_swdec_pending_queue(struct adapter *adapter) { u32 cnt = 0; struct recv_frame *pending_frame; + while ((pending_frame = rtw_alloc_recvframe(&adapter->recvpriv.uc_swdec_pending_queue))) { rtw_free_recvframe(pending_frame, &adapter->recvpriv.free_recv_queue); DBG_88E("%s: dequeue uc_swdec_pending_queue\n", __func__); @@ -356,6 +357,7 @@ static int recvframe_chkmic(struct adapter *adapter, *(pframemic-10), *(pframemic-9))); { uint i; + RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("\n ======demp packet (len=%d)======\n", precvframe->len)); @@ -434,6 +436,7 @@ static struct recv_frame *decryptor(struct adapter *padapter, if (prxattrib->encrypt > 0) { u8 *iv = precv_frame->rx_data+prxattrib->hdrlen; + prxattrib->key_index = (((iv[3])>>6)&0x3); if (prxattrib->key_index > WEP_KEYS) { @@ -951,6 +954,7 @@ static int sta2ap_data_frame(struct adapter *adapter, } } else { u8 *myhwaddr = myid(&adapter->eeprompriv); + if (memcmp(pattrib->ra, myhwaddr, ETH_ALEN)) { ret = RTW_RX_HANDLED; goto exit; @@ -1269,9 +1273,9 @@ static int validate_recv_frame(struct adapter *adapter, u8 ver = (unsigned char)(*ptr)&0x3; struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv; - if (pmlmeext->sitesurvey_res.state == SCAN_PROCESS) { int ch_set_idx = rtw_ch_set_search_ch(pmlmeext->channel_set, rtw_get_oper_ch(adapter)); + if (ch_set_idx >= 0) pmlmeext->channel_set[ch_set_idx].rx_count++; } @@ -1301,6 +1305,7 @@ static int validate_recv_frame(struct adapter *adapter, rtw_hal_get_def_var(adapter, HAL_DEF_DBG_DUMP_RXPKT, &(bDumpRxPkt)); if (bDumpRxPkt == 1) {/* dump all rx packets */ int i; + DBG_88E("#############################\n"); for (i = 0; i < 64; i = i+8) @@ -1310,6 +1315,7 @@ static int validate_recv_frame(struct adapter *adapter, } else if (bDumpRxPkt == 2) { if (type == WIFI_MGT_TYPE) { int i; + DBG_88E("#############################\n"); for (i = 0; i < 64; i = i+8) @@ -1320,6 +1326,7 @@ static int validate_recv_frame(struct adapter *adapter, } else if (bDumpRxPkt == 3) { if (type == WIFI_DATA_TYPE) { int i; + DBG_88E("#############################\n"); for (i = 0; i < 64; i = i+8) @@ -1347,6 +1354,7 @@ static int validate_recv_frame(struct adapter *adapter, retval = validate_recv_data_frame(adapter, precv_frame); if (retval == _FAIL) { struct recv_priv *precvpriv = &adapter->recvpriv; + precvpriv->rx_drop++; } break; @@ -1524,7 +1532,6 @@ struct recv_frame *recvframe_chk_defrag(struct adapter *padapter, struct recv_frame *prtnframe = NULL; struct __queue *pfree_recv_queue, *pdefrag_q; - pstapriv = &padapter->stapriv; pfhdr = precv_frame; @@ -1539,6 +1546,7 @@ struct recv_frame *recvframe_chk_defrag(struct adapter *padapter, psta = rtw_get_stainfo(pstapriv, psta_addr); if (psta == NULL) { u8 type = GetFrameType(pfhdr->rx_data); + if (type != WIFI_DATA_TYPE) { psta = rtw_get_bcmc_stainfo(padapter); pdefrag_q = &psta->sta_recvpriv.defrag_q; @@ -1623,8 +1631,8 @@ static int amsdu_to_msdu(struct adapter *padapter, struct recv_frame *prframe) struct sk_buff *sub_skb, *subframes[MAX_SUBFRAME_COUNT]; struct recv_priv *precvpriv = &padapter->recvpriv; struct __queue *pfree_recv_queue = &(precvpriv->free_recv_queue); - nr_subframes = 0; + nr_subframes = 0; pattrib = &prframe->attrib; recvframe_pull(prframe, prframe->attrib.hdrlen); diff --git a/drivers/staging/rtl8188eu/core/rtw_security.c b/drivers/staging/rtl8188eu/core/rtw_security.c index bd8d60a..790fa91 100644 --- a/drivers/staging/rtl8188eu/core/rtw_security.c +++ b/drivers/staging/rtl8188eu/core/rtw_security.c @@ -41,6 +41,7 @@ static void arcfour_init(struct arc4context *parc4ctx, u8 *key, u32 key_len) u32 stateindex; u8 *state; u32 counter; + state = parc4ctx->state; parc4ctx->x = 0; parc4ctx->y = 0; @@ -65,6 +66,7 @@ static u32 arcfour_byte(struct arc4context *parc4ctx) u32 y; u32 sx, sy; u8 *state; + state = parc4ctx->state; x = (parc4ctx->x + 1) & 0xff; sx = state[x]; @@ -80,6 +82,7 @@ static u32 arcfour_byte(struct arc4context *parc4ctx) static void arcfour_encrypt(struct arc4context *parc4ctx, u8 *dest, u8 *src, u32 len) { u32 i; + for (i = 0; i < len; i++) dest[i] = src[i] ^ (unsigned char)arcfour_byte(parc4ctx); } @@ -125,6 +128,7 @@ static __le32 getcrc32(u8 *buf, int len) { u8 *p; u32 crc; + if (bcrc32initialized == 0) crc32_init(); @@ -248,6 +252,7 @@ static u32 secmicgetuint32(u8 *p) { s32 i; u32 res = 0; + for (i = 0; i < 4; i++) res |= ((u32)(*p++)) << (8*i); return res; @@ -257,6 +262,7 @@ static void secmicputuint32(u8 *p, u32 val) /* Convert from Us3232 to Byte[] in a portable way */ { long i; + for (i = 0; i < 4; i++) { *p++ = (u8)(val & 0xff); val >>= 8; @@ -334,6 +340,7 @@ void rtw_seccalctkipmic(u8 *key, u8 *header, u8 *data, u32 data_len, u8 *mic_cod { struct mic_data micdata; u8 priority[4] = {0x0, 0x0, 0x0, 0x0}; + rtw_secmicsetkey(&micdata, key); priority[0] = pri; @@ -782,6 +789,7 @@ static void aes128k128d(u8 *key, u8 *data, u8 *ciphertext); static void xor_128(u8 *a, u8 *b, u8 *out) { int i; + for (i = 0; i < 16; i++) out[i] = a[i] ^ b[i]; } @@ -789,6 +797,7 @@ static void xor_128(u8 *a, u8 *b, u8 *out) static void xor_32(u8 *a, u8 *b, u8 *out) { int i; + for (i = 0; i < 4; i++) out[i] = a[i] ^ b[i]; } @@ -824,6 +833,7 @@ static void next_key(u8 *key, int round) static void byte_sub(u8 *in, u8 *out) { int i; + for (i = 0; i < 16; i++) out[i] = sbox(in[i]); } @@ -859,6 +869,7 @@ static void mix_column(u8 *in, u8 *out) u8 rotr[4]; u8 temp[4]; u8 tempb[4]; + for (i = 0 ; i < 4; i++) { if ((in[i] & 0x80) == 0x80) add1b[i] = 0x1b; @@ -911,6 +922,7 @@ static void aes128k128d(u8 *key, u8 *data, u8 *ciphertext) u8 intermediatea[16]; u8 intermediateb[16]; u8 round_key[16]; + for (i = 0; i < 16; i++) round_key[i] = key[i]; for (round = 0; round < 11; round++) { @@ -942,6 +954,7 @@ static void construct_mic_iv(u8 *mic_iv, int qc_exists, int a4_exists, u8 *mpdu, uint payload_length, u8 *pn_vector) { int i; + mic_iv[0] = 0x59; if (qc_exists && a4_exists) mic_iv[1] = mpdu[30] & 0x0f; /* QoS_TC */ @@ -990,6 +1003,7 @@ static void construct_mic_header1(u8 *mic_header1, int header_length, u8 *mpdu) static void construct_mic_header2(u8 *mic_header2, u8 *mpdu, int a4_exists, int qc_exists) { int i; + for (i = 0; i < 16; i++) mic_header2[i] = 0x00; @@ -1031,6 +1045,7 @@ static void construct_mic_header2(u8 *mic_header2, u8 *mpdu, int a4_exists, int static void construct_ctr_preload(u8 *ctr_preload, int a4_exists, int qc_exists, u8 *mpdu, u8 *pn_vector, int c) { int i; + for (i = 0; i < 16; i++) ctr_preload[i] = 0x00; i = 0; @@ -1056,6 +1071,7 @@ static void construct_ctr_preload(u8 *ctr_preload, int a4_exists, int qc_exists, static void bitwise_xor(u8 *ina, u8 *inb, u8 *out) { int i; + for (i = 0; i < 16; i++) out[i] = ina[i] ^ inb[i]; } @@ -1277,6 +1293,7 @@ static int aes_decipher(u8 *key, uint hdrlen, /* uint offset = 0; */ uint frtype = GetFrameType(pframe); uint frsubtype = GetFrameSubType(pframe); + frsubtype = frsubtype>>4; memset((void *)mic_iv, 0, 16); @@ -1458,6 +1475,7 @@ u32 rtw_aes_decrypt(struct adapter *padapter, u8 *precvframe) struct rx_pkt_attrib *prxattrib = &((struct recv_frame *)precvframe)->attrib; struct security_priv *psecuritypriv = &padapter->securitypriv; u32 res = _SUCCESS; + pframe = (unsigned char *)((struct recv_frame *)precvframe)->rx_data; /* 4 start to encrypt each fragment */ if (prxattrib->encrypt == _AES_) { diff --git a/drivers/staging/rtl8188eu/core/rtw_sreset.c b/drivers/staging/rtl8188eu/core/rtw_sreset.c index cd4e344..5ea4216 100644 --- a/drivers/staging/rtl8188eu/core/rtw_sreset.c +++ b/drivers/staging/rtl8188eu/core/rtw_sreset.c @@ -60,5 +60,6 @@ u8 sreset_get_wifi_status(struct adapter *padapter) void sreset_set_wifi_error_status(struct adapter *padapter, u32 status) { struct hal_data_8188e *pHalData = GET_HAL_DATA(padapter); + pHalData->srestpriv.Wifi_Error_Status = status; } diff --git a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c index dc9d0dd..04036c8 100644 --- a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c +++ b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c @@ -187,6 +187,7 @@ u32 _rtw_free_sta_priv(struct sta_priv *pstapriv) while (phead != plist) { int i; + psta = container_of(plist, struct sta_info , hash_list); plist = plist->next; diff --git a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c index a3ffc69..5646b6f 100644 --- a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c +++ b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c @@ -408,6 +408,7 @@ int get_bsstype(unsigned short capability) u16 get_beacon_interval(struct wlan_bssid_ex *bss) { __le16 val; + memcpy((unsigned char *)&val, rtw_get_beacon_interval_from_ie(bss->IEs), 2); return le16_to_cpu(val); @@ -1222,6 +1223,7 @@ unsigned int is_ap_in_wep(struct adapter *padapter) static int wifirate2_ratetbl_inx(unsigned char rate) { int inx = 0; + rate = rate & 0x7f; switch (rate) { @@ -1354,6 +1356,7 @@ void set_sta_rate(struct adapter *padapter, struct sta_info *psta) void update_tx_basic_rate(struct adapter *padapter, u8 wirelessmode) { unsigned char supported_rates[NDIS_802_11_LENGTH_RATES_EX]; + memset(supported_rates, 0, NDIS_802_11_LENGTH_RATES_EX); if ((wirelessmode & WIRELESS_11B) && (wirelessmode == WIRELESS_11B)) @@ -1378,6 +1381,7 @@ unsigned char check_assoc_AP(u8 *pframe, uint len) struct ndis_802_11_var_ie *pIE; u8 epigram_vendor_flag; u8 ralink_vendor_flag; + epigram_vendor_flag = 0; ralink_vendor_flag = 0; diff --git a/drivers/staging/rtl8188eu/core/rtw_xmit.c b/drivers/staging/rtl8188eu/core/rtw_xmit.c index 7a71df1..54a2762 100644 --- a/drivers/staging/rtl8188eu/core/rtw_xmit.c +++ b/drivers/staging/rtl8188eu/core/rtw_xmit.c @@ -318,6 +318,7 @@ static void update_attrib_vcs_info(struct adapter *padapter, struct xmit_frame * /* check HT op mode */ if (pattrib->ht_en) { u8 htopmode = pmlmeinfo->HT_protection; + if ((pmlmeext->cur_bwmode && (htopmode == 2 || htopmode == 3)) || (!pmlmeext->cur_bwmode && htopmode == 3)) { pattrib->vcs_mode = RTS_CTS; @@ -468,6 +469,7 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p /* The following is for DHCP and ARP packet, we use cck1M to tx these packets and let LPS awake some time */ /* to prevent DHCP protocol fail */ u8 tmp[24]; + _rtw_pktfile_read(&pktfile, &tmp[0], 24); pattrib->dhcp_pkt = 0; if (pktfile.pkt_len > 282) {/* MINIMUM_DHCP_PACKET_SIZE) { */ @@ -1665,6 +1667,7 @@ void rtw_free_hwxmits(struct adapter *padapter) void rtw_init_hwxmits(struct hw_xmit *phwxmit, int entry) { int i; + for (i = 0; i < entry; i++, phwxmit++) phwxmit->accnt = 0; } -- 1.9.1 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel