From patchwork Fri Aug 9 09:44:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lin X-Patchwork-Id: 13758613 X-Patchwork-Delegate: kvalo@adurom.com Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013064.outbound.protection.outlook.com [52.101.67.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A039F194A42; Fri, 9 Aug 2024 09:46:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.67.64 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723196788; cv=fail; b=PYtgj0BwSunGoQrAr606c/YrvcLf6enAN1TLWIWvbaeWUmM05tOA1k79AGNwaFTNKO/9F2onrUyHaJaddE/u9L/yy1qOSfZfvstauypRDkSGDjC9/HVWnFtmtR0Knde4tVlnxO6N9YCJg+OUczCnukAzYRw56ELucpyBLToe820= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723196788; c=relaxed/simple; bh=znWLtTkFM76wGBuVsUdfZMDp40n4XqPUorbBvxwHMzQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=i/qTn164bIOYqyzejsmszXJkAJEQdZGvvrQdtuDz7k+K+4IB1Akbr7KRT7igCcf0xGJGVixIurJS8V1pUV9nWySRCuVkXXBIhf0OuvZ/bNoCX0Ebup5SQQHyHknbjarpmtC5zy1v7wKwCTQiYbGurrtmLHZ0AzWK+zY5UhH+HLU= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=Sz2o6YZY; arc=fail smtp.client-ip=52.101.67.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="Sz2o6YZY" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=FbonYZ7ke312MdB/NtTbYwZ8+n5d35Y2EmOdWHxlfjdQpDTkUvil0IEd2dxvurLjY67bSj1F0htx2fPHGNqGACP+0GY8nR4BEN3xjS8tg3tfmsiIpTWimImBbRHMfgbm/kjjXOFmPxDhoOQwrtizLirRImwU+btd3HKmsWa1jXNrEeTvOje9Htf8mQGZPElC4+qN64Ix9jn2jS0H/cePLC9SkihY1iAbI3ZXk9/X20yUYToFu1cE8zzq92vMg12xltSIXQ2FoRg9P4hdWlvTFkMpykT2mqpSCwvO3yBuvQzpD2TQQB0LpX5GSTNO5fNCQi5uBC5jZfSEU4qGZcFgOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=D3boSOwEh0i1qO6vUWvAJ9pNPb0xhMcSZHsWqmugtc8=; b=dMruA+ySyZLbajpAsoeTM9OgU+om5hyxWSkVNenb+jZ8daCSpFZ8yXPvBd0Xoio5bbWxgMYoQo6d7AXsmd1dq+iDkssd4zdem7/YIEtYRDoAeVNJDZKOcZwngeazcQC4w6nVnOmuAna0cQ22b6xwsv3kyNp9D+zKWXEvBlHx3yt+oKY1SQc6PomZtGvj4ovgdTK9Sgofeovg13mmi4sioUKket8I93EKu8rJU+BRpQhbAcc6SGXHb1ZYXSB+UZHFTMAFJCG9zw4Bp9IUnjmjHPI/6Yd49/SWbNgHh/w7ZGHgQWevg1hEyOqhenT+W51FDEPayhJtIvTphwGZkNBU2Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=D3boSOwEh0i1qO6vUWvAJ9pNPb0xhMcSZHsWqmugtc8=; b=Sz2o6YZYm/9g/K5ITQfyIEwLcHPo+LOs0EhdpbAfYNG0GJk5yiMybxy/wYd8Y9a5dw1meU5+33yfb869NjLEyjrWwrd0HEKebOIhvhxcJNuBlZS/1HYJmzZbu8CeHSpcYmSKb4L9MorNAPNEMshGtxMvkNMoWzPfA7PZfJfN0cnhCmvlFXJ7+sv9b2jqoc7KCLdBOjRJ5C55NK6oBx+kI0GETzrdeh2e8UOiVMn59P7/grY6DRZf0Yh8Ewk1T6teTLhwYDnorwYGZ3e7xu4f12SqGvDpWam+39gmV7B50LFRrWN3CLua1fWLncrYerFa3iD6TPvng4qLkUSt8nUGFw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PA4PR04MB9638.eurprd04.prod.outlook.com (2603:10a6:102:273::20) by PAXPR04MB9229.eurprd04.prod.outlook.com (2603:10a6:102:2bd::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.26; Fri, 9 Aug 2024 09:46:21 +0000 Received: from PA4PR04MB9638.eurprd04.prod.outlook.com ([fe80::f950:3bb6:6848:2257]) by PA4PR04MB9638.eurprd04.prod.outlook.com ([fe80::f950:3bb6:6848:2257%5]) with mapi id 15.20.7828.023; Fri, 9 Aug 2024 09:46:21 +0000 From: David Lin To: linux-wireless@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kvalo@kernel.org, johannes@sipsolutions.net, briannorris@chromium.org, francesco@dolcini.it, tsung-hsien.hsieh@nxp.com, David Lin Subject: [PATCH v2 09/43] wifi: nxpwifi: add 11n_rxreorder.h Date: Fri, 9 Aug 2024 17:44:59 +0800 Message-Id: <20240809094533.1660-10-yu-hao.lin@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240809094533.1660-1-yu-hao.lin@nxp.com> References: <20240809094533.1660-1-yu-hao.lin@nxp.com> X-ClientProxiedBy: TYCP286CA0178.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3c6::9) To PA4PR04MB9638.eurprd04.prod.outlook.com (2603:10a6:102:273::20) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PA4PR04MB9638:EE_|PAXPR04MB9229:EE_ X-MS-Office365-Filtering-Correlation-Id: db09b283-f7b6-451d-76e5-08dcb8581fc6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|366016|1800799024|52116014; X-Microsoft-Antispam-Message-Info: VwTNdyct9c6w4Q/e6lhNSwtSnZCQjGsNkJlFmXbSkZw+5x1if4TgfhqxXvhZFeugWE/PxG5l05qKRhCklHO7+YgiA5v4c9jACSoLZnq7i3dc1AzN6irAUG37GzXXTMq1MYCcsVK/rFeZ4+zjrIZKo7RCKhDIM0bhZRD6FqKpr3k6oHawUc2xoHkILPdYsv0bvEFyxif8hOBbdH12lPEOqfILJtirUNaxa642qdkTcV6seB0K0a3tqBChqWinKwq23KMMGSrdI2ZV6b9/P2+J/fhxMP0eFSuPdNbop2+WiDvX1C1JEoFHFLKg4GsuGg3mm4Y1eDcd485pH8ASyQBKqjXmTv1YvOEWf21hIrmCvrR+9k2PUe++Mh9Xd+Kqn6AoYHN9EGRsrHMt26mTqM3+C7YycZdJIDe+9uo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)(366016)(1800799024)(52116014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: YW7VxbQSYrl6bC1s5FWN0I8CwvfUI34ig/xPfmTosJcokBhg/3P7DguUVkI3uNw8Cio2QHD/4ZOcjfNH3Qm04zXcZWkr1awv8fXvhVCupd1b+M87oR50dXty+9//ZuqTCdpAnzJ7qpvR43oVv9Qq7bSntBk5HU939tFHzgkc1CYmx/EcWVdXewrR3AVyei9/LwMpbeCGDQcSOqX0MAcXFufq3af3MOYAWo2nvbfsFkAEfTidYG3xrTJ+mZvwEJsxK6aRezdrnlzFidSBd5Fp1i1qGAhPlC19w//eV4Qw0wQyW5/fE7FFN+VJRcA/jqJtuQAiDJUHWSTq4e6lY0RLmiMLWkkdX14RVdjOqWSn0DYOoyqr0tqhA94wQnJiT7twtYPdL5NJ/YLx9M5oKbtZIwOoCZNBsxHGPBxkdyS4XHyl+DbIii+k199LAiiDfkplqbsmzmtMdQRdXwxOQIy1XlTqrQL1DqFBa0EN5KEPj2if65K6zBMetsEHZGc60Bw6XEk6AZ8Gva35KU05p0ax4LduKcljWAVBSOiUD9Ga4li+WWVN1lxxY6+VQJFjkKcqI3S+GpesMn1zSg9tg0NVczZw8n0OXNiAm0lZQ3pXELTevEm07c8Z0wMLFNCGYL8GojUceHpQNr0cxy6A5YBQTLjo5tlRIWkePkWI0QJ9c2IZiiLVr7s1hdi+zy65++hIbJKWKP/n6BMJjYO0rzeCbQ0c3oEKh3wBEmkQzPDtZXd537BiCGZnopPtSEAqKihHOUh5YEKbOp6+SA4IwPoHwOMdxhbqjBTI6Kg+Brold/vta9qtd84gO9Vj7lHsN93w311oZ88ED+Gec56bQq8fZuIndJD6myys0vHECnLG9Uyz868FIJ8KJc4h5RbXLGYcs59HqBUC36iWlMeMToVxc+jbZW96ASrUvCepTzuhv47mfSbqpt9DzbAlUJYQEl1OpwERRpAAVYIr5f0KwUnBNH3aOZYRTi+FPCV0iGuZSiP620KfA7ZJpgvCGRH1GEuH3AQLi49YhG7a6fXnJhinbNc5r2LHWgx5Yrwn5eXIeJnM4QO7fGblFWM2zQ0uJOBfGZ5JsBKjl40R8MHjPoIYZDKhhAOKFAsjxigD7/MWTDszCf+EspmNrBmf2xLKACZVhBWADwHGVZWCACqzzJoSj69XQ2a1xDVDDHmdziE2BtChvz8K4vmZOjZzLEV9ADBfCwJPhPPmfJxFHeK5sYRd5yFuvbKg6CDX7H2D7L5ubxB/MScuTGszlbUslBnUJ59fkD9XE+LL+CrMLdeBeSYRmqSaK6apHi2blfQkf4sTN9tU1kvm3UEQ1O/uVXENKbly5HWqZZY9OV7+kyifJHw1AWk4HNszQWzC5n+evbOdx/Zp3GZw8CQJEZAgliIhkzRsZ5MSbL6UUS3vLdaBi+UTa502uOAdMJLXxRL+y+nwbtjYkTgTgny8EJ/Qb5PhTHFcgeNv6o3geK7XCzD296+wBDyJa27ow3ySmCzHObi6WsjNRdxIoX78Arfa/v7sC688qr+aYF9ZyyvK1UhYpeNIqLMgV5H0C4OC8lQ2uh1Q94Y86bU9VQcbZImf+q5AOrf+2vFUbJZpiIh50RlCNPd+xOgvl2i+FHPUOvaR8znpf0oIEW42hJn0TiLiQA8ZvyRx X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: db09b283-f7b6-451d-76e5-08dcb8581fc6 X-MS-Exchange-CrossTenant-AuthSource: PA4PR04MB9638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Aug 2024 09:46:21.0877 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: qwuax0rLl98o3pkjBx/D2u+qPW7EQuQwk9O8SzjX+Dl9W8qqPT+jDoMbjxA8Nkm+lL7C0320zLajqH//GnI1NA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9229 --- .../net/wireless/nxp/nxpwifi/11n_rxreorder.h | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 drivers/net/wireless/nxp/nxpwifi/11n_rxreorder.h diff --git a/drivers/net/wireless/nxp/nxpwifi/11n_rxreorder.h b/drivers/net/wireless/nxp/nxpwifi/11n_rxreorder.h new file mode 100644 index 000000000000..9b5dd4899f0e --- /dev/null +++ b/drivers/net/wireless/nxp/nxpwifi/11n_rxreorder.h @@ -0,0 +1,72 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * NXP Wireless LAN device driver: 802.11n RX Re-ordering + * + * Copyright 2011-2024 NXP + */ + +#ifndef _NXPWIFI_11N_RXREORDER_H_ +#define _NXPWIFI_11N_RXREORDER_H_ + +#define MIN_FLUSH_TIMER_MS 50 +#define MIN_FLUSH_TIMER_15_MS 15 +#define NXPWIFI_BA_WIN_SIZE_32 32 + +#define PKT_TYPE_BAR 0xE7 +#define MAX_TID_VALUE (2 << 11) +#define TWOPOW11 (2 << 10) + +#define BLOCKACKPARAM_TID_POS 2 +#define BLOCKACKPARAM_AMSDU_SUPP_MASK 0x1 +#define BLOCKACKPARAM_WINSIZE_POS 6 +#define DELBA_TID_POS 12 +#define DELBA_INITIATOR_POS 11 +#define TYPE_DELBA_SENT 1 +#define TYPE_DELBA_RECEIVE 2 +#define IMMEDIATE_BLOCK_ACK 0x2 + +#define ADDBA_RSP_STATUS_ACCEPT 0 + +#define NXPWIFI_DEF_11N_RX_SEQ_NUM 0xffff +#define BA_SETUP_MAX_PACKET_THRESHOLD 16 +#define BA_SETUP_PACKET_OFFSET 16 + +enum nxpwifi_rxreor_flags { + RXREOR_FORCE_NO_DROP = 1 << 0, + RXREOR_INIT_WINDOW_SHIFT = 1 << 1, +}; + +static inline void nxpwifi_reset_11n_rx_seq_num(struct nxpwifi_private *priv) +{ + memset(priv->rx_seq, 0xff, sizeof(priv->rx_seq)); +} + +int nxpwifi_11n_rx_reorder_pkt(struct nxpwifi_private *, + u16 seqNum, + u16 tid, u8 *ta, + u8 pkttype, void *payload); +void nxpwifi_del_ba_tbl(struct nxpwifi_private *priv, int tid, + u8 *peer_mac, u8 type, int initiator); +void nxpwifi_11n_ba_stream_timeout(struct nxpwifi_private *priv, + struct host_cmd_ds_11n_batimeout *event); +int nxpwifi_ret_11n_addba_resp(struct nxpwifi_private *priv, + struct host_cmd_ds_command + *resp); +int nxpwifi_cmd_11n_delba(struct host_cmd_ds_command *cmd, + void *data_buf); +int nxpwifi_cmd_11n_addba_rsp_gen(struct nxpwifi_private *priv, + struct host_cmd_ds_command *cmd, + struct host_cmd_ds_11n_addba_req + *cmd_addba_req); +int nxpwifi_cmd_11n_addba_req(struct host_cmd_ds_command *cmd, + void *data_buf); +void nxpwifi_11n_cleanup_reorder_tbl(struct nxpwifi_private *priv); +struct nxpwifi_rx_reorder_tbl * +nxpwifi_11n_get_rxreorder_tbl(struct nxpwifi_private *priv, int tid, u8 *ta); +struct nxpwifi_rx_reorder_tbl * +nxpwifi_11n_get_rx_reorder_tbl(struct nxpwifi_private *priv, int tid, u8 *ta); +void nxpwifi_11n_del_rx_reorder_tbl_by_ta(struct nxpwifi_private *priv, u8 *ta); +void nxpwifi_update_rxreor_flags(struct nxpwifi_adapter *adapter, u8 flags); +void nxpwifi_11n_rxba_sync_event(struct nxpwifi_private *priv, + u8 *event_buf, u16 len); +#endif /* _NXPWIFI_11N_RXREORDER_H_ */