From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753868AbbK3QNW (ORCPT ); Mon, 30 Nov 2015 11:13:22 -0500 Received: from mail-bl2on0135.outbound.protection.outlook.com ([65.55.169.135]:52000 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753327AbbK3QNQ (ORCPT ); Mon, 30 Nov 2015 11:13:16 -0500 Authentication-Results: spf=permerror (sender IP is 192.88.158.2) smtp.mailfrom=freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none;freescale.mail.onmicrosoft.com; dmarc=none action=none header.from=freescale.com; From: To: CC: , , , , , , , , , Igal Liberman Subject: [v8, 4/6] fsl/fman: Add FMan SP support Date: Mon, 30 Nov 2015 14:21:00 +0200 Message-ID: <1448886062-16962-5-git-send-email-igal.liberman@freescale.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1448886062-16962-1-git-send-email-igal.liberman@freescale.com> References: <1448886062-16962-1-git-send-email-igal.liberman@freescale.com> Reply-To: X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11FD012;1:cmM56IFxb9pUGiGRvtd+QKu32SMxhismdrUrHVudVKAwPri6HJqs05CFYXccxBmakjeKPAuil7BSPiZYzHshO5s8lgGlYVTXO8bxxEV7Q8+pF1KdPErnoMj8lTv1cKmmOJkcOzsUY7Uaa9iiaD82pt9zfwb2bF3o0gXMrLjpQP57mud7aCbbtELFWyMiajPtrmiZmLt24PiBwDPlt3Hpt4UcaqLMSrkShua/8Q6PRzEc/yh+vNY+LAlQCyMEoXo4Is1n3tGpPKlRI1tIRb/i1rqaLIgUlhm4f3gOnlXmrF5vaAUpsXouHUJeLzQmK2+HvH+rWGYdD7FwlTRJUb71Z7EJ2DLJXutZ88BlWmCbxAHizP4Psqg2ucTaGge0hKI0GuyIyzbmMdGWYweJMPza13oP27LtpyRBHbsHpU615EM= X-Forefront-Antispam-Report: CIP:192.88.158.2;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(448002)(199003)(189002)(97736004)(2950100001)(189998001)(86152002)(110136002)(50986999)(5003940100001)(107886002)(5001960100002)(81156007)(53806999)(76176999)(2351001)(19580395003)(4001430100002)(19580405001)(86362001)(77096005)(586003)(36756003)(48376002)(106466001)(229853001)(33646002)(11100500001)(43066003)(5008740100001)(47776003)(87936001)(50226001)(69596002)(104016004)(85326001)(1096002)(1220700001)(6806005)(50466002)(2004002);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR0301MB0760;H:az84smr01.freescale.net;FPR:;SPF:PermError;PTR:InfoDomainNonexistent;A:1;MX:1;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1;BY2PR0301MB0760;2:486oVKP9v05pUclxiw5Wz6iOjAf/UTZKhQoVx1k8AdnNrZzXixuznFmA/oBf2zKzPVcCyRWWIiJycKQSpHAS03DibnTJBjbHuVcEaUkox0X/arZS411f4CebkyO2Hr5KKVORuBp+umO9Y956Ee0qJQ==;3:qOAeGrvbqk5F+Wr0Cw473MjgTEVmfZCzyAimH/O+c7kovVGXe31r8hf0huoJXys00fAxdNOY5j5oEAHTfq96QsmVAgOVqbD5aYMXJ0BRHTFM8vCO3CFYWzoyrDvmnEdEFUT/GAfNeOm0/rC3kBHSPwr2L7rGefrhNyBcLO3NiwyWMhSu/3UusdXuNWZAEr/h7usx2NmuAXVGb3I7MSfb/VSXVY8QRvaEB2c+y7cdRJI=;25:QC4oJTLyIqwOx2RnK3dY/KmJjha2JQ5TCgx+h/aadL21h5vpHaPxvU+SFxbh7o5HSQN56cbzC1eSDH3md6sUq7vLrcYevTadnO73YLttViWu0ZouI6AukGLOiFTf41RWhg3zes8edGE3sJMaAyXl3RppBm55rcfwAVoZ52nVl+pbKGZTdKjSToqu0dR6mm1TgffgaAANAgicvPnpfY49wXIbmFVMrTbZ0aAxIvQJC/elKEJtQOXBf9AgH91fuDXDyT0CfsmiUN0RZm6iqaDcqQ== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0301MB0760; X-Microsoft-Exchange-Diagnostics: 1;BY2PR0301MB0760;20:udy4uNGgShPEgI02aCqN7H7F3+8rOVV2T3NQzkiQoJxEcNgPotF5Zb18CfZbE9EUDZIWjybMZ5vfyKhP+UE6aYnMUTkXdqIhtNBc81AMPuMcU83LpWAqMcHLGMFGsBY8ML2GABumklGRZhir+hRq0OhgoIgfZnxdQTNGy2ukZg1LMd8bQx7pob5or4Uce/GmUH1T9yqncMzS/zcKjxPESGkVm9fcaU6hXtgbjcGYgvjEFDqLZyC5by+UuWK/B4GREtUY6To7jNUWiNb8SKw8OrZ8zLNKDCc1UHsQLudd5TZrY4GKI7vNkgjl5HQc2rYSou6WpaKIFItw9AcUpw4zALB/HabDKnCWjAJvXL4C7gU=;4:RRSbZeQuH8vRIu4FqYXFBCEZ0BJlEyR5g0ifMXTOAe8t5Sn8LIoqn4rmZ4Ks+u6e2F9KIW0zsUh+wpB7i82rTbe0MHrHPZOXqEyoXt1ml6oh/zMRrlRSp2rnrS3cEflb772Ff5Y/cSCmFdSTk9/3O8WcVIM0Xft7wZzpTywad0XR6Pjm9Apq1n/mjk7yj/yWSDZPXgljex/E8l2J/g586HNb3qIjcaNPhRVvJyjiglCzK1EASABAtIMSwiALPLDa8yuxhOq9+PGkchoifzK77mlAfJtnZnQ8ijMVP+7NReegdqJzks8cvLLsTOusUgT1JK5fmSUaUbQpDrz41BAKO11Q8Mt/vP0z8U/8CW0sLaDb/51Vg0HJh5vgFfozOtjI6JMglvu/CxWz9CLKYKSs097wwa+2Um5Hh+SQhGP1fohx0CaH34mwLkKFOeFq+2rW X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(101931422205132); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(8121501046)(5005006)(520078)(10201501046)(3002001);SRVR:BY2PR0301MB0760;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0301MB0760; X-Forefront-PRVS: 0776C39A48 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BY2PR0301MB0760;23:ce2uonStLwP9LVjVssp2i4rTOjBIw0R3hjQfR48?= =?us-ascii?Q?qX2FBi6zkDdrTj3d5xAEpVQnMKl+Vjwlscr6Fne2xl3sg9ffBlXED4zL0oje?= =?us-ascii?Q?0woaD2+YFLjW/1+5xRBxYKq5D9lND8UCC9Dc23V6xgWT7ZlYdsbBX+TbWrVT?= =?us-ascii?Q?TaHh9YaSuqS0ZcqWx+Vuh2Be2hU99N3oldad5hlGYceWhuSPDMFY7qShcrNj?= =?us-ascii?Q?ldX0fo0CO1o3Gw2ug3cizGRGrik4pFh6d8AqmSxQOtJ2gg/qNWsETkz4FDEO?= =?us-ascii?Q?VZFCee0MWy/YdLpcsuD7w7ya6ZyxqtJncMfzP2eQ7GWIxrecJq+mLm9cCApL?= =?us-ascii?Q?lVFRjXR4/IjEHgM/WCOfjJBkbUI3nAcF3YIGdzTRTvk3VXvfU9/CZKZf+Jta?= =?us-ascii?Q?YoMLksEWgWZ6RoMySEgsaEJfDlUFMfJWD1ArBQLDNCZPKX6DX/rcQHZrQdU3?= =?us-ascii?Q?FQlf+T/a8lhok6n8vybziWl+o9Txmghjyuk3ONmi8ZR5k+gebSsDS8im6sRv?= =?us-ascii?Q?auWNjH5v2K3yheR7MzqQ75uaZVIO0vAQQozGf4pk9YgO/5mflJO+AgORIqvs?= =?us-ascii?Q?bvxcXT3MEQpenAE0VKvj7rfkLMI9ytI+LKJYF1R+kJJxZ5ZsXS7gpbg0Kzal?= =?us-ascii?Q?pmBpTztmdEl+d/mopqviNV62Ok3GVDfQvX5ow5sa9GsQQm0CVUZtvtNf2fv2?= =?us-ascii?Q?e9DDcirDSvojiyp1bbO7aexC/TX6rTV+ITmYJwNdzhmcTgbmmekT+qO1ii3D?= =?us-ascii?Q?nPXf6ZJ0/+wJ0pEnCqpcLlrx0to5FBHCJilW5Mlrd9vtd8SVDL4/agtu/6SM?= =?us-ascii?Q?/mv1fmuS7YJRMFxFbJhGpw75dgfNUGy7VQi4wCr23hCJ5p/WDFyxQ12OJK+0?= =?us-ascii?Q?BQOB8hDYuTJmTSeTrmIzBAxs6QGXmElUX4FDoFyd+KBRnq8+gCWuym4+6t23?= =?us-ascii?Q?1rWTlL/zjpvvRLaSmYrP5Mkv78c3vBqZ6sFdcbi6HKW7ZayapHU/PWZ9UXrk?= =?us-ascii?Q?Uk7jio92571XoLgPmAFanTG+1JC4s9qvXmBWLEePoGdz2waL7EHfP4JRnM07?= =?us-ascii?Q?hJFVJPs+J5WPbHbp3Kdw+Kp+jnEtANCjsahH6axXsrh+tduXyNWY+U9CAjrS?= =?us-ascii?Q?v9KZKVFHJYuP+lYIykUMLh6p0NABnnmt7?= X-Microsoft-Exchange-Diagnostics: 1;BY2PR0301MB0760;5:2W+nU0jVSdFtGJ7RmuermuuG0n6QjvsHeCaPkhEBFEZtiaX7k7Lu/cVdVXxBEZ/O2U64bVAgigpafcPNFqYvVKapN/P1/v83pGF74aROHidszgyqOQsqKp1BxTrXqiMdVMK5SwSulNDteg2bBUXcrg==;24:Rw7fJPjrAtda+WHtxKC4mY0c9fwLR3eAfFr0xn0hwUmvr/0ruBOwT4bv+xVFmYMCPrVE5SJ3psKPwowy2sb5woIjXmOUfPLvDVPUgxUg7Mg= X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2015 16:13:07.7407 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d;Ip=[192.88.158.2];Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0301MB0760 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Igal Liberman The Storage Profiles contain parameters that are used by the FMan for frame reception and transmission. Signed-off-by: Igal Liberman --- drivers/net/ethernet/freescale/fman/Makefile | 2 +- drivers/net/ethernet/freescale/fman/fman_sp.c | 167 +++++++++++++++++++++++++ drivers/net/ethernet/freescale/fman/fman_sp.h | 103 +++++++++++++++ 3 files changed, 271 insertions(+), 1 deletion(-) create mode 100644 drivers/net/ethernet/freescale/fman/fman_sp.c create mode 100644 drivers/net/ethernet/freescale/fman/fman_sp.h diff --git a/drivers/net/ethernet/freescale/fman/Makefile b/drivers/net/ethernet/freescale/fman/Makefile index 43360d70..5141532 100644 --- a/drivers/net/ethernet/freescale/fman/Makefile +++ b/drivers/net/ethernet/freescale/fman/Makefile @@ -2,5 +2,5 @@ subdir-ccflags-y += -I$(srctree)/drivers/net/ethernet/freescale/fman obj-y += fsl_fman.o fsl_fman_mac.o -fsl_fman-objs := fman_muram.o fman.o +fsl_fman-objs := fman_muram.o fman.o fman_sp.o fsl_fman_mac-objs := fman_dtsec.o fman_memac.o fman_tgec.o diff --git a/drivers/net/ethernet/freescale/fman/fman_sp.c b/drivers/net/ethernet/freescale/fman/fman_sp.c new file mode 100644 index 0000000..f36c622 --- /dev/null +++ b/drivers/net/ethernet/freescale/fman/fman_sp.c @@ -0,0 +1,167 @@ +/* + * Copyright 2008 - 2015 Freescale Semiconductor Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Freescale Semiconductor nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * + * ALTERNATIVELY, this software may be distributed under the terms of the + * GNU General Public License ("GPL") as published by the Free Software + * Foundation, either version 2 of that License or (at your option) any + * later version. + * + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "fman_sp.h" +#include "fman.h" + +void fman_sp_set_buf_pools_in_asc_order_of_buf_sizes(struct fman_ext_pools + *fm_ext_pools, + u8 *ordered_array, + u16 *sizes_array) +{ + u16 buf_size = 0; + int i = 0, j = 0, k = 0; + + /* First we copy the external buffers pools information + * to an ordered local array + */ + for (i = 0; i < fm_ext_pools->num_of_pools_used; i++) { + /* get pool size */ + buf_size = fm_ext_pools->ext_buf_pool[i].size; + + /* keep sizes in an array according to poolId + * for direct access + */ + sizes_array[fm_ext_pools->ext_buf_pool[i].id] = buf_size; + + /* save poolId in an ordered array according to size */ + for (j = 0; j <= i; j++) { + /* this is the next free place in the array */ + if (j == i) + ordered_array[i] = + fm_ext_pools->ext_buf_pool[i].id; + else { + /* find the right place for this poolId */ + if (buf_size < sizes_array[ordered_array[j]]) { + /* move the pool_ids one place ahead + * to make room for this poolId + */ + for (k = i; k > j; k--) + ordered_array[k] = + ordered_array[k - 1]; + + /* now k==j, this is the place for + * the new size + */ + ordered_array[k] = + fm_ext_pools->ext_buf_pool[i].id; + break; + } + } + } + } +} + +int fman_sp_build_buffer_struct(struct fman_sp_int_context_data_copy * + int_context_data_copy, + struct fman_buffer_prefix_content * + buffer_prefix_content, + struct fman_sp_buf_margins *buf_margins, + struct fman_sp_buffer_offsets *buffer_offsets, + u8 *internal_buf_offset) +{ + u32 tmp; + + /* Align start of internal context data to 16 byte */ + int_context_data_copy->ext_buf_offset = (u16) + ((buffer_prefix_content->priv_data_size & (OFFSET_UNITS - 1)) ? + ((buffer_prefix_content->priv_data_size + OFFSET_UNITS) & + ~(u16)(OFFSET_UNITS - 1)) : + buffer_prefix_content->priv_data_size); + + /* Translate margin and int_context params to FM parameters */ + /* Initialize with illegal value. Later we'll set legal values. */ + buffer_offsets->prs_result_offset = (u32)ILLEGAL_BASE; + buffer_offsets->time_stamp_offset = (u32)ILLEGAL_BASE; + buffer_offsets->hash_result_offset = (u32)ILLEGAL_BASE; + + /* Internally the driver supports 4 options + * 1. prsResult/timestamp/hashResult selection (in fact 8 options, + * but for simplicity we'll + * relate to it as 1). + * 2. All IC context (from AD) not including debug. + */ + + /* This case covers the options under 1 */ + /* Copy size must be in 16-byte granularity. */ + int_context_data_copy->size = + (u16)((buffer_prefix_content->pass_prs_result ? 32 : 0) + + ((buffer_prefix_content->pass_time_stamp || + buffer_prefix_content->pass_hash_result) ? 16 : 0)); + + /* Align start of internal context data to 16 byte */ + int_context_data_copy->int_context_offset = + (u8)(buffer_prefix_content->pass_prs_result ? 32 : + ((buffer_prefix_content->pass_time_stamp || + buffer_prefix_content->pass_hash_result) ? 64 : 0)); + + if (buffer_prefix_content->pass_prs_result) + buffer_offsets->prs_result_offset = + int_context_data_copy->ext_buf_offset; + if (buffer_prefix_content->pass_time_stamp) + buffer_offsets->time_stamp_offset = + buffer_prefix_content->pass_prs_result ? + (int_context_data_copy->ext_buf_offset + + sizeof(struct fman_prs_result)) : + int_context_data_copy->ext_buf_offset; + if (buffer_prefix_content->pass_hash_result) + /* If PR is not requested, whether TS is + * requested or not, IC will be copied from TS + */ + buffer_offsets->hash_result_offset = + buffer_prefix_content->pass_prs_result ? + (int_context_data_copy->ext_buf_offset + + sizeof(struct fman_prs_result) + 8) : + int_context_data_copy->ext_buf_offset + 8; + + if (int_context_data_copy->size) + buf_margins->start_margins = + (u16)(int_context_data_copy->ext_buf_offset + + int_context_data_copy->size); + else + /* No Internal Context passing, STartMargin is + * immediately after private_info + */ + buf_margins->start_margins = + buffer_prefix_content->priv_data_size; + + /* align data start */ + tmp = (u32)(buf_margins->start_margins % + buffer_prefix_content->data_align); + if (tmp) + buf_margins->start_margins += + (buffer_prefix_content->data_align - tmp); + buffer_offsets->data_offset = buf_margins->start_margins; + + return 0; +} + diff --git a/drivers/net/ethernet/freescale/fman/fman_sp.h b/drivers/net/ethernet/freescale/fman/fman_sp.h new file mode 100644 index 0000000..820b7f6 --- /dev/null +++ b/drivers/net/ethernet/freescale/fman/fman_sp.h @@ -0,0 +1,103 @@ +/* + * Copyright 2008 - 2015 Freescale Semiconductor Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Freescale Semiconductor nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * ALTERNATIVELY, this software may be distributed under the terms of the + * GNU General Public License ("GPL") as published by the Free Software + * Foundation, either version 2 of that License or (at your option) any + * later version. + * + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __FM_SP_H +#define __FM_SP_H + +#include "fman.h" +#include + +#define ILLEGAL_BASE (~0) + +/* defaults */ +#define DFLT_FM_SP_BUFFER_PREFIX_CONTEXT_DATA_ALIGN 64 + +/* Registers bit fields */ +#define FMAN_SP_EXT_BUF_POOL_EN_COUNTER 0x40000000 +#define FMAN_SP_EXT_BUF_POOL_VALID 0x80000000 +#define FMAN_SP_EXT_BUF_POOL_BACKUP 0x20000000 +#define FMAN_SP_DMA_ATTR_WRITE_OPTIMIZE 0x00100000 +#define FMAN_SP_SG_DISABLE 0x80000000 + +/* shifts */ +#define FMAN_SP_EXT_BUF_MARG_START_SHIFT 16 +#define FMAN_SP_DMA_ATTR_SWP_SHIFT 30 +#define FMAN_SP_IC_TO_EXT_SHIFT 16 +#define FMAN_SP_IC_FROM_INT_SHIFT 8 + +/* structure for defining internal context copying */ +struct fman_sp_int_context_data_copy { + /* < Offset in External buffer to which internal + * context is copied to (Rx) or taken from (Tx, Op). + */ + u16 ext_buf_offset; + /* Offset within internal context to copy from + * (Rx) or to copy to (Tx, Op). + */ + u8 int_context_offset; + /* Internal offset size to be copied */ + u16 size; +}; + +/* struct for defining external buffer margins */ +struct fman_sp_buf_margins { + /* Number of bytes to be left at the beginning + * of the external buffer (must be divisible by 16) + */ + u16 start_margins; + /* number of bytes to be left at the end + * of the external buffer(must be divisible by 16) + */ + u16 end_margins; +}; + +struct fman_sp_buffer_offsets { + u32 data_offset; + u32 prs_result_offset; + u32 time_stamp_offset; + u32 hash_result_offset; +}; + +int fman_sp_build_buffer_struct(struct fman_sp_int_context_data_copy + *int_context_data_copy, + struct fman_buffer_prefix_content + *buffer_prefix_content, + struct fman_sp_buf_margins *buf_margins, + struct fman_sp_buffer_offsets + *buffer_offsets, + u8 *internal_buf_offset); + +void fman_sp_set_buf_pools_in_asc_order_of_buf_sizes(struct fman_ext_pools + *fm_ext_pools, + u8 *ordered_array, + u16 *sizes_array); + +#endif /* __FM_SP_H */ -- 1.7.9.5