diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 17:40:19 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 17:40:19 +0000 |
commit | 9f0fc191371843c4fc000a226b0a26b6c059aacd (patch) | |
tree | 35f8be3ef04506ac891ad001e8c41e535ae8d01d /drivers/staging/rtl8192e/rtl819x_TSProc.c | |
parent | Releasing progress-linux version 6.6.15-2~progress7.99u1. (diff) | |
download | linux-9f0fc191371843c4fc000a226b0a26b6c059aacd.tar.xz linux-9f0fc191371843c4fc000a226b0a26b6c059aacd.zip |
Merging upstream version 6.7.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'drivers/staging/rtl8192e/rtl819x_TSProc.c')
-rw-r--r-- | drivers/staging/rtl8192e/rtl819x_TSProc.c | 256 |
1 files changed, 114 insertions, 142 deletions
diff --git a/drivers/staging/rtl8192e/rtl819x_TSProc.c b/drivers/staging/rtl8192e/rtl819x_TSProc.c index 419ff72f2b..3206fdb3e6 100644 --- a/drivers/staging/rtl8192e/rtl819x_TSProc.c +++ b/drivers/staging/rtl8192e/rtl819x_TSProc.c @@ -10,10 +10,9 @@ static void RxPktPendingTimeout(struct timer_list *t) { - struct rx_ts_record *pRxTs = from_timer(pRxTs, t, - rx_pkt_pending_timer); - struct rtllib_device *ieee = container_of(pRxTs, struct rtllib_device, - RxTsRecord[pRxTs->num]); + struct rx_ts_record *ts = from_timer(ts, t, rx_pkt_pending_timer); + struct rtllib_device *ieee = container_of(ts, struct rtllib_device, + RxTsRecord[ts->num]); struct rx_reorder_entry *pReorderEntry = NULL; @@ -22,24 +21,24 @@ static void RxPktPendingTimeout(struct timer_list *t) bool bPktInBuf = false; spin_lock_irqsave(&(ieee->reorder_spinlock), flags); - if (pRxTs->rx_timeout_indicate_seq != 0xffff) { - while (!list_empty(&pRxTs->rx_pending_pkt_list)) { + if (ts->rx_timeout_indicate_seq != 0xffff) { + while (!list_empty(&ts->rx_pending_pkt_list)) { pReorderEntry = (struct rx_reorder_entry *) - list_entry(pRxTs->rx_pending_pkt_list.prev, + list_entry(ts->rx_pending_pkt_list.prev, struct rx_reorder_entry, List); if (index == 0) - pRxTs->rx_indicate_seq = pReorderEntry->SeqNum; + ts->rx_indicate_seq = pReorderEntry->SeqNum; if (SN_LESS(pReorderEntry->SeqNum, - pRxTs->rx_indicate_seq) || + ts->rx_indicate_seq) || SN_EQUAL(pReorderEntry->SeqNum, - pRxTs->rx_indicate_seq)) { + ts->rx_indicate_seq)) { list_del_init(&pReorderEntry->List); if (SN_EQUAL(pReorderEntry->SeqNum, - pRxTs->rx_indicate_seq)) - pRxTs->rx_indicate_seq = - (pRxTs->rx_indicate_seq + 1) % 4096; + ts->rx_indicate_seq)) + ts->rx_indicate_seq = + (ts->rx_indicate_seq + 1) % 4096; netdev_dbg(ieee->dev, "%s(): Indicate SeqNum: %d\n", @@ -58,7 +57,7 @@ static void RxPktPendingTimeout(struct timer_list *t) } if (index > 0) { - pRxTs->rx_timeout_indicate_seq = 0xffff; + ts->rx_timeout_indicate_seq = 0xffff; if (index > REORDER_WIN_SIZE) { netdev_warn(ieee->dev, @@ -72,9 +71,9 @@ static void RxPktPendingTimeout(struct timer_list *t) bPktInBuf = false; } - if (bPktInBuf && (pRxTs->rx_timeout_indicate_seq == 0xffff)) { - pRxTs->rx_timeout_indicate_seq = pRxTs->rx_indicate_seq; - mod_timer(&pRxTs->rx_pkt_pending_timer, jiffies + + if (bPktInBuf && (ts->rx_timeout_indicate_seq == 0xffff)) { + ts->rx_timeout_indicate_seq = ts->rx_indicate_seq; + mod_timer(&ts->rx_pkt_pending_timer, jiffies + msecs_to_jiffies(ieee->ht_info->rx_reorder_pending_time) ); } @@ -94,37 +93,34 @@ static void TsAddBaProcess(struct timer_list *t) static void ResetTsCommonInfo(struct ts_common_info *pTsCommonInfo) { - eth_zero_addr(pTsCommonInfo->Addr); - memset(&pTsCommonInfo->TSpec, 0, sizeof(union tspec_body)); - memset(&pTsCommonInfo->TClass, 0, sizeof(union qos_tclas) * TCLAS_NUM); - pTsCommonInfo->TClasProc = 0; - pTsCommonInfo->TClasNum = 0; + eth_zero_addr(pTsCommonInfo->addr); + memset(&pTsCommonInfo->TSpec, 0, sizeof(struct qos_tsinfo)); } -static void ResetTxTsEntry(struct tx_ts_record *pTS) +static void ResetTxTsEntry(struct tx_ts_record *ts) { - ResetTsCommonInfo(&pTS->TsCommonInfo); - pTS->TxCurSeq = 0; - pTS->bAddBaReqInProgress = false; - pTS->bAddBaReqDelayed = false; - pTS->bUsingBa = false; - pTS->bDisable_AddBa = false; - rtllib_reset_ba_entry(&pTS->TxAdmittedBARecord); - rtllib_reset_ba_entry(&pTS->TxPendingBARecord); + ResetTsCommonInfo(&ts->TsCommonInfo); + ts->TxCurSeq = 0; + ts->bAddBaReqInProgress = false; + ts->bAddBaReqDelayed = false; + ts->bUsingBa = false; + ts->bDisable_AddBa = false; + rtllib_reset_ba_entry(&ts->TxAdmittedBARecord); + rtllib_reset_ba_entry(&ts->TxPendingBARecord); } -static void ResetRxTsEntry(struct rx_ts_record *pTS) +static void ResetRxTsEntry(struct rx_ts_record *ts) { - ResetTsCommonInfo(&pTS->ts_common_info); - pTS->rx_indicate_seq = 0xffff; - pTS->rx_timeout_indicate_seq = 0xffff; - rtllib_reset_ba_entry(&pTS->rx_admitted_ba_record); + ResetTsCommonInfo(&ts->ts_common_info); + ts->rx_indicate_seq = 0xffff; + ts->rx_timeout_indicate_seq = 0xffff; + rtllib_reset_ba_entry(&ts->rx_admitted_ba_record); } -void TSInitialize(struct rtllib_device *ieee) +void rtllib_ts_init(struct rtllib_device *ieee) { struct tx_ts_record *pTxTS = ieee->TxTsRecord; - struct rx_ts_record *pRxTS = ieee->RxTsRecord; + struct rx_ts_record *rxts = ieee->RxTsRecord; struct rx_reorder_entry *pRxReorderEntry = ieee->RxReorderEntry; u8 count = 0; @@ -151,17 +147,17 @@ void TSInitialize(struct rtllib_device *ieee) INIT_LIST_HEAD(&ieee->Rx_TS_Pending_List); INIT_LIST_HEAD(&ieee->Rx_TS_Unused_List); for (count = 0; count < TOTAL_TS_NUM; count++) { - pRxTS->num = count; - INIT_LIST_HEAD(&pRxTS->rx_pending_pkt_list); - timer_setup(&pRxTS->rx_admitted_ba_record.timer, + rxts->num = count; + INIT_LIST_HEAD(&rxts->rx_pending_pkt_list); + timer_setup(&rxts->rx_admitted_ba_record.timer, rtllib_rx_ba_inact_timeout, 0); - timer_setup(&pRxTS->rx_pkt_pending_timer, RxPktPendingTimeout, 0); + timer_setup(&rxts->rx_pkt_pending_timer, RxPktPendingTimeout, 0); - ResetRxTsEntry(pRxTS); - list_add_tail(&pRxTS->ts_common_info.List, + ResetRxTsEntry(rxts); + list_add_tail(&rxts->ts_common_info.List, &ieee->Rx_TS_Unused_List); - pRxTS++; + rxts++; } INIT_LIST_HEAD(&ieee->RxReorder_Unused_List); for (count = 0; count < REORDER_ENTRY_NUM; count++) { @@ -174,7 +170,7 @@ void TSInitialize(struct rtllib_device *ieee) } static struct ts_common_info *SearchAdmitTRStream(struct rtllib_device *ieee, - u8 *Addr, u8 TID, + u8 *addr, u8 TID, enum tr_select TxRxSelect) { u8 dir; @@ -182,21 +178,14 @@ static struct ts_common_info *SearchAdmitTRStream(struct rtllib_device *ieee, struct list_head *psearch_list; struct ts_common_info *pRet = NULL; - if (ieee->iw_mode == IW_MODE_ADHOC) { - if (TxRxSelect == TX_DIR) - search_dir[DIR_UP] = true; - else - search_dir[DIR_DOWN] = true; + if (TxRxSelect == TX_DIR) { + search_dir[DIR_UP] = true; + search_dir[DIR_BI_DIR] = true; + search_dir[DIR_DIRECT] = true; } else { - if (TxRxSelect == TX_DIR) { - search_dir[DIR_UP] = true; - search_dir[DIR_BI_DIR] = true; - search_dir[DIR_DIRECT] = true; - } else { - search_dir[DIR_DOWN] = true; - search_dir[DIR_BI_DIR] = true; - search_dir[DIR_DIRECT] = true; - } + search_dir[DIR_DOWN] = true; + search_dir[DIR_BI_DIR] = true; + search_dir[DIR_DIRECT] = true; } if (TxRxSelect == TX_DIR) @@ -208,9 +197,9 @@ static struct ts_common_info *SearchAdmitTRStream(struct rtllib_device *ieee, if (!search_dir[dir]) continue; list_for_each_entry(pRet, psearch_list, List) { - if (memcmp(pRet->Addr, Addr, 6) == 0 && - pRet->TSpec.f.TSInfo.field.ucTSID == TID && - pRet->TSpec.f.TSInfo.field.ucDirection == dir) + if (memcmp(pRet->addr, addr, 6) == 0 && + pRet->TSpec.ucTSID == TID && + pRet->TSpec.ucDirection == dir) break; } if (&pRet->List != psearch_list) @@ -222,40 +211,30 @@ static struct ts_common_info *SearchAdmitTRStream(struct rtllib_device *ieee, return NULL; } -static void MakeTSEntry(struct ts_common_info *pTsCommonInfo, u8 *Addr, - union tspec_body *pTSPEC, union qos_tclas *pTCLAS, - u8 TCLAS_Num, u8 TCLAS_Proc) +static void MakeTSEntry(struct ts_common_info *pTsCommonInfo, u8 *addr, + struct qos_tsinfo *pTSPEC) { - u8 count; - if (!pTsCommonInfo) return; - memcpy(pTsCommonInfo->Addr, Addr, 6); + memcpy(pTsCommonInfo->addr, addr, 6); if (pTSPEC) memcpy((u8 *)(&(pTsCommonInfo->TSpec)), (u8 *)pTSPEC, - sizeof(union tspec_body)); - - for (count = 0; count < TCLAS_Num; count++) - memcpy((u8 *)(&(pTsCommonInfo->TClass[count])), - (u8 *)pTCLAS, sizeof(union qos_tclas)); - - pTsCommonInfo->TClasProc = TCLAS_Proc; - pTsCommonInfo->TClasNum = TCLAS_Num; + sizeof(struct qos_tsinfo)); } -bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS, - u8 *Addr, u8 TID, enum tr_select TxRxSelect, bool bAddNewTs) +bool rtllib_get_ts(struct rtllib_device *ieee, struct ts_common_info **ppTS, + u8 *addr, u8 TID, enum tr_select TxRxSelect, bool bAddNewTs) { u8 UP = 0; - union tspec_body TSpec; - union qos_tsinfo *pTSInfo = &TSpec.f.TSInfo; + struct qos_tsinfo TSpec; + struct qos_tsinfo *ts_info = &TSpec; struct list_head *pUnusedList; struct list_head *pAddmitList; enum direction_value Dir; - if (is_multicast_ether_addr(Addr)) { + if (is_multicast_ether_addr(addr)) { netdev_warn(ieee->dev, "Get TS for Broadcast or Multicast\n"); return false; } @@ -286,7 +265,7 @@ bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS, } } - *ppTS = SearchAdmitTRStream(ieee, Addr, UP, TxRxSelect); + *ppTS = SearchAdmitTRStream(ieee, addr, UP, TxRxSelect); if (*ppTS) return true; @@ -316,27 +295,20 @@ bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS, TsCommonInfo); ResetTxTsEntry(tmp); } else { - struct rx_ts_record *tmp = + struct rx_ts_record *ts = container_of(*ppTS, struct rx_ts_record, ts_common_info); - ResetRxTsEntry(tmp); + ResetRxTsEntry(ts); } netdev_dbg(ieee->dev, "to init current TS, UP:%d, Dir:%d, addr: %pM ppTs=%p\n", - UP, Dir, Addr, *ppTS); - pTSInfo->field.ucTrafficType = 0; - pTSInfo->field.ucTSID = UP; - pTSInfo->field.ucDirection = Dir; - pTSInfo->field.ucAccessPolicy = 1; - pTSInfo->field.ucAggregation = 0; - pTSInfo->field.ucPSB = 0; - pTSInfo->field.ucUP = UP; - pTSInfo->field.ucTSInfoAckPolicy = 0; - pTSInfo->field.ucSchedule = 0; - - MakeTSEntry(*ppTS, Addr, &TSpec, NULL, 0, 0); + UP, Dir, addr, *ppTS); + ts_info->ucTSID = UP; + ts_info->ucDirection = Dir; + + MakeTSEntry(*ppTS, addr, &TSpec); list_add_tail(&((*ppTS)->List), pAddmitList); return true; @@ -355,14 +327,14 @@ static void RemoveTsEntry(struct rtllib_device *ieee, if (TxRxSelect == RX_DIR) { struct rx_reorder_entry *pRxReorderEntry; - struct rx_ts_record *pRxTS = (struct rx_ts_record *)pTs; + struct rx_ts_record *ts = (struct rx_ts_record *)pTs; - if (timer_pending(&pRxTS->rx_pkt_pending_timer)) - del_timer_sync(&pRxTS->rx_pkt_pending_timer); + if (timer_pending(&ts->rx_pkt_pending_timer)) + del_timer_sync(&ts->rx_pkt_pending_timer); - while (!list_empty(&pRxTS->rx_pending_pkt_list)) { + while (!list_empty(&ts->rx_pending_pkt_list)) { pRxReorderEntry = (struct rx_reorder_entry *) - list_entry(pRxTS->rx_pending_pkt_list.prev, + list_entry(ts->rx_pending_pkt_list.prev, struct rx_reorder_entry, List); netdev_dbg(ieee->dev, "%s(): Delete SeqNum %d!\n", __func__, pRxReorderEntry->SeqNum); @@ -388,43 +360,43 @@ static void RemoveTsEntry(struct rtllib_device *ieee, } } -void RemovePeerTS(struct rtllib_device *ieee, u8 *Addr) +void RemovePeerTS(struct rtllib_device *ieee, u8 *addr) { - struct ts_common_info *pTS, *pTmpTS; + struct ts_common_info *ts, *pTmpTS; - netdev_info(ieee->dev, "===========>%s, %pM\n", __func__, Addr); + netdev_info(ieee->dev, "===========>%s, %pM\n", __func__, addr); - list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Pending_List, List) { - if (memcmp(pTS->Addr, Addr, 6) == 0) { - RemoveTsEntry(ieee, pTS, TX_DIR); - list_del_init(&pTS->List); - list_add_tail(&pTS->List, &ieee->Tx_TS_Unused_List); + list_for_each_entry_safe(ts, pTmpTS, &ieee->Tx_TS_Pending_List, List) { + if (memcmp(ts->addr, addr, 6) == 0) { + RemoveTsEntry(ieee, ts, TX_DIR); + list_del_init(&ts->List); + list_add_tail(&ts->List, &ieee->Tx_TS_Unused_List); } } - list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Admit_List, List) { - if (memcmp(pTS->Addr, Addr, 6) == 0) { + list_for_each_entry_safe(ts, pTmpTS, &ieee->Tx_TS_Admit_List, List) { + if (memcmp(ts->addr, addr, 6) == 0) { netdev_info(ieee->dev, "====>remove Tx_TS_admin_list\n"); - RemoveTsEntry(ieee, pTS, TX_DIR); - list_del_init(&pTS->List); - list_add_tail(&pTS->List, &ieee->Tx_TS_Unused_List); + RemoveTsEntry(ieee, ts, TX_DIR); + list_del_init(&ts->List); + list_add_tail(&ts->List, &ieee->Tx_TS_Unused_List); } } - list_for_each_entry_safe(pTS, pTmpTS, &ieee->Rx_TS_Pending_List, List) { - if (memcmp(pTS->Addr, Addr, 6) == 0) { - RemoveTsEntry(ieee, pTS, RX_DIR); - list_del_init(&pTS->List); - list_add_tail(&pTS->List, &ieee->Rx_TS_Unused_List); + list_for_each_entry_safe(ts, pTmpTS, &ieee->Rx_TS_Pending_List, List) { + if (memcmp(ts->addr, addr, 6) == 0) { + RemoveTsEntry(ieee, ts, RX_DIR); + list_del_init(&ts->List); + list_add_tail(&ts->List, &ieee->Rx_TS_Unused_List); } } - list_for_each_entry_safe(pTS, pTmpTS, &ieee->Rx_TS_Admit_List, List) { - if (memcmp(pTS->Addr, Addr, 6) == 0) { - RemoveTsEntry(ieee, pTS, RX_DIR); - list_del_init(&pTS->List); - list_add_tail(&pTS->List, &ieee->Rx_TS_Unused_List); + list_for_each_entry_safe(ts, pTmpTS, &ieee->Rx_TS_Admit_List, List) { + if (memcmp(ts->addr, addr, 6) == 0) { + RemoveTsEntry(ieee, ts, RX_DIR); + list_del_init(&ts->List); + list_add_tail(&ts->List, &ieee->Rx_TS_Unused_List); } } } @@ -432,30 +404,30 @@ EXPORT_SYMBOL(RemovePeerTS); void RemoveAllTS(struct rtllib_device *ieee) { - struct ts_common_info *pTS, *pTmpTS; + struct ts_common_info *ts, *pTmpTS; - list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Pending_List, List) { - RemoveTsEntry(ieee, pTS, TX_DIR); - list_del_init(&pTS->List); - list_add_tail(&pTS->List, &ieee->Tx_TS_Unused_List); + list_for_each_entry_safe(ts, pTmpTS, &ieee->Tx_TS_Pending_List, List) { + RemoveTsEntry(ieee, ts, TX_DIR); + list_del_init(&ts->List); + list_add_tail(&ts->List, &ieee->Tx_TS_Unused_List); } - list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Admit_List, List) { - RemoveTsEntry(ieee, pTS, TX_DIR); - list_del_init(&pTS->List); - list_add_tail(&pTS->List, &ieee->Tx_TS_Unused_List); + list_for_each_entry_safe(ts, pTmpTS, &ieee->Tx_TS_Admit_List, List) { + RemoveTsEntry(ieee, ts, TX_DIR); + list_del_init(&ts->List); + list_add_tail(&ts->List, &ieee->Tx_TS_Unused_List); } - list_for_each_entry_safe(pTS, pTmpTS, &ieee->Rx_TS_Pending_List, List) { - RemoveTsEntry(ieee, pTS, RX_DIR); - list_del_init(&pTS->List); - list_add_tail(&pTS->List, &ieee->Rx_TS_Unused_List); + list_for_each_entry_safe(ts, pTmpTS, &ieee->Rx_TS_Pending_List, List) { + RemoveTsEntry(ieee, ts, RX_DIR); + list_del_init(&ts->List); + list_add_tail(&ts->List, &ieee->Rx_TS_Unused_List); } - list_for_each_entry_safe(pTS, pTmpTS, &ieee->Rx_TS_Admit_List, List) { - RemoveTsEntry(ieee, pTS, RX_DIR); - list_del_init(&pTS->List); - list_add_tail(&pTS->List, &ieee->Rx_TS_Unused_List); + list_for_each_entry_safe(ts, pTmpTS, &ieee->Rx_TS_Admit_List, List) { + RemoveTsEntry(ieee, ts, RX_DIR); + list_del_init(&ts->List); + list_add_tail(&ts->List, &ieee->Rx_TS_Unused_List); } } |