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