diff options
Diffstat (limited to 'drivers/staging/rtl8192e/rtllib_rx.c')
-rw-r--r-- | drivers/staging/rtl8192e/rtllib_rx.c | 172 |
1 files changed, 87 insertions, 85 deletions
diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index 66c135321da4..6e48b31a9afc 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -449,9 +449,9 @@ drop: static bool AddReorderEntry(struct rx_ts_record *pTS, struct rx_reorder_entry *pReorderEntry) { - struct list_head *pList = &pTS->RxPendingPktList; + struct list_head *pList = &pTS->rx_pending_pkt_list; - while (pList->next != &pTS->RxPendingPktList) { + while (pList->next != &pTS->rx_pending_pkt_list) { if (SN_LESS(pReorderEntry->SeqNum, ((struct rx_reorder_entry *) list_entry(pList->next, struct rx_reorder_entry, List))->SeqNum)) @@ -536,8 +536,8 @@ void rtllib_FlushRxTsPendingPkts(struct rtllib_device *ieee, struct rx_reorder_entry *pRxReorderEntry; u8 RfdCnt = 0; - del_timer_sync(&pTS->RxPktPendingTimer); - while (!list_empty(&pTS->RxPendingPktList)) { + del_timer_sync(&pTS->rx_pkt_pending_timer); + while (!list_empty(&pTS->rx_pending_pkt_list)) { if (RfdCnt >= REORDER_WIN_SIZE) { netdev_info(ieee->dev, "-------------->%s() error! RfdCnt >= REORDER_WIN_SIZE\n", @@ -546,7 +546,7 @@ void rtllib_FlushRxTsPendingPkts(struct rtllib_device *ieee, } pRxReorderEntry = (struct rx_reorder_entry *) - list_entry(pTS->RxPendingPktList.prev, + list_entry(pTS->rx_pending_pkt_list.prev, struct rx_reorder_entry, List); netdev_dbg(ieee->dev, "%s(): Indicate SeqNum %d!\n", __func__, pRxReorderEntry->SeqNum); @@ -560,7 +560,7 @@ void rtllib_FlushRxTsPendingPkts(struct rtllib_device *ieee, } rtllib_indicate_packets(ieee, ieee->RfdArray, RfdCnt); - pTS->RxIndicateSeq = 0xffff; + pTS->rx_indicate_seq = 0xffff; } static void RxReorderIndicatePacket(struct rtllib_device *ieee, @@ -576,21 +576,21 @@ static void RxReorderIndicatePacket(struct rtllib_device *ieee, unsigned long flags; netdev_dbg(ieee->dev, - "%s(): Seq is %d, pTS->RxIndicateSeq is %d, WinSize is %d\n", - __func__, SeqNum, pTS->RxIndicateSeq, WinSize); + "%s(): Seq is %d, pTS->rx_indicate_seq is %d, WinSize is %d\n", + __func__, SeqNum, pTS->rx_indicate_seq, WinSize); spin_lock_irqsave(&(ieee->reorder_spinlock), flags); - WinEnd = (pTS->RxIndicateSeq + WinSize - 1) % 4096; + WinEnd = (pTS->rx_indicate_seq + WinSize - 1) % 4096; /* Rx Reorder initialize condition.*/ - if (pTS->RxIndicateSeq == 0xffff) - pTS->RxIndicateSeq = SeqNum; + if (pTS->rx_indicate_seq == 0xffff) + pTS->rx_indicate_seq = SeqNum; /* Drop out the packet which SeqNum is smaller than WinStart */ - if (SN_LESS(SeqNum, pTS->RxIndicateSeq)) { + if (SN_LESS(SeqNum, pTS->rx_indicate_seq)) { netdev_dbg(ieee->dev, "Packet Drop! IndicateSeq: %d, NewSeq: %d\n", - pTS->RxIndicateSeq, SeqNum); + pTS->rx_indicate_seq, SeqNum); pHTInfo->RxReorderDropCounter++; { int i; @@ -608,18 +608,18 @@ static void RxReorderIndicatePacket(struct rtllib_device *ieee, * 1. Incoming SeqNum is equal to WinStart =>Window shift 1 * 2. Incoming SeqNum is larger than the WinEnd => Window shift N */ - if (SN_EQUAL(SeqNum, pTS->RxIndicateSeq)) { - pTS->RxIndicateSeq = (pTS->RxIndicateSeq + 1) % 4096; + if (SN_EQUAL(SeqNum, pTS->rx_indicate_seq)) { + pTS->rx_indicate_seq = (pTS->rx_indicate_seq + 1) % 4096; bMatchWinStart = true; } else if (SN_LESS(WinEnd, SeqNum)) { if (SeqNum >= (WinSize - 1)) - pTS->RxIndicateSeq = SeqNum + 1 - WinSize; + pTS->rx_indicate_seq = SeqNum + 1 - WinSize; else - pTS->RxIndicateSeq = 4095 - + pTS->rx_indicate_seq = 4095 - (WinSize - (SeqNum + 1)) + 1; netdev_dbg(ieee->dev, "Window Shift! IndicateSeq: %d, NewSeq: %d\n", - pTS->RxIndicateSeq, SeqNum); + pTS->rx_indicate_seq, SeqNum); } /* Indication process. @@ -636,7 +636,7 @@ static void RxReorderIndicatePacket(struct rtllib_device *ieee, /* Current packet is going to be indicated.*/ netdev_dbg(ieee->dev, "Packets indication! IndicateSeq: %d, NewSeq: %d\n", - pTS->RxIndicateSeq, SeqNum); + pTS->rx_indicate_seq, SeqNum); ieee->prxbIndicateArray[0] = prxb; index = 1; } else { @@ -658,7 +658,7 @@ static void RxReorderIndicatePacket(struct rtllib_device *ieee, netdev_dbg(ieee->dev, "%s(): Duplicate packet is dropped. IndicateSeq: %d, NewSeq: %d\n", - __func__, pTS->RxIndicateSeq, + __func__, pTS->rx_indicate_seq, SeqNum); list_add_tail(&pReorderEntry->List, &ieee->RxReorder_Unused_List); @@ -670,7 +670,7 @@ static void RxReorderIndicatePacket(struct rtllib_device *ieee, } else { netdev_dbg(ieee->dev, "Pkt insert into struct buffer. IndicateSeq: %d, NewSeq: %d\n", - pTS->RxIndicateSeq, SeqNum); + pTS->rx_indicate_seq, SeqNum); } } else { /* Packets are dropped if there are not enough reorder @@ -693,16 +693,16 @@ static void RxReorderIndicatePacket(struct rtllib_device *ieee, } /* Check if there is any packet need indicate.*/ - while (!list_empty(&pTS->RxPendingPktList)) { + while (!list_empty(&pTS->rx_pending_pkt_list)) { netdev_dbg(ieee->dev, "%s(): start RREORDER indicate\n", __func__); pReorderEntry = (struct rx_reorder_entry *) - list_entry(pTS->RxPendingPktList.prev, + list_entry(pTS->rx_pending_pkt_list.prev, struct rx_reorder_entry, List); - if (SN_LESS(pReorderEntry->SeqNum, pTS->RxIndicateSeq) || - SN_EQUAL(pReorderEntry->SeqNum, pTS->RxIndicateSeq)) { + if (SN_LESS(pReorderEntry->SeqNum, pTS->rx_indicate_seq) || + SN_EQUAL(pReorderEntry->SeqNum, pTS->rx_indicate_seq)) { /* This protect struct buffer from overflow. */ if (index >= REORDER_WIN_SIZE) { netdev_err(ieee->dev, @@ -714,8 +714,8 @@ static void RxReorderIndicatePacket(struct rtllib_device *ieee, list_del_init(&pReorderEntry->List); - if (SN_EQUAL(pReorderEntry->SeqNum, pTS->RxIndicateSeq)) - pTS->RxIndicateSeq = (pTS->RxIndicateSeq + 1) % + if (SN_EQUAL(pReorderEntry->SeqNum, pTS->rx_indicate_seq)) + pTS->rx_indicate_seq = (pTS->rx_indicate_seq + 1) % 4096; ieee->prxbIndicateArray[index] = pReorderEntry->prxb; @@ -735,9 +735,9 @@ static void RxReorderIndicatePacket(struct rtllib_device *ieee, * Rx buffering. */ if (index > 0) { - if (timer_pending(&pTS->RxPktPendingTimer)) - del_timer_sync(&pTS->RxPktPendingTimer); - pTS->RxTimeoutIndicateSeq = 0xffff; + if (timer_pending(&pTS->rx_pkt_pending_timer)) + del_timer_sync(&pTS->rx_pkt_pending_timer); + pTS->rx_timeout_indicate_seq = 0xffff; if (index > REORDER_WIN_SIZE) { netdev_err(ieee->dev, @@ -751,10 +751,10 @@ static void RxReorderIndicatePacket(struct rtllib_device *ieee, bPktInBuf = false; } - if (bPktInBuf && pTS->RxTimeoutIndicateSeq == 0xffff) { + if (bPktInBuf && pTS->rx_timeout_indicate_seq == 0xffff) { netdev_dbg(ieee->dev, "%s(): SET rx timeout timer\n", __func__); - pTS->RxTimeoutIndicateSeq = pTS->RxIndicateSeq; - mod_timer(&pTS->RxPktPendingTimer, jiffies + + pTS->rx_timeout_indicate_seq = pTS->rx_indicate_seq; + mod_timer(&pTS->rx_pkt_pending_timer, jiffies + msecs_to_jiffies(pHTInfo->RxReorderPendingTime)); } spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags); @@ -938,11 +938,11 @@ static int rtllib_rx_check_duplicate(struct rtllib_device *ieee, if (GetTs(ieee, (struct ts_common_info **) &pRxTS, hdr->addr2, (u8)Frame_QoSTID((u8 *)(skb->data)), RX_DIR, true)) { - if ((fc & (1<<11)) && (frag == pRxTS->RxLastFragNum) && - (WLAN_GET_SEQ_SEQ(sc) == pRxTS->RxLastSeqNum)) + if ((fc & (1<<11)) && (frag == pRxTS->rx_last_frag_num) && + (WLAN_GET_SEQ_SEQ(sc) == pRxTS->rx_last_seq_num)) return -1; - pRxTS->RxLastFragNum = frag; - pRxTS->RxLastSeqNum = WLAN_GET_SEQ_SEQ(sc); + pRxTS->rx_last_frag_num = frag; + pRxTS->rx_last_seq_num = WLAN_GET_SEQ_SEQ(sc); } else { netdev_warn(ieee->dev, "%s(): No TS! Skip the check!\n", __func__); @@ -1850,19 +1850,20 @@ static void rtllib_parse_mife_generic(struct rtllib_device *ieee, *tmp_htcap_len = min_t(u8, info_element->len, MAX_IE_LEN); if (*tmp_htcap_len != 0) { - network->bssht.bdHTSpecVer = HT_SPEC_VER_EWC; - network->bssht.bdHTCapLen = min_t(u16, *tmp_htcap_len, sizeof(network->bssht.bdHTCapBuf)); - memcpy(network->bssht.bdHTCapBuf, + network->bssht.bd_ht_spec_ver = HT_SPEC_VER_EWC; + network->bssht.bd_ht_cap_len = min_t(u16, *tmp_htcap_len, + sizeof(network->bssht.bd_ht_cap_buf)); + memcpy(network->bssht.bd_ht_cap_buf, info_element->data, - network->bssht.bdHTCapLen); + network->bssht.bd_ht_cap_len); } } if (*tmp_htcap_len != 0) { - network->bssht.bdSupportHT = true; - network->bssht.bdHT1R = ((((struct ht_capab_ele *)(network->bssht.bdHTCapBuf))->MCS[1]) == 0); + network->bssht.bd_support_ht = true; + network->bssht.bd_ht_1r = ((((struct ht_capab_ele *)(network->bssht.bd_ht_cap_buf))->MCS[1]) == 0); } else { - network->bssht.bdSupportHT = false; - network->bssht.bdHT1R = false; + network->bssht.bd_support_ht = false; + network->bssht.bd_ht_1r = false; } } @@ -1876,16 +1877,17 @@ static void rtllib_parse_mife_generic(struct rtllib_device *ieee, *tmp_htinfo_len = min_t(u8, info_element->len, MAX_IE_LEN); if (*tmp_htinfo_len != 0) { - network->bssht.bdHTSpecVer = HT_SPEC_VER_EWC; - network->bssht.bdHTInfoLen = min_t(u16, *tmp_htinfo_len, sizeof(network->bssht.bdHTInfoBuf)); - memcpy(network->bssht.bdHTInfoBuf, + network->bssht.bd_ht_spec_ver = HT_SPEC_VER_EWC; + network->bssht.bd_ht_info_len = min_t(u16, *tmp_htinfo_len, + sizeof(network->bssht.bd_ht_info_buf)); + memcpy(network->bssht.bd_ht_info_buf, info_element->data, - network->bssht.bdHTInfoLen); + network->bssht.bd_ht_info_len); } } } - if (network->bssht.bdSupportHT) { + if (network->bssht.bd_support_ht) { if (info_element->len >= 4 && info_element->data[0] == 0x00 && info_element->data[1] == 0xe0 && @@ -1898,20 +1900,20 @@ static void rtllib_parse_mife_generic(struct rtllib_device *ieee, } if (ht_realtek_agg_len >= 5) { network->realtek_cap_exit = true; - network->bssht.bdRT2RTAggregation = true; + network->bssht.bd_rt2rt_aggregation = true; if ((ht_realtek_agg_buf[4] == 1) && (ht_realtek_agg_buf[5] & 0x02)) - network->bssht.bdRT2RTLongSlotTime = true; + network->bssht.bd_rt2rt_long_slot_time = true; if ((ht_realtek_agg_buf[4] == 1) && (ht_realtek_agg_buf[5] & RT_HT_CAP_USE_92SE)) - network->bssht.RT2RT_HT_Mode |= RT_HT_CAP_USE_92SE; + network->bssht.rt2rt_ht_mode |= RT_HT_CAP_USE_92SE; } } if (ht_realtek_agg_len >= 5) { if ((ht_realtek_agg_buf[5] & RT_HT_CAP_USE_SOFTAP)) - network->bssht.RT2RT_HT_Mode |= RT_HT_CAP_USE_SOFTAP; + network->bssht.rt2rt_ht_mode |= RT_HT_CAP_USE_SOFTAP; } if ((info_element->len >= 3 && @@ -1967,7 +1969,7 @@ static void rtllib_parse_mife_generic(struct rtllib_device *ieee, info_element->data[2] == 0x96 && info_element->data[3] == 0x01) { if (info_element->len == 6) { - memcpy(network->CcxRmState, &info_element[4], 2); + memcpy(network->CcxRmState, &info_element->data[4], 2); if (network->CcxRmState[0] != 0) network->bCcxRmEnable = true; else @@ -2020,22 +2022,22 @@ static void rtllib_parse_mfie_ht_cap(struct rtllib_info_element *info_element, *tmp_htcap_len = min_t(u8, info_element->len, MAX_IE_LEN); if (*tmp_htcap_len != 0) { - ht->bdHTSpecVer = HT_SPEC_VER_EWC; - ht->bdHTCapLen = min_t(u16, *tmp_htcap_len, - sizeof(ht->bdHTCapBuf)); - memcpy(ht->bdHTCapBuf, info_element->data, ht->bdHTCapLen); + ht->bd_ht_spec_ver = HT_SPEC_VER_EWC; + ht->bd_ht_cap_len = min_t(u16, *tmp_htcap_len, + sizeof(ht->bd_ht_cap_buf)); + memcpy(ht->bd_ht_cap_buf, info_element->data, ht->bd_ht_cap_len); - ht->bdSupportHT = true; - ht->bdHT1R = ((((struct ht_capab_ele *) - ht->bdHTCapBuf))->MCS[1]) == 0; + ht->bd_support_ht = true; + ht->bd_ht_1r = ((((struct ht_capab_ele *) + ht->bd_ht_cap_buf))->MCS[1]) == 0; - ht->bdBandWidth = (enum ht_channel_width) + ht->bd_bandwidth = (enum ht_channel_width) (((struct ht_capab_ele *) - (ht->bdHTCapBuf))->ChlWidth); + (ht->bd_ht_cap_buf))->ChlWidth); } else { - ht->bdSupportHT = false; - ht->bdHT1R = false; - ht->bdBandWidth = HT_CHANNEL_WIDTH_20; + ht->bd_support_ht = false; + ht->bd_ht_1r = false; + ht->bd_bandwidth = HT_CHANNEL_WIDTH_20; } } @@ -2232,14 +2234,14 @@ int rtllib_parse_info_param(struct rtllib_device *ieee, tmp_htinfo_len = min_t(u8, info_element->len, MAX_IE_LEN); if (tmp_htinfo_len) { - network->bssht.bdHTSpecVer = HT_SPEC_VER_IEEE; - network->bssht.bdHTInfoLen = tmp_htinfo_len > - sizeof(network->bssht.bdHTInfoBuf) ? - sizeof(network->bssht.bdHTInfoBuf) : + network->bssht.bd_ht_spec_ver = HT_SPEC_VER_IEEE; + network->bssht.bd_ht_info_len = tmp_htinfo_len > + sizeof(network->bssht.bd_ht_info_buf) ? + sizeof(network->bssht.bd_ht_info_buf) : tmp_htinfo_len; - memcpy(network->bssht.bdHTInfoBuf, + memcpy(network->bssht.bd_ht_info_buf, info_element->data, - network->bssht.bdHTInfoLen); + network->bssht.bd_ht_info_len); } break; @@ -2289,7 +2291,7 @@ int rtllib_parse_info_param(struct rtllib_device *ieee, if (!network->atheros_cap_exist && !network->broadcom_cap_exist && !network->cisco_cap_exist && !network->ralink_cap_exist && - !network->bssht.bdRT2RTAggregation) + !network->bssht.bd_rt2rt_aggregation) network->unknown_cap_exist = true; else network->unknown_cap_exist = false; @@ -2380,7 +2382,7 @@ static inline int rtllib_network_init( return 1; } - if (network->bssht.bdSupportHT) { + if (network->bssht.bd_support_ht) { if (network->mode == IEEE_A) network->mode = IEEE_N_5G; else if (network->mode & (IEEE_G | IEEE_B)) @@ -2456,16 +2458,16 @@ static inline void update_network(struct rtllib_device *ieee, dst->last_dtim_sta_time = src->last_dtim_sta_time; memcpy(&dst->tim, &src->tim, sizeof(struct rtllib_tim_parameters)); - dst->bssht.bdSupportHT = src->bssht.bdSupportHT; - dst->bssht.bdRT2RTAggregation = src->bssht.bdRT2RTAggregation; - dst->bssht.bdHTCapLen = src->bssht.bdHTCapLen; - memcpy(dst->bssht.bdHTCapBuf, src->bssht.bdHTCapBuf, - src->bssht.bdHTCapLen); - dst->bssht.bdHTInfoLen = src->bssht.bdHTInfoLen; - memcpy(dst->bssht.bdHTInfoBuf, src->bssht.bdHTInfoBuf, - src->bssht.bdHTInfoLen); - dst->bssht.bdHTSpecVer = src->bssht.bdHTSpecVer; - dst->bssht.bdRT2RTLongSlotTime = src->bssht.bdRT2RTLongSlotTime; + dst->bssht.bd_support_ht = src->bssht.bd_support_ht; + dst->bssht.bd_rt2rt_aggregation = src->bssht.bd_rt2rt_aggregation; + dst->bssht.bd_ht_cap_len = src->bssht.bd_ht_cap_len; + memcpy(dst->bssht.bd_ht_cap_buf, src->bssht.bd_ht_cap_buf, + src->bssht.bd_ht_cap_len); + dst->bssht.bd_ht_info_len = src->bssht.bd_ht_info_len; + memcpy(dst->bssht.bd_ht_info_buf, src->bssht.bd_ht_info_buf, + src->bssht.bd_ht_info_len); + dst->bssht.bd_ht_spec_ver = src->bssht.bd_ht_spec_ver; + dst->bssht.bd_rt2rt_long_slot_time = src->bssht.bd_rt2rt_long_slot_time; dst->broadcom_cap_exist = src->broadcom_cap_exist; dst->ralink_cap_exist = src->ralink_cap_exist; dst->atheros_cap_exist = src->atheros_cap_exist; |