144961713Sgirish /* 244961713Sgirish * CDDL HEADER START 344961713Sgirish * 444961713Sgirish * The contents of this file are subject to the terms of the 544961713Sgirish * Common Development and Distribution License (the "License"). 644961713Sgirish * You may not use this file except in compliance with the License. 744961713Sgirish * 844961713Sgirish * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 944961713Sgirish * or http://www.opensolaris.org/os/licensing. 1044961713Sgirish * See the License for the specific language governing permissions 1144961713Sgirish * and limitations under the License. 1244961713Sgirish * 1344961713Sgirish * When distributing Covered Code, include this CDDL HEADER in each 1444961713Sgirish * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 1544961713Sgirish * If applicable, add the following below this CDDL HEADER, with the 1644961713Sgirish * fields enclosed by brackets "[]" replaced with your own identifying 1744961713Sgirish * information: Portions Copyright [yyyy] [name of copyright owner] 1844961713Sgirish * 1944961713Sgirish * CDDL HEADER END 2044961713Sgirish */ 2144961713Sgirish /* 22*678453a8Sspeer * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 2344961713Sgirish * Use is subject to license terms. 2444961713Sgirish */ 2544961713Sgirish 2644961713Sgirish #ifndef _NPI_FFLP_H 2744961713Sgirish #define _NPI_FFLP_H 2844961713Sgirish 2944961713Sgirish #pragma ident "%Z%%M% %I% %E% SMI" 3044961713Sgirish 3144961713Sgirish #ifdef __cplusplus 3244961713Sgirish extern "C" { 3344961713Sgirish #endif 3444961713Sgirish 3544961713Sgirish 3644961713Sgirish #include <npi.h> 37*678453a8Sspeer #include <nxge_hw.h> 3844961713Sgirish #include <nxge_fflp_hw.h> 3944961713Sgirish #include <nxge_fflp.h> 4044961713Sgirish 4144961713Sgirish 4244961713Sgirish typedef uint8_t part_id_t; 4344961713Sgirish typedef uint8_t tcam_location_t; 4444961713Sgirish typedef uint16_t vlan_id_t; 4544961713Sgirish 4644961713Sgirish typedef enum _tcam_op { 4744961713Sgirish TCAM_RWC_STAT = 0x1, 4844961713Sgirish TCAM_RWC_MATCH = 0x2 4944961713Sgirish } tcam_op_t; 5044961713Sgirish 5144961713Sgirish 5244961713Sgirish #define NPI_TCAM_COMP_NO_MATCH 0x8000000000000ULL 5344961713Sgirish 5444961713Sgirish /* 5544961713Sgirish * NPI FFLP ERROR Codes 5644961713Sgirish */ 5744961713Sgirish 5844961713Sgirish #define NPI_FFLP_BLK_CODE FFLP_BLK_ID << 8 5944961713Sgirish #define NPI_FFLP_ERROR (NPI_FAILURE | NPI_FFLP_BLK_CODE) 6044961713Sgirish #define NPI_TCAM_ERROR 0x10 6144961713Sgirish #define NPI_FCRAM_ERROR 0x20 6244961713Sgirish #define NPI_GEN_FFLP 0x30 6344961713Sgirish #define NPI_FFLP_SW_PARAM_ERROR 0x40 6444961713Sgirish #define NPI_FFLP_HW_ERROR 0x80 6544961713Sgirish 6644961713Sgirish 6744961713Sgirish #define NPI_FFLP_RESET_ERROR (NPI_FFLP_ERROR | NPI_GEN_FFLP | RESET_FAILED) 6844961713Sgirish #define NPI_FFLP_RDC_TABLE_INVALID (NPI_FFLP_ERROR | RDC_TAB_INVALID) 6944961713Sgirish #define NPI_FFLP_VLAN_INVALID (NPI_FFLP_ERROR | VLAN_INVALID) 7044961713Sgirish #define NPI_FFLP_PORT_INVALID (NPI_FFLP_ERROR | PORT_INVALID) 7144961713Sgirish #define NPI_FFLP_TCAM_RD_ERROR \ 7244961713Sgirish (NPI_FFLP_ERROR | NPI_TCAM_ERROR | READ_FAILED) 7344961713Sgirish #define NPI_FFLP_TCAM_WR_ERROR \ 7444961713Sgirish (NPI_FFLP_ERROR | NPI_TCAM_ERROR | WRITE_FAILED) 7544961713Sgirish #define NPI_FFLP_TCAM_LOC_INVALID \ 7644961713Sgirish (NPI_FFLP_ERROR | NPI_TCAM_ERROR | LOCATION_INVALID) 7744961713Sgirish #define NPI_FFLP_ASC_RAM_RD_ERROR \ 7844961713Sgirish (NPI_FFLP_ERROR | NPI_TCAM_ERROR | READ_FAILED) 7944961713Sgirish #define NPI_FFLP_ASC_RAM_WR_ERROR \ 8044961713Sgirish (NPI_FFLP_ERROR | NPI_TCAM_ERROR | WRITE_FAILED) 8144961713Sgirish #define NPI_FFLP_FCRAM_READ_ERROR \ 8244961713Sgirish (NPI_FFLP_ERROR | NPI_FCRAM_ERROR | READ_FAILED) 8344961713Sgirish #define NPI_FFLP_FCRAM_WR_ERROR \ 8444961713Sgirish (NPI_FFLP_ERROR | NPI_FCRAM_ERROR | WRITE_FAILED) 8544961713Sgirish #define NPI_FFLP_FCRAM_PART_INVALID \ 8644961713Sgirish (NPI_FFLP_ERROR | NPI_FCRAM_ERROR | RDC_TAB_INVALID) 8744961713Sgirish #define NPI_FFLP_FCRAM_LOC_INVALID \ 8844961713Sgirish (NPI_FFLP_ERROR | NPI_FCRAM_ERROR | LOCATION_INVALID) 8944961713Sgirish 9044961713Sgirish #define TCAM_CLASS_INVALID \ 9144961713Sgirish (NPI_FFLP_SW_PARAM_ERROR | 0xb) 9244961713Sgirish /* have only 0xc, 0xd, 0xe and 0xf left for sw error codes */ 9344961713Sgirish #define NPI_FFLP_TCAM_CLASS_INVALID \ 9444961713Sgirish (NPI_FFLP_ERROR | NPI_TCAM_ERROR | TCAM_CLASS_INVALID) 9544961713Sgirish #define NPI_FFLP_TCAM_HW_ERROR \ 9644961713Sgirish (NPI_FFLP_ERROR | NPI_FFLP_HW_ERROR | NPI_TCAM_ERROR) 9744961713Sgirish #define NPI_FFLP_FCRAM_HW_ERROR \ 9844961713Sgirish (NPI_FFLP_ERROR | NPI_FFLP_HW_ERROR | NPI_FCRAM_ERROR) 9944961713Sgirish 10044961713Sgirish 10144961713Sgirish /* 10244961713Sgirish * FFLP NPI defined event masks (mapped to the hardware defined masks). 10344961713Sgirish */ 10444961713Sgirish typedef enum _fflp_event_mask_cfg_e { 10544961713Sgirish CFG_FFLP_ENT_MSK_VLAN_MASK = FFLP_ERR_VLAN_MASK, 10644961713Sgirish CFG_FFLP_ENT_MSK_TCAM_MASK = FFLP_ERR_TCAM_MASK, 10744961713Sgirish CFG_FFLP_ENT_MSK_HASH_TBL_LKUP_MASK = FFLP_ERR_HASH_TBL_LKUP_MASK, 10844961713Sgirish CFG_FFLP_ENT_MSK_HASH_TBL_DAT_MASK = FFLP_ERR_HASH_TBL_DAT_MASK, 10944961713Sgirish 11044961713Sgirish CFG_FFLP_MASK_ALL = (FFLP_ERR_VLAN_MASK | FFLP_ERR_TCAM_MASK | 11144961713Sgirish FFLP_ERR_HASH_TBL_LKUP_MASK | 11244961713Sgirish FFLP_ERR_HASH_TBL_DAT_MASK) 11344961713Sgirish } fflp_event_mask_cfg_t; 11444961713Sgirish 11544961713Sgirish 11644961713Sgirish /* FFLP FCRAM Related Functions */ 11744961713Sgirish /* The following are FCRAM datapath functions */ 11844961713Sgirish 11944961713Sgirish /* 12044961713Sgirish * npi_fflp_fcram_entry_write () 12144961713Sgirish * Populates an FCRAM entry 12244961713Sgirish * Inputs: 12344961713Sgirish * handle: opaque handle interpreted by the underlying OS 12444961713Sgirish * partid: Partition ID 12544961713Sgirish * location: Index to the FCRAM. 12644961713Sgirish * Corresponds to last 20 bits of H1 value 12744961713Sgirish * fcram_ptr: Pointer to the FCRAM contents to be used for writing 12844961713Sgirish * format: Entry Format. Determines the size of the write. 12944961713Sgirish * FCRAM_ENTRY_OPTIM: 8 bytes (a 64 bit write) 13044961713Sgirish * FCRAM_ENTRY_EX_IP4: 32 bytes (4 X 64 bit write) 13144961713Sgirish * FCRAM_ENTRY_EX_IP6: 56 bytes (7 X 64 bit write) 13244961713Sgirish * 13344961713Sgirish * Return: 13444961713Sgirish * NPI_SUCCESS 13544961713Sgirish * NPI_FAILURE 13644961713Sgirish * NPI_HW_ERR 13744961713Sgirish * NPI_SW_ERR 13844961713Sgirish * 13944961713Sgirish */ 14044961713Sgirish 14144961713Sgirish npi_status_t npi_fflp_fcram_entry_write(npi_handle_t, part_id_t, 14244961713Sgirish uint32_t, fcram_entry_t *, 14344961713Sgirish fcram_entry_format_t); 14444961713Sgirish 14544961713Sgirish /* 14644961713Sgirish * npi_fflp_fcram_entry_read () 14744961713Sgirish * Reads an FCRAM entry 14844961713Sgirish * Inputs: 14944961713Sgirish * handle: opaque handle interpreted by the underlying OS 15044961713Sgirish * partid: Partition ID 15144961713Sgirish * location: Index to the FCRAM. 15244961713Sgirish * Corresponds to last 20 bits of H1 value 15344961713Sgirish * fcram_ptr: Pointer to the FCRAM contents to be updated 15444961713Sgirish * format: Entry Format. Determines the size of the read. 15544961713Sgirish * FCRAM_ENTRY_OPTIM: 8 bytes (a 64 bit read) 15644961713Sgirish * FCRAM_ENTRY_EX_IP4: 32 bytes (4 X 64 bit read ) 15744961713Sgirish * FCRAM_ENTRY_EX_IP6: 56 bytes (7 X 64 bit read ) 15844961713Sgirish * 15944961713Sgirish * Return: 16044961713Sgirish * NPI_SUCCESS 16144961713Sgirish * NPI_FAILURE 16244961713Sgirish * NPI_HW_ERR 16344961713Sgirish * NPI_SW_ERR 16444961713Sgirish */ 16544961713Sgirish 16644961713Sgirish npi_status_t npi_fflp_fcram_entry_read(npi_handle_t, part_id_t, 16744961713Sgirish uint32_t, fcram_entry_t *, 16844961713Sgirish fcram_entry_format_t); 16944961713Sgirish 17044961713Sgirish /* 17144961713Sgirish * npi_fflp_fcram_entry_invalidate () 17244961713Sgirish * Invalidate FCRAM entry at the given location 17344961713Sgirish * Inputs: 17444961713Sgirish * handle: opaque handle interpreted by the underlying OS 17544961713Sgirish * partid: Partition ID 17644961713Sgirish * location: location of the FCRAM/hash entry. 17744961713Sgirish * 17844961713Sgirish * Return: 17944961713Sgirish * NPI_SUCCESS 18044961713Sgirish * NPI_FAILURE 18144961713Sgirish * NPI_HW_ERR 18244961713Sgirish * NPI_SW_ERR 18344961713Sgirish * 18444961713Sgirish */ 18544961713Sgirish 18644961713Sgirish npi_status_t 18744961713Sgirish npi_fflp_fcram_entry_invalidate(npi_handle_t, part_id_t, 18844961713Sgirish uint32_t); 18944961713Sgirish 19044961713Sgirish /* 19144961713Sgirish * npi_fflp_fcram_subarea_write () 19244961713Sgirish * Writes to FCRAM entry subarea i.e the 8 bytes within the 64 bytes pointed by 19344961713Sgirish * last 20 bits of H1. Effectively, this accesses specific 8 bytes within the 19444961713Sgirish * hash table bucket. 19544961713Sgirish * 19644961713Sgirish * |-----------------| <-- H1 19744961713Sgirish * | subarea 0 | 19844961713Sgirish * |_________________| 19944961713Sgirish * | Subarea 1 | 20044961713Sgirish * |_________________| 20144961713Sgirish * | ....... | 20244961713Sgirish * |_________________| 20344961713Sgirish * | Subarea 7 | 20444961713Sgirish * |_________________| 20544961713Sgirish * 20644961713Sgirish * Inputs: 20744961713Sgirish * handle: opaque handle interpreted by the underlying OS 20844961713Sgirish * partid: Partition ID 20944961713Sgirish * location: location of the subarea. It is derived from: 21044961713Sgirish * Bucket = [19:15][14:0] (20 bits of H1) 21144961713Sgirish * location = (Bucket << 3 ) + subarea * 8 21244961713Sgirish * = [22:18][17:3] || subarea * 8 21344961713Sgirish * data: Data 21444961713Sgirish * Return: 21544961713Sgirish * NPI_SUCCESS 21644961713Sgirish * NPI_FAILURE 21744961713Sgirish * NPI_HW_ERR 21844961713Sgirish * NPI_SW_ERR 21944961713Sgirish * 22044961713Sgirish */ 22144961713Sgirish 22244961713Sgirish 22344961713Sgirish npi_status_t npi_fflp_fcram_subarea_write(npi_handle_t, part_id_t, 22444961713Sgirish uint32_t, uint64_t); 22544961713Sgirish /* 22644961713Sgirish * npi_fflp_fcram_subarea_read () 22744961713Sgirish * Reads an FCRAM entry subarea i.e the 8 bytes within the 64 bytes pointed by 22844961713Sgirish * last 20 bits of H1. Effectively, this accesses specific 8 bytes within the 22944961713Sgirish * hash table bucket. 23044961713Sgirish * 23144961713Sgirish * H1--> |-----------------| 23244961713Sgirish * | subarea 0 | 23344961713Sgirish * |_________________| 23444961713Sgirish * | Subarea 1 | 23544961713Sgirish * |_________________| 23644961713Sgirish * | ....... | 23744961713Sgirish * |_________________| 23844961713Sgirish * | Subarea 7 | 23944961713Sgirish * |_________________| 24044961713Sgirish * 24144961713Sgirish * Inputs: 24244961713Sgirish * handle: opaque handle interpreted by the underlying OS 24344961713Sgirish * partid: Partition ID 24444961713Sgirish * location: location of the subarea. It is derived from: 24544961713Sgirish * Bucket = [19:15][14:0] (20 bits of H1) 24644961713Sgirish * location = (Bucket << 3 ) + subarea * 8 24744961713Sgirish * = [22:18][17:3] || subarea * 8 24844961713Sgirish * data: ptr do write subarea contents to. 24944961713Sgirish * 25044961713Sgirish * Return: 25144961713Sgirish * NPI_SUCCESS 25244961713Sgirish * NPI_FAILURE 25344961713Sgirish * NPI_HW_ERR 25444961713Sgirish * NPI_SW_ERR 25544961713Sgirish * 25644961713Sgirish */ 25744961713Sgirish 25844961713Sgirish npi_status_t npi_fflp_fcram_subarea_read (npi_handle_t, 25944961713Sgirish part_id_t, uint32_t, uint64_t *); 26044961713Sgirish 26144961713Sgirish 26244961713Sgirish /* The following are zero function fflp configuration functions */ 26344961713Sgirish /* 26444961713Sgirish * npi_fflp_fcram_config_partition() 26544961713Sgirish * Partitions and configures the FCRAM 26644961713Sgirish * 26744961713Sgirish * Input 26844961713Sgirish * partid partition ID 26944961713Sgirish * Corresponds to the RDC table 27044961713Sgirish * part_size Size of the partition 27144961713Sgirish * 27244961713Sgirish * Return: 27344961713Sgirish * NPI_SUCCESS 27444961713Sgirish * NPI_FAILURE 27544961713Sgirish * NPI_HW_ERR 27644961713Sgirish * NPI_SW_ERR 27744961713Sgirish * 27844961713Sgirish */ 27944961713Sgirish npi_status_t npi_fflp_cfg_fcram_partition(npi_handle_t, part_id_t, 28044961713Sgirish uint8_t, uint8_t); 28144961713Sgirish 28244961713Sgirish /* 28344961713Sgirish * npi_fflp_fcram_partition_enable 28444961713Sgirish * Enable previously configured FCRAM partition 28544961713Sgirish * 28644961713Sgirish * Input 28744961713Sgirish * partid partition ID 28844961713Sgirish * Corresponds to the RDC table 28944961713Sgirish * 29044961713Sgirish * Return 29144961713Sgirish * 0 Successful 29244961713Sgirish * Non zero error code Enable failed, and reason. 29344961713Sgirish * 29444961713Sgirish */ 29544961713Sgirish npi_status_t npi_fflp_cfg_fcram_partition_enable(npi_handle_t, 29644961713Sgirish part_id_t); 29744961713Sgirish 29844961713Sgirish /* 29944961713Sgirish * npi_fflp_fcram_partition_disable 30044961713Sgirish * Disable previously configured FCRAM partition 30144961713Sgirish * 30244961713Sgirish * Input 30344961713Sgirish * partid partition ID 30444961713Sgirish * Corresponds to the RDC table 30544961713Sgirish * 30644961713Sgirish * Return: 30744961713Sgirish * NPI_SUCCESS 30844961713Sgirish * NPI_FAILURE 30944961713Sgirish * NPI_HW_ERR 31044961713Sgirish * NPI_SW_ERR 31144961713Sgirish * 31244961713Sgirish */ 31344961713Sgirish 31444961713Sgirish npi_status_t npi_fflp_cfg_fcram_partition_disable(npi_handle_t, 31544961713Sgirish part_id_t); 31644961713Sgirish 31744961713Sgirish 31844961713Sgirish /* 31944961713Sgirish * npi_fflp_cfg_fcram_reset 32044961713Sgirish * Initializes the FCRAM reset sequence (including FFLP). 32144961713Sgirish * 32244961713Sgirish * Input 32344961713Sgirish * strength: FCRAM Drive strength 32444961713Sgirish * strong, weak or normal 32544961713Sgirish * HW recommended value: 32644961713Sgirish * qs: FCRAM QS mode selection 32744961713Sgirish * qs mode or free running 32844961713Sgirish * HW recommended value is: 32944961713Sgirish * 33044961713Sgirish * Return: 33144961713Sgirish * NPI_SUCCESS 33244961713Sgirish * NPI_FAILURE 33344961713Sgirish * NPI_HW_ERR 33444961713Sgirish * NPI_SW_ERR 33544961713Sgirish * 33644961713Sgirish */ 33744961713Sgirish 33844961713Sgirish npi_status_t npi_fflp_cfg_fcram_reset(npi_handle_t, 33944961713Sgirish fflp_fcram_output_drive_t, 34044961713Sgirish fflp_fcram_qs_t); 34144961713Sgirish 34244961713Sgirish 34344961713Sgirish 34444961713Sgirish /* 34544961713Sgirish * npi_fflp_cfg_tcam_reset 34644961713Sgirish * Initializes the FFLP reset sequence 34744961713Sgirish * Doesn't configure the FCRAM params. 34844961713Sgirish * 34944961713Sgirish * Input 35044961713Sgirish * 35144961713Sgirish * Return: 35244961713Sgirish * NPI_SUCCESS 35344961713Sgirish * NPI_FAILURE 35444961713Sgirish * NPI_HW_ERR 35544961713Sgirish * NPI_SW_ERR 35644961713Sgirish * 35744961713Sgirish */ 35844961713Sgirish 35944961713Sgirish npi_status_t npi_fflp_cfg_tcam_reset(npi_handle_t); 36044961713Sgirish 36144961713Sgirish /* 36244961713Sgirish * npi_fflp_cfg_tcam_enable 36344961713Sgirish * Enables the TCAM function 36444961713Sgirish * 36544961713Sgirish * Input 36644961713Sgirish * 36744961713Sgirish * Return: 36844961713Sgirish * NPI_SUCCESS 36944961713Sgirish * NPI_FAILURE 37044961713Sgirish * NPI_HW_ERR 37144961713Sgirish * NPI_SW_ERR 37244961713Sgirish * 37344961713Sgirish */ 37444961713Sgirish 37544961713Sgirish npi_status_t npi_fflp_cfg_tcam_enable(npi_handle_t); 37644961713Sgirish 37744961713Sgirish /* 37844961713Sgirish * npi_fflp_cfg_tcam_disable 37944961713Sgirish * Enables the TCAM function 38044961713Sgirish * 38144961713Sgirish * Input 38244961713Sgirish * 38344961713Sgirish * Return: 38444961713Sgirish * NPI_SUCCESS 38544961713Sgirish * NPI_FAILURE 38644961713Sgirish * NPI_HW_ERR 38744961713Sgirish * NPI_SW_ERR 38844961713Sgirish * 38944961713Sgirish */ 39044961713Sgirish 39144961713Sgirish npi_status_t npi_fflp_cfg_tcam_disable(npi_handle_t); 39244961713Sgirish 39344961713Sgirish 39444961713Sgirish /* 39544961713Sgirish * npi_fflp_cfg_cam_errorcheck_disable 39644961713Sgirish * Disables FCRAM and TCAM error checking 39744961713Sgirish * 39844961713Sgirish * Input 39944961713Sgirish * 40044961713Sgirish * 40144961713Sgirish * Return: 40244961713Sgirish * NPI_SUCCESS 40344961713Sgirish * NPI_FAILURE 40444961713Sgirish * NPI_HW_ERR 40544961713Sgirish * NPI_SW_ERR 40644961713Sgirish * 40744961713Sgirish */ 40844961713Sgirish 40944961713Sgirish npi_status_t npi_fflp_cfg_cam_errorcheck_disable(npi_handle_t); 41044961713Sgirish 41144961713Sgirish /* 41244961713Sgirish * npi_fflp_cfg_cam_errorcheck_enable 41344961713Sgirish * Enables FCRAM and TCAM error checking 41444961713Sgirish * 41544961713Sgirish * Input 41644961713Sgirish * 41744961713Sgirish * 41844961713Sgirish * Return 41944961713Sgirish * 0 Successful 42044961713Sgirish * Non zero error code Enable failed, and reason. 42144961713Sgirish * 42244961713Sgirish */ 42344961713Sgirish npi_status_t npi_fflp_cfg_cam_errorcheck_enable(npi_handle_t); 42444961713Sgirish 42544961713Sgirish 42644961713Sgirish /* 42744961713Sgirish * npi_fflp_cfg_llcsnap_enable 42844961713Sgirish * Enables input parser llcsnap recognition 42944961713Sgirish * 43044961713Sgirish * Input 43144961713Sgirish * 43244961713Sgirish * 43344961713Sgirish * Return: 43444961713Sgirish * NPI_SUCCESS 43544961713Sgirish * NPI_FAILURE 43644961713Sgirish * NPI_HW_ERR 43744961713Sgirish * NPI_SW_ERR 43844961713Sgirish * 43944961713Sgirish * 44044961713Sgirish */ 44144961713Sgirish npi_status_t npi_fflp_cfg_llcsnap_enable(npi_handle_t); 44244961713Sgirish 44344961713Sgirish /* 44444961713Sgirish * npi_fflp_cam_llcsnap_disable 44544961713Sgirish * Disables input parser llcsnap recognition 44644961713Sgirish * 44744961713Sgirish * Input 44844961713Sgirish * 44944961713Sgirish * 45044961713Sgirish * Return: 45144961713Sgirish * NPI_SUCCESS 45244961713Sgirish * NPI_FAILURE 45344961713Sgirish * NPI_HW_ERR 45444961713Sgirish * NPI_SW_ERR 45544961713Sgirish * 45644961713Sgirish * 45744961713Sgirish */ 45844961713Sgirish 45944961713Sgirish npi_status_t npi_fflp_cfg_llcsnap_disable(npi_handle_t); 46044961713Sgirish 46144961713Sgirish /* 46244961713Sgirish * npi_fflp_config_fcram_refresh 46344961713Sgirish * Set FCRAM min and max refresh time. 46444961713Sgirish * 46544961713Sgirish * Input 46644961713Sgirish * min_time Minimum Refresh time count 46744961713Sgirish * max_time maximum Refresh Time count 46844961713Sgirish * sys_time System Clock rate 46944961713Sgirish * 47044961713Sgirish * The counters are 16 bit counters. The maximum refresh time is 47144961713Sgirish * 3.9us/clock cycle. The minimum is 400ns/clock cycle. 47244961713Sgirish * Clock cycle is the FCRAM clock cycle????? 47344961713Sgirish * If the cycle is FCRAM clock cycle, then sys_time parameter 47444961713Sgirish * is not needed as there wont be configuration variation due to 47544961713Sgirish * system clock cycle. 47644961713Sgirish * 47744961713Sgirish * Return: 47844961713Sgirish * NPI_SUCCESS 47944961713Sgirish * NPI_FAILURE 48044961713Sgirish * NPI_HW_ERR 48144961713Sgirish * NPI_SW_ERR 48244961713Sgirish * 48344961713Sgirish */ 48444961713Sgirish 48544961713Sgirish npi_status_t npi_fflp_cfg_fcram_refresh_time(npi_handle_t, 48644961713Sgirish uint32_t, uint32_t, uint32_t); 48744961713Sgirish 48844961713Sgirish 48944961713Sgirish /* 49044961713Sgirish * npi_fflp_cfg_fcram_access () 49144961713Sgirish * 49244961713Sgirish * Sets the ratio between the FCRAM pio and lookup access 49344961713Sgirish * Input: 49444961713Sgirish * access_ratio: 0 Lookup has the highest priority 49544961713Sgirish * 15 PIO has maximum possible priority 49644961713Sgirish * 49744961713Sgirish */ 49844961713Sgirish 49944961713Sgirish npi_status_t npi_fflp_cfg_fcram_access(npi_handle_t, 50044961713Sgirish uint8_t); 50144961713Sgirish 50244961713Sgirish 50344961713Sgirish /* 50444961713Sgirish * npi_fflp_cfg_tcam_access () 50544961713Sgirish * 50644961713Sgirish * Sets the ratio between the TCAM pio and lookup access 50744961713Sgirish * Input: 50844961713Sgirish * access_ratio: 0 Lookup has the highest priority 50944961713Sgirish * 15 PIO has maximum possible priority 51044961713Sgirish * 51144961713Sgirish */ 51244961713Sgirish 51344961713Sgirish npi_status_t npi_fflp_cfg_tcam_access(npi_handle_t, uint8_t); 51444961713Sgirish 51544961713Sgirish 51644961713Sgirish /* 51744961713Sgirish * npi_fflp_hash_lookup_err_report 51844961713Sgirish * Reports hash table (fcram) lookup errors 51944961713Sgirish * 52044961713Sgirish * Input 52144961713Sgirish * status Pointer to return Error bits 52244961713Sgirish * 52344961713Sgirish * 52444961713Sgirish * Return: 52544961713Sgirish * NPI_SUCCESS 52644961713Sgirish * NPI_FAILURE 52744961713Sgirish * NPI_HW_ERR 52844961713Sgirish * NPI_SW_ERR 52944961713Sgirish * 53044961713Sgirish */ 53144961713Sgirish 53244961713Sgirish npi_status_t npi_fflp_fcram_get_lookup_err_log(npi_handle_t, 53344961713Sgirish hash_lookup_err_log_t *); 53444961713Sgirish 53544961713Sgirish 53644961713Sgirish 53744961713Sgirish /* 53844961713Sgirish * npi_fflp_fcram_get_pio_err_log 53944961713Sgirish * Reports hash table PIO read errors. 54044961713Sgirish * 54144961713Sgirish * Input 54244961713Sgirish * partid: partition ID 54344961713Sgirish * err_stat pointer to return Error bits 54444961713Sgirish * 54544961713Sgirish * Return: 54644961713Sgirish * NPI_SUCCESS 54744961713Sgirish * NPI_FAILURE 54844961713Sgirish * NPI_HW_ERR 54944961713Sgirish * NPI_SW_ERR 55044961713Sgirish * 55144961713Sgirish */ 55244961713Sgirish npi_status_t npi_fflp_fcram_get_pio_err_log(npi_handle_t, 55344961713Sgirish part_id_t, hash_pio_err_log_t *); 55444961713Sgirish 55544961713Sgirish 55644961713Sgirish /* 55744961713Sgirish * npi_fflp_fcram_clr_pio_err_log 55844961713Sgirish * Clears FCRAM PIO error status for the partition. 55944961713Sgirish * If there are TCAM errors as indicated by err bit set by HW, 56044961713Sgirish * then the SW will clear it by clearing the bit. 56144961713Sgirish * 56244961713Sgirish * Input 56344961713Sgirish * partid: partition ID 56444961713Sgirish * 56544961713Sgirish * 56644961713Sgirish * Return 56744961713Sgirish * NPI_SUCCESS Success 56844961713Sgirish * 56944961713Sgirish * 57044961713Sgirish */ 57144961713Sgirish 57244961713Sgirish npi_status_t npi_fflp_fcram_clr_pio_err_log(npi_handle_t, 57344961713Sgirish part_id_t); 57444961713Sgirish 57544961713Sgirish 57644961713Sgirish 57744961713Sgirish /* 57844961713Sgirish * npi_fflp_fcram_err_data_test 57944961713Sgirish * Tests the FCRAM error detection logic. 58044961713Sgirish * The error detection logic for the datapath is tested. 58144961713Sgirish * bits [63:0] are set to select the data bits to be xored 58244961713Sgirish * 58344961713Sgirish * Input 58444961713Sgirish * data: data bits to select bits to be xored 58544961713Sgirish * 58644961713Sgirish * 58744961713Sgirish * Return 58844961713Sgirish * NPI_SUCCESS Success 58944961713Sgirish * 59044961713Sgirish * 59144961713Sgirish */ 59244961713Sgirish npi_status_t npi_fflp_fcram_err_data_test(npi_handle_t, fcram_err_data_t *); 59344961713Sgirish 59444961713Sgirish 59544961713Sgirish /* 59644961713Sgirish * npi_fflp_fcram_err_synd_test 59744961713Sgirish * Tests the FCRAM error detection logic. 59844961713Sgirish * The error detection logic for the syndrome is tested. 59944961713Sgirish * tst0->synd (8bits) are set to select the syndrome bits 60044961713Sgirish * to be XOR'ed 60144961713Sgirish * 60244961713Sgirish * Input 60344961713Sgirish * syndrome_bits: Syndrome bits to select bits to be xor'ed 60444961713Sgirish * 60544961713Sgirish * 60644961713Sgirish * Return 60744961713Sgirish * NPI_SUCCESS Success 60844961713Sgirish * 60944961713Sgirish * 61044961713Sgirish */ 61144961713Sgirish npi_status_t npi_fflp_fcram_err_synd_test(npi_handle_t, uint8_t); 61244961713Sgirish 61344961713Sgirish 61444961713Sgirish /* 61544961713Sgirish * npi_fflp_cfg_vlan_table_clear 61644961713Sgirish * Clears the vlan RDC table 61744961713Sgirish * 61844961713Sgirish * Input 61944961713Sgirish * vlan_id VLAN ID 62044961713Sgirish * 62144961713Sgirish * Output 62244961713Sgirish * 62344961713Sgirish * NPI_SUCCESS Successful 62444961713Sgirish * 62544961713Sgirish */ 62644961713Sgirish 62744961713Sgirish npi_status_t npi_fflp_cfg_vlan_table_clear(npi_handle_t, vlan_id_t); 62844961713Sgirish 62944961713Sgirish /* 63044961713Sgirish * npi_fflp_cfg_enet_vlan_table_assoc 63144961713Sgirish * associates port vlan id to rdc table and sets the priority 63244961713Sgirish * in respect to L2DA rdc table. 63344961713Sgirish * 63444961713Sgirish * Input 63544961713Sgirish * mac_portn port number 63644961713Sgirish * vlan_id VLAN ID 63744961713Sgirish * rdc_table RDC Table # 63844961713Sgirish * priority priority 63944961713Sgirish * 1: vlan classification has higher priority 64044961713Sgirish * 0: l2da classification has higher priority 64144961713Sgirish * 64244961713Sgirish * Return: 64344961713Sgirish * NPI_SUCCESS 64444961713Sgirish * NPI_FAILURE 64544961713Sgirish * NPI_HW_ERR 64644961713Sgirish * NPI_SW_ERR 64744961713Sgirish * 64844961713Sgirish */ 64944961713Sgirish 65044961713Sgirish npi_status_t npi_fflp_cfg_enet_vlan_table_assoc(npi_handle_t, 65144961713Sgirish uint8_t, vlan_id_t, 65244961713Sgirish uint8_t, uint8_t); 65344961713Sgirish 65444961713Sgirish 65544961713Sgirish /* 65644961713Sgirish * npi_fflp_cfg_enet_vlan_table_set_pri 65744961713Sgirish * sets the vlan based classification priority in respect to 65844961713Sgirish * L2DA classification. 65944961713Sgirish * 66044961713Sgirish * Input 66144961713Sgirish * mac_portn port number 66244961713Sgirish * vlan_id VLAN ID 66344961713Sgirish * priority priority 66444961713Sgirish * 1: vlan classification has higher priority 66544961713Sgirish * 0: l2da classification has higher priority 66644961713Sgirish * 66744961713Sgirish * Return: 66844961713Sgirish * NPI_SUCCESS 66944961713Sgirish * NPI_FAILURE 67044961713Sgirish * NPI_HW_ERR 67144961713Sgirish * NPI_SW_ERR 67244961713Sgirish * 67344961713Sgirish */ 67444961713Sgirish 67544961713Sgirish npi_status_t npi_fflp_cfg_enet_vlan_table_set_pri(npi_handle_t, 67644961713Sgirish uint8_t, vlan_id_t, 67744961713Sgirish uint8_t); 67844961713Sgirish 67944961713Sgirish /* 68044961713Sgirish * npi_fflp_cfg_enet_usr_cls_set() 68144961713Sgirish * Configures a user configurable ethernet class 68244961713Sgirish * 68344961713Sgirish * Input 68444961713Sgirish * class: Ethernet Class 68544961713Sgirish * class (TCAM_CLASS_ETYPE or TCAM_CLASS_ETYPE_2) 68644961713Sgirish * enet_type: 16 bit Ethernet Type value, corresponding ethernet bytes 68744961713Sgirish * [13:14] in the frame. 68844961713Sgirish * 68944961713Sgirish * by default, the class will be disabled until explicitly enabled. 69044961713Sgirish * 69144961713Sgirish * Return 69244961713Sgirish * NPI_SUCCESS 69344961713Sgirish * NPI_FAILURE 69444961713Sgirish * NPI_HW_ERR 69544961713Sgirish * NPI_SW_ERR 69644961713Sgirish * 69744961713Sgirish * 69844961713Sgirish * 69944961713Sgirish */ 70044961713Sgirish 70144961713Sgirish npi_status_t npi_fflp_cfg_enet_usr_cls_set(npi_handle_t, 70244961713Sgirish tcam_class_t, uint16_t); 70344961713Sgirish 70444961713Sgirish /* 70544961713Sgirish * npi_fflp_cfg_enet_usr_cls_enable() 70644961713Sgirish * Enable previously configured TCAM user configurable Ethernet classes. 70744961713Sgirish * 70844961713Sgirish * Input 70944961713Sgirish * class: Ethernet Class class 71044961713Sgirish * (TCAM_CLASS_ETYPE or TCAM_CLASS_ETYPE_2) 71144961713Sgirish * 71244961713Sgirish * Return 71344961713Sgirish * NPI_SUCCESS 71444961713Sgirish * NPI_FAILURE 71544961713Sgirish * NPI_HW_ERR 71644961713Sgirish * NPI_SW_ERR 71744961713Sgirish * 71844961713Sgirish */ 71944961713Sgirish 72044961713Sgirish npi_status_t npi_fflp_cfg_enet_usr_cls_enable(npi_handle_t, tcam_class_t); 72144961713Sgirish 72244961713Sgirish /* 72344961713Sgirish * npi_fflp_cfg_enet_usr_cls_disable() 72444961713Sgirish * Disables previously configured TCAM user configurable Ethernet classes. 72544961713Sgirish * 72644961713Sgirish * Input 72744961713Sgirish * class: Ethernet Class 72844961713Sgirish * class = (TCAM_CLASS_ETYPE or TCAM_CLASS_ETYPE_2) 72944961713Sgirish * 73044961713Sgirish * Return 73144961713Sgirish * NPI_SUCCESS 73244961713Sgirish * NPI_FAILURE 73344961713Sgirish * NPI_HW_ERR 73444961713Sgirish * NPI_SW_ERR 73544961713Sgirish * 73644961713Sgirish */ 73744961713Sgirish 73844961713Sgirish 73944961713Sgirish npi_status_t npi_fflp_cfg_enet_usr_cls_disable(npi_handle_t, tcam_class_t); 74044961713Sgirish 74144961713Sgirish 74244961713Sgirish /* 74344961713Sgirish * npi_fflp_cfg_ip_usr_cls_set() 74444961713Sgirish * Configures the TCAM user configurable IP classes. 74544961713Sgirish * 74644961713Sgirish * Input 74744961713Sgirish * class: IP Class 74844961713Sgirish * (TCAM_CLASS_IP_USER_4 <= class <= TCAM_CLASS_IP_USER_7) 74944961713Sgirish * tos: IP TOS bits 75044961713Sgirish * tos_mask: IP TOS bits mask. bits with mask bits set will be used 75144961713Sgirish * proto: IP Proto 75244961713Sgirish * ver: IP Version 75344961713Sgirish * by default, will the class is disabled until explicitly enabled 75444961713Sgirish * 75544961713Sgirish * Return 75644961713Sgirish * NPI_SUCCESS 75744961713Sgirish * NPI_FAILURE 75844961713Sgirish * NPI_HW_ERR 75944961713Sgirish * NPI_SW_ERR 76044961713Sgirish * 76144961713Sgirish */ 76244961713Sgirish 76344961713Sgirish npi_status_t npi_fflp_cfg_ip_usr_cls_set(npi_handle_t, 76444961713Sgirish tcam_class_t, 76544961713Sgirish uint8_t, uint8_t, 76644961713Sgirish uint8_t, uint8_t); 76744961713Sgirish 76844961713Sgirish /* 76944961713Sgirish * npi_fflp_cfg_ip_usr_cls_enable() 77044961713Sgirish * Enable previously configured TCAM user configurable IP classes. 77144961713Sgirish * 77244961713Sgirish * Input 77344961713Sgirish * class: IP Class 77444961713Sgirish * (TCAM_CLASS_IP_USER_4 <= class <= TCAM_CLASS_IP_USER_7) 77544961713Sgirish * 77644961713Sgirish * Return 77744961713Sgirish * NPI_SUCCESS 77844961713Sgirish * NPI_FAILURE 77944961713Sgirish * NPI_HW_ERR 78044961713Sgirish * NPI_SW_ERR 78144961713Sgirish * 78244961713Sgirish */ 78344961713Sgirish 78444961713Sgirish npi_status_t npi_fflp_cfg_ip_usr_cls_enable(npi_handle_t, tcam_class_t); 78544961713Sgirish 78644961713Sgirish /* 78744961713Sgirish * npi_fflp_cfg_ip_usr_cls_disable() 78844961713Sgirish * Disables previously configured TCAM user configurable IP classes. 78944961713Sgirish * 79044961713Sgirish * Input 79144961713Sgirish * class: IP Class 79244961713Sgirish * (TCAM_CLASS_IP_USER_4 <= class <= TCAM_CLASS_IP_USER_7) 79344961713Sgirish * 79444961713Sgirish * Return 79544961713Sgirish * NPI_SUCCESS 79644961713Sgirish * NPI_FAILURE 79744961713Sgirish * NPI_HW_ERR 79844961713Sgirish * NPI_SW_ERR 79944961713Sgirish * 80044961713Sgirish */ 80144961713Sgirish 80244961713Sgirish 80344961713Sgirish npi_status_t npi_fflp_cfg_ip_usr_cls_disable(npi_handle_t, tcam_class_t); 80444961713Sgirish 80544961713Sgirish 80644961713Sgirish /* 80744961713Sgirish * npi_fflp_cfg_ip_cls_tcam_key () 80844961713Sgirish * 80944961713Sgirish * Configures the TCAM key generation for the IP classes 81044961713Sgirish * 81144961713Sgirish * Input 81244961713Sgirish * l3_class: IP class to configure key generation 81344961713Sgirish * cfg: Configuration bits: 81444961713Sgirish * discard: Discard all frames of this class 81544961713Sgirish * use_ip_saddr: use ip src address (for ipv6) 81644961713Sgirish * use_ip_daddr: use ip dest address (for ipv6) 81744961713Sgirish * lookup_enable: Enable Lookup 81844961713Sgirish * 81944961713Sgirish * 82044961713Sgirish * Return 82144961713Sgirish * NPI_SUCCESS 82244961713Sgirish * NPI_HW_ERR 82344961713Sgirish * NPI_SW_ERR 82444961713Sgirish * 82544961713Sgirish */ 82644961713Sgirish 82744961713Sgirish 82844961713Sgirish npi_status_t npi_fflp_cfg_ip_cls_tcam_key(npi_handle_t, 82944961713Sgirish tcam_class_t, tcam_key_cfg_t *); 83044961713Sgirish 83144961713Sgirish /* 83244961713Sgirish * npi_fflp_cfg_ip_cls_flow_key () 83344961713Sgirish * 83444961713Sgirish * Configures the flow key generation for the IP classes 83544961713Sgirish * Flow key is used to generate the H1 hash function value 83644961713Sgirish * The fields used for the generation are configured using this 83744961713Sgirish * NPI function. 83844961713Sgirish * 83944961713Sgirish * Input 84044961713Sgirish * l3_class: IP class to configure flow key generation 84144961713Sgirish * cfg: Configuration bits: 84244961713Sgirish * use_proto: Use IP proto field 84344961713Sgirish * use_dport: use l4 destination port 84444961713Sgirish * use_sport: use l4 source port 84544961713Sgirish * ip_opts_exist: IP Options Present 84644961713Sgirish * use_daddr: use ip dest address 84744961713Sgirish * use_saddr: use ip source address 84844961713Sgirish * use_vlan: use VLAN ID 84944961713Sgirish * use_l2da: use L2 Dest MAC Address 85044961713Sgirish * use_portnum: use L2 virtual port number 85144961713Sgirish * 85244961713Sgirish * 85344961713Sgirish * Return 85444961713Sgirish * NPI_SUCCESS 85544961713Sgirish * NPI_HW_ERR 85644961713Sgirish * NPI_SW_ERR 85744961713Sgirish * 85844961713Sgirish */ 85944961713Sgirish 86044961713Sgirish npi_status_t npi_fflp_cfg_ip_cls_flow_key(npi_handle_t, 86144961713Sgirish tcam_class_t, flow_key_cfg_t *); 86244961713Sgirish 86344961713Sgirish 86444961713Sgirish 86544961713Sgirish npi_status_t npi_fflp_cfg_ip_cls_flow_key_get(npi_handle_t, 86644961713Sgirish tcam_class_t, 86744961713Sgirish flow_key_cfg_t *); 86844961713Sgirish 86944961713Sgirish 87044961713Sgirish npi_status_t npi_fflp_cfg_ip_cls_tcam_key_get(npi_handle_t, 87144961713Sgirish tcam_class_t, tcam_key_cfg_t *); 87244961713Sgirish /* 87344961713Sgirish * npi_fflp_cfg_hash_h1poly() 87444961713Sgirish * Initializes the H1 hash generation logic. 87544961713Sgirish * 87644961713Sgirish * Input 87744961713Sgirish * init_value: The initial value (seed) 87844961713Sgirish * 87944961713Sgirish * Return 88044961713Sgirish * NPI_SUCCESS 88144961713Sgirish * NPI_FAILURE 88244961713Sgirish * NPI_HW_ERR 88344961713Sgirish * NPI_SW_ERR 88444961713Sgirish * 88544961713Sgirish */ 88644961713Sgirish 88744961713Sgirish npi_status_t npi_fflp_cfg_hash_h1poly(npi_handle_t, uint32_t); 88844961713Sgirish 88944961713Sgirish 89044961713Sgirish 89144961713Sgirish /* 89244961713Sgirish * npi_fflp_cfg_hash_h2poly() 89344961713Sgirish * Initializes the H2 hash generation logic. 89444961713Sgirish * 89544961713Sgirish * Input 89644961713Sgirish * init_value: The initial value (seed) 89744961713Sgirish * 89844961713Sgirish * Return 89944961713Sgirish * NPI_SUCCESS 90044961713Sgirish * NPI_FAILURE 90144961713Sgirish * NPI_HW_ERR 90244961713Sgirish * NPI_SW_ERR 90344961713Sgirish * 90444961713Sgirish */ 90544961713Sgirish 90644961713Sgirish npi_status_t npi_fflp_cfg_hash_h2poly(npi_handle_t, uint16_t); 90744961713Sgirish 90844961713Sgirish 90944961713Sgirish /* 91044961713Sgirish * Reset the fflp block (actually the FCRAM) 91144961713Sgirish * Waits until reset is completed 91244961713Sgirish * 91344961713Sgirish * input 91444961713Sgirish * strength fcram output drive strength: weak, normal or strong 91544961713Sgirish * qs qs mode. Normal or free running 91644961713Sgirish * 91744961713Sgirish * return value 91844961713Sgirish * NPI_SUCCESS 91944961713Sgirish * NPI_SW_ERR 92044961713Sgirish * NPI_HW_ERR 92144961713Sgirish */ 92244961713Sgirish 92344961713Sgirish npi_status_t npi_fflp_fcram_reset(npi_handle_t, 92444961713Sgirish fflp_fcram_output_drive_t, 92544961713Sgirish fflp_fcram_qs_t); 92644961713Sgirish 92744961713Sgirish 92844961713Sgirish /* FFLP TCAM Related Functions */ 92944961713Sgirish 93044961713Sgirish 93144961713Sgirish /* 93244961713Sgirish * npi_fflp_tcam_entry_match() 93344961713Sgirish * 93444961713Sgirish * Tests for TCAM match of the tcam entry 93544961713Sgirish * 93644961713Sgirish * Input 93744961713Sgirish * tcam_ptr 93844961713Sgirish * 93944961713Sgirish * Return 94044961713Sgirish * NPI_SUCCESS 94144961713Sgirish * NPI_SW_ERR 94244961713Sgirish * NPI_HW_ERR 94344961713Sgirish * 94444961713Sgirish */ 94544961713Sgirish 94644961713Sgirish int npi_fflp_tcam_entry_match(npi_handle_t, tcam_entry_t *); 94744961713Sgirish 94844961713Sgirish /* 94944961713Sgirish * npi_fflp_tcam_entry_write() 95044961713Sgirish * 95144961713Sgirish * writes a tcam entry at the TCAM location, location 95244961713Sgirish * 95344961713Sgirish * Input 95444961713Sgirish * location 95544961713Sgirish * tcam_ptr 95644961713Sgirish * 95744961713Sgirish * Return 95844961713Sgirish * NPI_SUCCESS 95944961713Sgirish * NPI_SW_ERR 96044961713Sgirish * NPI_HW_ERR 96144961713Sgirish * 96244961713Sgirish */ 96344961713Sgirish 96444961713Sgirish npi_status_t npi_fflp_tcam_entry_write(npi_handle_t, 96544961713Sgirish tcam_location_t, 96644961713Sgirish tcam_entry_t *); 96744961713Sgirish 96844961713Sgirish /* 96944961713Sgirish * npi_fflp_tcam_entry_read () 97044961713Sgirish * 97144961713Sgirish * Reads a tcam entry from the TCAM location, location 97244961713Sgirish * 97344961713Sgirish * Input: 97444961713Sgirish * location 97544961713Sgirish * tcam_ptr 97644961713Sgirish * 97744961713Sgirish * Return: 97844961713Sgirish * NPI_SUCCESS 97944961713Sgirish * NPI_HW_ERR 98044961713Sgirish * NPI_SW_ERR 98144961713Sgirish * 98244961713Sgirish */ 98344961713Sgirish 98444961713Sgirish 98544961713Sgirish npi_status_t npi_fflp_tcam_entry_read(npi_handle_t, 98644961713Sgirish tcam_location_t, 98744961713Sgirish tcam_entry_t *); 98844961713Sgirish 98944961713Sgirish /* 99044961713Sgirish * npi_fflp_tcam_entry_invalidate() 99144961713Sgirish * 99244961713Sgirish * invalidates entry at tcam location 99344961713Sgirish * 99444961713Sgirish * Input 99544961713Sgirish * location 99644961713Sgirish * 99744961713Sgirish * Return 99844961713Sgirish * NPI_SUCCESS 99944961713Sgirish * NPI_SW_ERR 100044961713Sgirish * NPI_HW_ERR 100144961713Sgirish * 100244961713Sgirish */ 100344961713Sgirish 100444961713Sgirish npi_status_t npi_fflp_tcam_entry_invalidate(npi_handle_t, 100544961713Sgirish tcam_location_t); 100644961713Sgirish 100744961713Sgirish 100844961713Sgirish /* 100944961713Sgirish * npi_fflp_tcam_asc_ram_entry_write() 101044961713Sgirish * 101144961713Sgirish * writes a tcam associatedRAM at the TCAM location, location 101244961713Sgirish * 101344961713Sgirish * Input: 101444961713Sgirish * location tcam associatedRAM location 101544961713Sgirish * ram_data Value to write 101644961713Sgirish * 101744961713Sgirish * Return: 101844961713Sgirish * NPI_SUCCESS 101944961713Sgirish * NPI_HW_ERR 102044961713Sgirish * NPI_SW_ERR 102144961713Sgirish * 102244961713Sgirish */ 102344961713Sgirish 102444961713Sgirish npi_status_t npi_fflp_tcam_asc_ram_entry_write(npi_handle_t, 102544961713Sgirish tcam_location_t, 102644961713Sgirish uint64_t); 102744961713Sgirish 102844961713Sgirish 102944961713Sgirish /* 103044961713Sgirish * npi_fflp_tcam_asc_ram_entry_read() 103144961713Sgirish * 103244961713Sgirish * reads a tcam associatedRAM content at the TCAM location, location 103344961713Sgirish * 103444961713Sgirish * Input: 103544961713Sgirish * location tcam associatedRAM location 103644961713Sgirish * ram_data ptr to return contents 103744961713Sgirish * 103844961713Sgirish * Return: 103944961713Sgirish * NPI_SUCCESS 104044961713Sgirish * NPI_HW_ERR 104144961713Sgirish * NPI_SW_ERR 104244961713Sgirish * 104344961713Sgirish */ 104444961713Sgirish 104544961713Sgirish npi_status_t npi_fflp_tcam_asc_ram_entry_read(npi_handle_t, 104644961713Sgirish tcam_location_t, 104744961713Sgirish uint64_t *); 104844961713Sgirish 104944961713Sgirish /* 105044961713Sgirish * npi_fflp_tcam_get_err_log 105144961713Sgirish * Reports TCAM PIO read and lookup errors. 105244961713Sgirish * If there are TCAM errors as indicated by err bit set by HW, 105344961713Sgirish * then the SW will clear it by clearing the bit. 105444961713Sgirish * 105544961713Sgirish * Input 105644961713Sgirish * err_stat: structure to report various TCAM errors. 105744961713Sgirish * will be updated if there are TCAM errors. 105844961713Sgirish * 105944961713Sgirish * 106044961713Sgirish * Return 106144961713Sgirish * NPI_SUCCESS Success 106244961713Sgirish * 106344961713Sgirish * 106444961713Sgirish */ 106544961713Sgirish npi_status_t npi_fflp_tcam_get_err_log(npi_handle_t, tcam_err_log_t *); 106644961713Sgirish 106744961713Sgirish 106844961713Sgirish 106944961713Sgirish /* 107044961713Sgirish * npi_fflp_tcam_clr_err_log 107144961713Sgirish * Clears TCAM PIO read and lookup error status. 107244961713Sgirish * If there are TCAM errors as indicated by err bit set by HW, 107344961713Sgirish * then the SW will clear it by clearing the bit. 107444961713Sgirish * 107544961713Sgirish * Input 107644961713Sgirish * err_stat: structure to report various TCAM errors. 107744961713Sgirish * will be updated if there are TCAM errors. 107844961713Sgirish * 107944961713Sgirish * 108044961713Sgirish * Return 108144961713Sgirish * NPI_SUCCESS Success 108244961713Sgirish * 108344961713Sgirish * 108444961713Sgirish */ 108544961713Sgirish 108644961713Sgirish npi_status_t npi_fflp_tcam_clr_err_log(npi_handle_t); 108744961713Sgirish 108844961713Sgirish 108944961713Sgirish 109044961713Sgirish 109144961713Sgirish 109244961713Sgirish /* 109344961713Sgirish * npi_fflp_vlan_tbl_clr_err_log 109444961713Sgirish * Clears VLAN Table PIO error status. 109544961713Sgirish * If there are VLAN Table errors as indicated by err bit set by HW, 109644961713Sgirish * then the SW will clear it by clearing the bit. 109744961713Sgirish * 109844961713Sgirish * Input 109944961713Sgirish * err_stat: structure to report various VLAN Table errors. 110044961713Sgirish * will be updated if there are errors. 110144961713Sgirish * 110244961713Sgirish * 110344961713Sgirish * Return 110444961713Sgirish * NPI_SUCCESS Success 110544961713Sgirish * 110644961713Sgirish * 110744961713Sgirish */ 110844961713Sgirish 110944961713Sgirish npi_status_t npi_fflp_vlan_tbl_clr_err_log(npi_handle_t); 111044961713Sgirish 111144961713Sgirish 111244961713Sgirish /* 111344961713Sgirish * npi_fflp_vlan_tbl_get_err_log 111444961713Sgirish * Reports VLAN Table errors. 111544961713Sgirish * If there are VLAN Table errors as indicated by err bit set by HW, 111644961713Sgirish * then the SW will clear it by clearing the bit. 111744961713Sgirish * 111844961713Sgirish * Input 111944961713Sgirish * err_stat: structure to report various VLAN table errors. 112044961713Sgirish * will be updated if there are errors. 112144961713Sgirish * 112244961713Sgirish * 112344961713Sgirish * Return 112444961713Sgirish * NPI_SUCCESS Success 112544961713Sgirish * 112644961713Sgirish * 112744961713Sgirish */ 112844961713Sgirish npi_status_t npi_fflp_vlan_tbl_get_err_log(npi_handle_t, 112944961713Sgirish vlan_tbl_err_log_t *); 113044961713Sgirish 113144961713Sgirish 113244961713Sgirish 113344961713Sgirish 113444961713Sgirish /* 113544961713Sgirish * npi_rxdma_event_mask_config(): 113644961713Sgirish * This function is called to operate on the event mask 113744961713Sgirish * register which is used for generating interrupts 113844961713Sgirish * and status register. 113944961713Sgirish * 114044961713Sgirish * Parameters: 114144961713Sgirish * handle - NPI handle 114244961713Sgirish * op_mode - OP_GET: get hardware event mask 114344961713Sgirish * OP_SET: set hardware interrupt event masks 114444961713Sgirish * channel - hardware RXDMA channel from 0 to 23. 114544961713Sgirish * cfgp - pointer to NPI defined event mask 114644961713Sgirish * enum data type. 114744961713Sgirish * Return: 114844961713Sgirish * NPI_SUCCESS - If set is complete successfully. 114944961713Sgirish * 115044961713Sgirish * Error: 115144961713Sgirish * NPI_FAILURE - 115244961713Sgirish * NPI_FFLP_ERROR | NPI_FFLP_SW_PARAM_ERROR 115344961713Sgirish * 115444961713Sgirish */ 115544961713Sgirish npi_status_t 115644961713Sgirish npi_fflp_event_mask_config(npi_handle_t, io_op_t, 115744961713Sgirish fflp_event_mask_cfg_t *); 115844961713Sgirish 115944961713Sgirish npi_status_t npi_fflp_dump_regs(npi_handle_t); 116044961713Sgirish 116144961713Sgirish 116244961713Sgirish /* Error status read and clear functions */ 116344961713Sgirish 116444961713Sgirish void npi_fflp_vlan_error_get(npi_handle_t, 116544961713Sgirish p_vlan_par_err_t); 116644961713Sgirish void npi_fflp_vlan_error_clear(npi_handle_t); 116744961713Sgirish void npi_fflp_tcam_error_get(npi_handle_t, 116844961713Sgirish p_tcam_err_t); 116944961713Sgirish void npi_fflp_tcam_error_clear(npi_handle_t); 117044961713Sgirish 117144961713Sgirish void npi_fflp_fcram_error_get(npi_handle_t, 117244961713Sgirish p_hash_tbl_data_log_t, 117344961713Sgirish uint8_t); 117444961713Sgirish void npi_fflp_fcram_error_clear(npi_handle_t, uint8_t); 117544961713Sgirish 117644961713Sgirish void npi_fflp_fcram_error_log1_get(npi_handle_t, 117744961713Sgirish p_hash_lookup_err_log1_t); 117844961713Sgirish 117944961713Sgirish void npi_fflp_fcram_error_log2_get(npi_handle_t, 118044961713Sgirish p_hash_lookup_err_log2_t); 118144961713Sgirish 118244961713Sgirish void npi_fflp_vlan_tbl_dump(npi_handle_t); 118344961713Sgirish 118444961713Sgirish #ifdef __cplusplus 118544961713Sgirish } 118644961713Sgirish #endif 118744961713Sgirish 118844961713Sgirish #endif /* _NPI_FFLP_H */ 1189