xref: /onnv-gate/usr/src/uts/common/io/nxge/npi/npi_fflp.h (revision 11304:3092d1e303d6)
13859Sml29623 /*
23859Sml29623  * CDDL HEADER START
33859Sml29623  *
43859Sml29623  * The contents of this file are subject to the terms of the
53859Sml29623  * Common Development and Distribution License (the "License").
63859Sml29623  * You may not use this file except in compliance with the License.
73859Sml29623  *
83859Sml29623  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
93859Sml29623  * or http://www.opensolaris.org/os/licensing.
103859Sml29623  * See the License for the specific language governing permissions
113859Sml29623  * and limitations under the License.
123859Sml29623  *
133859Sml29623  * When distributing Covered Code, include this CDDL HEADER in each
143859Sml29623  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
153859Sml29623  * If applicable, add the following below this CDDL HEADER, with the
163859Sml29623  * fields enclosed by brackets "[]" replaced with your own identifying
173859Sml29623  * information: Portions Copyright [yyyy] [name of copyright owner]
183859Sml29623  *
193859Sml29623  * CDDL HEADER END
203859Sml29623  */
213859Sml29623 /*
22*11304SJanie.Lu@Sun.COM  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
233859Sml29623  * Use is subject to license terms.
243859Sml29623  */
253859Sml29623 
263859Sml29623 #ifndef _NPI_FFLP_H
273859Sml29623 #define	_NPI_FFLP_H
283859Sml29623 
293859Sml29623 #ifdef	__cplusplus
303859Sml29623 extern "C" {
313859Sml29623 #endif
323859Sml29623 
333859Sml29623 
343859Sml29623 #include <npi.h>
356495Sspeer #include <nxge_hw.h>
363859Sml29623 #include <nxge_fflp_hw.h>
373859Sml29623 #include <nxge_fflp.h>
383859Sml29623 
393859Sml29623 
403859Sml29623 typedef uint8_t part_id_t;
413859Sml29623 typedef uint8_t tcam_location_t;
423859Sml29623 typedef uint16_t vlan_id_t;
433859Sml29623 
443859Sml29623 typedef	enum _tcam_op {
453859Sml29623 	TCAM_RWC_STAT	= 0x1,
463859Sml29623 	TCAM_RWC_MATCH	= 0x2
473859Sml29623 } tcam_op_t;
483859Sml29623 
493859Sml29623 
503859Sml29623 #define	NPI_TCAM_COMP_NO_MATCH	0x8000000000000ULL
513859Sml29623 
523859Sml29623 /*
533859Sml29623  * NPI FFLP ERROR Codes
543859Sml29623  */
553859Sml29623 
563859Sml29623 #define	NPI_FFLP_BLK_CODE	FFLP_BLK_ID << 8
573859Sml29623 #define	NPI_FFLP_ERROR		(NPI_FAILURE | NPI_FFLP_BLK_CODE)
583859Sml29623 #define	NPI_TCAM_ERROR		0x10
593859Sml29623 #define	NPI_FCRAM_ERROR		0x20
603859Sml29623 #define	NPI_GEN_FFLP		0x30
613859Sml29623 #define	NPI_FFLP_SW_PARAM_ERROR	0x40
623859Sml29623 #define	NPI_FFLP_HW_ERROR	0x80
633859Sml29623 
643859Sml29623 
653859Sml29623 #define	NPI_FFLP_RESET_ERROR	(NPI_FFLP_ERROR | NPI_GEN_FFLP | RESET_FAILED)
663859Sml29623 #define	NPI_FFLP_RDC_TABLE_INVALID	(NPI_FFLP_ERROR | RDC_TAB_INVALID)
673859Sml29623 #define	NPI_FFLP_VLAN_INVALID		(NPI_FFLP_ERROR | VLAN_INVALID)
683859Sml29623 #define	NPI_FFLP_PORT_INVALID		(NPI_FFLP_ERROR | PORT_INVALID)
693859Sml29623 #define	NPI_FFLP_TCAM_RD_ERROR		\
703859Sml29623 	(NPI_FFLP_ERROR | NPI_TCAM_ERROR | READ_FAILED)
713859Sml29623 #define	NPI_FFLP_TCAM_WR_ERROR		\
723859Sml29623 	(NPI_FFLP_ERROR | NPI_TCAM_ERROR | WRITE_FAILED)
733859Sml29623 #define	NPI_FFLP_TCAM_LOC_INVALID	\
743859Sml29623 	(NPI_FFLP_ERROR | NPI_TCAM_ERROR | LOCATION_INVALID)
753859Sml29623 #define	NPI_FFLP_ASC_RAM_RD_ERROR	\
763859Sml29623 	(NPI_FFLP_ERROR | NPI_TCAM_ERROR | READ_FAILED)
773859Sml29623 #define	NPI_FFLP_ASC_RAM_WR_ERROR	\
783859Sml29623 	(NPI_FFLP_ERROR | NPI_TCAM_ERROR | WRITE_FAILED)
793859Sml29623 #define	NPI_FFLP_FCRAM_READ_ERROR	\
803859Sml29623 	(NPI_FFLP_ERROR | NPI_FCRAM_ERROR | READ_FAILED)
813859Sml29623 #define	NPI_FFLP_FCRAM_WR_ERROR		\
823859Sml29623 	(NPI_FFLP_ERROR | NPI_FCRAM_ERROR | WRITE_FAILED)
833859Sml29623 #define	NPI_FFLP_FCRAM_PART_INVALID	\
843859Sml29623 	(NPI_FFLP_ERROR | NPI_FCRAM_ERROR | RDC_TAB_INVALID)
853859Sml29623 #define	NPI_FFLP_FCRAM_LOC_INVALID	\
863859Sml29623 	(NPI_FFLP_ERROR | NPI_FCRAM_ERROR | LOCATION_INVALID)
873859Sml29623 
883859Sml29623 #define	TCAM_CLASS_INVALID		\
893859Sml29623 	(NPI_FFLP_SW_PARAM_ERROR | 0xb)
903859Sml29623 /* have only 0xc, 0xd, 0xe and 0xf left for sw error codes */
913859Sml29623 #define	NPI_FFLP_TCAM_CLASS_INVALID	\
923859Sml29623 	(NPI_FFLP_ERROR | NPI_TCAM_ERROR | TCAM_CLASS_INVALID)
933859Sml29623 #define	NPI_FFLP_TCAM_HW_ERROR		\
943859Sml29623 	(NPI_FFLP_ERROR | NPI_FFLP_HW_ERROR | NPI_TCAM_ERROR)
953859Sml29623 #define	NPI_FFLP_FCRAM_HW_ERROR		\
963859Sml29623 	(NPI_FFLP_ERROR | NPI_FFLP_HW_ERROR | NPI_FCRAM_ERROR)
973859Sml29623 
983859Sml29623 
993859Sml29623 /*
1003859Sml29623  * FFLP NPI defined event masks (mapped to the hardware defined masks).
1013859Sml29623  */
1023859Sml29623 typedef	enum _fflp_event_mask_cfg_e {
1033859Sml29623 	CFG_FFLP_ENT_MSK_VLAN_MASK = FFLP_ERR_VLAN_MASK,
1043859Sml29623 	CFG_FFLP_ENT_MSK_TCAM_MASK = FFLP_ERR_TCAM_MASK,
1053859Sml29623 	CFG_FFLP_ENT_MSK_HASH_TBL_LKUP_MASK = FFLP_ERR_HASH_TBL_LKUP_MASK,
1063859Sml29623 	CFG_FFLP_ENT_MSK_HASH_TBL_DAT_MASK = FFLP_ERR_HASH_TBL_DAT_MASK,
1073859Sml29623 
1083859Sml29623 	CFG_FFLP_MASK_ALL	= (FFLP_ERR_VLAN_MASK | FFLP_ERR_TCAM_MASK |
1093859Sml29623 						FFLP_ERR_HASH_TBL_LKUP_MASK |
1103859Sml29623 						FFLP_ERR_HASH_TBL_DAT_MASK)
1113859Sml29623 } fflp_event_mask_cfg_t;
1123859Sml29623 
1133859Sml29623 
1143859Sml29623 /* FFLP FCRAM Related Functions */
1153859Sml29623 /* The following are FCRAM datapath functions */
1163859Sml29623 
1173859Sml29623 /*
1183859Sml29623  * npi_fflp_fcram_entry_write ()
1193859Sml29623  * Populates an FCRAM entry
1203859Sml29623  * Inputs:
1213859Sml29623  *         handle:	opaque handle interpreted by the underlying OS
1223859Sml29623  *	   partid:	Partition ID
1233859Sml29623  *	   location:	Index to the FCRAM.
1243859Sml29623  *			Corresponds to last 20 bits of H1 value
1253859Sml29623  *	   fcram_ptr:	Pointer to the FCRAM contents to be used for writing
1263859Sml29623  *	   format:	Entry Format. Determines the size of the write.
1273859Sml29623  *			      FCRAM_ENTRY_OPTIM:   8 bytes (a 64 bit write)
1283859Sml29623  *			      FCRAM_ENTRY_EX_IP4:  32 bytes (4 X 64 bit write)
1293859Sml29623  *			      FCRAM_ENTRY_EX_IP6:  56 bytes (7 X 64 bit write)
1303859Sml29623  *
1313859Sml29623  * Return:
1323859Sml29623  * NPI_SUCCESS
1333859Sml29623  * NPI_FAILURE
1343859Sml29623  * NPI_HW_ERR
1353859Sml29623  * NPI_SW_ERR
1363859Sml29623  *
1373859Sml29623  */
1383859Sml29623 
1393859Sml29623 npi_status_t npi_fflp_fcram_entry_write(npi_handle_t, part_id_t,
1403859Sml29623 			    uint32_t, fcram_entry_t *,
1413859Sml29623 			    fcram_entry_format_t);
1423859Sml29623 
1433859Sml29623 /*
1443859Sml29623  * npi_fflp_fcram_entry_read ()
1453859Sml29623  * Reads an FCRAM entry
1463859Sml29623  * Inputs:
1473859Sml29623  *         handle:	opaque handle interpreted by the underlying OS
1483859Sml29623  *	   partid:	Partition ID
1493859Sml29623  *	   location:	Index to the FCRAM.
1503859Sml29623  *			Corresponds to last 20 bits of H1 value
1513859Sml29623  *	   fcram_ptr:	Pointer to the FCRAM contents to be updated
1523859Sml29623  *	   format:	Entry Format. Determines the size of the read.
1533859Sml29623  *			      FCRAM_ENTRY_OPTIM:   8 bytes (a 64 bit read)
1543859Sml29623  *			      FCRAM_ENTRY_EX_IP4:  32 bytes (4 X 64 bit read )
1553859Sml29623  *			      FCRAM_ENTRY_EX_IP6:  56 bytes (7 X 64 bit read )
1563859Sml29623  *
1573859Sml29623  * Return:
1583859Sml29623  * NPI_SUCCESS
1593859Sml29623  * NPI_FAILURE
1603859Sml29623  * NPI_HW_ERR
1613859Sml29623  * NPI_SW_ERR
1623859Sml29623  */
1633859Sml29623 
1643859Sml29623 npi_status_t npi_fflp_fcram_entry_read(npi_handle_t,  part_id_t,
1653859Sml29623 				    uint32_t, fcram_entry_t *,
1663859Sml29623 				    fcram_entry_format_t);
1673859Sml29623 
1683859Sml29623 /*
1693859Sml29623  * npi_fflp_fcram_entry_invalidate ()
1703859Sml29623  * Invalidate FCRAM entry at the given location
1713859Sml29623  * Inputs:
1723859Sml29623  *	handle:		opaque handle interpreted by the underlying OS
1733859Sml29623  *	partid:		Partition ID
1743859Sml29623  *	location:	location of the FCRAM/hash entry.
1753859Sml29623  *
1763859Sml29623  * Return:
1773859Sml29623  * NPI_SUCCESS
1783859Sml29623  * NPI_FAILURE
1793859Sml29623  * NPI_HW_ERR
1803859Sml29623  * NPI_SW_ERR
1813859Sml29623  *
1823859Sml29623  */
1833859Sml29623 
1843859Sml29623 npi_status_t
1853859Sml29623 npi_fflp_fcram_entry_invalidate(npi_handle_t, part_id_t,
1863859Sml29623 				    uint32_t);
1873859Sml29623 
1883859Sml29623 /*
1893859Sml29623  * npi_fflp_fcram_subarea_write ()
1903859Sml29623  * Writes to FCRAM entry subarea i.e the 8 bytes within the 64 bytes pointed by
1913859Sml29623  * last 20 bits of  H1. Effectively, this accesses specific 8 bytes within the
1923859Sml29623  * hash table bucket.
1933859Sml29623  *
1943859Sml29623  *    |-----------------| <-- H1
1953859Sml29623  *	   |	subarea 0    |
1963859Sml29623  *	   |_________________|
1973859Sml29623  *	   | Subarea 1	     |
1983859Sml29623  *	   |_________________|
1993859Sml29623  *	   | .......	     |
2003859Sml29623  *	   |_________________|
2013859Sml29623  *	   | Subarea 7       |
2023859Sml29623  *	   |_________________|
2033859Sml29623  *
2043859Sml29623  * Inputs:
2053859Sml29623  *         handle:	opaque handle interpreted by the underlying OS
2063859Sml29623  *	   partid:	Partition ID
2073859Sml29623  *	   location:	location of the subarea. It is derived from:
2083859Sml29623  *			Bucket = [19:15][14:0]       (20 bits of H1)
2093859Sml29623  *			location = (Bucket << 3 ) + subarea * 8
2103859Sml29623  *				 = [22:18][17:3] || subarea * 8
2113859Sml29623  *	   data:	Data
2123859Sml29623  * Return:
2133859Sml29623  * NPI_SUCCESS
2143859Sml29623  * NPI_FAILURE
2153859Sml29623  * NPI_HW_ERR
2163859Sml29623  * NPI_SW_ERR
2173859Sml29623  *
2183859Sml29623  */
2193859Sml29623 
2203859Sml29623 
2213859Sml29623 npi_status_t npi_fflp_fcram_subarea_write(npi_handle_t, part_id_t,
2223859Sml29623 				    uint32_t, uint64_t);
2233859Sml29623 /*
2243859Sml29623  * npi_fflp_fcram_subarea_read ()
2253859Sml29623  * Reads an FCRAM entry subarea i.e the 8 bytes within the 64 bytes pointed by
2263859Sml29623  * last 20 bits of  H1. Effectively, this accesses specific 8 bytes within the
2273859Sml29623  * hash table bucket.
2283859Sml29623  *
2293859Sml29623  *  H1-->  |-----------------|
2303859Sml29623  *	   |	subarea 0    |
2313859Sml29623  *	   |_________________|
2323859Sml29623  *	   | Subarea 1	     |
2333859Sml29623  *	   |_________________|
2343859Sml29623  *	   | .......	     |
2353859Sml29623  *	   |_________________|
2363859Sml29623  *	   | Subarea 7       |
2373859Sml29623  *	   |_________________|
2383859Sml29623  *
2393859Sml29623  * Inputs:
2403859Sml29623  *         handle:	opaque handle interpreted by the underlying OS
2413859Sml29623  *	   partid:	Partition ID
2423859Sml29623  *	   location:	location of the subarea. It is derived from:
2433859Sml29623  *			Bucket = [19:15][14:0]       (20 bits of H1)
2443859Sml29623  *			location = (Bucket << 3 ) + subarea * 8
2453859Sml29623  *				 = [22:18][17:3] || subarea * 8
2463859Sml29623  *	   data:	ptr do write subarea contents to.
2473859Sml29623  *
2483859Sml29623  * Return:
2493859Sml29623  * NPI_SUCCESS
2503859Sml29623  * NPI_FAILURE
2513859Sml29623  * NPI_HW_ERR
2523859Sml29623  * NPI_SW_ERR
2533859Sml29623  *
2543859Sml29623  */
2553859Sml29623 
2563859Sml29623 npi_status_t npi_fflp_fcram_subarea_read  (npi_handle_t,
2573859Sml29623 			part_id_t, uint32_t, uint64_t *);
2583859Sml29623 
2593859Sml29623 
2603859Sml29623 /* The following are zero function fflp configuration functions */
2613859Sml29623 /*
2623859Sml29623  * npi_fflp_fcram_config_partition()
2633859Sml29623  * Partitions and configures the FCRAM
2643859Sml29623  *
2653859Sml29623  * Input
2663859Sml29623  *     partid			partition ID
2673859Sml29623  *				Corresponds to the RDC table
2683859Sml29623  *     part_size		Size of the partition
2693859Sml29623  *
2703859Sml29623  * Return:
2713859Sml29623  * NPI_SUCCESS
2723859Sml29623  * NPI_FAILURE
2733859Sml29623  * NPI_HW_ERR
2743859Sml29623  * NPI_SW_ERR
2753859Sml29623  *
2763859Sml29623  */
2773859Sml29623 npi_status_t npi_fflp_cfg_fcram_partition(npi_handle_t, part_id_t,
2783859Sml29623 				uint8_t, uint8_t);
2793859Sml29623 
2803859Sml29623 /*
2813859Sml29623  * npi_fflp_fcram_partition_enable
2823859Sml29623  * Enable previously configured FCRAM partition
2833859Sml29623  *
2843859Sml29623  * Input
2853859Sml29623  *     partid			partition ID
2863859Sml29623  *				Corresponds to the RDC table
2873859Sml29623  *
2883859Sml29623  * Return
2893859Sml29623  *      0			Successful
2903859Sml29623  *      Non zero  error code    Enable failed, and reason.
2913859Sml29623  *
2923859Sml29623  */
2933859Sml29623 npi_status_t npi_fflp_cfg_fcram_partition_enable(npi_handle_t,
2943859Sml29623 				part_id_t);
2953859Sml29623 
2963859Sml29623 /*
2973859Sml29623  * npi_fflp_fcram_partition_disable
2983859Sml29623  * Disable previously configured FCRAM partition
2993859Sml29623  *
3003859Sml29623  * Input
3013859Sml29623  *     partid			partition ID
3023859Sml29623  *				Corresponds to the RDC table
3033859Sml29623  *
3043859Sml29623  * Return:
3053859Sml29623  * NPI_SUCCESS
3063859Sml29623  * NPI_FAILURE
3073859Sml29623  * NPI_HW_ERR
3083859Sml29623  * NPI_SW_ERR
3093859Sml29623  *
3103859Sml29623  */
3113859Sml29623 
3123859Sml29623 npi_status_t npi_fflp_cfg_fcram_partition_disable(npi_handle_t,
3133859Sml29623 				part_id_t);
3143859Sml29623 
3153859Sml29623 
3163859Sml29623 /*
3173859Sml29623  *  npi_fflp_cfg_fcram_reset
3183859Sml29623  *  Initializes the FCRAM reset sequence (including FFLP).
3193859Sml29623  *
3203859Sml29623  *  Input
3213859Sml29623  *	strength:		FCRAM Drive strength
3223859Sml29623  *				   strong, weak or normal
3233859Sml29623  *				   HW recommended value:
3243859Sml29623  *	qs:			FCRAM QS mode selection
3253859Sml29623  *				   qs mode or free running
3263859Sml29623  *				   HW recommended value is:
3273859Sml29623  *
3283859Sml29623  * Return:
3293859Sml29623  * NPI_SUCCESS
3303859Sml29623  * NPI_FAILURE
3313859Sml29623  * NPI_HW_ERR
3323859Sml29623  * NPI_SW_ERR
3333859Sml29623  *
3343859Sml29623  */
3353859Sml29623 
3363859Sml29623 npi_status_t npi_fflp_cfg_fcram_reset(npi_handle_t,
3373859Sml29623 				    fflp_fcram_output_drive_t,
3383859Sml29623 				    fflp_fcram_qs_t);
3393859Sml29623 
3403859Sml29623 
3413859Sml29623 
3423859Sml29623 /*
3433859Sml29623  *  npi_fflp_cfg_tcam_reset
3443859Sml29623  *  Initializes the FFLP reset sequence
3453859Sml29623  * Doesn't configure the FCRAM params.
3463859Sml29623  *
3473859Sml29623  *  Input
3483859Sml29623  *
3493859Sml29623  * Return:
3503859Sml29623  * NPI_SUCCESS
3513859Sml29623  * NPI_FAILURE
3523859Sml29623  * NPI_HW_ERR
3533859Sml29623  * NPI_SW_ERR
3543859Sml29623  *
3553859Sml29623  */
3563859Sml29623 
3573859Sml29623 npi_status_t npi_fflp_cfg_tcam_reset(npi_handle_t);
3583859Sml29623 
3593859Sml29623 /*
3603859Sml29623  *  npi_fflp_cfg_tcam_enable
3613859Sml29623  *  Enables the TCAM function
3623859Sml29623  *
3633859Sml29623  *  Input
3643859Sml29623  *
3653859Sml29623  * Return:
3663859Sml29623  * NPI_SUCCESS
3673859Sml29623  * NPI_FAILURE
3683859Sml29623  * NPI_HW_ERR
3693859Sml29623  * NPI_SW_ERR
3703859Sml29623  *
3713859Sml29623  */
3723859Sml29623 
3733859Sml29623 npi_status_t npi_fflp_cfg_tcam_enable(npi_handle_t);
3743859Sml29623 
3753859Sml29623 /*
3763859Sml29623  *  npi_fflp_cfg_tcam_disable
3773859Sml29623  *  Enables the TCAM function
3783859Sml29623  *
3793859Sml29623  *  Input
3803859Sml29623  *
3813859Sml29623  * Return:
3823859Sml29623  * NPI_SUCCESS
3833859Sml29623  * NPI_FAILURE
3843859Sml29623  * NPI_HW_ERR
3853859Sml29623  * NPI_SW_ERR
3863859Sml29623  *
3873859Sml29623  */
3883859Sml29623 
3893859Sml29623 npi_status_t npi_fflp_cfg_tcam_disable(npi_handle_t);
3903859Sml29623 
3913859Sml29623 
3923859Sml29623 /*
3933859Sml29623  *  npi_fflp_cfg_cam_errorcheck_disable
3943859Sml29623  *  Disables FCRAM and TCAM error checking
3953859Sml29623  *
3963859Sml29623  *  Input
3973859Sml29623  *
3983859Sml29623  *
3993859Sml29623  * Return:
4003859Sml29623  * NPI_SUCCESS
4013859Sml29623  * NPI_FAILURE
4023859Sml29623  * NPI_HW_ERR
4033859Sml29623  * NPI_SW_ERR
4043859Sml29623  *
4053859Sml29623  */
4063859Sml29623 
4073859Sml29623 npi_status_t npi_fflp_cfg_cam_errorcheck_disable(npi_handle_t);
4083859Sml29623 
4093859Sml29623 /*
4103859Sml29623  *  npi_fflp_cfg_cam_errorcheck_enable
4113859Sml29623  *  Enables FCRAM and TCAM error checking
4123859Sml29623  *
4133859Sml29623  *  Input
4143859Sml29623  *
4153859Sml29623  *
4163859Sml29623  *  Return
4173859Sml29623  *      0			Successful
4183859Sml29623  *      Non zero  error code    Enable failed, and reason.
4193859Sml29623  *
4203859Sml29623  */
4213859Sml29623 npi_status_t npi_fflp_cfg_cam_errorcheck_enable(npi_handle_t);
4223859Sml29623 
4233859Sml29623 
4243859Sml29623 /*
4253859Sml29623  *  npi_fflp_cfg_llcsnap_enable
4263859Sml29623  *  Enables input parser llcsnap recognition
4273859Sml29623  *
4283859Sml29623  *  Input
4293859Sml29623  *
4303859Sml29623  *
4313859Sml29623  * Return:
4323859Sml29623  * NPI_SUCCESS
4333859Sml29623  * NPI_FAILURE
4343859Sml29623  * NPI_HW_ERR
4353859Sml29623  * NPI_SW_ERR
4363859Sml29623  *
4373859Sml29623  *
4383859Sml29623  */
4393859Sml29623 npi_status_t npi_fflp_cfg_llcsnap_enable(npi_handle_t);
4403859Sml29623 
4413859Sml29623 /*
4423859Sml29623  *  npi_fflp_cam_llcsnap_disable
4433859Sml29623  *  Disables input parser llcsnap recognition
4443859Sml29623  *
4453859Sml29623  *  Input
4463859Sml29623  *
4473859Sml29623  *
4483859Sml29623  * Return:
4493859Sml29623  * NPI_SUCCESS
4503859Sml29623  * NPI_FAILURE
4513859Sml29623  * NPI_HW_ERR
4523859Sml29623  * NPI_SW_ERR
4533859Sml29623  *
4543859Sml29623  *
4553859Sml29623  */
4563859Sml29623 
4573859Sml29623 npi_status_t npi_fflp_cfg_llcsnap_disable(npi_handle_t);
4583859Sml29623 
4593859Sml29623 /*
4603859Sml29623  * npi_fflp_config_fcram_refresh
4613859Sml29623  * Set FCRAM min and max refresh time.
4623859Sml29623  *
4633859Sml29623  * Input
4643859Sml29623  *	min_time		Minimum Refresh time count
4653859Sml29623  *	max_time		maximum Refresh Time count
4663859Sml29623  *	sys_time		System Clock rate
4673859Sml29623  *
4683859Sml29623  *	The counters are 16 bit counters. The maximum refresh time is
4693859Sml29623  *      3.9us/clock cycle. The minimum is 400ns/clock cycle.
4703859Sml29623  *	Clock cycle is the FCRAM clock cycle?????
4713859Sml29623  *	If the cycle is FCRAM clock cycle, then sys_time parameter
4723859Sml29623  *      is not needed as there wont be configuration variation due to
4733859Sml29623  *      system clock cycle.
4743859Sml29623  *
4753859Sml29623  * Return:
4763859Sml29623  * NPI_SUCCESS
4773859Sml29623  * NPI_FAILURE
4783859Sml29623  * NPI_HW_ERR
4793859Sml29623  * NPI_SW_ERR
4803859Sml29623  *
4813859Sml29623  */
4823859Sml29623 
4833859Sml29623 npi_status_t npi_fflp_cfg_fcram_refresh_time(npi_handle_t,
4843859Sml29623 		uint32_t, uint32_t, uint32_t);
4853859Sml29623 
4863859Sml29623 
4873859Sml29623 /*
4883859Sml29623  * npi_fflp_cfg_fcram_access ()
4893859Sml29623  *
4903859Sml29623  * Sets the ratio between the FCRAM pio and lookup access
4913859Sml29623  * Input:
4923859Sml29623  * access_ratio: 0  Lookup has the highest priority
4933859Sml29623  *		 15 PIO has maximum possible priority
4943859Sml29623  *
4953859Sml29623  */
4963859Sml29623 
4973859Sml29623 npi_status_t npi_fflp_cfg_fcram_access(npi_handle_t,
4983859Sml29623 					uint8_t);
4993859Sml29623 
5003859Sml29623 
5013859Sml29623 /*
5023859Sml29623  * npi_fflp_cfg_tcam_access ()
5033859Sml29623  *
5043859Sml29623  * Sets the ratio between the TCAM pio and lookup access
5053859Sml29623  * Input:
5063859Sml29623  * access_ratio: 0  Lookup has the highest priority
5073859Sml29623  *		 15 PIO has maximum possible priority
5083859Sml29623  *
5093859Sml29623  */
5103859Sml29623 
5113859Sml29623 npi_status_t npi_fflp_cfg_tcam_access(npi_handle_t, uint8_t);
5123859Sml29623 
5133859Sml29623 
5143859Sml29623 /*
5153859Sml29623  *  npi_fflp_hash_lookup_err_report
5163859Sml29623  *  Reports hash table (fcram) lookup errors
5173859Sml29623  *
5183859Sml29623  *  Input
5193859Sml29623  *      status			Pointer to return Error bits
5203859Sml29623  *
5213859Sml29623  *
5223859Sml29623  * Return:
5233859Sml29623  * NPI_SUCCESS
5243859Sml29623  * NPI_FAILURE
5253859Sml29623  * NPI_HW_ERR
5263859Sml29623  * NPI_SW_ERR
5273859Sml29623  *
5283859Sml29623  */
5293859Sml29623 
5303859Sml29623 npi_status_t npi_fflp_fcram_get_lookup_err_log(npi_handle_t,
5313859Sml29623 				    hash_lookup_err_log_t *);
5323859Sml29623 
5333859Sml29623 
5343859Sml29623 
5353859Sml29623 /*
5363859Sml29623  * npi_fflp_fcram_get_pio_err_log
5373859Sml29623  * Reports hash table PIO read errors.
5383859Sml29623  *
5393859Sml29623  * Input
5403859Sml29623  *	partid:		partition ID
5413859Sml29623  *      err_stat	pointer to return Error bits
5423859Sml29623  *
5433859Sml29623  * Return:
5443859Sml29623  * NPI_SUCCESS
5453859Sml29623  * NPI_FAILURE
5463859Sml29623  * NPI_HW_ERR
5473859Sml29623  * NPI_SW_ERR
5483859Sml29623  *
5493859Sml29623  */
5503859Sml29623 npi_status_t npi_fflp_fcram_get_pio_err_log(npi_handle_t,
5513859Sml29623 				part_id_t, hash_pio_err_log_t *);
5523859Sml29623 
5533859Sml29623 
5543859Sml29623 /*
5553859Sml29623  * npi_fflp_fcram_clr_pio_err_log
5563859Sml29623  * Clears FCRAM PIO  error status for the partition.
5573859Sml29623  * If there are TCAM errors as indicated by err bit set by HW,
5583859Sml29623  *  then the SW will clear it by clearing the bit.
5593859Sml29623  *
5603859Sml29623  * Input
5613859Sml29623  *	partid:		partition ID
5623859Sml29623  *
5633859Sml29623  *
5643859Sml29623  * Return
5653859Sml29623  *	NPI_SUCCESS	Success
5663859Sml29623  *
5673859Sml29623  *
5683859Sml29623  */
5693859Sml29623 
5703859Sml29623 npi_status_t npi_fflp_fcram_clr_pio_err_log(npi_handle_t,
5713859Sml29623 						part_id_t);
5723859Sml29623 
5733859Sml29623 
5743859Sml29623 
5753859Sml29623 /*
5763859Sml29623  * npi_fflp_fcram_err_data_test
5773859Sml29623  * Tests the FCRAM error detection logic.
5783859Sml29623  * The error detection logic for the datapath is tested.
5793859Sml29623  * bits [63:0] are set to select the data bits to be xored
5803859Sml29623  *
5813859Sml29623  * Input
5823859Sml29623  *	data:	 data bits to select bits to be xored
5833859Sml29623  *
5843859Sml29623  *
5853859Sml29623  * Return
5863859Sml29623  *	NPI_SUCCESS	Success
5873859Sml29623  *
5883859Sml29623  *
5893859Sml29623  */
5903859Sml29623 npi_status_t npi_fflp_fcram_err_data_test(npi_handle_t, fcram_err_data_t *);
5913859Sml29623 
5923859Sml29623 
5933859Sml29623 /*
5943859Sml29623  * npi_fflp_fcram_err_synd_test
5953859Sml29623  * Tests the FCRAM error detection logic.
5963859Sml29623  * The error detection logic for the syndrome is tested.
5973859Sml29623  * tst0->synd (8bits) are set to select the syndrome bits
5983859Sml29623  * to be XOR'ed
5993859Sml29623  *
6003859Sml29623  * Input
6013859Sml29623  *	syndrome_bits:	 Syndrome bits to select bits to be xor'ed
6023859Sml29623  *
6033859Sml29623  *
6043859Sml29623  * Return
6053859Sml29623  *	NPI_SUCCESS	Success
6063859Sml29623  *
6073859Sml29623  *
6083859Sml29623  */
6093859Sml29623 npi_status_t npi_fflp_fcram_err_synd_test(npi_handle_t, uint8_t);
6103859Sml29623 
6113859Sml29623 
6123859Sml29623 /*
6133859Sml29623  * npi_fflp_cfg_vlan_table_clear
6143859Sml29623  * Clears the vlan RDC table
6153859Sml29623  *
6163859Sml29623  * Input
6173859Sml29623  *     vlan_id		VLAN ID
6183859Sml29623  *
6193859Sml29623  * Output
6203859Sml29623  *
6213859Sml29623  *	NPI_SUCCESS			Successful
6223859Sml29623  *
6233859Sml29623  */
6243859Sml29623 
6253859Sml29623 npi_status_t npi_fflp_cfg_vlan_table_clear(npi_handle_t, vlan_id_t);
6263859Sml29623 
6273859Sml29623 /*
6283859Sml29623  * npi_fflp_cfg_enet_vlan_table_assoc
6293859Sml29623  * associates port vlan id to rdc table and sets the priority
6303859Sml29623  * in respect to L2DA rdc table.
6313859Sml29623  *
6323859Sml29623  * Input
6333859Sml29623  *     mac_portn		port number
6343859Sml29623  *     vlan_id			VLAN ID
6353859Sml29623  *     rdc_table		RDC Table #
6363859Sml29623  *     priority			priority
6373859Sml29623  *				1: vlan classification has higher priority
6383859Sml29623  *				0: l2da classification has higher priority
6393859Sml29623  *
6403859Sml29623  * Return:
6413859Sml29623  * NPI_SUCCESS
6423859Sml29623  * NPI_FAILURE
6433859Sml29623  * NPI_HW_ERR
6443859Sml29623  * NPI_SW_ERR
6453859Sml29623  *
6463859Sml29623  */
6473859Sml29623 
6483859Sml29623 npi_status_t npi_fflp_cfg_enet_vlan_table_assoc(npi_handle_t,
6493859Sml29623 				    uint8_t, vlan_id_t,
6503859Sml29623 				    uint8_t, uint8_t);
6513859Sml29623 
6523859Sml29623 
6533859Sml29623 /*
6543859Sml29623  * npi_fflp_cfg_enet_vlan_table_set_pri
6553859Sml29623  * sets the  vlan based classification priority in respect to
6563859Sml29623  * L2DA classification.
6573859Sml29623  *
6583859Sml29623  * Input
6593859Sml29623  *     mac_portn	port number
6603859Sml29623  *     vlan_id		VLAN ID
6613859Sml29623  *     priority 	priority
6623859Sml29623  *			1: vlan classification has higher priority
6633859Sml29623  *			0: l2da classification has higher priority
6643859Sml29623  *
6653859Sml29623  * Return:
6663859Sml29623  * NPI_SUCCESS
6673859Sml29623  * NPI_FAILURE
6683859Sml29623  * NPI_HW_ERR
6693859Sml29623  * NPI_SW_ERR
6703859Sml29623  *
6713859Sml29623  */
6723859Sml29623 
6733859Sml29623 npi_status_t npi_fflp_cfg_enet_vlan_table_set_pri(npi_handle_t,
6743859Sml29623 				    uint8_t, vlan_id_t,
6753859Sml29623 				    uint8_t);
6763859Sml29623 
6773859Sml29623 /*
6783859Sml29623  * npi_fflp_cfg_enet_usr_cls_set()
6793859Sml29623  * Configures a user configurable ethernet class
6803859Sml29623  *
6813859Sml29623  * Input
6823859Sml29623  *      class:       Ethernet Class
6833859Sml29623  *		     class (TCAM_CLASS_ETYPE or  TCAM_CLASS_ETYPE_2)
6843859Sml29623  *      enet_type:   16 bit Ethernet Type value, corresponding ethernet bytes
6853859Sml29623  *                        [13:14] in the frame.
6863859Sml29623  *
6873859Sml29623  *  by default, the class will be disabled until explicitly enabled.
6883859Sml29623  *
6893859Sml29623  * Return
6903859Sml29623  * NPI_SUCCESS
6913859Sml29623  * NPI_FAILURE
6923859Sml29623  * NPI_HW_ERR
6933859Sml29623  * NPI_SW_ERR
6943859Sml29623  *
6953859Sml29623  *
6963859Sml29623  *
6973859Sml29623  */
6983859Sml29623 
6993859Sml29623 npi_status_t npi_fflp_cfg_enet_usr_cls_set(npi_handle_t,
7003859Sml29623 				    tcam_class_t, uint16_t);
7013859Sml29623 
7023859Sml29623 /*
7033859Sml29623  * npi_fflp_cfg_enet_usr_cls_enable()
7043859Sml29623  * Enable previously configured TCAM user configurable Ethernet classes.
7053859Sml29623  *
7063859Sml29623  * Input
7073859Sml29623  *      class:       Ethernet Class  class
7083859Sml29623  *		     (TCAM_CLASS_ETYPE or  TCAM_CLASS_ETYPE_2)
7093859Sml29623  *
7103859Sml29623  * Return
7113859Sml29623  * NPI_SUCCESS
7123859Sml29623  * NPI_FAILURE
7133859Sml29623  * NPI_HW_ERR
7143859Sml29623  * NPI_SW_ERR
7153859Sml29623  *
7163859Sml29623  */
7173859Sml29623 
7183859Sml29623 npi_status_t npi_fflp_cfg_enet_usr_cls_enable(npi_handle_t, tcam_class_t);
7193859Sml29623 
7203859Sml29623 /*
7213859Sml29623  * npi_fflp_cfg_enet_usr_cls_disable()
7223859Sml29623  * Disables previously configured TCAM user configurable Ethernet classes.
7233859Sml29623  *
7243859Sml29623  * Input
7253859Sml29623  *      class:       Ethernet Class
7263859Sml29623  *		     class = (TCAM_CLASS_ETYPE or  TCAM_CLASS_ETYPE_2)
7273859Sml29623  *
7283859Sml29623  * Return
7293859Sml29623  * NPI_SUCCESS
7303859Sml29623  * NPI_FAILURE
7313859Sml29623  * NPI_HW_ERR
7323859Sml29623  * NPI_SW_ERR
7333859Sml29623  *
7343859Sml29623  */
7353859Sml29623 
7363859Sml29623 
7373859Sml29623 npi_status_t npi_fflp_cfg_enet_usr_cls_disable(npi_handle_t, tcam_class_t);
7383859Sml29623 
7393859Sml29623 
7403859Sml29623 /*
7413859Sml29623  * npi_fflp_cfg_ip_usr_cls_set()
7423859Sml29623  * Configures the TCAM user configurable IP classes.
7433859Sml29623  *
7443859Sml29623  * Input
7453859Sml29623  *      class:       IP Class
7463859Sml29623  *		     (TCAM_CLASS_IP_USER_4 <= class <= TCAM_CLASS_IP_USER_7)
7473859Sml29623  *      tos:         IP TOS bits
7483859Sml29623  *      tos_mask:    IP TOS bits mask. bits with mask bits set will be used
7493859Sml29623  *      proto:       IP Proto
7503859Sml29623  *      ver:         IP Version
7513859Sml29623  * by default, will the class is disabled until explicitly enabled
7523859Sml29623  *
7533859Sml29623  * Return
7543859Sml29623  * NPI_SUCCESS
7553859Sml29623  * NPI_FAILURE
7563859Sml29623  * NPI_HW_ERR
7573859Sml29623  * NPI_SW_ERR
7583859Sml29623  *
7593859Sml29623  */
7603859Sml29623 
7613859Sml29623 npi_status_t npi_fflp_cfg_ip_usr_cls_set(npi_handle_t,
7623859Sml29623 					tcam_class_t,
7633859Sml29623 					uint8_t, uint8_t,
7643859Sml29623 					uint8_t, uint8_t);
7653859Sml29623 
766*11304SJanie.Lu@Sun.COM npi_status_t npi_fflp_cfg_ip_usr_cls_set_iptun(npi_handle_t,
767*11304SJanie.Lu@Sun.COM 		tcam_class_t, uint8_t, uint8_t, uint16_t, uint8_t);
768*11304SJanie.Lu@Sun.COM 
769*11304SJanie.Lu@Sun.COM npi_status_t npi_fflp_cfg_ip_usr_cls_get_iptun(npi_handle_t,
770*11304SJanie.Lu@Sun.COM 		tcam_class_t, uint8_t *, uint8_t *, uint16_t *, uint8_t *);
771*11304SJanie.Lu@Sun.COM 
7723859Sml29623 /*
7733859Sml29623  * npi_fflp_cfg_ip_usr_cls_enable()
7743859Sml29623  * Enable previously configured TCAM user configurable IP classes.
7753859Sml29623  *
7763859Sml29623  * Input
7773859Sml29623  *      class:       IP Class
7783859Sml29623  *		     (TCAM_CLASS_IP_USER_4 <= class <= TCAM_CLASS_IP_USER_7)
7793859Sml29623  *
7803859Sml29623  * Return
7813859Sml29623  * NPI_SUCCESS
7823859Sml29623  * NPI_FAILURE
7833859Sml29623  * NPI_HW_ERR
7843859Sml29623  * NPI_SW_ERR
7853859Sml29623  *
7863859Sml29623  */
7873859Sml29623 
7883859Sml29623 npi_status_t npi_fflp_cfg_ip_usr_cls_enable(npi_handle_t, tcam_class_t);
7893859Sml29623 
7903859Sml29623 /*
7913859Sml29623  * npi_fflp_cfg_ip_usr_cls_disable()
7923859Sml29623  * Disables previously configured TCAM user configurable IP classes.
7933859Sml29623  *
7943859Sml29623  * Input
7953859Sml29623  *      class:       IP Class
7963859Sml29623  *		     (TCAM_CLASS_IP_USER_4 <= class <= TCAM_CLASS_IP_USER_7)
7973859Sml29623  *
7983859Sml29623  * Return
7993859Sml29623  * NPI_SUCCESS
8003859Sml29623  * NPI_FAILURE
8013859Sml29623  * NPI_HW_ERR
8023859Sml29623  * NPI_SW_ERR
8033859Sml29623  *
8043859Sml29623  */
8053859Sml29623 
8063859Sml29623 
8073859Sml29623 npi_status_t npi_fflp_cfg_ip_usr_cls_disable(npi_handle_t, tcam_class_t);
8083859Sml29623 
8093859Sml29623 
8103859Sml29623 /*
8113859Sml29623  * npi_fflp_cfg_ip_cls_tcam_key ()
8123859Sml29623  *
8133859Sml29623  * Configures the TCAM key generation for the IP classes
8143859Sml29623  *
8153859Sml29623  * Input
8163859Sml29623  *      l3_class:        IP class to configure key generation
8173859Sml29623  *      cfg:             Configuration bits:
8183859Sml29623  *                   discard:      Discard all frames of this class
8193859Sml29623  *                   use_ip_saddr: use ip src address (for ipv6)
8203859Sml29623  *                   use_ip_daddr: use ip dest address (for ipv6)
8213859Sml29623  *                   lookup_enable: Enable Lookup
8223859Sml29623  *
8233859Sml29623  *
8243859Sml29623  * Return
8253859Sml29623  * NPI_SUCCESS
8263859Sml29623  * NPI_HW_ERR
8273859Sml29623  * NPI_SW_ERR
8283859Sml29623  *
8293859Sml29623  */
8303859Sml29623 
8313859Sml29623 
8323859Sml29623 npi_status_t npi_fflp_cfg_ip_cls_tcam_key(npi_handle_t,
8333859Sml29623 				    tcam_class_t, tcam_key_cfg_t *);
8343859Sml29623 
8353859Sml29623 /*
8363859Sml29623  * npi_fflp_cfg_ip_cls_flow_key ()
8373859Sml29623  *
8383859Sml29623  * Configures the flow key generation for the IP classes
8393859Sml29623  * Flow key is used to generate the H1 hash function value
8403859Sml29623  * The fields used for the generation are configured using this
8413859Sml29623  * NPI function.
8423859Sml29623  *
8433859Sml29623  * Input
8443859Sml29623  *      l3_class:        IP class to configure flow key generation
8453859Sml29623  *      cfg:             Configuration bits:
8463859Sml29623  *                   use_proto:     Use IP proto field
8473859Sml29623  *                   use_dport:     use l4 destination port
8483859Sml29623  *                   use_sport:     use l4 source port
8493859Sml29623  *                   ip_opts_exist: IP Options Present
8503859Sml29623  *                   use_daddr:     use ip dest address
8513859Sml29623  *                   use_saddr:     use ip source address
8523859Sml29623  *                   use_vlan:      use VLAN ID
8533859Sml29623  *                   use_l2da:      use L2 Dest MAC Address
8543859Sml29623  *                   use_portnum:   use L2 virtual port number
8553859Sml29623  *
8563859Sml29623  *
8573859Sml29623  * Return
8583859Sml29623  * NPI_SUCCESS
8593859Sml29623  * NPI_HW_ERR
8603859Sml29623  * NPI_SW_ERR
8613859Sml29623  *
8623859Sml29623  */
8633859Sml29623 
8643859Sml29623 npi_status_t npi_fflp_cfg_ip_cls_flow_key(npi_handle_t,
8653859Sml29623 			    tcam_class_t, flow_key_cfg_t *);
8663859Sml29623 
8673859Sml29623 npi_status_t npi_fflp_cfg_ip_cls_flow_key_get(npi_handle_t,
8683859Sml29623 				    tcam_class_t,
8693859Sml29623 				    flow_key_cfg_t *);
8703859Sml29623 
871*11304SJanie.Lu@Sun.COM npi_status_t npi_fflp_cfg_ip_cls_flow_key_rfnl(npi_handle_t,
872*11304SJanie.Lu@Sun.COM 		tcam_class_t, flow_key_cfg_t *);
873*11304SJanie.Lu@Sun.COM 
874*11304SJanie.Lu@Sun.COM npi_status_t npi_fflp_cfg_sym_ip_cls_flow_key(npi_handle_t, tcam_class_t,
875*11304SJanie.Lu@Sun.COM 					boolean_t);
876*11304SJanie.Lu@Sun.COM 
877*11304SJanie.Lu@Sun.COM npi_status_t npi_fflp_cfg_ip_cls_flow_key_get_rfnl(npi_handle_t,
878*11304SJanie.Lu@Sun.COM 			tcam_class_t, flow_key_cfg_t *);
8793859Sml29623 
8803859Sml29623 npi_status_t npi_fflp_cfg_ip_cls_tcam_key_get(npi_handle_t,
881*11304SJanie.Lu@Sun.COM 			tcam_class_t, tcam_key_cfg_t *);
8823859Sml29623 /*
8833859Sml29623  * npi_fflp_cfg_hash_h1poly()
8843859Sml29623  * Initializes the H1 hash generation logic.
8853859Sml29623  *
8863859Sml29623  * Input
8873859Sml29623  *      init_value:       The initial value (seed)
8883859Sml29623  *
8893859Sml29623  * Return
8903859Sml29623  * NPI_SUCCESS
8913859Sml29623  * NPI_FAILURE
8923859Sml29623  * NPI_HW_ERR
8933859Sml29623  * NPI_SW_ERR
8943859Sml29623  *
8953859Sml29623  */
8963859Sml29623 
8973859Sml29623 npi_status_t npi_fflp_cfg_hash_h1poly(npi_handle_t, uint32_t);
8983859Sml29623 
8993859Sml29623 
9003859Sml29623 
9013859Sml29623 /*
9023859Sml29623  * npi_fflp_cfg_hash_h2poly()
9033859Sml29623  * Initializes the H2 hash generation logic.
9043859Sml29623  *
9053859Sml29623  * Input
9063859Sml29623  *      init_value:       The initial value (seed)
9073859Sml29623  *
9083859Sml29623  * Return
9093859Sml29623  * NPI_SUCCESS
9103859Sml29623  * NPI_FAILURE
9113859Sml29623  * NPI_HW_ERR
9123859Sml29623  * NPI_SW_ERR
9133859Sml29623  *
9143859Sml29623  */
9153859Sml29623 
9163859Sml29623 npi_status_t npi_fflp_cfg_hash_h2poly(npi_handle_t, uint16_t);
9173859Sml29623 
9183859Sml29623 
9193859Sml29623 /*
9203859Sml29623  * Reset the fflp block (actually the FCRAM)
9213859Sml29623  * Waits until reset is completed
9223859Sml29623  *
9233859Sml29623  * input
9243859Sml29623  * strength	fcram output drive strength: weak, normal or strong
9253859Sml29623  * qs		qs mode. Normal or free running
9263859Sml29623  *
9273859Sml29623  * return value
9283859Sml29623  *	  NPI_SUCCESS
9293859Sml29623  *	  NPI_SW_ERR
9303859Sml29623  *	  NPI_HW_ERR
9313859Sml29623  */
9323859Sml29623 
9333859Sml29623 npi_status_t npi_fflp_fcram_reset(npi_handle_t,
9343859Sml29623 			    fflp_fcram_output_drive_t,
9353859Sml29623 			    fflp_fcram_qs_t);
9363859Sml29623 
9373859Sml29623 
9383859Sml29623 /* FFLP TCAM Related Functions */
9393859Sml29623 
9403859Sml29623 
9413859Sml29623 /*
9423859Sml29623  * npi_fflp_tcam_entry_match()
9433859Sml29623  *
9443859Sml29623  * Tests for TCAM match of the tcam entry
9453859Sml29623  *
9463859Sml29623  * Input
9473859Sml29623  * tcam_ptr
9483859Sml29623  *
9493859Sml29623  * Return
9503859Sml29623  *   NPI_SUCCESS
9513859Sml29623  *   NPI_SW_ERR
9523859Sml29623  *   NPI_HW_ERR
9533859Sml29623  *
9543859Sml29623  */
9553859Sml29623 
9563859Sml29623 int npi_fflp_tcam_entry_match(npi_handle_t, tcam_entry_t *);
9573859Sml29623 
9583859Sml29623 /*
9593859Sml29623  * npi_fflp_tcam_entry_write()
9603859Sml29623  *
9613859Sml29623  * writes a tcam entry at the TCAM location, location
9623859Sml29623  *
9633859Sml29623  * Input
9643859Sml29623  * location
9653859Sml29623  * tcam_ptr
9663859Sml29623  *
9673859Sml29623  * Return
9683859Sml29623  *   NPI_SUCCESS
9693859Sml29623  *   NPI_SW_ERR
9703859Sml29623  *   NPI_HW_ERR
9713859Sml29623  *
9723859Sml29623  */
9733859Sml29623 
9743859Sml29623 npi_status_t npi_fflp_tcam_entry_write(npi_handle_t,
9753859Sml29623 				tcam_location_t,
9763859Sml29623 				tcam_entry_t *);
9773859Sml29623 
9783859Sml29623 /*
9793859Sml29623  * npi_fflp_tcam_entry_read ()
9803859Sml29623  *
9813859Sml29623  * Reads a tcam entry from the TCAM location, location
9823859Sml29623  *
9833859Sml29623  * Input:
9843859Sml29623  * location
9853859Sml29623  * tcam_ptr
9863859Sml29623  *
9873859Sml29623  * Return:
9883859Sml29623  * NPI_SUCCESS
9893859Sml29623  * NPI_HW_ERR
9903859Sml29623  * NPI_SW_ERR
9913859Sml29623  *
9923859Sml29623  */
9933859Sml29623 
9943859Sml29623 
9953859Sml29623 npi_status_t npi_fflp_tcam_entry_read(npi_handle_t,
9963859Sml29623 					tcam_location_t,
9973859Sml29623 					tcam_entry_t *);
9983859Sml29623 
9993859Sml29623 /*
10003859Sml29623  * npi_fflp_tcam_entry_invalidate()
10013859Sml29623  *
10023859Sml29623  * invalidates entry at tcam location
10033859Sml29623  *
10043859Sml29623  * Input
10053859Sml29623  * location
10063859Sml29623  *
10073859Sml29623  * Return
10083859Sml29623  *   NPI_SUCCESS
10093859Sml29623  *   NPI_SW_ERR
10103859Sml29623  *   NPI_HW_ERR
10113859Sml29623  *
10123859Sml29623  */
10133859Sml29623 
10143859Sml29623 npi_status_t npi_fflp_tcam_entry_invalidate(npi_handle_t,
10153859Sml29623 				    tcam_location_t);
10163859Sml29623 
10173859Sml29623 
10183859Sml29623 /*
10193859Sml29623  * npi_fflp_tcam_asc_ram_entry_write()
10203859Sml29623  *
10213859Sml29623  * writes a tcam associatedRAM at the TCAM location, location
10223859Sml29623  *
10233859Sml29623  * Input:
10243859Sml29623  * location	tcam associatedRAM location
10253859Sml29623  * ram_data	Value to write
10263859Sml29623  *
10273859Sml29623  * Return:
10283859Sml29623  * NPI_SUCCESS
10293859Sml29623  * NPI_HW_ERR
10303859Sml29623  * NPI_SW_ERR
10313859Sml29623  *
10323859Sml29623  */
10333859Sml29623 
10343859Sml29623 npi_status_t npi_fflp_tcam_asc_ram_entry_write(npi_handle_t,
10353859Sml29623 				    tcam_location_t,
10363859Sml29623 				    uint64_t);
10373859Sml29623 
10383859Sml29623 
10393859Sml29623 /*
10403859Sml29623  * npi_fflp_tcam_asc_ram_entry_read()
10413859Sml29623  *
10423859Sml29623  * reads a tcam associatedRAM content at the TCAM location, location
10433859Sml29623  *
10443859Sml29623  * Input:
10453859Sml29623  * location	tcam associatedRAM location
10463859Sml29623  * ram_data	ptr to return contents
10473859Sml29623  *
10483859Sml29623  * Return:
10493859Sml29623  * NPI_SUCCESS
10503859Sml29623  * NPI_HW_ERR
10513859Sml29623  * NPI_SW_ERR
10523859Sml29623  *
10533859Sml29623  */
10543859Sml29623 
10553859Sml29623 npi_status_t npi_fflp_tcam_asc_ram_entry_read(npi_handle_t,
10563859Sml29623 				    tcam_location_t,
10573859Sml29623 				    uint64_t *);
10583859Sml29623 
10593859Sml29623 /*
10603859Sml29623  * npi_fflp_tcam_get_err_log
10613859Sml29623  * Reports TCAM PIO read and lookup errors.
10623859Sml29623  * If there are TCAM errors as indicated by err bit set by HW,
10633859Sml29623  *  then the SW will clear it by clearing the bit.
10643859Sml29623  *
10653859Sml29623  * Input
10663859Sml29623  *	err_stat:	 structure to report various TCAM errors.
10673859Sml29623  *                       will be updated if there are TCAM errors.
10683859Sml29623  *
10693859Sml29623  *
10703859Sml29623  * Return
10713859Sml29623  *	NPI_SUCCESS	Success
10723859Sml29623  *
10733859Sml29623  *
10743859Sml29623  */
10753859Sml29623 npi_status_t npi_fflp_tcam_get_err_log(npi_handle_t, tcam_err_log_t *);
10763859Sml29623 
10773859Sml29623 
10783859Sml29623 
10793859Sml29623 /*
10803859Sml29623  * npi_fflp_tcam_clr_err_log
10813859Sml29623  * Clears TCAM PIO read and lookup error status.
10823859Sml29623  * If there are TCAM errors as indicated by err bit set by HW,
10833859Sml29623  *  then the SW will clear it by clearing the bit.
10843859Sml29623  *
10853859Sml29623  * Input
10863859Sml29623  *	err_stat:	 structure to report various TCAM errors.
10873859Sml29623  *                       will be updated if there are TCAM errors.
10883859Sml29623  *
10893859Sml29623  *
10903859Sml29623  * Return
10913859Sml29623  *	NPI_SUCCESS	Success
10923859Sml29623  *
10933859Sml29623  *
10943859Sml29623  */
10953859Sml29623 
10963859Sml29623 npi_status_t npi_fflp_tcam_clr_err_log(npi_handle_t);
10973859Sml29623 
10983859Sml29623 
10993859Sml29623 
11003859Sml29623 
11013859Sml29623 
11023859Sml29623 /*
11033859Sml29623  * npi_fflp_vlan_tbl_clr_err_log
11043859Sml29623  * Clears VLAN Table PIO  error status.
11053859Sml29623  * If there are VLAN Table errors as indicated by err bit set by HW,
11063859Sml29623  *  then the SW will clear it by clearing the bit.
11073859Sml29623  *
11083859Sml29623  * Input
11093859Sml29623  *	err_stat:	 structure to report various VLAN Table errors.
11103859Sml29623  *                       will be updated if there are  errors.
11113859Sml29623  *
11123859Sml29623  *
11133859Sml29623  * Return
11143859Sml29623  *	NPI_SUCCESS	Success
11153859Sml29623  *
11163859Sml29623  *
11173859Sml29623  */
11183859Sml29623 
11193859Sml29623 npi_status_t npi_fflp_vlan_tbl_clr_err_log(npi_handle_t);
11203859Sml29623 
11213859Sml29623 
11223859Sml29623 /*
11233859Sml29623  * npi_fflp_vlan_tbl_get_err_log
11243859Sml29623  * Reports VLAN Table  errors.
11253859Sml29623  * If there are VLAN Table errors as indicated by err bit set by HW,
11263859Sml29623  *  then the SW will clear it by clearing the bit.
11273859Sml29623  *
11283859Sml29623  * Input
11293859Sml29623  *	err_stat:	 structure to report various VLAN table errors.
11303859Sml29623  *                       will be updated if there are errors.
11313859Sml29623  *
11323859Sml29623  *
11333859Sml29623  * Return
11343859Sml29623  *	NPI_SUCCESS	Success
11353859Sml29623  *
11363859Sml29623  *
11373859Sml29623  */
11383859Sml29623 npi_status_t npi_fflp_vlan_tbl_get_err_log(npi_handle_t,
11393859Sml29623 				    vlan_tbl_err_log_t *);
11403859Sml29623 
11413859Sml29623 
11423859Sml29623 
11433859Sml29623 
11443859Sml29623 /*
11453859Sml29623  * npi_rxdma_event_mask_config():
11463859Sml29623  *	This function is called to operate on the event mask
11473859Sml29623  *	register which is used for generating interrupts
11483859Sml29623  *	and status register.
11493859Sml29623  *
11503859Sml29623  * Parameters:
11513859Sml29623  *	handle		- NPI handle
11523859Sml29623  *	op_mode		- OP_GET: get hardware event mask
11533859Sml29623  *			  OP_SET: set hardware interrupt event masks
11543859Sml29623  *	channel		- hardware RXDMA channel from 0 to 23.
11553859Sml29623  *	cfgp		- pointer to NPI defined event mask
11563859Sml29623  *			  enum data type.
11573859Sml29623  * Return:
11583859Sml29623  *	NPI_SUCCESS		- If set is complete successfully.
11593859Sml29623  *
11603859Sml29623  *	Error:
11613859Sml29623  *	NPI_FAILURE		-
11623859Sml29623  *	NPI_FFLP_ERROR | NPI_FFLP_SW_PARAM_ERROR
11633859Sml29623  *
11643859Sml29623  */
11653859Sml29623 npi_status_t
11663859Sml29623 npi_fflp_event_mask_config(npi_handle_t, io_op_t,
11673859Sml29623 			    fflp_event_mask_cfg_t *);
11683859Sml29623 
11693859Sml29623 npi_status_t npi_fflp_dump_regs(npi_handle_t);
11703859Sml29623 
11713859Sml29623 
11723859Sml29623 /* Error status read and clear functions */
11733859Sml29623 
11743859Sml29623 void	npi_fflp_vlan_error_get(npi_handle_t,
11753859Sml29623 				    p_vlan_par_err_t);
11763859Sml29623 void	npi_fflp_vlan_error_clear(npi_handle_t);
11773859Sml29623 void	npi_fflp_tcam_error_get(npi_handle_t,
11783859Sml29623 				    p_tcam_err_t);
11793859Sml29623 void	npi_fflp_tcam_error_clear(npi_handle_t);
11803859Sml29623 
11813859Sml29623 void	npi_fflp_fcram_error_get(npi_handle_t,
11823859Sml29623 				    p_hash_tbl_data_log_t,
11833859Sml29623 				    uint8_t);
11843859Sml29623 void npi_fflp_fcram_error_clear(npi_handle_t, uint8_t);
11853859Sml29623 
11863859Sml29623 void npi_fflp_fcram_error_log1_get(npi_handle_t,
11873859Sml29623 				    p_hash_lookup_err_log1_t);
11883859Sml29623 
11893859Sml29623 void npi_fflp_fcram_error_log2_get(npi_handle_t,
11903859Sml29623 			    p_hash_lookup_err_log2_t);
11913859Sml29623 
11923859Sml29623 void npi_fflp_vlan_tbl_dump(npi_handle_t);
11933859Sml29623 
11943859Sml29623 #ifdef	__cplusplus
11953859Sml29623 }
11963859Sml29623 #endif
11973859Sml29623 
11983859Sml29623 #endif	/* _NPI_FFLP_H */
1199