162306a36Sopenharmony_ci/*
262306a36Sopenharmony_ci * libcxgb_ppm.h: Chelsio common library for T3/T4/T5 iSCSI ddp operation
362306a36Sopenharmony_ci *
462306a36Sopenharmony_ci * Copyright (c) 2016 Chelsio Communications, Inc. All rights reserved.
562306a36Sopenharmony_ci *
662306a36Sopenharmony_ci * This software is available to you under a choice of one of two
762306a36Sopenharmony_ci * licenses.  You may choose to be licensed under the terms of the GNU
862306a36Sopenharmony_ci * General Public License (GPL) Version 2, available from the file
962306a36Sopenharmony_ci * COPYING in the main directory of this source tree, or the
1062306a36Sopenharmony_ci * OpenIB.org BSD license below:
1162306a36Sopenharmony_ci *
1262306a36Sopenharmony_ci *     Redistribution and use in source and binary forms, with or
1362306a36Sopenharmony_ci *     without modification, are permitted provided that the following
1462306a36Sopenharmony_ci *     conditions are met:
1562306a36Sopenharmony_ci *
1662306a36Sopenharmony_ci *      - Redistributions of source code must retain the above
1762306a36Sopenharmony_ci *        copyright notice, this list of conditions and the following
1862306a36Sopenharmony_ci *        disclaimer.
1962306a36Sopenharmony_ci *
2062306a36Sopenharmony_ci *      - Redistributions in binary form must reproduce the above
2162306a36Sopenharmony_ci *        copyright notice, this list of conditions and the following
2262306a36Sopenharmony_ci *        disclaimer in the documentation and/or other materials
2362306a36Sopenharmony_ci *        provided with the distribution.
2462306a36Sopenharmony_ci *
2562306a36Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
2662306a36Sopenharmony_ci * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2762306a36Sopenharmony_ci * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
2862306a36Sopenharmony_ci * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
2962306a36Sopenharmony_ci * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
3062306a36Sopenharmony_ci * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
3162306a36Sopenharmony_ci * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3262306a36Sopenharmony_ci * SOFTWARE.
3362306a36Sopenharmony_ci *
3462306a36Sopenharmony_ci * Written by: Karen Xie (kxie@chelsio.com)
3562306a36Sopenharmony_ci */
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_ci#ifndef	__LIBCXGB_PPM_H__
3862306a36Sopenharmony_ci#define	__LIBCXGB_PPM_H__
3962306a36Sopenharmony_ci
4062306a36Sopenharmony_ci#include <linux/kernel.h>
4162306a36Sopenharmony_ci#include <linux/errno.h>
4262306a36Sopenharmony_ci#include <linux/types.h>
4362306a36Sopenharmony_ci#include <linux/debugfs.h>
4462306a36Sopenharmony_ci#include <linux/list.h>
4562306a36Sopenharmony_ci#include <linux/netdevice.h>
4662306a36Sopenharmony_ci#include <linux/scatterlist.h>
4762306a36Sopenharmony_ci#include <linux/skbuff.h>
4862306a36Sopenharmony_ci#include <linux/vmalloc.h>
4962306a36Sopenharmony_ci#include <linux/bitmap.h>
5062306a36Sopenharmony_ci
5162306a36Sopenharmony_cistruct cxgbi_pagepod_hdr {
5262306a36Sopenharmony_ci	u32 vld_tid;
5362306a36Sopenharmony_ci	u32 pgsz_tag_clr;
5462306a36Sopenharmony_ci	u32 max_offset;
5562306a36Sopenharmony_ci	u32 page_offset;
5662306a36Sopenharmony_ci	u64 rsvd;
5762306a36Sopenharmony_ci};
5862306a36Sopenharmony_ci
5962306a36Sopenharmony_ci#define PPOD_PAGES_MAX			4
6062306a36Sopenharmony_cistruct cxgbi_pagepod {
6162306a36Sopenharmony_ci	struct cxgbi_pagepod_hdr hdr;
6262306a36Sopenharmony_ci	__be64 addr[PPOD_PAGES_MAX + 1];
6362306a36Sopenharmony_ci};
6462306a36Sopenharmony_ci
6562306a36Sopenharmony_ci/* ddp tag format
6662306a36Sopenharmony_ci * for a 32-bit tag:
6762306a36Sopenharmony_ci * bit #
6862306a36Sopenharmony_ci * 31 .....   .....  0
6962306a36Sopenharmony_ci *     X   Y...Y Z...Z, where
7062306a36Sopenharmony_ci *     ^   ^^^^^ ^^^^
7162306a36Sopenharmony_ci *     |   |      |____ when ddp bit = 0: color bits
7262306a36Sopenharmony_ci *     |   |
7362306a36Sopenharmony_ci *     |   |____ when ddp bit = 0: idx into the ddp memory region
7462306a36Sopenharmony_ci *     |
7562306a36Sopenharmony_ci *     |____ ddp bit: 0 - ddp tag, 1 - non-ddp tag
7662306a36Sopenharmony_ci *
7762306a36Sopenharmony_ci *  [page selector:2] [sw/free bits] [0] [idx] [color:6]
7862306a36Sopenharmony_ci */
7962306a36Sopenharmony_ci
8062306a36Sopenharmony_ci#define DDP_PGIDX_MAX		4
8162306a36Sopenharmony_ci#define DDP_PGSZ_BASE_SHIFT	12	/* base page 4K */
8262306a36Sopenharmony_ci
8362306a36Sopenharmony_cistruct cxgbi_task_tag_info {
8462306a36Sopenharmony_ci	unsigned char flags;
8562306a36Sopenharmony_ci#define CXGBI_PPOD_INFO_FLAG_VALID	0x1
8662306a36Sopenharmony_ci#define CXGBI_PPOD_INFO_FLAG_MAPPED	0x2
8762306a36Sopenharmony_ci	unsigned char cid;
8862306a36Sopenharmony_ci	unsigned short pg_shift;
8962306a36Sopenharmony_ci	unsigned int npods;
9062306a36Sopenharmony_ci	unsigned int idx;
9162306a36Sopenharmony_ci	unsigned int tag;
9262306a36Sopenharmony_ci	struct cxgbi_pagepod_hdr hdr;
9362306a36Sopenharmony_ci	int nents;
9462306a36Sopenharmony_ci	int nr_pages;
9562306a36Sopenharmony_ci	struct scatterlist *sgl;
9662306a36Sopenharmony_ci};
9762306a36Sopenharmony_ci
9862306a36Sopenharmony_cistruct cxgbi_tag_format {
9962306a36Sopenharmony_ci	unsigned char pgsz_order[DDP_PGIDX_MAX];
10062306a36Sopenharmony_ci	unsigned char pgsz_idx_dflt;
10162306a36Sopenharmony_ci	unsigned char free_bits:4;
10262306a36Sopenharmony_ci	unsigned char color_bits:4;
10362306a36Sopenharmony_ci	unsigned char idx_bits;
10462306a36Sopenharmony_ci	unsigned char rsvd_bits;
10562306a36Sopenharmony_ci	unsigned int  no_ddp_mask;
10662306a36Sopenharmony_ci	unsigned int  idx_mask;
10762306a36Sopenharmony_ci	unsigned int  color_mask;
10862306a36Sopenharmony_ci	unsigned int  idx_clr_mask;
10962306a36Sopenharmony_ci	unsigned int  rsvd_mask;
11062306a36Sopenharmony_ci};
11162306a36Sopenharmony_ci
11262306a36Sopenharmony_cistruct cxgbi_ppod_data {
11362306a36Sopenharmony_ci	unsigned char pg_idx:2;
11462306a36Sopenharmony_ci	unsigned char color:6;
11562306a36Sopenharmony_ci	unsigned char chan_id;
11662306a36Sopenharmony_ci	unsigned short npods;
11762306a36Sopenharmony_ci	unsigned long caller_data;
11862306a36Sopenharmony_ci};
11962306a36Sopenharmony_ci
12062306a36Sopenharmony_ci/* per cpu ppm pool */
12162306a36Sopenharmony_cistruct cxgbi_ppm_pool {
12262306a36Sopenharmony_ci	unsigned int base;		/* base index */
12362306a36Sopenharmony_ci	unsigned int next;		/* next possible free index */
12462306a36Sopenharmony_ci	spinlock_t lock;		/* ppm pool lock */
12562306a36Sopenharmony_ci	unsigned long bmap[];
12662306a36Sopenharmony_ci} ____cacheline_aligned_in_smp;
12762306a36Sopenharmony_ci
12862306a36Sopenharmony_cistruct cxgbi_ppm {
12962306a36Sopenharmony_ci	struct kref refcnt;
13062306a36Sopenharmony_ci	struct net_device *ndev;	/* net_device, 1st port */
13162306a36Sopenharmony_ci	struct pci_dev *pdev;
13262306a36Sopenharmony_ci	void *lldev;
13362306a36Sopenharmony_ci	void **ppm_pp;
13462306a36Sopenharmony_ci	struct cxgbi_tag_format tformat;
13562306a36Sopenharmony_ci	unsigned int ppmax;
13662306a36Sopenharmony_ci	unsigned int llimit;
13762306a36Sopenharmony_ci	unsigned int base_idx;
13862306a36Sopenharmony_ci
13962306a36Sopenharmony_ci	unsigned int pool_rsvd;
14062306a36Sopenharmony_ci	unsigned int pool_index_max;
14162306a36Sopenharmony_ci	struct cxgbi_ppm_pool __percpu *pool;
14262306a36Sopenharmony_ci	/* map lock */
14362306a36Sopenharmony_ci	spinlock_t map_lock;		/* ppm map lock */
14462306a36Sopenharmony_ci	unsigned int bmap_index_max;
14562306a36Sopenharmony_ci	unsigned int next;
14662306a36Sopenharmony_ci	unsigned int max_index_in_edram;
14762306a36Sopenharmony_ci	unsigned long *ppod_bmap;
14862306a36Sopenharmony_ci	struct cxgbi_ppod_data ppod_data[];
14962306a36Sopenharmony_ci};
15062306a36Sopenharmony_ci
15162306a36Sopenharmony_ci#define DDP_THRESHOLD		512
15262306a36Sopenharmony_ci
15362306a36Sopenharmony_ci#define PPOD_PAGES_SHIFT	2       /*  4 pages per pod */
15462306a36Sopenharmony_ci
15562306a36Sopenharmony_ci#define IPPOD_SIZE               sizeof(struct cxgbi_pagepod)  /*  64 */
15662306a36Sopenharmony_ci#define PPOD_SIZE_SHIFT         6
15762306a36Sopenharmony_ci
15862306a36Sopenharmony_ci/* page pods are allocated in groups of this size (must be power of 2) */
15962306a36Sopenharmony_ci#define PPOD_CLUSTER_SIZE	16U
16062306a36Sopenharmony_ci
16162306a36Sopenharmony_ci#define ULPMEM_DSGL_MAX_NPPODS	16	/*  1024/PPOD_SIZE */
16262306a36Sopenharmony_ci#define ULPMEM_IDATA_MAX_NPPODS	3	/* (PPOD_SIZE * 3 + ulptx hdr) < 256B */
16362306a36Sopenharmony_ci#define PCIE_MEMWIN_MAX_NPPODS	16	/*  1024/PPOD_SIZE */
16462306a36Sopenharmony_ci
16562306a36Sopenharmony_ci#define PPOD_COLOR_SHIFT	0
16662306a36Sopenharmony_ci#define PPOD_COLOR(x)		((x) << PPOD_COLOR_SHIFT)
16762306a36Sopenharmony_ci
16862306a36Sopenharmony_ci#define PPOD_IDX_SHIFT          6
16962306a36Sopenharmony_ci#define PPOD_IDX_MAX_SIZE       24
17062306a36Sopenharmony_ci
17162306a36Sopenharmony_ci#define PPOD_TID_SHIFT		0
17262306a36Sopenharmony_ci#define PPOD_TID(x)		((x) << PPOD_TID_SHIFT)
17362306a36Sopenharmony_ci
17462306a36Sopenharmony_ci#define PPOD_TAG_SHIFT		6
17562306a36Sopenharmony_ci#define PPOD_TAG(x)		((x) << PPOD_TAG_SHIFT)
17662306a36Sopenharmony_ci
17762306a36Sopenharmony_ci#define PPOD_VALID_SHIFT	24
17862306a36Sopenharmony_ci#define PPOD_VALID(x)		((x) << PPOD_VALID_SHIFT)
17962306a36Sopenharmony_ci#define PPOD_VALID_FLAG		PPOD_VALID(1U)
18062306a36Sopenharmony_ci
18162306a36Sopenharmony_ci#define PPOD_PI_EXTRACT_CTL_SHIFT	31
18262306a36Sopenharmony_ci#define PPOD_PI_EXTRACT_CTL(x)		((x) << PPOD_PI_EXTRACT_CTL_SHIFT)
18362306a36Sopenharmony_ci#define PPOD_PI_EXTRACT_CTL_FLAG	V_PPOD_PI_EXTRACT_CTL(1U)
18462306a36Sopenharmony_ci
18562306a36Sopenharmony_ci#define PPOD_PI_TYPE_SHIFT		29
18662306a36Sopenharmony_ci#define PPOD_PI_TYPE_MASK		0x3
18762306a36Sopenharmony_ci#define PPOD_PI_TYPE(x)			((x) << PPOD_PI_TYPE_SHIFT)
18862306a36Sopenharmony_ci
18962306a36Sopenharmony_ci#define PPOD_PI_CHECK_CTL_SHIFT		27
19062306a36Sopenharmony_ci#define PPOD_PI_CHECK_CTL_MASK		0x3
19162306a36Sopenharmony_ci#define PPOD_PI_CHECK_CTL(x)		((x) << PPOD_PI_CHECK_CTL_SHIFT)
19262306a36Sopenharmony_ci
19362306a36Sopenharmony_ci#define PPOD_PI_REPORT_CTL_SHIFT	25
19462306a36Sopenharmony_ci#define PPOD_PI_REPORT_CTL_MASK		0x3
19562306a36Sopenharmony_ci#define PPOD_PI_REPORT_CTL(x)		((x) << PPOD_PI_REPORT_CTL_SHIFT)
19662306a36Sopenharmony_ci
19762306a36Sopenharmony_cistatic inline int cxgbi_ppm_is_ddp_tag(struct cxgbi_ppm *ppm, u32 tag)
19862306a36Sopenharmony_ci{
19962306a36Sopenharmony_ci	return !(tag & ppm->tformat.no_ddp_mask);
20062306a36Sopenharmony_ci}
20162306a36Sopenharmony_ci
20262306a36Sopenharmony_cistatic inline int cxgbi_ppm_sw_tag_is_usable(struct cxgbi_ppm *ppm,
20362306a36Sopenharmony_ci					     u32 tag)
20462306a36Sopenharmony_ci{
20562306a36Sopenharmony_ci	/* the sw tag must be using <= 31 bits */
20662306a36Sopenharmony_ci	return !(tag & 0x80000000U);
20762306a36Sopenharmony_ci}
20862306a36Sopenharmony_ci
20962306a36Sopenharmony_cistatic inline int cxgbi_ppm_make_non_ddp_tag(struct cxgbi_ppm *ppm,
21062306a36Sopenharmony_ci					     u32 sw_tag,
21162306a36Sopenharmony_ci					     u32 *final_tag)
21262306a36Sopenharmony_ci{
21362306a36Sopenharmony_ci	struct cxgbi_tag_format *tformat = &ppm->tformat;
21462306a36Sopenharmony_ci
21562306a36Sopenharmony_ci	if (!cxgbi_ppm_sw_tag_is_usable(ppm, sw_tag)) {
21662306a36Sopenharmony_ci		pr_info("sw_tag 0x%x NOT usable.\n", sw_tag);
21762306a36Sopenharmony_ci		return -EINVAL;
21862306a36Sopenharmony_ci	}
21962306a36Sopenharmony_ci
22062306a36Sopenharmony_ci	if (!sw_tag) {
22162306a36Sopenharmony_ci		*final_tag = tformat->no_ddp_mask;
22262306a36Sopenharmony_ci	} else {
22362306a36Sopenharmony_ci		unsigned int shift = tformat->idx_bits + tformat->color_bits;
22462306a36Sopenharmony_ci		u32 lower = sw_tag & tformat->idx_clr_mask;
22562306a36Sopenharmony_ci		u32 upper = (sw_tag >> shift) << (shift + 1);
22662306a36Sopenharmony_ci
22762306a36Sopenharmony_ci		*final_tag = upper | tformat->no_ddp_mask | lower;
22862306a36Sopenharmony_ci	}
22962306a36Sopenharmony_ci	return 0;
23062306a36Sopenharmony_ci}
23162306a36Sopenharmony_ci
23262306a36Sopenharmony_cistatic inline u32 cxgbi_ppm_decode_non_ddp_tag(struct cxgbi_ppm *ppm,
23362306a36Sopenharmony_ci					       u32 tag)
23462306a36Sopenharmony_ci{
23562306a36Sopenharmony_ci	struct cxgbi_tag_format *tformat = &ppm->tformat;
23662306a36Sopenharmony_ci	unsigned int shift = tformat->idx_bits + tformat->color_bits;
23762306a36Sopenharmony_ci	u32 lower = tag & tformat->idx_clr_mask;
23862306a36Sopenharmony_ci	u32 upper = (tag >> tformat->rsvd_bits) << shift;
23962306a36Sopenharmony_ci
24062306a36Sopenharmony_ci	return upper | lower;
24162306a36Sopenharmony_ci}
24262306a36Sopenharmony_ci
24362306a36Sopenharmony_cistatic inline u32 cxgbi_ppm_ddp_tag_get_idx(struct cxgbi_ppm *ppm,
24462306a36Sopenharmony_ci					    u32 ddp_tag)
24562306a36Sopenharmony_ci{
24662306a36Sopenharmony_ci	u32 hw_idx = (ddp_tag >> PPOD_IDX_SHIFT) &
24762306a36Sopenharmony_ci			ppm->tformat.idx_mask;
24862306a36Sopenharmony_ci
24962306a36Sopenharmony_ci	return hw_idx - ppm->base_idx;
25062306a36Sopenharmony_ci}
25162306a36Sopenharmony_ci
25262306a36Sopenharmony_cistatic inline u32 cxgbi_ppm_make_ddp_tag(unsigned int hw_idx,
25362306a36Sopenharmony_ci					 unsigned char color)
25462306a36Sopenharmony_ci{
25562306a36Sopenharmony_ci	return (hw_idx << PPOD_IDX_SHIFT) | ((u32)color);
25662306a36Sopenharmony_ci}
25762306a36Sopenharmony_ci
25862306a36Sopenharmony_cistatic inline unsigned long
25962306a36Sopenharmony_cicxgbi_ppm_get_tag_caller_data(struct cxgbi_ppm *ppm,
26062306a36Sopenharmony_ci			      u32 ddp_tag)
26162306a36Sopenharmony_ci{
26262306a36Sopenharmony_ci	u32 idx = cxgbi_ppm_ddp_tag_get_idx(ppm, ddp_tag);
26362306a36Sopenharmony_ci
26462306a36Sopenharmony_ci	return ppm->ppod_data[idx].caller_data;
26562306a36Sopenharmony_ci}
26662306a36Sopenharmony_ci
26762306a36Sopenharmony_ci/* sw bits are the free bits */
26862306a36Sopenharmony_cistatic inline int cxgbi_ppm_ddp_tag_update_sw_bits(struct cxgbi_ppm *ppm,
26962306a36Sopenharmony_ci						   u32 val, u32 orig_tag,
27062306a36Sopenharmony_ci						   u32 *final_tag)
27162306a36Sopenharmony_ci{
27262306a36Sopenharmony_ci	struct cxgbi_tag_format *tformat = &ppm->tformat;
27362306a36Sopenharmony_ci	u32 v = val >> tformat->free_bits;
27462306a36Sopenharmony_ci
27562306a36Sopenharmony_ci	if (v) {
27662306a36Sopenharmony_ci		pr_info("sw_bits 0x%x too large, avail bits %u.\n",
27762306a36Sopenharmony_ci			val, tformat->free_bits);
27862306a36Sopenharmony_ci		return -EINVAL;
27962306a36Sopenharmony_ci	}
28062306a36Sopenharmony_ci	if (!cxgbi_ppm_is_ddp_tag(ppm, orig_tag))
28162306a36Sopenharmony_ci		return -EINVAL;
28262306a36Sopenharmony_ci
28362306a36Sopenharmony_ci	*final_tag = (val << tformat->rsvd_bits) |
28462306a36Sopenharmony_ci		     (orig_tag & ppm->tformat.rsvd_mask);
28562306a36Sopenharmony_ci	return 0;
28662306a36Sopenharmony_ci}
28762306a36Sopenharmony_ci
28862306a36Sopenharmony_cistatic inline void cxgbi_ppm_ppod_clear(struct cxgbi_pagepod *ppod)
28962306a36Sopenharmony_ci{
29062306a36Sopenharmony_ci	ppod->hdr.vld_tid = 0U;
29162306a36Sopenharmony_ci}
29262306a36Sopenharmony_ci
29362306a36Sopenharmony_cistatic inline void cxgbi_tagmask_check(unsigned int tagmask,
29462306a36Sopenharmony_ci				       struct cxgbi_tag_format *tformat)
29562306a36Sopenharmony_ci{
29662306a36Sopenharmony_ci	unsigned int bits = fls(tagmask);
29762306a36Sopenharmony_ci
29862306a36Sopenharmony_ci	/* reserve top most 2 bits for page selector */
29962306a36Sopenharmony_ci	tformat->free_bits = 32 - 2 - bits;
30062306a36Sopenharmony_ci	tformat->rsvd_bits = bits;
30162306a36Sopenharmony_ci	tformat->color_bits = PPOD_IDX_SHIFT;
30262306a36Sopenharmony_ci	tformat->idx_bits = bits - 1 - PPOD_IDX_SHIFT;
30362306a36Sopenharmony_ci	tformat->no_ddp_mask = 1 << (bits - 1);
30462306a36Sopenharmony_ci	tformat->idx_mask = (1 << tformat->idx_bits) - 1;
30562306a36Sopenharmony_ci	tformat->color_mask = (1 << PPOD_IDX_SHIFT) - 1;
30662306a36Sopenharmony_ci	tformat->idx_clr_mask = (1 << (bits - 1)) - 1;
30762306a36Sopenharmony_ci	tformat->rsvd_mask = (1 << bits) - 1;
30862306a36Sopenharmony_ci
30962306a36Sopenharmony_ci	pr_info("ippm: tagmask 0x%x, rsvd %u=%u+%u+1, mask 0x%x,0x%x, "
31062306a36Sopenharmony_ci		"pg %u,%u,%u,%u.\n",
31162306a36Sopenharmony_ci		tagmask, tformat->rsvd_bits, tformat->idx_bits,
31262306a36Sopenharmony_ci		tformat->color_bits, tformat->no_ddp_mask, tformat->rsvd_mask,
31362306a36Sopenharmony_ci		tformat->pgsz_order[0], tformat->pgsz_order[1],
31462306a36Sopenharmony_ci		tformat->pgsz_order[2], tformat->pgsz_order[3]);
31562306a36Sopenharmony_ci}
31662306a36Sopenharmony_ci
31762306a36Sopenharmony_ciint cxgbi_ppm_find_page_index(struct cxgbi_ppm *ppm, unsigned long pgsz);
31862306a36Sopenharmony_civoid cxgbi_ppm_make_ppod_hdr(struct cxgbi_ppm *ppm, u32 tag,
31962306a36Sopenharmony_ci			     unsigned int tid, unsigned int offset,
32062306a36Sopenharmony_ci			     unsigned int length,
32162306a36Sopenharmony_ci			     struct cxgbi_pagepod_hdr *hdr);
32262306a36Sopenharmony_civoid cxgbi_ppm_ppod_release(struct cxgbi_ppm *, u32 idx);
32362306a36Sopenharmony_ciint cxgbi_ppm_ppods_reserve(struct cxgbi_ppm *, unsigned short nr_pages,
32462306a36Sopenharmony_ci			    u32 per_tag_pg_idx, u32 *ppod_idx, u32 *ddp_tag,
32562306a36Sopenharmony_ci			    unsigned long caller_data);
32662306a36Sopenharmony_ciint cxgbi_ppm_init(void **ppm_pp, struct net_device *, struct pci_dev *,
32762306a36Sopenharmony_ci		   void *lldev, struct cxgbi_tag_format *,
32862306a36Sopenharmony_ci		   unsigned int iscsi_size, unsigned int llimit,
32962306a36Sopenharmony_ci		   unsigned int start, unsigned int reserve_factor,
33062306a36Sopenharmony_ci		   unsigned int edram_start, unsigned int edram_size);
33162306a36Sopenharmony_ciint cxgbi_ppm_release(struct cxgbi_ppm *ppm);
33262306a36Sopenharmony_civoid cxgbi_tagmask_check(unsigned int tagmask, struct cxgbi_tag_format *);
33362306a36Sopenharmony_ciunsigned int cxgbi_tagmask_set(unsigned int ppmax);
33462306a36Sopenharmony_ci
33562306a36Sopenharmony_ci#endif	/*__LIBCXGB_PPM_H__*/
336