get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/60212/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 60212,
    "url": "https://patches.dpdk.org/api/patches/60212/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20190930144104.12742-6-akhil.goyal@nxp.com/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20190930144104.12742-6-akhil.goyal@nxp.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190930144104.12742-6-akhil.goyal@nxp.com",
    "date": "2019-09-30T14:40:45",
    "name": "[v3,05/24] crypto/dpaa2_sec: update desc for pdcp 18bit enc-auth",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "f5e01348da82908a2da841c51907cf700e9aba06",
    "submitter": {
        "id": 517,
        "url": "https://patches.dpdk.org/api/people/517/?format=api",
        "name": "Akhil Goyal",
        "email": "akhil.goyal@nxp.com"
    },
    "delegate": {
        "id": 6690,
        "url": "https://patches.dpdk.org/api/users/6690/?format=api",
        "username": "akhil",
        "first_name": "akhil",
        "last_name": "goyal",
        "email": "gakhil@marvell.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20190930144104.12742-6-akhil.goyal@nxp.com/mbox/",
    "series": [
        {
            "id": 6623,
            "url": "https://patches.dpdk.org/api/series/6623/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=6623",
            "date": "2019-09-30T14:40:40",
            "name": "crypto/dpaaX_sec: Support Wireless algos",
            "version": 3,
            "mbox": "https://patches.dpdk.org/series/6623/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/60212/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/60212/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id E0EA11BEBC;\n\tMon, 30 Sep 2019 16:56:36 +0200 (CEST)",
            "from inva020.nxp.com (inva020.nxp.com [92.121.34.13])\n\tby dpdk.org (Postfix) with ESMTP id 0C1F41BE8F\n\tfor <dev@dpdk.org>; Mon, 30 Sep 2019 16:56:23 +0200 (CEST)",
            "from inva020.nxp.com (localhost [127.0.0.1])\n\tby inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id DF8351A0043;\n\tMon, 30 Sep 2019 16:56:22 +0200 (CEST)",
            "from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com\n\t[165.114.16.14])\n\tby inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 533521A0877;\n\tMon, 30 Sep 2019 16:56:20 +0200 (CEST)",
            "from GDB1.ap.freescale.net (GDB1.ap.freescale.net [10.232.132.179])\n\tby invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 2F76940313;\n\tMon, 30 Sep 2019 22:56:17 +0800 (SGT)"
        ],
        "From": "Akhil Goyal <akhil.goyal@nxp.com>",
        "To": "dev@dpdk.org",
        "Cc": "aconole@redhat.com, anoobj@marvell.com, Akhil Goyal <akhil.goyal@nxp.com>",
        "Date": "Mon, 30 Sep 2019 20:10:45 +0530",
        "Message-Id": "<20190930144104.12742-6-akhil.goyal@nxp.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20190930144104.12742-1-akhil.goyal@nxp.com>",
        "References": "<20190930115237.5073-1-akhil.goyal@nxp.com>\n\t<20190930144104.12742-1-akhil.goyal@nxp.com>",
        "X-Virus-Scanned": "ClamAV using ClamSMTP",
        "Subject": "[dpdk-dev] [PATCH v3 05/24] crypto/dpaa2_sec: update desc for pdcp\n\t18bit enc-auth",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Support following cases\nint-only (NULL-NULL, NULL-SNOW, NULL-AES, NULL-ZUC)\nenc-only (SNOW-NULL, AES-NULL, ZUC-NULL)\n\nSigned-off-by: Akhil Goyal <akhil.goyal@nxp.com>\n---\n drivers/crypto/dpaa2_sec/hw/desc/pdcp.h | 532 +++++++++++++++++++-----\n 1 file changed, 420 insertions(+), 112 deletions(-)",
    "diff": "diff --git a/drivers/crypto/dpaa2_sec/hw/desc/pdcp.h b/drivers/crypto/dpaa2_sec/hw/desc/pdcp.h\nindex a636640c4..9a73105ac 100644\n--- a/drivers/crypto/dpaa2_sec/hw/desc/pdcp.h\n+++ b/drivers/crypto/dpaa2_sec/hw/desc/pdcp.h\n@@ -1,5 +1,6 @@\n /* SPDX-License-Identifier: BSD-3-Clause or GPL-2.0+\n  * Copyright 2008-2013 Freescale Semiconductor, Inc.\n+ * Copyright 2019 NXP\n  */\n \n #ifndef __DESC_PDCP_H__\n@@ -52,6 +53,14 @@\n #define PDCP_U_PLANE_15BIT_SN_MASK\t0xFF7F0000\n #define PDCP_U_PLANE_15BIT_SN_MASK_BE\t0x00007FFF\n \n+/**\n+ * PDCP_U_PLANE_18BIT_SN_MASK - This mask is used in the PDCP descriptors for\n+ *                              extracting the sequence number (SN) from the\n+ *                              PDCP User Plane header.\n+ */\n+#define PDCP_U_PLANE_18BIT_SN_MASK\t0xFFFF0300\n+#define PDCP_U_PLANE_18BIT_SN_MASK_BE\t0x0003FFFF\n+\n /**\n  * PDCP_BEARER_MASK - This mask is used masking out the bearer for PDCP\n  *                    processing with SNOW f9 in LTE.\n@@ -192,7 +201,8 @@ enum pdcp_sn_size {\n \tPDCP_SN_SIZE_5 = 5,\n \tPDCP_SN_SIZE_7 = 7,\n \tPDCP_SN_SIZE_12 = 12,\n-\tPDCP_SN_SIZE_15 = 15\n+\tPDCP_SN_SIZE_15 = 15,\n+\tPDCP_SN_SIZE_18 = 18\n };\n \n /*\n@@ -205,14 +215,17 @@ enum pdcp_sn_size {\n \n #define PDCP_U_PLANE_PDB_OPT_SHORT_SN\t\t0x2\n #define PDCP_U_PLANE_PDB_OPT_15B_SN\t\t0x4\n+#define PDCP_U_PLANE_PDB_OPT_18B_SN\t\t0x6\n #define PDCP_U_PLANE_PDB_SHORT_SN_HFN_SHIFT\t7\n #define PDCP_U_PLANE_PDB_LONG_SN_HFN_SHIFT\t12\n #define PDCP_U_PLANE_PDB_15BIT_SN_HFN_SHIFT\t15\n+#define PDCP_U_PLANE_PDB_18BIT_SN_HFN_SHIFT\t18\n #define PDCP_U_PLANE_PDB_BEARER_SHIFT\t\t27\n #define PDCP_U_PLANE_PDB_DIR_SHIFT\t\t26\n #define PDCP_U_PLANE_PDB_SHORT_SN_HFN_THR_SHIFT\t7\n #define PDCP_U_PLANE_PDB_LONG_SN_HFN_THR_SHIFT\t12\n #define PDCP_U_PLANE_PDB_15BIT_SN_HFN_THR_SHIFT\t15\n+#define PDCP_U_PLANE_PDB_18BIT_SN_HFN_THR_SHIFT\t18\n \n struct pdcp_pdb {\n \tunion {\n@@ -417,6 +430,9 @@ pdcp_insert_cplane_int_only_op(struct program *p,\n \t\t\t       enum pdcp_sn_size sn_size,\n \t\t\t       unsigned char era_2_sw_hfn_ovrd)\n {\n+\tuint32_t offset = 0, length = 0, sn_mask = 0;\n+\n+\t/* 12 bit SN is only supported for protocol offload case */\n \tif (rta_sec_era >= RTA_SEC_ERA_8 && sn_size == PDCP_SN_SIZE_12) {\n \t\tKEY(p, KEY2, authdata->key_enc_flags, authdata->key,\n \t\t    authdata->keylen, INLINE_KEY(authdata));\n@@ -426,6 +442,27 @@ pdcp_insert_cplane_int_only_op(struct program *p,\n \t\treturn 0;\n \t}\n \n+\t/* Non-proto is supported only for 5bit cplane and 18bit uplane */\n+\tswitch (sn_size) {\n+\tcase PDCP_SN_SIZE_5:\n+\t\toffset = 7;\n+\t\tlength = 1;\n+\t\tsn_mask = (swap == false) ? PDCP_C_PLANE_SN_MASK :\n+\t\t\t\t\tPDCP_C_PLANE_SN_MASK_BE;\n+\t\tbreak;\n+\tcase PDCP_SN_SIZE_18:\n+\t\toffset = 5;\n+\t\tlength = 3;\n+\t\tsn_mask = (swap == false) ? PDCP_U_PLANE_18BIT_SN_MASK :\n+\t\t\t\t\tPDCP_U_PLANE_18BIT_SN_MASK_BE;\n+\t\tbreak;\n+\tcase PDCP_SN_SIZE_7:\n+\tcase PDCP_SN_SIZE_12:\n+\tcase PDCP_SN_SIZE_15:\n+\t\tpr_err(\"Invalid sn_size for %s\\n\", __func__);\n+\t\treturn -ENOTSUP;\n+\n+\t}\n \tLABEL(local_offset);\n \tREFERENCE(move_cmd_read_descbuf);\n \tREFERENCE(move_cmd_write_descbuf);\n@@ -435,20 +472,20 @@ pdcp_insert_cplane_int_only_op(struct program *p,\n \t\t/* Insert Auth Key */\n \t\tKEY(p, KEY2, authdata->key_enc_flags, authdata->key,\n \t\t    authdata->keylen, INLINE_KEY(authdata));\n-\t\tSEQLOAD(p, MATH0, 7, 1, 0);\n+\t\tSEQLOAD(p, MATH0, offset, length, 0);\n \t\tJUMP(p, 1, LOCAL_JUMP, ALL_TRUE, CALM);\n \n \t\tif (rta_sec_era > RTA_SEC_ERA_2 ||\n \t\t    (rta_sec_era == RTA_SEC_ERA_2 &&\n \t\t\t\t   era_2_sw_hfn_ovrd == 0)) {\n-\t\t\tSEQINPTR(p, 0, 1, RTO);\n+\t\t\tSEQINPTR(p, 0, length, RTO);\n \t\t} else {\n \t\t\tSEQINPTR(p, 0, 5, RTO);\n \t\t\tSEQFIFOLOAD(p, SKIP, 4, 0);\n \t\t}\n \n \t\tif (swap == false) {\n-\t\t\tMATHB(p, MATH0, AND, PDCP_C_PLANE_SN_MASK, MATH1,  8,\n+\t\t\tMATHB(p, MATH0, AND, sn_mask, MATH1,  8,\n \t\t\t      IFB | IMMED2);\n \t\t\tMATHB(p, MATH1, SHLD, MATH1, MATH1,  8, 0);\n \n@@ -461,7 +498,7 @@ pdcp_insert_cplane_int_only_op(struct program *p,\n \t\t\tMATHB(p, MATH1, OR, MATH2, MATH2, 8, 0);\n \t\t\tMOVEB(p, MATH2, 0, CONTEXT2, 0, 0x0C, WAITCOMP | IMMED);\n \t\t} else {\n-\t\t\tMATHB(p, MATH0, AND, PDCP_C_PLANE_SN_MASK_BE, MATH1,  8,\n+\t\t\tMATHB(p, MATH0, AND, sn_mask, MATH1,  8,\n \t\t\t      IFB | IMMED2);\n \t\t\tMATHB(p, MATH1, SHLD, MATH1, MATH1,  8, 0);\n \n@@ -553,19 +590,19 @@ pdcp_insert_cplane_int_only_op(struct program *p,\n \t\t/* Insert Auth Key */\n \t\tKEY(p, KEY1, authdata->key_enc_flags, authdata->key,\n \t\t    authdata->keylen, INLINE_KEY(authdata));\n-\t\tSEQLOAD(p, MATH0, 7, 1, 0);\n+\t\tSEQLOAD(p, MATH0, offset, length, 0);\n \t\tJUMP(p, 1, LOCAL_JUMP, ALL_TRUE, CALM);\n \t\tif (rta_sec_era > RTA_SEC_ERA_2 ||\n \t\t    (rta_sec_era == RTA_SEC_ERA_2 &&\n \t\t     era_2_sw_hfn_ovrd == 0)) {\n-\t\t\tSEQINPTR(p, 0, 1, RTO);\n+\t\t\tSEQINPTR(p, 0, length, RTO);\n \t\t} else {\n \t\t\tSEQINPTR(p, 0, 5, RTO);\n \t\t\tSEQFIFOLOAD(p, SKIP, 4, 0);\n \t\t}\n \n \t\tif (swap == false) {\n-\t\t\tMATHB(p, MATH0, AND, PDCP_C_PLANE_SN_MASK, MATH1, 8,\n+\t\t\tMATHB(p, MATH0, AND, sn_mask, MATH1, 8,\n \t\t\t      IFB | IMMED2);\n \t\t\tMATHB(p, MATH1, SHLD, MATH1, MATH1, 8, 0);\n \n@@ -573,7 +610,7 @@ pdcp_insert_cplane_int_only_op(struct program *p,\n \t\t\tMATHB(p, MATH1, OR, MATH2, MATH2, 8, 0);\n \t\t\tMOVEB(p, MATH2, 0, IFIFOAB1, 0, 8, IMMED);\n \t\t} else {\n-\t\t\tMATHB(p, MATH0, AND, PDCP_C_PLANE_SN_MASK_BE, MATH1, 8,\n+\t\t\tMATHB(p, MATH0, AND, sn_mask, MATH1, 8,\n \t\t\t      IFB | IMMED2);\n \t\t\tMATHB(p, MATH1, SHLD, MATH1, MATH1, 8, 0);\n \n@@ -665,11 +702,11 @@ pdcp_insert_cplane_int_only_op(struct program *p,\n \t\t/* Insert Auth Key */\n \t\tKEY(p, KEY2, authdata->key_enc_flags, authdata->key,\n \t\t    authdata->keylen, INLINE_KEY(authdata));\n-\t\tSEQLOAD(p, MATH0, 7, 1, 0);\n+\t\tSEQLOAD(p, MATH0, offset, length, 0);\n \t\tJUMP(p, 1, LOCAL_JUMP, ALL_TRUE, CALM);\n-\t\tSEQINPTR(p, 0, 1, RTO);\n+\t\tSEQINPTR(p, 0, length, RTO);\n \t\tif (swap == false) {\n-\t\t\tMATHB(p, MATH0, AND, PDCP_C_PLANE_SN_MASK, MATH1, 8,\n+\t\t\tMATHB(p, MATH0, AND, sn_mask, MATH1, 8,\n \t\t\t      IFB | IMMED2);\n \t\t\tMATHB(p, MATH1, SHLD, MATH1, MATH1, 8, 0);\n \n@@ -678,7 +715,7 @@ pdcp_insert_cplane_int_only_op(struct program *p,\n \t\t\tMOVEB(p, MATH2, 0, CONTEXT2, 0, 8, IMMED);\n \n \t\t} else {\n-\t\t\tMATHB(p, MATH0, AND, PDCP_C_PLANE_SN_MASK_BE, MATH1, 8,\n+\t\t\tMATHB(p, MATH0, AND, sn_mask, MATH1, 8,\n \t\t\t      IFB | IMMED2);\n \t\t\tMATHB(p, MATH1, SHLD, MATH1, MATH1, 8, 0);\n \n@@ -734,11 +771,12 @@ pdcp_insert_cplane_enc_only_op(struct program *p,\n \t\t\t       enum pdcp_sn_size sn_size,\n \t\t\t       unsigned char era_2_sw_hfn_ovrd __maybe_unused)\n {\n+\tuint32_t offset = 0, length = 0, sn_mask = 0;\n \t/* Insert Cipher Key */\n \tKEY(p, KEY1, cipherdata->key_enc_flags, cipherdata->key,\n \t    cipherdata->keylen, INLINE_KEY(cipherdata));\n \n-\tif (rta_sec_era >= RTA_SEC_ERA_8) {\n+\tif (rta_sec_era >= RTA_SEC_ERA_8 && sn_size != PDCP_SN_SIZE_18) {\n \t\tif (sn_size == PDCP_SN_SIZE_5)\n \t\t\tPROTOCOL(p, dir, OP_PCLID_LTE_PDCP_CTRL_MIXED,\n \t\t\t\t (uint16_t)cipherdata->algtype << 8);\n@@ -747,16 +785,32 @@ pdcp_insert_cplane_enc_only_op(struct program *p,\n \t\t\t\t (uint16_t)cipherdata->algtype << 8);\n \t\treturn 0;\n \t}\n+\t/* Non-proto is supported only for 5bit cplane and 18bit uplane */\n+\tswitch (sn_size) {\n+\tcase PDCP_SN_SIZE_5:\n+\t\toffset = 7;\n+\t\tlength = 1;\n+\t\tsn_mask = (swap == false) ? PDCP_C_PLANE_SN_MASK :\n+\t\t\t\t\tPDCP_C_PLANE_SN_MASK_BE;\n+\t\tbreak;\n+\tcase PDCP_SN_SIZE_18:\n+\t\toffset = 5;\n+\t\tlength = 3;\n+\t\tsn_mask = (swap == false) ? PDCP_U_PLANE_18BIT_SN_MASK :\n+\t\t\t\t\tPDCP_U_PLANE_18BIT_SN_MASK_BE;\n+\t\tbreak;\n+\tcase PDCP_SN_SIZE_7:\n+\tcase PDCP_SN_SIZE_12:\n+\tcase PDCP_SN_SIZE_15:\n+\t\tpr_err(\"Invalid sn_size for %s\\n\", __func__);\n+\t\treturn -ENOTSUP;\n \n-\tSEQLOAD(p, MATH0, 7, 1, 0);\n+\t}\n+\n+\tSEQLOAD(p, MATH0, offset, length, 0);\n \tJUMP(p, 1, LOCAL_JUMP, ALL_TRUE, CALM);\n-\tif (swap == false)\n-\t\tMATHB(p, MATH0, AND, PDCP_C_PLANE_SN_MASK, MATH1, 8,\n-\t\t\tIFB | IMMED2);\n-\telse\n-\t\tMATHB(p, MATH0, AND, PDCP_C_PLANE_SN_MASK_BE, MATH1, 8,\n-\t\t\tIFB | IMMED2);\n-\tSEQSTORE(p, MATH0, 7, 1, 0);\n+\tMATHB(p, MATH0, AND, sn_mask, MATH1, 8, IFB | IMMED2);\n+\tSEQSTORE(p, MATH0, offset, length, 0);\n \tMATHB(p, MATH1, SHLD, MATH1, MATH1, 8, 0);\n \tMOVEB(p, DESCBUF, 8, MATH2, 0, 8, WAITCOMP | IMMED);\n \tMATHB(p, MATH1, OR, MATH2, MATH2, 8, 0);\n@@ -895,6 +949,8 @@ pdcp_insert_cplane_snow_aes_op(struct program *p,\n \t\t\t       enum pdcp_sn_size sn_size,\n \t\t\t       unsigned char era_2_sw_hfn_ovrd)\n {\n+\tuint32_t offset = 0, length = 0, sn_mask = 0;\n+\n \tLABEL(back_to_sd_offset);\n \tLABEL(end_desc);\n \tLABEL(local_offset);\n@@ -906,7 +962,7 @@ pdcp_insert_cplane_snow_aes_op(struct program *p,\n \tREFERENCE(jump_back_to_sd_cmd);\n \tREFERENCE(move_mac_i_to_desc_buf);\n \n-\tif (rta_sec_era >= RTA_SEC_ERA_8) {\n+\tif (rta_sec_era >= RTA_SEC_ERA_8 && sn_size != PDCP_SN_SIZE_18) {\n \t\tKEY(p, KEY1, cipherdata->key_enc_flags, cipherdata->key,\n \t\t\t\tcipherdata->keylen, INLINE_KEY(cipherdata));\n \t\tKEY(p, KEY2, authdata->key_enc_flags, authdata->key,\n@@ -923,19 +979,35 @@ pdcp_insert_cplane_snow_aes_op(struct program *p,\n \n \t\treturn 0;\n \t}\n+\t/* Non-proto is supported only for 5bit cplane and 18bit uplane */\n+\tswitch (sn_size) {\n+\tcase PDCP_SN_SIZE_5:\n+\t\toffset = 7;\n+\t\tlength = 1;\n+\t\tsn_mask = (swap == false) ? PDCP_C_PLANE_SN_MASK :\n+\t\t\t\t\tPDCP_C_PLANE_SN_MASK_BE;\n+\t\tbreak;\n+\tcase PDCP_SN_SIZE_18:\n+\t\toffset = 5;\n+\t\tlength = 3;\n+\t\tsn_mask = (swap == false) ? PDCP_U_PLANE_18BIT_SN_MASK :\n+\t\t\t\t\tPDCP_U_PLANE_18BIT_SN_MASK_BE;\n+\t\tbreak;\n+\tcase PDCP_SN_SIZE_7:\n+\tcase PDCP_SN_SIZE_12:\n+\tcase PDCP_SN_SIZE_15:\n+\t\tpr_err(\"Invalid sn_size for %s\\n\", __func__);\n+\t\treturn -ENOTSUP;\n+\n+\t}\n \n-\tSEQLOAD(p, MATH0, 7, 1, 0);\n+\tSEQLOAD(p, MATH0, offset, length, 0);\n \tJUMP(p, 1, LOCAL_JUMP, ALL_TRUE, CALM);\n-\tif (swap == false)\n-\t\tMATHB(p, MATH0, AND, PDCP_C_PLANE_SN_MASK, MATH1, 8,\n-\t\t\tIFB | IMMED2);\n-\telse\n-\t\tMATHB(p, MATH0, AND, PDCP_C_PLANE_SN_MASK_BE, MATH1, 8,\n-\t\t\tIFB | IMMED2);\n+\tMATHB(p, MATH0, AND, sn_mask, MATH1, 8, IFB | IMMED2);\n \tMATHB(p, MATH1, SHLD, MATH1, MATH1, 8, 0);\n \tMOVE(p, DESCBUF, 4, MATH2, 0, 0x08, WAITCOMP | IMMED);\n \tMATHB(p, MATH1, OR, MATH2, MATH2, 8, 0);\n-\tSEQSTORE(p, MATH0, 7, 1, 0);\n+\tSEQSTORE(p, MATH0, offset, length, 0);\n \tif (dir == OP_TYPE_ENCAP_PROTOCOL) {\n \t\tif (rta_sec_era > RTA_SEC_ERA_2 ||\n \t\t    (rta_sec_era == RTA_SEC_ERA_2 &&\n@@ -1207,12 +1279,14 @@ pdcp_insert_cplane_aes_snow_op(struct program *p,\n \t\t\t       enum pdcp_sn_size sn_size,\n \t\t\t       unsigned char era_2_sw_hfn_ovrd __maybe_unused)\n {\n+\tuint32_t offset = 0, length = 0, sn_mask = 0;\n+\n \tKEY(p, KEY1, cipherdata->key_enc_flags, cipherdata->key,\n \t    cipherdata->keylen, INLINE_KEY(cipherdata));\n \tKEY(p, KEY2, authdata->key_enc_flags, authdata->key, authdata->keylen,\n \t    INLINE_KEY(authdata));\n \n-\tif (rta_sec_era >= RTA_SEC_ERA_8) {\n+\tif (rta_sec_era >= RTA_SEC_ERA_8 && sn_size != PDCP_SN_SIZE_18) {\n \t\tint pclid;\n \n \t\tif (sn_size == PDCP_SN_SIZE_5)\n@@ -1226,21 +1300,37 @@ pdcp_insert_cplane_aes_snow_op(struct program *p,\n \n \t\treturn 0;\n \t}\n+\t/* Non-proto is supported only for 5bit cplane and 18bit uplane */\n+\tswitch (sn_size) {\n+\tcase PDCP_SN_SIZE_5:\n+\t\toffset = 7;\n+\t\tlength = 1;\n+\t\tsn_mask = (swap == false) ? PDCP_C_PLANE_SN_MASK :\n+\t\t\t\t\tPDCP_C_PLANE_SN_MASK_BE;\n+\t\tbreak;\n+\tcase PDCP_SN_SIZE_18:\n+\t\toffset = 5;\n+\t\tlength = 3;\n+\t\tsn_mask = (swap == false) ? PDCP_U_PLANE_18BIT_SN_MASK :\n+\t\t\t\t\tPDCP_U_PLANE_18BIT_SN_MASK_BE;\n+\t\tbreak;\n+\tcase PDCP_SN_SIZE_7:\n+\tcase PDCP_SN_SIZE_12:\n+\tcase PDCP_SN_SIZE_15:\n+\t\tpr_err(\"Invalid sn_size for %s\\n\", __func__);\n+\t\treturn -ENOTSUP;\n+\n+\t}\n \n \tif (dir == OP_TYPE_ENCAP_PROTOCOL)\n \t\tMATHB(p, SEQINSZ, SUB, ONE, VSEQINSZ, 4, 0);\n \n-\tSEQLOAD(p, MATH0, 7, 1, 0);\n+\tSEQLOAD(p, MATH0, offset, length, 0);\n \tJUMP(p, 1, LOCAL_JUMP, ALL_TRUE, CALM);\n \tMOVE(p, MATH0, 7, IFIFOAB2, 0, 1, IMMED);\n-\tif (swap == false)\n-\t\tMATHB(p, MATH0, AND, PDCP_C_PLANE_SN_MASK, MATH1, 8,\n-\t\t\tIFB | IMMED2);\n-\telse\n-\t\tMATHB(p, MATH0, AND, PDCP_C_PLANE_SN_MASK_BE, MATH1, 8,\n-\t\t\tIFB | IMMED2);\n+\tMATHB(p, MATH0, AND, sn_mask, MATH1, 8, IFB | IMMED2);\n \n-\tSEQSTORE(p, MATH0, 7, 1, 0);\n+\tSEQSTORE(p, MATH0, offset, length, 0);\n \tMATHB(p, MATH1, SHLD, MATH1, MATH1, 8, 0);\n \tMOVE(p, DESCBUF, 4, MATH2, 0, 8, WAITCOMP | IMMED);\n \tMATHB(p, MATH1, OR, MATH2, MATH1, 8, 0);\n@@ -1322,6 +1412,8 @@ pdcp_insert_cplane_snow_zuc_op(struct program *p,\n \t\t\t       enum pdcp_sn_size sn_size,\n \t\t\t       unsigned char era_2_sw_hfn_ovrd __maybe_unused)\n {\n+\tuint32_t offset = 0, length = 0, sn_mask = 0;\n+\n \tLABEL(keyjump);\n \tREFERENCE(pkeyjump);\n \n@@ -1338,7 +1430,7 @@ pdcp_insert_cplane_snow_zuc_op(struct program *p,\n \n \tSET_LABEL(p, keyjump);\n \n-\tif (rta_sec_era >= RTA_SEC_ERA_8) {\n+\tif (rta_sec_era >= RTA_SEC_ERA_8 && sn_size != PDCP_SN_SIZE_18) {\n \t\tint pclid;\n \n \t\tif (sn_size == PDCP_SN_SIZE_5)\n@@ -1351,16 +1443,32 @@ pdcp_insert_cplane_snow_zuc_op(struct program *p,\n \t\t\t (uint16_t)authdata->algtype);\n \t\treturn 0;\n \t}\n+\t/* Non-proto is supported only for 5bit cplane and 18bit uplane */\n+\tswitch (sn_size) {\n+\tcase PDCP_SN_SIZE_5:\n+\t\toffset = 7;\n+\t\tlength = 1;\n+\t\tsn_mask = (swap == false) ? PDCP_C_PLANE_SN_MASK :\n+\t\t\t\t\tPDCP_C_PLANE_SN_MASK_BE;\n+\t\tbreak;\n+\tcase PDCP_SN_SIZE_18:\n+\t\toffset = 5;\n+\t\tlength = 3;\n+\t\tsn_mask = (swap == false) ? PDCP_U_PLANE_18BIT_SN_MASK :\n+\t\t\t\t\tPDCP_U_PLANE_18BIT_SN_MASK_BE;\n+\t\tbreak;\n+\tcase PDCP_SN_SIZE_7:\n+\tcase PDCP_SN_SIZE_12:\n+\tcase PDCP_SN_SIZE_15:\n+\t\tpr_err(\"Invalid sn_size for %s\\n\", __func__);\n+\t\treturn -ENOTSUP;\n+\n+\t}\n \n-\tSEQLOAD(p, MATH0, 7, 1, 0);\n+\tSEQLOAD(p, MATH0, offset, length, 0);\n \tJUMP(p, 1, LOCAL_JUMP, ALL_TRUE, CALM);\n \tMOVE(p, MATH0, 7, IFIFOAB2, 0, 1, IMMED);\n-\tif (swap == false)\n-\t\tMATHB(p, MATH0, AND, PDCP_C_PLANE_SN_MASK, MATH1, 8,\n-\t\t\tIFB | IMMED2);\n-\telse\n-\t\tMATHB(p, MATH0, AND, PDCP_C_PLANE_SN_MASK, MATH1, 8,\n-\t\t\tIFB | IMMED2);\n+\tMATHB(p, MATH0, AND, sn_mask, MATH1, 8, IFB | IMMED2);\n \n \tMATHB(p, MATH1, SHLD, MATH1, MATH1, 8, 0);\n \tMOVE(p, DESCBUF, 4, MATH2, 0, 8, WAITCOMP | IMMED);\n@@ -1374,7 +1482,7 @@ pdcp_insert_cplane_snow_zuc_op(struct program *p,\n \t\tMATHB(p, SEQINSZ, SUB, PDCP_MAC_I_LEN, VSEQOUTSZ, 4, IMMED2);\n \n \tMATHB(p, SEQINSZ, SUB, ZERO, VSEQINSZ, 4, 0);\n-\tSEQSTORE(p, MATH0, 7, 1, 0);\n+\tSEQSTORE(p, MATH0, offset, length, 0);\n \n \tif (dir == OP_TYPE_ENCAP_PROTOCOL) {\n \t\tSEQFIFOSTORE(p, MSG, 0, 0, VLF);\n@@ -1425,6 +1533,7 @@ pdcp_insert_cplane_aes_zuc_op(struct program *p,\n \t\t\t      enum pdcp_sn_size sn_size,\n \t\t\t      unsigned char era_2_sw_hfn_ovrd __maybe_unused)\n {\n+\tuint32_t offset = 0, length = 0, sn_mask = 0;\n \tLABEL(keyjump);\n \tREFERENCE(pkeyjump);\n \n@@ -1439,7 +1548,7 @@ pdcp_insert_cplane_aes_zuc_op(struct program *p,\n \tKEY(p, KEY2, authdata->key_enc_flags, authdata->key, authdata->keylen,\n \t    INLINE_KEY(authdata));\n \n-\tif (rta_sec_era >= RTA_SEC_ERA_8) {\n+\tif (rta_sec_era >= RTA_SEC_ERA_8 && sn_size != PDCP_SN_SIZE_18) {\n \t\tint pclid;\n \n \t\tif (sn_size == PDCP_SN_SIZE_5)\n@@ -1453,17 +1562,33 @@ pdcp_insert_cplane_aes_zuc_op(struct program *p,\n \n \t\treturn 0;\n \t}\n+\t/* Non-proto is supported only for 5bit cplane and 18bit uplane */\n+\tswitch (sn_size) {\n+\tcase PDCP_SN_SIZE_5:\n+\t\toffset = 7;\n+\t\tlength = 1;\n+\t\tsn_mask = (swap == false) ? PDCP_C_PLANE_SN_MASK :\n+\t\t\t\t\tPDCP_C_PLANE_SN_MASK_BE;\n+\t\tbreak;\n+\tcase PDCP_SN_SIZE_18:\n+\t\toffset = 5;\n+\t\tlength = 3;\n+\t\tsn_mask = (swap == false) ? PDCP_U_PLANE_18BIT_SN_MASK :\n+\t\t\t\t\tPDCP_U_PLANE_18BIT_SN_MASK_BE;\n+\t\tbreak;\n+\tcase PDCP_SN_SIZE_7:\n+\tcase PDCP_SN_SIZE_12:\n+\tcase PDCP_SN_SIZE_15:\n+\t\tpr_err(\"Invalid sn_size for %s\\n\", __func__);\n+\t\treturn -ENOTSUP;\n+\n+\t}\n \n \tSET_LABEL(p, keyjump);\n-\tSEQLOAD(p, MATH0, 7, 1, 0);\n+\tSEQLOAD(p, MATH0, offset, length, 0);\n \tJUMP(p, 1, LOCAL_JUMP, ALL_TRUE, CALM);\n \tMOVE(p, MATH0, 7, IFIFOAB2, 0, 1, IMMED);\n-\tif (swap == false)\n-\t\tMATHB(p, MATH0, AND, PDCP_C_PLANE_SN_MASK, MATH1, 8,\n-\t\t\tIFB | IMMED2);\n-\telse\n-\t\tMATHB(p, MATH0, AND, PDCP_C_PLANE_SN_MASK, MATH1, 8,\n-\t\t\tIFB | IMMED2);\n+\tMATHB(p, MATH0, AND, sn_mask, MATH1, 8, IFB | IMMED2);\n \n \tMATHB(p, MATH1, SHLD, MATH1, MATH1, 8, 0);\n \tMOVE(p, DESCBUF, 4, MATH2, 0, 8, WAITCOMP | IMMED);\n@@ -1477,7 +1602,7 @@ pdcp_insert_cplane_aes_zuc_op(struct program *p,\n \t\tMATHB(p, SEQINSZ, SUB, PDCP_MAC_I_LEN, VSEQOUTSZ, 4, IMMED2);\n \n \tMATHB(p, SEQINSZ, SUB, ZERO, VSEQINSZ, 4, 0);\n-\tSEQSTORE(p, MATH0, 7, 1, 0);\n+\tSEQSTORE(p, MATH0, offset, length, 0);\n \n \tif (dir == OP_TYPE_ENCAP_PROTOCOL) {\n \t\tSEQFIFOSTORE(p, MSG, 0, 0, VLF);\n@@ -1531,6 +1656,7 @@ pdcp_insert_cplane_zuc_snow_op(struct program *p,\n \t\t\t       enum pdcp_sn_size sn_size,\n \t\t\t       unsigned char era_2_sw_hfn_ovrd __maybe_unused)\n {\n+\tuint32_t offset = 0, length = 0, sn_mask = 0;\n \tLABEL(keyjump);\n \tREFERENCE(pkeyjump);\n \n@@ -1545,7 +1671,7 @@ pdcp_insert_cplane_zuc_snow_op(struct program *p,\n \tKEY(p, KEY2, authdata->key_enc_flags, authdata->key, authdata->keylen,\n \t    INLINE_KEY(authdata));\n \n-\tif (rta_sec_era >= RTA_SEC_ERA_8) {\n+\tif (rta_sec_era >= RTA_SEC_ERA_8 && sn_size != PDCP_SN_SIZE_18) {\n \t\tint pclid;\n \n \t\tif (sn_size == PDCP_SN_SIZE_5)\n@@ -1559,17 +1685,32 @@ pdcp_insert_cplane_zuc_snow_op(struct program *p,\n \n \t\treturn 0;\n \t}\n+\t/* Non-proto is supported only for 5bit cplane and 18bit uplane */\n+\tswitch (sn_size) {\n+\tcase PDCP_SN_SIZE_5:\n+\t\toffset = 7;\n+\t\tlength = 1;\n+\t\tsn_mask = (swap == false) ? PDCP_C_PLANE_SN_MASK :\n+\t\t\t\t\tPDCP_C_PLANE_SN_MASK_BE;\n+\t\tbreak;\n+\tcase PDCP_SN_SIZE_18:\n+\t\toffset = 5;\n+\t\tlength = 3;\n+\t\tsn_mask = (swap == false) ? PDCP_U_PLANE_18BIT_SN_MASK :\n+\t\t\t\t\tPDCP_U_PLANE_18BIT_SN_MASK_BE;\n+\t\tbreak;\n+\tcase PDCP_SN_SIZE_7:\n+\tcase PDCP_SN_SIZE_12:\n+\tcase PDCP_SN_SIZE_15:\n+\t\tpr_err(\"Invalid sn_size for %s\\n\", __func__);\n+\t\treturn -ENOTSUP;\n \n+\t}\n \tSET_LABEL(p, keyjump);\n-\tSEQLOAD(p, MATH0, 7, 1, 0);\n+\tSEQLOAD(p, MATH0, offset, length, 0);\n \tJUMP(p, 1, LOCAL_JUMP, ALL_TRUE, CALM);\n \tMOVE(p, MATH0, 7, IFIFOAB2, 0, 1, IMMED);\n-\tif (swap == false)\n-\t\tMATHB(p, MATH0, AND, PDCP_C_PLANE_SN_MASK, MATH1, 8,\n-\t\t\tIFB | IMMED2);\n-\telse\n-\t\tMATHB(p, MATH0, AND, PDCP_C_PLANE_SN_MASK, MATH1, 8,\n-\t\t\tIFB | IMMED2);\n+\tMATHB(p, MATH0, AND, sn_mask, MATH1, 8, IFB | IMMED2);\n \n \tMATHB(p, MATH1, SHLD, MATH1, MATH1, 8, 0);\n \tMOVE(p, DESCBUF, 4, MATH2, 0, 8, WAITCOMP | IMMED);\n@@ -1599,7 +1740,7 @@ pdcp_insert_cplane_zuc_snow_op(struct program *p,\n \t\tMATHB(p, VSEQOUTSZ, SUB, ZERO, VSEQINSZ, 4, 0);\n \t}\n \n-\tSEQSTORE(p, MATH0, 7, 1, 0);\n+\tSEQSTORE(p, MATH0, offset, length, 0);\n \n \tif (dir == OP_TYPE_ENCAP_PROTOCOL) {\n \t\tSEQFIFOSTORE(p, MSG, 0, 0, VLF);\n@@ -1659,12 +1800,13 @@ pdcp_insert_cplane_zuc_aes_op(struct program *p,\n \t\t\t      enum pdcp_sn_size sn_size,\n \t\t\t      unsigned char era_2_sw_hfn_ovrd __maybe_unused)\n {\n+\tuint32_t offset = 0, length = 0, sn_mask = 0;\n \tif (rta_sec_era < RTA_SEC_ERA_5) {\n \t\tpr_err(\"Invalid era for selected algorithm\\n\");\n \t\treturn -ENOTSUP;\n \t}\n \n-\tif (rta_sec_era >= RTA_SEC_ERA_8) {\n+\tif (rta_sec_era >= RTA_SEC_ERA_8 && sn_size != PDCP_SN_SIZE_18) {\n \t\tint pclid;\n \n \t\tKEY(p, KEY1, cipherdata->key_enc_flags, cipherdata->key,\n@@ -1682,20 +1824,35 @@ pdcp_insert_cplane_zuc_aes_op(struct program *p,\n \t\t\t (uint16_t)authdata->algtype);\n \t\treturn 0;\n \t}\n+\t/* Non-proto is supported only for 5bit cplane and 18bit uplane */\n+\tswitch (sn_size) {\n+\tcase PDCP_SN_SIZE_5:\n+\t\toffset = 7;\n+\t\tlength = 1;\n+\t\tsn_mask = (swap == false) ? PDCP_C_PLANE_SN_MASK :\n+\t\t\t\t\tPDCP_C_PLANE_SN_MASK_BE;\n+\t\tbreak;\n+\tcase PDCP_SN_SIZE_18:\n+\t\toffset = 5;\n+\t\tlength = 3;\n+\t\tsn_mask = (swap == false) ? PDCP_U_PLANE_18BIT_SN_MASK :\n+\t\t\t\t\tPDCP_U_PLANE_18BIT_SN_MASK_BE;\n+\t\tbreak;\n+\tcase PDCP_SN_SIZE_7:\n+\tcase PDCP_SN_SIZE_12:\n+\tcase PDCP_SN_SIZE_15:\n+\t\tpr_err(\"Invalid sn_size for %s\\n\", __func__);\n+\t\treturn -ENOTSUP;\n+\t}\n \n-\tSEQLOAD(p, MATH0, 7, 1, 0);\n+\tSEQLOAD(p, MATH0, offset, length, 0);\n \tJUMP(p, 1, LOCAL_JUMP, ALL_TRUE, CALM);\n-\tif (swap == false)\n-\t\tMATHB(p, MATH0, AND, PDCP_C_PLANE_SN_MASK, MATH1, 8,\n-\t\t\tIFB | IMMED2);\n-\telse\n-\t\tMATHB(p, MATH0, AND, PDCP_C_PLANE_SN_MASK, MATH1, 8,\n-\t\t\tIFB | IMMED2);\n+\tMATHB(p, MATH0, AND, sn_mask, MATH1, 8, IFB | IMMED2);\n \n \tMATHB(p, MATH1, SHLD, MATH1, MATH1, 8, 0);\n \tMOVE(p, DESCBUF, 4, MATH2, 0, 0x08, WAITCOMP | IMMED);\n \tMATHB(p, MATH1, OR, MATH2, MATH2, 8, 0);\n-\tSEQSTORE(p, MATH0, 7, 1, 0);\n+\tSEQSTORE(p, MATH0, offset, length, 0);\n \tif (dir == OP_TYPE_ENCAP_PROTOCOL) {\n \t\tKEY(p, KEY1, authdata->key_enc_flags, authdata->key,\n \t\t    authdata->keylen, INLINE_KEY(authdata));\n@@ -1798,38 +1955,43 @@ pdcp_insert_cplane_zuc_aes_op(struct program *p,\n }\n \n static inline int\n-pdcp_insert_uplane_15bit_op(struct program *p,\n+pdcp_insert_uplane_no_int_op(struct program *p,\n \t\t\t    bool swap __maybe_unused,\n \t\t\t    struct alginfo *cipherdata,\n-\t\t\t    struct alginfo *authdata,\n-\t\t\t    unsigned int dir)\n+\t\t\t    unsigned int dir,\n+\t\t\t    enum pdcp_sn_size sn_size)\n {\n \tint op;\n-\n-\t/* Insert auth key if requested */\n-\tif (authdata && authdata->algtype)\n-\t\tKEY(p, KEY2, authdata->key_enc_flags, authdata->key,\n-\t\t    authdata->keylen, INLINE_KEY(authdata));\n+\tuint32_t sn_mask;\n \n \t/* Insert Cipher Key */\n \tKEY(p, KEY1, cipherdata->key_enc_flags, cipherdata->key,\n \t    cipherdata->keylen, INLINE_KEY(cipherdata));\n \n-\tif (rta_sec_era >= RTA_SEC_ERA_8) {\n+\tif ((rta_sec_era >= RTA_SEC_ERA_8 && sn_size == PDCP_SN_SIZE_15) ||\n+\t\t\t(rta_sec_era >= RTA_SEC_ERA_10)) {\n \t\tPROTOCOL(p, dir, OP_PCLID_LTE_PDCP_USER,\n \t\t\t (uint16_t)cipherdata->algtype);\n \t\treturn 0;\n \t}\n \n-\tSEQLOAD(p, MATH0, 6, 2, 0);\n+\tif (sn_size == PDCP_SN_SIZE_15) {\n+\t\tSEQLOAD(p, MATH0, 6, 2, 0);\n+\t\tsn_mask = (swap == false) ? PDCP_U_PLANE_15BIT_SN_MASK :\n+\t\t\t\t\tPDCP_U_PLANE_15BIT_SN_MASK_BE;\n+\t} else { /* SN Size == PDCP_SN_SIZE_18 */\n+\t\tSEQLOAD(p, MATH0, 5, 3, 0);\n+\t\tsn_mask = (swap == false) ? PDCP_U_PLANE_18BIT_SN_MASK :\n+\t\t\t\t\tPDCP_U_PLANE_18BIT_SN_MASK_BE;\n+\t}\n \tJUMP(p, 1, LOCAL_JUMP, ALL_TRUE, CALM);\n-\tif (swap == false)\n-\t\tMATHB(p, MATH0, AND, PDCP_U_PLANE_15BIT_SN_MASK, MATH1, 8,\n-\t\t      IFB | IMMED2);\n-\telse\n-\t\tMATHB(p, MATH0, AND, PDCP_U_PLANE_15BIT_SN_MASK_BE, MATH1, 8,\n-\t\t      IFB | IMMED2);\n-\tSEQSTORE(p, MATH0, 6, 2, 0);\n+\tMATHB(p, MATH0, AND, sn_mask, MATH1, 8, IFB | IMMED2);\n+\n+\tif (sn_size == PDCP_SN_SIZE_15)\n+\t\tSEQSTORE(p, MATH0, 6, 2, 0);\n+\telse /* SN Size == PDCP_SN_SIZE_18 */\n+\t\tSEQSTORE(p, MATH0, 5, 3, 0);\n+\n \tMATHB(p, MATH1, SHLD, MATH1, MATH1, 8, 0);\n \tMOVEB(p, DESCBUF, 8, MATH2, 0, 8, WAITCOMP | IMMED);\n \tMATHB(p, MATH1, OR, MATH2, MATH2, 8, 0);\n@@ -2124,6 +2286,13 @@ cnstr_pdcp_u_plane_pdb(struct program *p,\n \t\t\thfn_threshold<<PDCP_U_PLANE_PDB_15BIT_SN_HFN_THR_SHIFT;\n \t\tbreak;\n \n+\tcase PDCP_SN_SIZE_18:\n+\t\tpdb.opt_res.opt = (uint32_t)(PDCP_U_PLANE_PDB_OPT_18B_SN);\n+\t\tpdb.hfn_res = hfn << PDCP_U_PLANE_PDB_18BIT_SN_HFN_SHIFT;\n+\t\tpdb.hfn_thr_res =\n+\t\t\thfn_threshold<<PDCP_U_PLANE_PDB_18BIT_SN_HFN_THR_SHIFT;\n+\t\tbreak;\n+\n \tdefault:\n \t\tpr_err(\"Invalid Sequence Number Size setting in PDB\\n\");\n \t\treturn -EINVAL;\n@@ -2448,6 +2617,61 @@ cnstr_shdsc_pdcp_c_plane_decap(uint32_t *descbuf,\n \treturn PROGRAM_FINALIZE(p);\n }\n \n+static int\n+pdcp_insert_uplane_with_int_op(struct program *p,\n+\t\t\t      bool swap __maybe_unused,\n+\t\t\t      struct alginfo *cipherdata,\n+\t\t\t      struct alginfo *authdata,\n+\t\t\t      enum pdcp_sn_size sn_size,\n+\t\t\t      unsigned char era_2_sw_hfn_ovrd,\n+\t\t\t      unsigned int dir)\n+{\n+\tstatic int\n+\t\t(*pdcp_cp_fp[PDCP_CIPHER_TYPE_INVALID][PDCP_AUTH_TYPE_INVALID])\n+\t\t\t(struct program*, bool swap, struct alginfo *,\n+\t\t\t struct alginfo *, unsigned int, enum pdcp_sn_size,\n+\t\t\tunsigned char __maybe_unused) = {\n+\t\t{\t/* NULL */\n+\t\t\tpdcp_insert_cplane_null_op,\t/* NULL */\n+\t\t\tpdcp_insert_cplane_int_only_op,\t/* SNOW f9 */\n+\t\t\tpdcp_insert_cplane_int_only_op,\t/* AES CMAC */\n+\t\t\tpdcp_insert_cplane_int_only_op\t/* ZUC-I */\n+\t\t},\n+\t\t{\t/* SNOW f8 */\n+\t\t\tpdcp_insert_cplane_enc_only_op,\t/* NULL */\n+\t\t\tpdcp_insert_cplane_acc_op,\t/* SNOW f9 */\n+\t\t\tpdcp_insert_cplane_snow_aes_op,\t/* AES CMAC */\n+\t\t\tpdcp_insert_cplane_snow_zuc_op\t/* ZUC-I */\n+\t\t},\n+\t\t{\t/* AES CTR */\n+\t\t\tpdcp_insert_cplane_enc_only_op,\t/* NULL */\n+\t\t\tpdcp_insert_cplane_aes_snow_op,\t/* SNOW f9 */\n+\t\t\tpdcp_insert_cplane_acc_op,\t/* AES CMAC */\n+\t\t\tpdcp_insert_cplane_aes_zuc_op\t/* ZUC-I */\n+\t\t},\n+\t\t{\t/* ZUC-E */\n+\t\t\tpdcp_insert_cplane_enc_only_op,\t/* NULL */\n+\t\t\tpdcp_insert_cplane_zuc_snow_op,\t/* SNOW f9 */\n+\t\t\tpdcp_insert_cplane_zuc_aes_op,\t/* AES CMAC */\n+\t\t\tpdcp_insert_cplane_acc_op\t/* ZUC-I */\n+\t\t},\n+\t};\n+\tint err;\n+\n+\terr = pdcp_cp_fp[cipherdata->algtype][authdata->algtype](p,\n+\t\tswap,\n+\t\tcipherdata,\n+\t\tauthdata,\n+\t\tdir,\n+\t\tsn_size,\n+\t\tera_2_sw_hfn_ovrd);\n+\tif (err)\n+\t\treturn err;\n+\n+\treturn 0;\n+}\n+\n+\n /**\n  * cnstr_shdsc_pdcp_u_plane_encap - Function for creating a PDCP User Plane\n  *                                  encapsulation descriptor.\n@@ -2491,6 +2715,33 @@ cnstr_shdsc_pdcp_u_plane_encap(uint32_t *descbuf,\n \tstruct program prg;\n \tstruct program *p = &prg;\n \tint err;\n+\tstatic enum rta_share_type\n+\t\tdesc_share[PDCP_CIPHER_TYPE_INVALID][PDCP_AUTH_TYPE_INVALID] = {\n+\t\t{\t/* NULL */\n+\t\t\tSHR_WAIT,\t/* NULL */\n+\t\t\tSHR_ALWAYS,\t/* SNOW f9 */\n+\t\t\tSHR_ALWAYS,\t/* AES CMAC */\n+\t\t\tSHR_ALWAYS\t/* ZUC-I */\n+\t\t},\n+\t\t{\t/* SNOW f8 */\n+\t\t\tSHR_ALWAYS,\t/* NULL */\n+\t\t\tSHR_ALWAYS,\t/* SNOW f9 */\n+\t\t\tSHR_WAIT,\t/* AES CMAC */\n+\t\t\tSHR_WAIT\t/* ZUC-I */\n+\t\t},\n+\t\t{\t/* AES CTR */\n+\t\t\tSHR_ALWAYS,\t/* NULL */\n+\t\t\tSHR_ALWAYS,\t/* SNOW f9 */\n+\t\t\tSHR_ALWAYS,\t/* AES CMAC */\n+\t\t\tSHR_WAIT\t/* ZUC-I */\n+\t\t},\n+\t\t{\t/* ZUC-E */\n+\t\t\tSHR_ALWAYS,\t/* NULL */\n+\t\t\tSHR_WAIT,\t/* SNOW f9 */\n+\t\t\tSHR_WAIT,\t/* AES CMAC */\n+\t\t\tSHR_ALWAYS\t/* ZUC-I */\n+\t\t},\n+\t};\n \tLABEL(pdb_end);\n \n \tif (rta_sec_era != RTA_SEC_ERA_2 && era_2_sw_hfn_ovrd) {\n@@ -2509,7 +2760,10 @@ cnstr_shdsc_pdcp_u_plane_encap(uint32_t *descbuf,\n \tif (ps)\n \t\tPROGRAM_SET_36BIT_ADDR(p);\n \n-\tSHR_HDR(p, SHR_ALWAYS, 0, 0);\n+\tif (authdata)\n+\t\tSHR_HDR(p, desc_share[cipherdata->algtype][authdata->algtype], 0, 0);\n+\telse\n+\t\tSHR_HDR(p, SHR_ALWAYS, 0, 0);\n \tif (cnstr_pdcp_u_plane_pdb(p, sn_size, hfn, bearer, direction,\n \t\t\t\t   hfn_threshold)) {\n \t\tpr_err(\"Error creating PDCP UPlane PDB\\n\");\n@@ -2522,13 +2776,6 @@ cnstr_shdsc_pdcp_u_plane_encap(uint32_t *descbuf,\n \tif (err)\n \t\treturn err;\n \n-\t/* Insert auth key if requested */\n-\tif (authdata && authdata->algtype) {\n-\t\tKEY(p, KEY2, authdata->key_enc_flags,\n-\t\t    (uint64_t)authdata->key, authdata->keylen,\n-\t\t    INLINE_KEY(authdata));\n-\t}\n-\n \tswitch (sn_size) {\n \tcase PDCP_SN_SIZE_7:\n \tcase PDCP_SN_SIZE_12:\n@@ -2542,6 +2789,12 @@ cnstr_shdsc_pdcp_u_plane_encap(uint32_t *descbuf,\n \t\tcase PDCP_CIPHER_TYPE_AES:\n \t\tcase PDCP_CIPHER_TYPE_SNOW:\n \t\tcase PDCP_CIPHER_TYPE_NULL:\n+\t\t\t/* Insert auth key if requested */\n+\t\t\tif (authdata && authdata->algtype) {\n+\t\t\t\tKEY(p, KEY2, authdata->key_enc_flags,\n+\t\t\t\t    (uint64_t)authdata->key, authdata->keylen,\n+\t\t\t\t    INLINE_KEY(authdata));\n+\t\t\t}\n \t\t\t/* Insert Cipher Key */\n \t\t\tKEY(p, KEY1, cipherdata->key_enc_flags,\n \t\t\t    (uint64_t)cipherdata->key, cipherdata->keylen,\n@@ -2566,6 +2819,18 @@ cnstr_shdsc_pdcp_u_plane_encap(uint32_t *descbuf,\n \t\tbreak;\n \n \tcase PDCP_SN_SIZE_15:\n+\tcase PDCP_SN_SIZE_18:\n+\t\tif (authdata) {\n+\t\t\terr = pdcp_insert_uplane_with_int_op(p, swap,\n+\t\t\t\t\tcipherdata, authdata,\n+\t\t\t\t\tsn_size, era_2_sw_hfn_ovrd,\n+\t\t\t\t\tOP_TYPE_ENCAP_PROTOCOL);\n+\t\t\tif (err)\n+\t\t\t\treturn err;\n+\n+\t\t\tbreak;\n+\t\t}\n+\n \t\tswitch (cipherdata->algtype) {\n \t\tcase PDCP_CIPHER_TYPE_NULL:\n \t\t\tinsert_copy_frame_op(p,\n@@ -2574,8 +2839,8 @@ cnstr_shdsc_pdcp_u_plane_encap(uint32_t *descbuf,\n \t\t\tbreak;\n \n \t\tdefault:\n-\t\t\terr = pdcp_insert_uplane_15bit_op(p, swap, cipherdata,\n-\t\t\t\t\tauthdata, OP_TYPE_ENCAP_PROTOCOL);\n+\t\t\terr = pdcp_insert_uplane_no_int_op(p, swap, cipherdata,\n+\t\t\t\t\tOP_TYPE_ENCAP_PROTOCOL, sn_size);\n \t\t\tif (err)\n \t\t\t\treturn err;\n \t\t\tbreak;\n@@ -2635,6 +2900,34 @@ cnstr_shdsc_pdcp_u_plane_decap(uint32_t *descbuf,\n \tstruct program prg;\n \tstruct program *p = &prg;\n \tint err;\n+\tstatic enum rta_share_type\n+\t\tdesc_share[PDCP_CIPHER_TYPE_INVALID][PDCP_AUTH_TYPE_INVALID] = {\n+\t\t{\t/* NULL */\n+\t\t\tSHR_WAIT,\t/* NULL */\n+\t\t\tSHR_ALWAYS,\t/* SNOW f9 */\n+\t\t\tSHR_ALWAYS,\t/* AES CMAC */\n+\t\t\tSHR_ALWAYS\t/* ZUC-I */\n+\t\t},\n+\t\t{\t/* SNOW f8 */\n+\t\t\tSHR_ALWAYS,\t/* NULL */\n+\t\t\tSHR_ALWAYS,\t/* SNOW f9 */\n+\t\t\tSHR_WAIT,\t/* AES CMAC */\n+\t\t\tSHR_WAIT\t/* ZUC-I */\n+\t\t},\n+\t\t{\t/* AES CTR */\n+\t\t\tSHR_ALWAYS,\t/* NULL */\n+\t\t\tSHR_ALWAYS,\t/* SNOW f9 */\n+\t\t\tSHR_ALWAYS,\t/* AES CMAC */\n+\t\t\tSHR_WAIT\t/* ZUC-I */\n+\t\t},\n+\t\t{\t/* ZUC-E */\n+\t\t\tSHR_ALWAYS,\t/* NULL */\n+\t\t\tSHR_WAIT,\t/* SNOW f9 */\n+\t\t\tSHR_WAIT,\t/* AES CMAC */\n+\t\t\tSHR_ALWAYS\t/* ZUC-I */\n+\t\t},\n+\t};\n+\n \tLABEL(pdb_end);\n \n \tif (rta_sec_era != RTA_SEC_ERA_2 && era_2_sw_hfn_ovrd) {\n@@ -2652,8 +2945,11 @@ cnstr_shdsc_pdcp_u_plane_decap(uint32_t *descbuf,\n \t\tPROGRAM_SET_BSWAP(p);\n \tif (ps)\n \t\tPROGRAM_SET_36BIT_ADDR(p);\n+\tif (authdata)\n+\t\tSHR_HDR(p, desc_share[cipherdata->algtype][authdata->algtype], 0, 0);\n+\telse\n+\t\tSHR_HDR(p, SHR_ALWAYS, 0, 0);\n \n-\tSHR_HDR(p, SHR_ALWAYS, 0, 0);\n \tif (cnstr_pdcp_u_plane_pdb(p, sn_size, hfn, bearer, direction,\n \t\t\t\t   hfn_threshold)) {\n \t\tpr_err(\"Error creating PDCP UPlane PDB\\n\");\n@@ -2666,12 +2962,6 @@ cnstr_shdsc_pdcp_u_plane_decap(uint32_t *descbuf,\n \tif (err)\n \t\treturn err;\n \n-\t/* Insert auth key if requested */\n-\tif (authdata && authdata->algtype)\n-\t\tKEY(p, KEY2, authdata->key_enc_flags,\n-\t\t    (uint64_t)authdata->key, authdata->keylen,\n-\t\t    INLINE_KEY(authdata));\n-\n \tswitch (sn_size) {\n \tcase PDCP_SN_SIZE_7:\n \tcase PDCP_SN_SIZE_12:\n@@ -2685,6 +2975,12 @@ cnstr_shdsc_pdcp_u_plane_decap(uint32_t *descbuf,\n \t\tcase PDCP_CIPHER_TYPE_AES:\n \t\tcase PDCP_CIPHER_TYPE_SNOW:\n \t\tcase PDCP_CIPHER_TYPE_NULL:\n+\t\t\t/* Insert auth key if requested */\n+\t\t\tif (authdata && authdata->algtype)\n+\t\t\t\tKEY(p, KEY2, authdata->key_enc_flags,\n+\t\t\t\t    (uint64_t)authdata->key, authdata->keylen,\n+\t\t\t\t    INLINE_KEY(authdata));\n+\n \t\t\t/* Insert Cipher Key */\n \t\t\tKEY(p, KEY1, cipherdata->key_enc_flags,\n \t\t\t    cipherdata->key, cipherdata->keylen,\n@@ -2708,6 +3004,18 @@ cnstr_shdsc_pdcp_u_plane_decap(uint32_t *descbuf,\n \t\tbreak;\n \n \tcase PDCP_SN_SIZE_15:\n+\tcase PDCP_SN_SIZE_18:\n+\t\tif (authdata) {\n+\t\t\terr = pdcp_insert_uplane_with_int_op(p, swap,\n+\t\t\t\t\tcipherdata, authdata,\n+\t\t\t\t\tsn_size, era_2_sw_hfn_ovrd,\n+\t\t\t\t\tOP_TYPE_DECAP_PROTOCOL);\n+\t\t\tif (err)\n+\t\t\t\treturn err;\n+\n+\t\t\tbreak;\n+\t\t}\n+\n \t\tswitch (cipherdata->algtype) {\n \t\tcase PDCP_CIPHER_TYPE_NULL:\n \t\t\tinsert_copy_frame_op(p,\n@@ -2716,8 +3024,8 @@ cnstr_shdsc_pdcp_u_plane_decap(uint32_t *descbuf,\n \t\t\tbreak;\n \n \t\tdefault:\n-\t\t\terr = pdcp_insert_uplane_15bit_op(p, swap, cipherdata,\n-\t\t\t\tauthdata, OP_TYPE_DECAP_PROTOCOL);\n+\t\t\terr = pdcp_insert_uplane_no_int_op(p, swap, cipherdata,\n+\t\t\t\tOP_TYPE_DECAP_PROTOCOL, sn_size);\n \t\t\tif (err)\n \t\t\t\treturn err;\n \t\t\tbreak;\n",
    "prefixes": [
        "v3",
        "05/24"
    ]
}