Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 1 | /****************************************************************************** |
| 2 | * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved. |
| 3 | * |
| 4 | * This program is distributed in the hope that it will be useful, but WITHOUT |
| 5 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 6 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
| 7 | * more details. |
| 8 | * |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 9 | * The full GNU General Public License is included in this distribution in the |
| 10 | * file called LICENSE. |
| 11 | * |
| 12 | * Contact Information: |
| 13 | * wlanfae <wlanfae@realtek.com> |
| 14 | ******************************************************************************/ |
| 15 | #include "rtllib.h" |
| 16 | #include <linux/etherdevice.h> |
| 17 | #include "rtl819x_TS.h" |
Mike McCormack | cb76215 | 2011-07-11 08:56:20 +0900 | [diff] [blame] | 18 | |
Larry Finger | ec0dc6be | 2011-08-25 14:07:04 -0500 | [diff] [blame] | 19 | static void TsSetupTimeOut(unsigned long data) |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 20 | { |
| 21 | } |
| 22 | |
Larry Finger | ec0dc6be | 2011-08-25 14:07:04 -0500 | [diff] [blame] | 23 | static void TsInactTimeout(unsigned long data) |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 24 | { |
| 25 | } |
| 26 | |
Larry Finger | ec0dc6be | 2011-08-25 14:07:04 -0500 | [diff] [blame] | 27 | static void RxPktPendingTimeout(unsigned long data) |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 28 | { |
Larry Finger | 2c47ae2 | 2011-07-18 20:11:56 -0500 | [diff] [blame] | 29 | struct rx_ts_record *pRxTs = (struct rx_ts_record *)data; |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 30 | struct rtllib_device *ieee = container_of(pRxTs, struct rtllib_device, |
| 31 | RxTsRecord[pRxTs->num]); |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 32 | |
Larry Finger | 8cba143 | 2011-07-18 22:16:48 -0500 | [diff] [blame] | 33 | struct rx_reorder_entry *pReorderEntry = NULL; |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 34 | |
| 35 | unsigned long flags = 0; |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 36 | u8 index = 0; |
| 37 | bool bPktInBuf = false; |
| 38 | |
| 39 | spin_lock_irqsave(&(ieee->reorder_spinlock), flags); |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 40 | if (pRxTs->RxTimeoutIndicateSeq != 0xffff) { |
| 41 | while (!list_empty(&pRxTs->RxPendingPktList)) { |
| 42 | pReorderEntry = (struct rx_reorder_entry *) |
| 43 | list_entry(pRxTs->RxPendingPktList.prev, |
| 44 | struct rx_reorder_entry, List); |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 45 | if (index == 0) |
| 46 | pRxTs->RxIndicateSeq = pReorderEntry->SeqNum; |
| 47 | |
Mateusz Kulikowski | 35e33b0 | 2015-05-31 20:19:40 +0200 | [diff] [blame] | 48 | if (SN_LESS(pReorderEntry->SeqNum, |
| 49 | pRxTs->RxIndicateSeq) || |
| 50 | SN_EQUAL(pReorderEntry->SeqNum, |
| 51 | pRxTs->RxIndicateSeq)) { |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 52 | list_del_init(&pReorderEntry->List); |
| 53 | |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 54 | if (SN_EQUAL(pReorderEntry->SeqNum, |
| 55 | pRxTs->RxIndicateSeq)) |
| 56 | pRxTs->RxIndicateSeq = |
| 57 | (pRxTs->RxIndicateSeq + 1) % 4096; |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 58 | |
Mateusz Kulikowski | b94436b | 2015-05-31 20:19:35 +0200 | [diff] [blame] | 59 | netdev_dbg(ieee->dev, |
| 60 | "%s(): Indicate SeqNum: %d\n", |
| 61 | __func__, pReorderEntry->SeqNum); |
Larry Finger | 2eed3de | 2011-09-01 12:23:20 -0500 | [diff] [blame] | 62 | ieee->stats_IndicateArray[index] = |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 63 | pReorderEntry->prxb; |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 64 | index++; |
| 65 | |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 66 | list_add_tail(&pReorderEntry->List, |
| 67 | &ieee->RxReorder_Unused_List); |
| 68 | } else { |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 69 | bPktInBuf = true; |
| 70 | break; |
| 71 | } |
| 72 | } |
| 73 | } |
| 74 | |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 75 | if (index > 0) { |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 76 | pRxTs->RxTimeoutIndicateSeq = 0xffff; |
| 77 | |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 78 | if (index > REORDER_WIN_SIZE) { |
Mateusz Kulikowski | 11e672c | 2015-05-31 20:19:26 +0200 | [diff] [blame] | 79 | netdev_warn(ieee->dev, |
| 80 | "%s(): Rx Reorder struct buffer full\n", |
| 81 | __func__); |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 82 | spin_unlock_irqrestore(&(ieee->reorder_spinlock), |
| 83 | flags); |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 84 | return; |
| 85 | } |
Larry Finger | 2eed3de | 2011-09-01 12:23:20 -0500 | [diff] [blame] | 86 | rtllib_indicate_packets(ieee, ieee->stats_IndicateArray, index); |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 87 | bPktInBuf = false; |
| 88 | } |
| 89 | |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 90 | if (bPktInBuf && (pRxTs->RxTimeoutIndicateSeq == 0xffff)) { |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 91 | pRxTs->RxTimeoutIndicateSeq = pRxTs->RxIndicateSeq; |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 92 | mod_timer(&pRxTs->RxPktPendingTimer, jiffies + |
Mateusz Kulikowski | 35e33b0 | 2015-05-31 20:19:40 +0200 | [diff] [blame] | 93 | msecs_to_jiffies(ieee->pHTInfo->RxReorderPendingTime) |
| 94 | ); |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 95 | } |
| 96 | spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags); |
| 97 | } |
| 98 | |
Larry Finger | ec0dc6be | 2011-08-25 14:07:04 -0500 | [diff] [blame] | 99 | static void TsAddBaProcess(unsigned long data) |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 100 | { |
Larry Finger | 60554f2 | 2011-07-18 20:10:03 -0500 | [diff] [blame] | 101 | struct tx_ts_record *pTxTs = (struct tx_ts_record *)data; |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 102 | u8 num = pTxTs->num; |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 103 | struct rtllib_device *ieee = container_of(pTxTs, struct rtllib_device, |
| 104 | TxTsRecord[num]); |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 105 | |
| 106 | TsInitAddBA(ieee, pTxTs, BA_POLICY_IMMEDIATE, false); |
Mateusz Kulikowski | b94436b | 2015-05-31 20:19:35 +0200 | [diff] [blame] | 107 | netdev_dbg(ieee->dev, "%s(): ADDBA Req is started\n", __func__); |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 108 | } |
| 109 | |
Larry Finger | ec0dc6be | 2011-08-25 14:07:04 -0500 | [diff] [blame] | 110 | static void ResetTsCommonInfo(struct ts_common_info *pTsCommonInfo) |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 111 | { |
Vaishali Thakkar | 3e3148c | 2015-06-26 09:37:25 +0530 | [diff] [blame] | 112 | eth_zero_addr(pTsCommonInfo->Addr); |
Larry Finger | ed306e4 | 2011-07-19 10:25:55 -0500 | [diff] [blame] | 113 | memset(&pTsCommonInfo->TSpec, 0, sizeof(union tspec_body)); |
Larry Finger | 626f951 | 2011-07-19 10:27:46 -0500 | [diff] [blame] | 114 | memset(&pTsCommonInfo->TClass, 0, sizeof(union qos_tclas)*TCLAS_NUM); |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 115 | pTsCommonInfo->TClasProc = 0; |
| 116 | pTsCommonInfo->TClasNum = 0; |
| 117 | } |
| 118 | |
Larry Finger | ec0dc6be | 2011-08-25 14:07:04 -0500 | [diff] [blame] | 119 | static void ResetTxTsEntry(struct tx_ts_record *pTS) |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 120 | { |
| 121 | ResetTsCommonInfo(&pTS->TsCommonInfo); |
| 122 | pTS->TxCurSeq = 0; |
| 123 | pTS->bAddBaReqInProgress = false; |
| 124 | pTS->bAddBaReqDelayed = false; |
| 125 | pTS->bUsingBa = false; |
| 126 | pTS->bDisable_AddBa = false; |
| 127 | ResetBaEntry(&pTS->TxAdmittedBARecord); |
| 128 | ResetBaEntry(&pTS->TxPendingBARecord); |
| 129 | } |
| 130 | |
Larry Finger | ec0dc6be | 2011-08-25 14:07:04 -0500 | [diff] [blame] | 131 | static void ResetRxTsEntry(struct rx_ts_record *pTS) |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 132 | { |
| 133 | ResetTsCommonInfo(&pTS->TsCommonInfo); |
| 134 | pTS->RxIndicateSeq = 0xffff; |
| 135 | pTS->RxTimeoutIndicateSeq = 0xffff; |
| 136 | ResetBaEntry(&pTS->RxAdmittedBARecord); |
| 137 | } |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 138 | |
| 139 | void TSInitialize(struct rtllib_device *ieee) |
| 140 | { |
Larry Finger | 60554f2 | 2011-07-18 20:10:03 -0500 | [diff] [blame] | 141 | struct tx_ts_record *pTxTS = ieee->TxTsRecord; |
Larry Finger | 2c47ae2 | 2011-07-18 20:11:56 -0500 | [diff] [blame] | 142 | struct rx_ts_record *pRxTS = ieee->RxTsRecord; |
Larry Finger | 8cba143 | 2011-07-18 22:16:48 -0500 | [diff] [blame] | 143 | struct rx_reorder_entry *pRxReorderEntry = ieee->RxReorderEntry; |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 144 | u8 count = 0; |
Matthew Casey | 3a6b70c | 2014-08-22 06:27:52 -0400 | [diff] [blame] | 145 | |
Mateusz Kulikowski | b94436b | 2015-05-31 20:19:35 +0200 | [diff] [blame] | 146 | netdev_vdbg(ieee->dev, "%s()\n", __func__); |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 147 | INIT_LIST_HEAD(&ieee->Tx_TS_Admit_List); |
| 148 | INIT_LIST_HEAD(&ieee->Tx_TS_Pending_List); |
| 149 | INIT_LIST_HEAD(&ieee->Tx_TS_Unused_List); |
| 150 | |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 151 | for (count = 0; count < TOTAL_TS_NUM; count++) { |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 152 | pTxTS->num = count; |
Gnanachandran Dhanapal | 2e59e40 | 2015-06-16 07:25:48 +0000 | [diff] [blame] | 153 | setup_timer(&pTxTS->TsCommonInfo.SetupTimer, |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 154 | TsSetupTimeOut, |
| 155 | (unsigned long) pTxTS); |
| 156 | |
Gnanachandran Dhanapal | 2e59e40 | 2015-06-16 07:25:48 +0000 | [diff] [blame] | 157 | setup_timer(&pTxTS->TsCommonInfo.InactTimer, |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 158 | TsInactTimeout, |
| 159 | (unsigned long) pTxTS); |
| 160 | |
Gnanachandran Dhanapal | 2e59e40 | 2015-06-16 07:25:48 +0000 | [diff] [blame] | 161 | setup_timer(&pTxTS->TsAddBaTimer, |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 162 | TsAddBaProcess, |
| 163 | (unsigned long) pTxTS); |
| 164 | |
Gnanachandran Dhanapal | 2e59e40 | 2015-06-16 07:25:48 +0000 | [diff] [blame] | 165 | setup_timer(&pTxTS->TxPendingBARecord.Timer, |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 166 | BaSetupTimeOut, |
| 167 | (unsigned long) pTxTS); |
Gnanachandran Dhanapal | 2e59e40 | 2015-06-16 07:25:48 +0000 | [diff] [blame] | 168 | setup_timer(&pTxTS->TxAdmittedBARecord.Timer, |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 169 | TxBaInactTimeout, |
| 170 | (unsigned long) pTxTS); |
| 171 | |
| 172 | ResetTxTsEntry(pTxTS); |
| 173 | list_add_tail(&pTxTS->TsCommonInfo.List, |
| 174 | &ieee->Tx_TS_Unused_List); |
| 175 | pTxTS++; |
| 176 | } |
| 177 | |
| 178 | INIT_LIST_HEAD(&ieee->Rx_TS_Admit_List); |
| 179 | INIT_LIST_HEAD(&ieee->Rx_TS_Pending_List); |
| 180 | INIT_LIST_HEAD(&ieee->Rx_TS_Unused_List); |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 181 | for (count = 0; count < TOTAL_TS_NUM; count++) { |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 182 | pRxTS->num = count; |
| 183 | INIT_LIST_HEAD(&pRxTS->RxPendingPktList); |
| 184 | |
Gnanachandran Dhanapal | 2e59e40 | 2015-06-16 07:25:48 +0000 | [diff] [blame] | 185 | setup_timer(&pRxTS->TsCommonInfo.SetupTimer, |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 186 | TsSetupTimeOut, |
| 187 | (unsigned long) pRxTS); |
| 188 | |
Gnanachandran Dhanapal | 2e59e40 | 2015-06-16 07:25:48 +0000 | [diff] [blame] | 189 | setup_timer(&pRxTS->TsCommonInfo.InactTimer, |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 190 | TsInactTimeout, |
| 191 | (unsigned long) pRxTS); |
| 192 | |
Gnanachandran Dhanapal | 2e59e40 | 2015-06-16 07:25:48 +0000 | [diff] [blame] | 193 | setup_timer(&pRxTS->RxAdmittedBARecord.Timer, |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 194 | RxBaInactTimeout, |
| 195 | (unsigned long) pRxTS); |
| 196 | |
Gnanachandran Dhanapal | 2e59e40 | 2015-06-16 07:25:48 +0000 | [diff] [blame] | 197 | setup_timer(&pRxTS->RxPktPendingTimer, |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 198 | RxPktPendingTimeout, |
| 199 | (unsigned long) pRxTS); |
| 200 | |
| 201 | ResetRxTsEntry(pRxTS); |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 202 | list_add_tail(&pRxTS->TsCommonInfo.List, |
| 203 | &ieee->Rx_TS_Unused_List); |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 204 | pRxTS++; |
| 205 | } |
| 206 | INIT_LIST_HEAD(&ieee->RxReorder_Unused_List); |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 207 | for (count = 0; count < REORDER_ENTRY_NUM; count++) { |
| 208 | list_add_tail(&pRxReorderEntry->List, |
| 209 | &ieee->RxReorder_Unused_List); |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 210 | if (count == (REORDER_ENTRY_NUM-1)) |
| 211 | break; |
| 212 | pRxReorderEntry = &ieee->RxReorderEntry[count+1]; |
| 213 | } |
| 214 | |
| 215 | } |
| 216 | |
Larry Finger | ec0dc6be | 2011-08-25 14:07:04 -0500 | [diff] [blame] | 217 | static void AdmitTS(struct rtllib_device *ieee, |
| 218 | struct ts_common_info *pTsCommonInfo, u32 InactTime) |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 219 | { |
| 220 | del_timer_sync(&pTsCommonInfo->SetupTimer); |
| 221 | del_timer_sync(&pTsCommonInfo->InactTimer); |
| 222 | |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 223 | if (InactTime != 0) |
| 224 | mod_timer(&pTsCommonInfo->InactTimer, jiffies + |
Vaishali Thakkar | 8b9733c | 2015-03-11 13:51:36 +0530 | [diff] [blame] | 225 | msecs_to_jiffies(InactTime)); |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 226 | } |
| 227 | |
Larry Finger | ec0dc6be | 2011-08-25 14:07:04 -0500 | [diff] [blame] | 228 | static struct ts_common_info *SearchAdmitTRStream(struct rtllib_device *ieee, |
| 229 | u8 *Addr, u8 TID, |
| 230 | enum tr_select TxRxSelect) |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 231 | { |
| 232 | u8 dir; |
Larry Finger | ec0dc6be | 2011-08-25 14:07:04 -0500 | [diff] [blame] | 233 | bool search_dir[4] = {0}; |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 234 | struct list_head *psearch_list; |
Larry Finger | 74724de | 2011-07-18 20:19:19 -0500 | [diff] [blame] | 235 | struct ts_common_info *pRet = NULL; |
Matthew Casey | 3a6b70c | 2014-08-22 06:27:52 -0400 | [diff] [blame] | 236 | |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 237 | if (ieee->iw_mode == IW_MODE_MASTER) { |
| 238 | if (TxRxSelect == TX_DIR) { |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 239 | search_dir[DIR_DOWN] = true; |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 240 | search_dir[DIR_BI_DIR] = true; |
| 241 | } else { |
| 242 | search_dir[DIR_UP] = true; |
| 243 | search_dir[DIR_BI_DIR] = true; |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 244 | } |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 245 | } else if (ieee->iw_mode == IW_MODE_ADHOC) { |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 246 | if (TxRxSelect == TX_DIR) |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 247 | search_dir[DIR_UP] = true; |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 248 | else |
| 249 | search_dir[DIR_DOWN] = true; |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 250 | } else { |
| 251 | if (TxRxSelect == TX_DIR) { |
| 252 | search_dir[DIR_UP] = true; |
| 253 | search_dir[DIR_BI_DIR] = true; |
| 254 | search_dir[DIR_DIRECT] = true; |
| 255 | } else { |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 256 | search_dir[DIR_DOWN] = true; |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 257 | search_dir[DIR_BI_DIR] = true; |
| 258 | search_dir[DIR_DIRECT] = true; |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 259 | } |
| 260 | } |
| 261 | |
| 262 | if (TxRxSelect == TX_DIR) |
| 263 | psearch_list = &ieee->Tx_TS_Admit_List; |
| 264 | else |
| 265 | psearch_list = &ieee->Rx_TS_Admit_List; |
| 266 | |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 267 | for (dir = 0; dir <= DIR_BI_DIR; dir++) { |
Valentina Manea | 4bb0142 | 2013-10-25 11:28:10 +0300 | [diff] [blame] | 268 | if (!search_dir[dir]) |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 269 | continue; |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 270 | list_for_each_entry(pRet, psearch_list, List) { |
Mateusz Kulikowski | 35e33b0 | 2015-05-31 20:19:40 +0200 | [diff] [blame] | 271 | if (memcmp(pRet->Addr, Addr, 6) == 0 && |
| 272 | pRet->TSpec.f.TSInfo.field.ucTSID == TID && |
| 273 | pRet->TSpec.f.TSInfo.field.ucDirection == dir) |
| 274 | break; |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 275 | |
| 276 | } |
| 277 | if (&pRet->List != psearch_list) |
| 278 | break; |
| 279 | } |
| 280 | |
Larry Finger | d7613e5 | 2011-09-01 12:23:21 -0500 | [diff] [blame] | 281 | if (pRet && &pRet->List != psearch_list) |
Mahati Chamarthy | 6af1976 | 2014-09-20 02:38:39 +0530 | [diff] [blame] | 282 | return pRet; |
Mahati Chamarthy | 13402f7 | 2014-09-20 02:36:31 +0530 | [diff] [blame] | 283 | return NULL; |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 284 | } |
| 285 | |
Larry Finger | ec0dc6be | 2011-08-25 14:07:04 -0500 | [diff] [blame] | 286 | static void MakeTSEntry(struct ts_common_info *pTsCommonInfo, u8 *Addr, |
| 287 | union tspec_body *pTSPEC, union qos_tclas *pTCLAS, |
| 288 | u8 TCLAS_Num, u8 TCLAS_Proc) |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 289 | { |
| 290 | u8 count; |
| 291 | |
| 292 | if (pTsCommonInfo == NULL) |
| 293 | return; |
| 294 | |
| 295 | memcpy(pTsCommonInfo->Addr, Addr, 6); |
| 296 | |
| 297 | if (pTSPEC != NULL) |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 298 | memcpy((u8 *)(&(pTsCommonInfo->TSpec)), (u8 *)pTSPEC, |
| 299 | sizeof(union tspec_body)); |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 300 | |
| 301 | for (count = 0; count < TCLAS_Num; count++) |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 302 | memcpy((u8 *)(&(pTsCommonInfo->TClass[count])), |
| 303 | (u8 *)pTCLAS, sizeof(union qos_tclas)); |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 304 | |
| 305 | pTsCommonInfo->TClasProc = TCLAS_Proc; |
| 306 | pTsCommonInfo->TClasNum = TCLAS_Num; |
| 307 | } |
| 308 | |
Arnd Bergmann | fd181f7 | 2016-07-20 17:26:06 +0200 | [diff] [blame] | 309 | static bool IsACValid(unsigned int tid) |
| 310 | { |
| 311 | return tid < 7; |
| 312 | } |
| 313 | |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 314 | bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS, |
| 315 | u8 *Addr, u8 TID, enum tr_select TxRxSelect, bool bAddNewTs) |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 316 | { |
| 317 | u8 UP = 0; |
Mateusz Kulikowski | 285b7c0 | 2015-04-01 00:24:26 +0200 | [diff] [blame] | 318 | union tspec_body TSpec; |
| 319 | union qos_tsinfo *pTSInfo = &TSpec.f.TSInfo; |
| 320 | struct list_head *pUnusedList; |
| 321 | struct list_head *pAddmitList; |
| 322 | enum direction_value Dir; |
Matthew Casey | 3a6b70c | 2014-08-22 06:27:52 -0400 | [diff] [blame] | 323 | |
Joe Perches | 14fc423 | 2012-05-08 10:11:56 -0700 | [diff] [blame] | 324 | if (is_multicast_ether_addr(Addr)) { |
Mateusz Kulikowski | 11e672c | 2015-05-31 20:19:26 +0200 | [diff] [blame] | 325 | netdev_warn(ieee->dev, "Get TS for Broadcast or Multicast\n"); |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 326 | return false; |
| 327 | } |
| 328 | if (ieee->current_network.qos_data.supported == 0) { |
| 329 | UP = 0; |
| 330 | } else { |
| 331 | if (!IsACValid(TID)) { |
Mateusz Kulikowski | 11e672c | 2015-05-31 20:19:26 +0200 | [diff] [blame] | 332 | netdev_warn(ieee->dev, "%s(): TID(%d) is not valid\n", |
| 333 | __func__, TID); |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 334 | return false; |
| 335 | } |
| 336 | |
| 337 | switch (TID) { |
| 338 | case 0: |
| 339 | case 3: |
| 340 | UP = 0; |
| 341 | break; |
| 342 | case 1: |
| 343 | case 2: |
| 344 | UP = 2; |
| 345 | break; |
| 346 | case 4: |
| 347 | case 5: |
| 348 | UP = 5; |
| 349 | break; |
| 350 | case 6: |
| 351 | case 7: |
| 352 | UP = 7; |
| 353 | break; |
| 354 | } |
| 355 | } |
| 356 | |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 357 | *ppTS = SearchAdmitTRStream(ieee, Addr, UP, TxRxSelect); |
Mateusz Kulikowski | 285b7c0 | 2015-04-01 00:24:26 +0200 | [diff] [blame] | 358 | if (*ppTS != NULL) |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 359 | return true; |
Mateusz Kulikowski | 285b7c0 | 2015-04-01 00:24:26 +0200 | [diff] [blame] | 360 | |
| 361 | if (!bAddNewTs) { |
Mateusz Kulikowski | b94436b | 2015-05-31 20:19:35 +0200 | [diff] [blame] | 362 | netdev_dbg(ieee->dev, "add new TS failed(tid:%d)\n", UP); |
Mateusz Kulikowski | 285b7c0 | 2015-04-01 00:24:26 +0200 | [diff] [blame] | 363 | return false; |
| 364 | } |
| 365 | |
| 366 | pUnusedList = (TxRxSelect == TX_DIR) ? |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 367 | (&ieee->Tx_TS_Unused_List) : |
| 368 | (&ieee->Rx_TS_Unused_List); |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 369 | |
Mateusz Kulikowski | 285b7c0 | 2015-04-01 00:24:26 +0200 | [diff] [blame] | 370 | pAddmitList = (TxRxSelect == TX_DIR) ? |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 371 | (&ieee->Tx_TS_Admit_List) : |
| 372 | (&ieee->Rx_TS_Admit_List); |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 373 | |
Mateusz Kulikowski | 285b7c0 | 2015-04-01 00:24:26 +0200 | [diff] [blame] | 374 | Dir = (ieee->iw_mode == IW_MODE_MASTER) ? |
| 375 | ((TxRxSelect == TX_DIR) ? DIR_DOWN : DIR_UP) : |
| 376 | ((TxRxSelect == TX_DIR) ? DIR_UP : DIR_DOWN); |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 377 | |
Mateusz Kulikowski | 285b7c0 | 2015-04-01 00:24:26 +0200 | [diff] [blame] | 378 | if (!list_empty(pUnusedList)) { |
| 379 | (*ppTS) = list_entry(pUnusedList->next, |
| 380 | struct ts_common_info, List); |
| 381 | list_del_init(&(*ppTS)->List); |
| 382 | if (TxRxSelect == TX_DIR) { |
| 383 | struct tx_ts_record *tmp = |
| 384 | container_of(*ppTS, |
| 385 | struct tx_ts_record, |
| 386 | TsCommonInfo); |
| 387 | ResetTxTsEntry(tmp); |
| 388 | } else { |
| 389 | struct rx_ts_record *tmp = |
| 390 | container_of(*ppTS, |
| 391 | struct rx_ts_record, |
| 392 | TsCommonInfo); |
| 393 | ResetRxTsEntry(tmp); |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 394 | } |
Mateusz Kulikowski | 285b7c0 | 2015-04-01 00:24:26 +0200 | [diff] [blame] | 395 | |
Mateusz Kulikowski | b94436b | 2015-05-31 20:19:35 +0200 | [diff] [blame] | 396 | netdev_dbg(ieee->dev, |
| 397 | "to init current TS, UP:%d, Dir:%d, addr: %pM ppTs=%p\n", |
| 398 | UP, Dir, Addr, *ppTS); |
Mateusz Kulikowski | 285b7c0 | 2015-04-01 00:24:26 +0200 | [diff] [blame] | 399 | pTSInfo->field.ucTrafficType = 0; |
| 400 | pTSInfo->field.ucTSID = UP; |
| 401 | pTSInfo->field.ucDirection = Dir; |
| 402 | pTSInfo->field.ucAccessPolicy = 1; |
| 403 | pTSInfo->field.ucAggregation = 0; |
| 404 | pTSInfo->field.ucPSB = 0; |
| 405 | pTSInfo->field.ucUP = UP; |
| 406 | pTSInfo->field.ucTSInfoAckPolicy = 0; |
| 407 | pTSInfo->field.ucSchedule = 0; |
| 408 | |
| 409 | MakeTSEntry(*ppTS, Addr, &TSpec, NULL, 0, 0); |
| 410 | AdmitTS(ieee, *ppTS, 0); |
| 411 | list_add_tail(&((*ppTS)->List), pAddmitList); |
| 412 | |
| 413 | return true; |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 414 | } |
Mateusz Kulikowski | 285b7c0 | 2015-04-01 00:24:26 +0200 | [diff] [blame] | 415 | |
Mateusz Kulikowski | 11e672c | 2015-05-31 20:19:26 +0200 | [diff] [blame] | 416 | netdev_warn(ieee->dev, |
| 417 | "There is not enough dir=%d(0=up down=1) TS record to be used!", |
| 418 | Dir); |
Mateusz Kulikowski | 285b7c0 | 2015-04-01 00:24:26 +0200 | [diff] [blame] | 419 | return false; |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 420 | } |
| 421 | |
Mateusz Kulikowski | 35e33b0 | 2015-05-31 20:19:40 +0200 | [diff] [blame] | 422 | static void RemoveTsEntry(struct rtllib_device *ieee, |
| 423 | struct ts_common_info *pTs, enum tr_select TxRxSelect) |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 424 | { |
| 425 | del_timer_sync(&pTs->SetupTimer); |
| 426 | del_timer_sync(&pTs->InactTimer); |
| 427 | TsInitDelBA(ieee, pTs, TxRxSelect); |
| 428 | |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 429 | if (TxRxSelect == RX_DIR) { |
Larry Finger | 8cba143 | 2011-07-18 22:16:48 -0500 | [diff] [blame] | 430 | struct rx_reorder_entry *pRxReorderEntry; |
Larry Finger | 2c47ae2 | 2011-07-18 20:11:56 -0500 | [diff] [blame] | 431 | struct rx_ts_record *pRxTS = (struct rx_ts_record *)pTs; |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 432 | |
| 433 | if (timer_pending(&pRxTS->RxPktPendingTimer)) |
| 434 | del_timer_sync(&pRxTS->RxPktPendingTimer); |
| 435 | |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 436 | while (!list_empty(&pRxTS->RxPendingPktList)) { |
| 437 | pRxReorderEntry = (struct rx_reorder_entry *) |
| 438 | list_entry(pRxTS->RxPendingPktList.prev, |
| 439 | struct rx_reorder_entry, List); |
Mateusz Kulikowski | b94436b | 2015-05-31 20:19:35 +0200 | [diff] [blame] | 440 | netdev_dbg(ieee->dev, "%s(): Delete SeqNum %d!\n", |
| 441 | __func__, pRxReorderEntry->SeqNum); |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 442 | list_del_init(&pRxReorderEntry->List); |
| 443 | { |
| 444 | int i = 0; |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 445 | struct rtllib_rxb *prxb = pRxReorderEntry->prxb; |
Matthew Casey | 3a6b70c | 2014-08-22 06:27:52 -0400 | [diff] [blame] | 446 | |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 447 | if (unlikely(!prxb)) |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 448 | return; |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 449 | for (i = 0; i < prxb->nr_subframes; i++) |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 450 | dev_kfree_skb(prxb->subframes[i]); |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 451 | kfree(prxb); |
| 452 | prxb = NULL; |
| 453 | } |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 454 | list_add_tail(&pRxReorderEntry->List, |
| 455 | &ieee->RxReorder_Unused_List); |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 456 | } |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 457 | } else { |
Larry Finger | 60554f2 | 2011-07-18 20:10:03 -0500 | [diff] [blame] | 458 | struct tx_ts_record *pTxTS = (struct tx_ts_record *)pTs; |
Matthew Casey | 3a6b70c | 2014-08-22 06:27:52 -0400 | [diff] [blame] | 459 | |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 460 | del_timer_sync(&pTxTS->TsAddBaTimer); |
| 461 | } |
| 462 | } |
| 463 | |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 464 | void RemovePeerTS(struct rtllib_device *ieee, u8 *Addr) |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 465 | { |
Larry Finger | 74724de | 2011-07-18 20:19:19 -0500 | [diff] [blame] | 466 | struct ts_common_info *pTS, *pTmpTS; |
Matthew Casey | 3a6b70c | 2014-08-22 06:27:52 -0400 | [diff] [blame] | 467 | |
Mateusz Kulikowski | d69d205 | 2015-03-17 00:00:52 +0100 | [diff] [blame] | 468 | netdev_info(ieee->dev, "===========>RemovePeerTS, %pM\n", Addr); |
Mike McCormack | 4f6807e | 2011-07-11 08:56:20 +0900 | [diff] [blame] | 469 | |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 470 | list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Pending_List, List) { |
| 471 | if (memcmp(pTS->Addr, Addr, 6) == 0) { |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 472 | RemoveTsEntry(ieee, pTS, TX_DIR); |
| 473 | list_del_init(&pTS->List); |
| 474 | list_add_tail(&pTS->List, &ieee->Tx_TS_Unused_List); |
| 475 | } |
| 476 | } |
| 477 | |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 478 | list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Admit_List, List) { |
| 479 | if (memcmp(pTS->Addr, Addr, 6) == 0) { |
Mateusz Kulikowski | d69d205 | 2015-03-17 00:00:52 +0100 | [diff] [blame] | 480 | netdev_info(ieee->dev, |
| 481 | "====>remove Tx_TS_admin_list\n"); |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 482 | RemoveTsEntry(ieee, pTS, TX_DIR); |
| 483 | list_del_init(&pTS->List); |
| 484 | list_add_tail(&pTS->List, &ieee->Tx_TS_Unused_List); |
| 485 | } |
| 486 | } |
| 487 | |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 488 | list_for_each_entry_safe(pTS, pTmpTS, &ieee->Rx_TS_Pending_List, List) { |
| 489 | if (memcmp(pTS->Addr, Addr, 6) == 0) { |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 490 | RemoveTsEntry(ieee, pTS, RX_DIR); |
| 491 | list_del_init(&pTS->List); |
| 492 | list_add_tail(&pTS->List, &ieee->Rx_TS_Unused_List); |
| 493 | } |
| 494 | } |
| 495 | |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 496 | list_for_each_entry_safe(pTS, pTmpTS, &ieee->Rx_TS_Admit_List, List) { |
| 497 | if (memcmp(pTS->Addr, Addr, 6) == 0) { |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 498 | RemoveTsEntry(ieee, pTS, RX_DIR); |
| 499 | list_del_init(&pTS->List); |
| 500 | list_add_tail(&pTS->List, &ieee->Rx_TS_Unused_List); |
| 501 | } |
| 502 | } |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 503 | } |
Sean MacLennan | 3b28499 | 2011-11-28 20:20:26 -0500 | [diff] [blame] | 504 | EXPORT_SYMBOL(RemovePeerTS); |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 505 | |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 506 | void RemoveAllTS(struct rtllib_device *ieee) |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 507 | { |
Larry Finger | 74724de | 2011-07-18 20:19:19 -0500 | [diff] [blame] | 508 | struct ts_common_info *pTS, *pTmpTS; |
Mike McCormack | 4f6807e | 2011-07-11 08:56:20 +0900 | [diff] [blame] | 509 | |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 510 | list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Pending_List, List) { |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 511 | RemoveTsEntry(ieee, pTS, TX_DIR); |
| 512 | list_del_init(&pTS->List); |
| 513 | list_add_tail(&pTS->List, &ieee->Tx_TS_Unused_List); |
| 514 | } |
| 515 | |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 516 | list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Admit_List, List) { |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 517 | RemoveTsEntry(ieee, pTS, TX_DIR); |
| 518 | list_del_init(&pTS->List); |
| 519 | list_add_tail(&pTS->List, &ieee->Tx_TS_Unused_List); |
| 520 | } |
| 521 | |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 522 | list_for_each_entry_safe(pTS, pTmpTS, &ieee->Rx_TS_Pending_List, List) { |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 523 | RemoveTsEntry(ieee, pTS, RX_DIR); |
| 524 | list_del_init(&pTS->List); |
| 525 | list_add_tail(&pTS->List, &ieee->Rx_TS_Unused_List); |
| 526 | } |
| 527 | |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 528 | list_for_each_entry_safe(pTS, pTmpTS, &ieee->Rx_TS_Admit_List, List) { |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 529 | RemoveTsEntry(ieee, pTS, RX_DIR); |
| 530 | list_del_init(&pTS->List); |
| 531 | list_add_tail(&pTS->List, &ieee->Rx_TS_Unused_List); |
| 532 | } |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 533 | } |
| 534 | |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 535 | void TsStartAddBaProcess(struct rtllib_device *ieee, struct tx_ts_record *pTxTS) |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 536 | { |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 537 | if (pTxTS->bAddBaReqInProgress == false) { |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 538 | pTxTS->bAddBaReqInProgress = true; |
Mike McCormack | 4f6807e | 2011-07-11 08:56:20 +0900 | [diff] [blame] | 539 | |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 540 | if (pTxTS->bAddBaReqDelayed) { |
Mateusz Kulikowski | b94436b | 2015-05-31 20:19:35 +0200 | [diff] [blame] | 541 | netdev_dbg(ieee->dev, "Start ADDBA after 60 sec!!\n"); |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 542 | mod_timer(&pTxTS->TsAddBaTimer, jiffies + |
Vaishali Thakkar | 8b9733c | 2015-03-11 13:51:36 +0530 | [diff] [blame] | 543 | msecs_to_jiffies(TS_ADDBA_DELAY)); |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 544 | } else { |
Mateusz Kulikowski | b94436b | 2015-05-31 20:19:35 +0200 | [diff] [blame] | 545 | netdev_dbg(ieee->dev, "Immediately Start ADDBA\n"); |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 546 | mod_timer(&pTxTS->TsAddBaTimer, jiffies+10); |
| 547 | } |
Larry Finger | f88ec6c | 2011-08-25 11:48:18 -0500 | [diff] [blame] | 548 | } else |
Mateusz Kulikowski | b94436b | 2015-05-31 20:19:35 +0200 | [diff] [blame] | 549 | netdev_dbg(ieee->dev, "BA timer is already added\n"); |
Larry Finger | 94a7994 | 2011-08-23 19:00:42 -0500 | [diff] [blame] | 550 | } |