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